2019-06-17 10:30:02 +02:00
|
|
|
enum {
|
|
|
|
EFFECT_LIGHT,
|
|
|
|
EFFECT_PARTICLE,
|
|
|
|
EFFECT_ATTRACTOR
|
|
|
|
};
|
|
|
|
|
2019-05-15 16:52:37 +02:00
|
|
|
class C2dEffect
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
struct Light {
|
|
|
|
float dist;
|
|
|
|
float outerRange;
|
|
|
|
float size;
|
|
|
|
float innerRange;
|
|
|
|
uint8 flash;
|
2019-06-17 10:30:02 +02:00
|
|
|
uint8 roadReflection;
|
|
|
|
uint8 flareType;
|
|
|
|
uint8 shadowIntensity;
|
|
|
|
uint8 flags;
|
2019-05-15 16:52:37 +02:00
|
|
|
RwTexture *corona;
|
|
|
|
RwTexture *shadow;
|
|
|
|
};
|
|
|
|
struct Particle {
|
|
|
|
int particleType;
|
2019-06-17 10:30:02 +02:00
|
|
|
CVector dir;
|
2019-05-15 16:52:37 +02:00
|
|
|
float scale;
|
|
|
|
};
|
|
|
|
struct Attractor {
|
|
|
|
CVector dir;
|
2019-06-17 10:30:02 +02:00
|
|
|
uint8 flags;
|
2019-05-15 16:52:37 +02:00
|
|
|
uint8 probability;
|
|
|
|
};
|
|
|
|
|
|
|
|
CVector pos;
|
2019-06-17 10:30:02 +02:00
|
|
|
CRGBA col;
|
2019-05-15 16:52:37 +02:00
|
|
|
uint8 type;
|
|
|
|
union {
|
|
|
|
Light light;
|
|
|
|
Particle particle;
|
|
|
|
Attractor attractor;
|
|
|
|
};
|
|
|
|
|
|
|
|
C2dEffect(void) {}
|
2019-06-17 10:30:02 +02:00
|
|
|
void Shutdown(void){
|
|
|
|
if(type == 0){ // TODO: enum
|
|
|
|
if(light.corona)
|
|
|
|
RwTextureDestroy(light.corona);
|
|
|
|
if(light.shadow)
|
|
|
|
RwTextureDestroy(light.shadow);
|
|
|
|
}
|
|
|
|
}
|
2019-05-15 16:52:37 +02:00
|
|
|
};
|
|
|
|
static_assert(sizeof(C2dEffect) == 0x34, "C2dEffect: error");
|