re3-wiiu/src/render/Coronas.h

106 lines
2.3 KiB
C
Raw Normal View History

2019-05-15 16:52:37 +02:00
#pragma once
2020-04-17 06:01:54 +02:00
extern RwTexture *gpCoronaTexture[9];
2019-05-15 16:52:37 +02:00
2019-06-01 01:58:19 +02:00
struct CRegisteredCorona
{
2020-08-09 13:17:48 +02:00
CVector coors;
2019-06-01 01:58:19 +02:00
uint32 id;
uint32 lastLOScheck;
RwTexture *texture;
2020-08-09 13:17:48 +02:00
float size;
float someAngle;
float drawDist;
float nearDist;
float heightAboveRoad;
2019-06-01 01:58:19 +02:00
uint8 red;
uint8 green;
uint8 blue;
uint8 alpha; // alpha when fully visible
uint8 fadeAlpha; // actual value used for rendering, faded
bool registeredThisFrame;
int8 flareType;
int8 reflection;
uint8 LOScheck : 1;
uint8 offScreen : 1;
uint8 firstUpdate : 1;
uint8 drawStreak : 1;
uint8 sightClear : 1;
2020-08-09 13:17:48 +02:00
uint8 useNearDist : 1;
uint8 renderReflection : 1;
2019-06-01 01:58:19 +02:00
2020-08-09 13:17:48 +02:00
int16 prevX[6];
int16 prevY[6];
2019-06-01 01:58:19 +02:00
uint8 prevRed[6];
uint8 prevGreen[6];
uint8 prevBlue[6];
bool hasValue[6];
void Update(void);
};
2020-05-10 15:54:37 +02:00
2020-08-09 13:17:48 +02:00
VALIDATE_SIZE(CRegisteredCorona, 0x68);
2019-06-01 01:58:19 +02:00
2019-05-15 16:52:37 +02:00
class CCoronas
{
2020-04-17 06:01:54 +02:00
static CRegisteredCorona aCoronas[NUMCORONAS];
2019-05-15 16:52:37 +02:00
public:
2019-06-01 01:58:19 +02:00
enum {
SUN_CORE = 1,
SUN_CORONA
};
enum {
TYPE_STAR,
TYPE_NORMAL,
TYPE_MOON,
TYPE_REFLECT,
TYPE_HEADLIGHT,
TYPE_HEX,
TYPE_CIRCLE,
TYPE_RING,
TYPE_STREAK,
};
enum {
FLARE_NONE,
FLARE_SUN,
FLARE_HEADLIGHTS
};
enum {
REFLECTION_OFF,
REFLECTION_ON,
};
enum {
LOSCHECK_OFF,
LOSCHECK_ON,
};
enum {
STREAK_OFF,
STREAK_ON,
};
2020-04-17 06:01:54 +02:00
static float LightsMult;
static float SunScreenY;
static float SunScreenX;
static int MoonSize;
2020-04-17 06:01:54 +02:00
static bool SunBlockedByClouds;
static int bChangeBrightnessImmediately;
2019-06-01 01:58:19 +02:00
static void Init(void);
static void Shutdown(void);
static void Update(void);
static void RegisterCorona(uint32 id, uint8 red, uint8 green, uint8 blue, uint8 alpha,
const CVector &coors, float size, float drawDist, RwTexture *tex,
2020-05-19 20:56:42 +02:00
int8 flareType, uint8 reflection, uint8 LOScheck, uint8 drawStreak, float someAngle,
2020-08-09 13:17:48 +02:00
bool useNearDist = false, float nearDist = 1.5f);
2019-06-01 01:58:19 +02:00
static void RegisterCorona(uint32 id, uint8 red, uint8 green, uint8 blue, uint8 alpha,
const CVector &coors, float size, float drawDist, uint8 type,
2020-05-19 20:56:42 +02:00
int8 flareType, uint8 reflection, uint8 LOScheck, uint8 drawStreak, float someAngle,
2020-08-09 13:17:48 +02:00
bool useNearDist = false, float nearDist = 1.5f);
static void UpdateCoronaCoors(uint32 id, const CVector &coors, float drawDist, float someAngle);
static void Render(void);
static void RenderReflections(void);
2020-08-09 13:17:48 +02:00
static void RenderSunReflection(void);
2019-06-01 01:58:19 +02:00
static void DoSunAndMoon(void);
2019-05-15 16:52:37 +02:00
};