1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-04 21:05:54 +00:00
re3/src/render/2dEffect.h

80 lines
1.4 KiB
C
Raw Normal View History

2019-06-17 08:30:02 +00:00
enum {
EFFECT_LIGHT,
EFFECT_PARTICLE,
EFFECT_ATTRACTOR
};
2019-06-30 19:06:55 +00:00
enum {
LIGHT_ON,
LIGHT_ON_NIGHT,
LIGHT_FLICKER,
LIGHT_FLICKER_NIGHT,
LIGHT_FLASH1,
LIGHT_FLASH1_NIGHT,
LIGHT_FLASH2,
LIGHT_FLASH2_NIGHT,
LIGHT_FLASH3,
LIGHT_FLASH3_NIGHT,
LIGHT_RANDOM_FLICKER,
LIGHT_RANDOM_FLICKER_NIGHT,
LIGHT_SPECIAL,
LIGHT_BRIDGE_FLASH1,
LIGHT_BRIDGE_FLASH2,
};
enum {
LIGHTFLAG_LOSCHECK = 1,
// same order as CPointLights flags, must start at 2
LIGHTFLAG_FOG_NORMAL = 2, // can have light and fog
LIGHTFLAG_FOG_ALWAYS = 4, // fog only
LIGHTFLAG_FOG = (LIGHTFLAG_FOG_NORMAL|LIGHTFLAG_FOG_ALWAYS)
};
2019-05-15 14:52:37 +00:00
class C2dEffect
{
public:
struct Light {
float dist;
2019-06-30 19:06:55 +00:00
float range; // of pointlight
2019-05-15 14:52:37 +00:00
float size;
2019-06-30 19:06:55 +00:00
float shadowRange;
uint8 lightType; // LIGHT_
2019-06-17 08:30:02 +00:00
uint8 roadReflection;
uint8 flareType;
uint8 shadowIntensity;
2019-06-30 19:06:55 +00:00
uint8 flags; // LIGHTFLAG_
2019-05-15 14:52:37 +00:00
RwTexture *corona;
RwTexture *shadow;
};
struct Particle {
int particleType;
2019-06-17 08:30:02 +00:00
CVector dir;
2019-05-15 14:52:37 +00:00
float scale;
};
struct Attractor {
CVector dir;
2019-06-17 08:30:02 +00:00
uint8 flags;
2019-05-15 14:52:37 +00:00
uint8 probability;
};
CVector pos;
2019-06-17 08:30:02 +00:00
CRGBA col;
2019-05-15 14:52:37 +00:00
uint8 type;
union {
Light light;
Particle particle;
Attractor attractor;
};
C2dEffect(void) {}
2019-06-17 08:30:02 +00:00
void Shutdown(void){
if(type == 0){ // TODO: enum
if(light.corona)
RwTextureDestroy(light.corona);
if(light.shadow)
RwTextureDestroy(light.shadow);
}
}
2019-05-15 14:52:37 +00:00
};
static_assert(sizeof(C2dEffect) == 0x34, "C2dEffect: error");