diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/PR/gbi.h | 13 | ||||
| -rw-r--r-- | include/color.h | 43 | ||||
| -rw-r--r-- | include/functions.h | 104 | ||||
| -rw-r--r-- | include/variables.h | 12 | ||||
| -rw-r--r-- | include/z64.h | 36 | ||||
| -rw-r--r-- | include/z64actor.h | 4 | ||||
| -rw-r--r-- | include/z64effect.h | 64 | ||||
| -rw-r--r-- | include/z64light.h | 109 |
8 files changed, 207 insertions, 178 deletions
diff --git a/include/PR/gbi.h b/include/PR/gbi.h index 5f5890400..2c04e570f 100644 --- a/include/PR/gbi.h +++ b/include/PR/gbi.h @@ -1261,6 +1261,16 @@ typedef struct { char pad3; } Light_t; +// Added in MM +typedef struct { + unsigned char col[3]; + unsigned char unk3; + unsigned char colc[3]; + unsigned char unk7; + short pos[3]; + unsigned char unkE; +} PointLight_t; + typedef struct { unsigned char col[3]; /* ambient light value (rgba) */ char pad1; @@ -1273,7 +1283,8 @@ typedef struct { } Hilite_t; typedef union { - Light_t l; + Light_t l; + PointLight_t p; long long int force_structure_alignment[2]; } Light; diff --git a/include/color.h b/include/color.h index f2fe27566..4d287c27f 100644 --- a/include/color.h +++ b/include/color.h @@ -4,23 +4,38 @@ #include <PR/ultratypes.h> typedef struct { - /* 0x0 */ u8 red; - /* 0x1 */ u8 green; - /* 0x2 */ u8 blue; - /* 0x3 */ u8 alpha; -} ColorRGBA8; // size = 0x4 + /* 0x0 */ u8 r; + /* 0x1 */ u8 g; + /* 0x2 */ u8 b; +} Color_RGB8; // size = 0x3 typedef struct { - /* 0x0 */ u8 red; - /* 0x1 */ u8 green; - /* 0x2 */ u8 blue; -} RGB; // size = 0x3 + /* 0x0 */ u8 r; + /* 0x1 */ u8 g; + /* 0x2 */ u8 b; + /* 0x3 */ u8 a; +} Color_RGBA8; // size = 0x4 + +// only use when necessary for alignment purposes +typedef union { + struct { + u8 r, g, b, a; + }; + u32 rgba; +} Color_RGBA8_u32; typedef struct { - /* 0x0 */ u8 red; - /* 0x1 */ u8 green; - /* 0x2 */ u8 blue; - /* 0x3 */ u8 alpha; -} RGBA8; // size = 0x4 + f32 r, g, b, a; +} Color_RGBAf; + +typedef union { + struct { + u16 r : 5; + u16 g : 5; + u16 b : 5; + u16 a : 1; + }; + u16 rgba; +} Color_RGB5A1; #endif diff --git a/include/functions.h b/include/functions.h index 03213eb1d..35d050385 100644 --- a/include/functions.h +++ b/include/functions.h @@ -551,17 +551,17 @@ void EffectBlure_Draw(EffBlureParams* params, GraphicsContext* gCtxt); void EffectShieldParticle_Init(EffShieldParticleParams* params, EffShieldParticleInit* init); void EffectShieldParticle_Destroy(EffShieldParticleParams* params); s32 EffectShieldParticle_Update(EffShieldParticleParams* params); -void EffectShieldParticle_CalculateColors(EffShieldParticleParams* params, ColorRGBA8* primColor, ColorRGBA8* envColor); +void EffectShieldParticle_CalculateColors(EffShieldParticleParams* params, Color_RGBA8* primColor, Color_RGBA8* envColor); void EffectShieldParticle_Draw(EffShieldParticleParams* params, GraphicsContext* gCtxt); void EffectSpark_Init(EffSparkParams* params, EffSparkParams* init); void EffectSpark_Destroy(EffSparkParams* params); s32 EffectSpark_Update(EffSparkParams* params); void EffectSpark_Draw(EffSparkParams* params, GraphicsContext* gCtxt); // void func_800AE2A0(void); -void func_800AE434(GlobalContext* ctxt, ColorRGBA8* color, s16 sParm3, s16 sParm4); +void func_800AE434(GlobalContext* ctxt, Color_RGBA8* color, s16 sParm3, s16 sParm4); void func_800AE5A0(GlobalContext* ctxt); // void func_800AE5E4(void); -void func_800AE778(GlobalContext* ctxt, ColorRGBA8* color, s16 param_3, s16 param_4); +void func_800AE778(GlobalContext* ctxt, Color_RGBA8* color, s16 param_3, s16 param_4); void func_800AE8EC(GlobalContext* ctxt); void func_800AE930(CollisionContext* bgCtxt, s32 param_2, float* param_3, f32 param_4, s16 param_5, BgPolygon* param_6, s32 param_7); // void func_800AEF44(void); @@ -596,7 +596,7 @@ s32 func_800B096C(s16 param_1, s16 param_2, s32 param_3); s16 func_800B09D0(s16 a0, s16 a1, f32 a2); u8 func_800B0A24(u8 a0, u8 a1, f32 a2); void func_800B0B10(GlobalContext* ctxt, LoadedParticleEntry* particle, u32 uParm3); -void EffectSS_SpawnDust(GlobalContext* ctxt, u16 flags, Vec3f* position, Vec3f* velocity, Vec3f* acceleration, ColorRGBA8* color1, ColorRGBA8* color2, s16 scale, s16 scaleChangePerFrame, s16 life, u8 type); +void EffectSS_SpawnDust(GlobalContext* ctxt, u16 flags, Vec3f* position, Vec3f* velocity, Vec3f* acceleration, Color_RGBA8* color1, Color_RGBA8* color2, s16 scale, s16 scaleChangePerFrame, s16 life, u8 type); // void func_800B0DE0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); // void func_800B0E48(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); // void func_800B0EB0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9); @@ -621,11 +621,11 @@ void EffectSS_SpawnDust(GlobalContext* ctxt, u16 flags, Vec3f* position, Vec3f* // void func_800B1830(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE4 param_8); // void EffectSS_SpawnBomb2(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4); // void func_800B1970(UNK_TYPE4 param_1, Vec3f* param_2, Vec3f* param_3, Vec3f* param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6); -// void EffectSS_SpawnBlast(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, ColorRGBA8* param_5, ColorRGBA8* param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9, UNK_TYPE2 param_10); +// void EffectSS_SpawnBlast(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, Color_RGBA8* param_5, Color_RGBA8* param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9, UNK_TYPE2 param_10); // void func_800B1A70(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7); // void func_800B1AC4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7); // void func_800B1B10(void); -// void EffectSS_SpawnGSpark(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, Vec3f* pzParm4, Vec3f* param_5, ColorRGBA8* param_6, ColorRGBA8* param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9); +// void EffectSS_SpawnGSpark(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, Vec3f* pzParm4, Vec3f* param_5, Color_RGBA8* param_6, Color_RGBA8* param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9); // void func_800B1BDC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9); // void func_800B1C70(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // void func_800B1CC4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7); @@ -633,9 +633,9 @@ void EffectSS_SpawnDust(GlobalContext* ctxt, u16 flags, Vec3f* position, Vec3f* // void EffectSS_SpawnDodongoFire(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9, UNK_TYPE4 param_10); // void EffectSS_SpawnBubble(UNK_TYPE4 uParm1, Vec3f* pzParm2, UNK_TYPE4 uParm3, UNK_TYPE4 uParm4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); // void EffectSS_SpawnGRipple(UNK_TYPE4 uParm1, Vec3f* pzParm2, UNK_TYPE2 uParm3, UNK_TYPE2 uParm4, UNK_TYPE2 param_5); -void EffectSS_SpawnGSplash(GlobalContext *globalCtx, Vec3f* pzParm2, ColorRGBA8* primaryCol, ColorRGBA8* envCol, s16 type, s16 scale); +void EffectSS_SpawnGSplash(GlobalContext *globalCtx, Vec3f* pzParm2, Color_RGBA8* primaryCol, Color_RGBA8* envCol, s16 type, s16 scale); // void EffectSS_SpawnGFire(UNK_TYPE4 uParm1, Vec3f* pzParm2); -// void EffectSS_SpawnLightning(UNK_TYPE4 uParm1, Vec3f* pzParm2, ColorRGBA8* pzParm3, ColorRGBA8* pzParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); +// void EffectSS_SpawnLightning(UNK_TYPE4 uParm1, Vec3f* pzParm2, Color_RGBA8* pzParm3, Color_RGBA8* pzParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); // void func_800B2090(UNK_TYPE4 param_1, Vec3f* param_2, Vec3f* param_3, Vec3f* param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); // void EffectSS_SpawnBigOctoBubble2(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9); // void EffectSS_SpawnFragment(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE4 param_9); @@ -654,11 +654,11 @@ void EffectSS_SpawnGSplash(GlobalContext *globalCtx, Vec3f* pzParm2, ColorRGBA8* void EffectSS_SpawnShard(GlobalContext *globalCtx, Vec3f *pos, Vec3f *vel, Vec3f *param_4, s16 gravity, s16 param_6, s16 param_7, s16 param_8, s16 param_9, s16 param_10, s16 param_11,s16 param_12, s32 param_13, s16 param_14, s16 param_15, Gfx* dList); // void EffectSS_SpawnIcePiece(UNK_TYPE4 uParm1, Vec3f* pzParm2, UNK_TYPE4 uParm3, Vec3f* pzParm4, Vec3f* param_5, UNK_TYPE4 param_6); // void func_800B2930(void); -// void EffectSS_SpawnEnemyIce(UNK_TYPE4 uParm1, Actor* pzParm2, Vec3f* pzParm3, ColorRGBA8* pzParm4, ColorRGBA8* param_5, UNK_TYPE4 param_6); +// void EffectSS_SpawnEnemyIce(UNK_TYPE4 uParm1, Actor* pzParm2, Vec3f* pzParm3, Color_RGBA8* pzParm4, Color_RGBA8* param_5, UNK_TYPE4 param_6); // void func_800B2B44(void); // void func_800B2B7C(void); // void func_800B2BC0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8); -// void EffectSS_SpawnFireTail(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, UNK_TYPE4 uParm4, Vec3f* param_5, UNK_TYPE2 param_6, ColorRGBA8* param_7, ColorRGBA8* param_8, UNK_TYPE2 param_9, UNK_TYPE2 param_10, UNK_TYPE4 param_11); +// void EffectSS_SpawnFireTail(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, UNK_TYPE4 uParm4, Vec3f* param_5, UNK_TYPE2 param_6, Color_RGBA8* param_7, Color_RGBA8* param_8, UNK_TYPE2 param_9, UNK_TYPE2 param_10, UNK_TYPE4 param_11); // void func_800B2CE0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE4 param_6); // void func_800B2DA4(void); // void EffectSS_SpawnEnemyFire(UNK_TYPE4 uParm1, Actor* pzParm2, Vec3f* pzParm3, UNK_TYPE2 uParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7); @@ -677,13 +677,13 @@ void DLF_LoadGameState(GameStateOverlay* gameState); void DLF_FreeGameState(GameStateOverlay* gameState); void Actor_PrintLists(ActorContext* actCtxt); void Actor_SetDrawParams(ActorShape* actorShape, f32 yOffset, ActorShadowFunc func, f32 scale); -void Actor_PostDraw(Actor* actor, LightMapper* mapper, GlobalContext* ctxt, u32 displayList, ColorRGBA8* color); -void func_800B3FC0(Actor* actor, LightMapper* mapper, GlobalContext* ctxt); -void func_800B4024(Actor* actor, LightMapper* mapper, GlobalContext* ctxt); -void func_800B4088(Actor* actor, LightMapper* mapper, GlobalContext* ctxt); -void func_800B40B8(Actor* actor, LightMapper* mapper, GlobalContext* ctxt); +void Actor_PostDraw(Actor* actor, Lights* mapper, GlobalContext* ctxt, u32 displayList, Color_RGBA8* color); +void func_800B3FC0(Actor* actor, Lights* mapper, GlobalContext* ctxt); +void func_800B4024(Actor* actor, Lights* mapper, GlobalContext* ctxt); +void func_800B4088(Actor* actor, Lights* mapper, GlobalContext* ctxt); +void func_800B40B8(Actor* actor, Lights* mapper, GlobalContext* ctxt); void func_800B40E0(GlobalContext* ctxt, s32 iParm2, z_Matrix* pzParm3, s32 iParm4, f32 param_5, f32 param_6, f32 param_7); -void func_800B42F8(Actor* actor, LightMapper* mapper, GlobalContext* ctxt); +void func_800B42F8(Actor* actor, Lights* mapper, GlobalContext* ctxt); // void func_800B4A98(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); void func_800B4AEC(GlobalContext* ctxt, Actor* actor, f32 param_3); void func_800B4B50(Actor* actor, s32 iParm2, GlobalContext* pzParm3); @@ -1741,12 +1741,12 @@ void func_800F6B44(GlobalContext* ctxt, KankyoContext* kanCtxt, s32 iParm3, s32 // void func_800F6CEC(void); // void func_800F6EA4(void); // UNK_TYPE4 Kankyo_IsSceneUpsideDown(GlobalContext* ctxt); -void func_800F6FF8(GlobalContext* ctxt, KankyoContext* kanCtxt, LightingContext* lCtxt); +void func_800F6FF8(GlobalContext* ctxt, KankyoContext* kanCtxt, LightContext* lCtxt); // void func_800F8554(void); // void func_800F88C4(void); // void func_800F8970(void); // void func_800F8A9C(void); -// void func_800F8CD4(GlobalContext* ctxt, KankyoContext* kanCtxt, LightingContext* lCtxt, s32 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); +// void func_800F8CD4(GlobalContext* ctxt, KankyoContext* kanCtxt, LightContext* lCtxt, s32 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); // void func_800F8D84(void); // void func_800F9728(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); // void func_800F9824(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE2 param_10, UNK_TYPE1 param_11); @@ -1769,10 +1769,10 @@ void func_800FBF3C(GlobalContext* ctxt); // void func_800FC444(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5, UNK_TYPE1 param_6); // void func_800FC64C(void); // void func_800FD2B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -void func_800FD538(RGB* param_1, RGB* param_2, f32 param_3, Vec3s* param_4); -void func_800FD59C(GlobalContext* ctxt, RGB* pzParm2, f32 fParm3); -void func_800FD5E0(GlobalContext* ctxt, RGB* pzParm2, f32 fParm3); -void func_800FD654(GlobalContext* ctxt, RGB* pzParm2, f32 fParm3); +void func_800FD538(Color_RGB8* param_1, Color_RGB8* param_2, f32 param_3, Vec3s* param_4); +void func_800FD59C(GlobalContext* ctxt, Color_RGB8* pzParm2, f32 fParm3); +void func_800FD5E0(GlobalContext* ctxt, Color_RGB8* pzParm2, f32 fParm3); +void func_800FD654(GlobalContext* ctxt, Color_RGB8* pzParm2, f32 fParm3); // void func_800FD698(void); // u32 get_days_elapsed(void); // void reset_days_elapsed(void); @@ -1863,12 +1863,12 @@ void Math_SmoothScaleMaxF(f32* start, f32 target, f32 scale, f32 maxStep); void Math_SmoothDownscaleMaxF(f32* start, f32 scale, f32 maxStep); s32 Math_SmoothScaleMaxMinS(s16* start, s16 target, s16 scale, s16 maxStep, s16 minStep); void Math_SmoothScaleMaxS(s16* start, s16 target, s16 scale, s16 maxStep); -void Color_RGBA8_Copy(ColorRGBA8* dst, ColorRGBA8* src); +void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src); void func_801000A4(u16 param_1); void func_801000CC(u16 param_1); void func_801000F4(UNK_TYPE4 param_1, u16 param_2); void Lib_TranslateAndRotateYVec3f(Vec3f* translation, s16 rotation, Vec3f* src, Vec3f* dst); -void Lib_LerpRGB(RGB* a, RGB* b, f32 t, RGB* dst); +void Lib_LerpRGB(Color_RGB8* a, Color_RGB8* b, f32 t, Color_RGB8* dst); f32 Lib_PushAwayVec3f(Vec3f* start, Vec3f* pusher, f32 distanceToApproach); void Lib_Nop801004FC(void); void* Lib_PtrSegToVirt(void* ptr); @@ -1883,33 +1883,33 @@ void LifeMeter_UpdateColors(GlobalContext* ctxt); void LifeMeter_Draw(GlobalContext* ctxt); void LifeMeter_UpdateSizeAndBeep(GlobalContext* ctxt); // s32 LifeMeter_IsCritical(void); -void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius, u32 type); -void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius); -void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius); -void Lights_SetPositionalLightColorAndRadius(LightInfoPositional* info, u8 red, u8 green, u8 blue, s16 radius); -void Lights_SetPositionalLightPosition(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ); -void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dirZ, u8 red, u8 green, u8 blue); -void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue); -void Lights_UploadLights(LightMapper* mapper, GraphicsContext* gCtxt); -Light* Lights_MapperGetNextFreeSlot(LightMapper* mapper); -void Lights_MapPositionalWithReference(LightMapper* mapper, LightInfoPositionalParams* params, Vec3f* pos); -void Lights_MapPositional(LightMapper* mapper, LightInfoPositionalParams* params, GlobalContext* ctxt); -void Lights_MapDirectional(LightMapper* mapper, LightInfoDirectionalParams* params, GlobalContext* ctxt); -void Lights_MapLights(LightMapper* mapper, z_Light* lights, Vec3f* refPos, GlobalContext* ctxt); -z_Light* Lights_FindFreeSlot(void); -void Lights_Free(z_Light* light); -void Lights_Init(GlobalContext* ctxt, LightingContext* lCtxt); -void Lights_SetAmbientColor(LightingContext* lCtxt, u8 red, u8 green, u8 blue); -void func_80102544(LightingContext* lCtxt, u8 a1, u8 a2, u8 a3, s16 sp12, s16 sp16); -LightMapper* Lights_CreateMapper(LightingContext* lCtxt, GraphicsContext* gCtxt); -void Lights_ClearHead(GlobalContext* ctxt, LightingContext* lCtxt); -void Lights_RemoveAll(GlobalContext* ctxt, LightingContext* lCtxt); -z_Light* Lights_Insert(GlobalContext* ctxt, LightingContext* lCtxt, LightInfo* info); -void Lights_Remove(GlobalContext* ctxt, LightingContext* lCtxt, z_Light* light); -LightMapper* func_801026E8(GraphicsContext* gCtxt, u8 ambientRed, u8 ambientGreen, u8 ambientBlue, u8 numLights, u8 red, u8 green, u8 blue, s8 dirX, s8 dirY, s8 dirZ); -LightMapper* Lights_MapperAllocateAndInit(GraphicsContext* gCtxt, u8 red, u8 green, u8 blue); -void func_80102880(GlobalContext* ctxt); -void func_80102A64(GlobalContext* ctxt); +void Lights_PointSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius, s32 type); +void Lights_PointNoGlowSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius); +void Lights_PointGlowSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius); +void Lights_PointSetColorAndRadius(LightInfo* info, u8 r, u8 g, u8 b, s16 radius); +void Lights_PointSetPosition(LightInfo* info, s16 x, s16 y, s16 z); +void Lights_DirectionalSetInfo(LightInfo* info, s8 x, s8 y, s8 z, u8 r, u8 g, u8 b); +void Lights_Reset(Lights* lights, u8 r, u8 g, u8 b); +void Lights_Draw(Lights* lights, GraphicsContext* gfxCtx); +Light* Lights_FindSlot(Lights* lights); +void Lights_BindPointWithReference(Lights* lights, LightParams* params, Vec3f* pos); +void Lights_BindPoint(Lights* lights, LightParams* params, GlobalContext* globalCtx); +void Lights_BindDirectional(Lights* lights, LightParams* params, void* unused); +void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* refPos, GlobalContext* globalCtx); +LightNode* Lights_FindBufSlot(); +void Lights_FreeNode(LightNode* light); +void LightContext_Init(GlobalContext* globalCtx, LightContext* lightCtx); +void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b); +void func_80102544(LightContext* lightCtx, u8 a1, u8 a2, u8 a3, s16 numLights, s16 sp16); +Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx); +void LightContext_InitList(GlobalContext* globalCtx, LightContext* lightCtx); +void LightContext_DestroyList(GlobalContext* globalCtx, LightContext* lightCtx); +LightNode* LightContext_InsertLight(GlobalContext* globalCtx, LightContext* lightCtx, LightInfo* info); +void LightContext_RemoveLight(GlobalContext* globalCtx, LightContext* lightCtx, LightNode* light); +Lights* Lights_NewAndDraw(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB, u8 numLights, u8 r, u8 g, u8 b, s8 x, s8 y, s8 z); +Lights* Lights_New(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB); +void Lights_GlowCheck(GlobalContext* globalCtx); +void Lights_DrawGlow(GlobalContext* globalCtx); void* zelda_malloc(u32 size); void* zelda_mallocR(u32 size); void* zelda_realloc(void* oldPtr, u32 newSize); @@ -2481,7 +2481,7 @@ Gfx* SceneProc_SetTile1Layer(GlobalContext* ctxt, ScrollingTextureParams* params void SceneProc_DrawType0Texture(GlobalContext* ctxt, u32 segment, ScrollingTextureParams* params); Gfx* SceneProc_SetTile2Layers(GlobalContext* ctxt, ScrollingTextureParams* params); void SceneProc_DrawType1Texture(GlobalContext* ctxt, u32 segment, ScrollingTextureParams* params); -void SceneProc_DrawFlashingTexture(GlobalContext* ctxt, u32 segment, FlashingTexturePrimColor* primColor, RGBA8* envColor); +void SceneProc_DrawFlashingTexture(GlobalContext* ctxt, u32 segment, FlashingTexturePrimColor* primColor, Color_RGBA8* envColor); void SceneProc_DrawType2Texture(GlobalContext* ctxt, u32 segment, FlashingTextureParams* params); s32 SceneProc_Lerp(s32 a, s32 b, f32 t); void SceneProc_DrawType3Texture(GlobalContext* ctxt, u32 segment, FlashingTextureParams* params); diff --git a/include/variables.h b/include/variables.h index 42efca03f..80977e89f 100644 --- a/include/variables.h +++ b/include/variables.h @@ -432,14 +432,14 @@ extern UNK_PTR D_801AE8F0; // extern UNK_TYPE4 D_801AEC70; // extern UNK_TYPE4 D_801AEC74; // extern UNK_TYPE4 D_801AEC78; -extern ColorRGBA8 D_801AEC80; +extern Color_RGBA8 D_801AEC80; extern s801AEC84 D_801AEC84[13]; extern f32 actorMovementScale; extern f32 D_801AECF0; extern f32 D_801AECF4; // extern UNK_TYPE1 D_801AED48; // extern UNK_TYPE4 D_801AED58; -extern ColorRGBA8 actorDefaultHitColor; +extern Color_RGBA8 actorDefaultHitColor; // extern UNK_TYPE1 D_801AED8C; // extern UNK_TYPE4 D_801AED98; // extern UNK_TYPE4 D_801AEDA4; @@ -1033,8 +1033,8 @@ extern actor_init_var_func actorInitVarFuncs[11]; // extern UNK_TYPE2 D_801BEA20; // extern UNK_TYPE1 D_801BEA30; // extern UNK_TYPE1 D_801BEA70; -extern light_map_positional_func lightPositionalMapFuncs[3]; -extern light_map_directional_func lightDirectionalMapFuncs[3]; +//extern LightsPosBindFunc posBindFuncs[3]; +//extern LightsBindFunc dirBindFuncs[3]; // extern UNK_TYPE4 D_801BEAD4; // extern UNK_TYPE4 D_801BEAD8; // extern UNK_TYPE1 D_801BEAE0; @@ -4017,7 +4017,7 @@ extern f32 D_801F4E70; // extern UNK_TYPE1 D_801F4F66; // extern UNK_TYPE1 D_801F4F68; // extern UNK_TYPE1 D_801F4F6A; -extern LightsList lightsList; +extern LightsBuffer sLightsBuffer; extern Arena mainHeap; // extern UNK_TYPE1 D_801F5130; // extern UNK_TYPE1 D_801F5270; @@ -4090,7 +4090,7 @@ extern Input D_801F6C18; // extern UNK_TYPE1 D_801F6D0C; extern UNK_TYPE4 D_801F6D10; // extern UNK_TYPE1 D_801F6D18; -extern ColorRGBA8 D_801F6D30; +extern Color_RGBA8 D_801F6D30; // extern UNK_TYPE1 D_801F6D38; // extern UNK_TYPE4 D_801F6D4C; // extern UNK_TYPE1 D_801F6D50; diff --git a/include/z64.h b/include/z64.h index fec555b48..a2252eb51 100644 --- a/include/z64.h +++ b/include/z64.h @@ -394,7 +394,7 @@ typedef struct { /* 0x04 */ UNK_TYPE4 unk4; /* 0x08 */ UNK_TYPE4 unk8; /* 0x0C */ f32 unkC; - /* 0x10 */ ColorRGBA8 unk10; + /* 0x10 */ Color_RGBA8 unk10; } TargetContextEntry; // size = 0x14 typedef struct { @@ -444,8 +444,6 @@ typedef void(*func_ptr)(void); typedef void(*actor_init_var_func)(u8*, InitChainEntry*); -typedef void(*light_map_directional_func)(LightMapper* mapper, void* params, Vec3f* pos); - typedef void(*osCreateThread_func)(void*); typedef void*(*printf_func)(void*, char*, size_t); @@ -593,7 +591,7 @@ typedef struct { /* 0x0 */ u16 cycleLength; /* 0x2 */ u16 numKeyFrames; /* 0x4 */ FlashingTexturePrimColor* primColors; - /* 0x8 */ RGBA8* envColors; + /* 0x8 */ Color_RGBA8* envColors; /* 0xC */ u16* keyFrames; } FlashingTextureParams; // size = 0x10 @@ -802,8 +800,8 @@ typedef struct { /* 0x24 */ u16 unk24; /* 0x26 */ UNK_TYPE1 unk26; /* 0x27 */ UNK_TYPE1 unk27; - /* 0x28 */ LightInfoDirectional unk28; - /* 0x36 */ LightInfoDirectional unk36; + /* 0x28 */ LightInfo unk28; + /* 0x36 */ LightInfo unk36; /* 0x44 */ UNK_TYPE1 unk44; /* 0x45 */ UNK_TYPE1 unk45; /* 0x46 */ UNK_TYPE1 unk46; @@ -901,16 +899,16 @@ typedef struct { /* 0xC1 */ u8 unkC1; /* 0xC2 */ u8 unkC2; /* 0xC3 */ u8 unkC3; - /* 0xC4 */ RGB unkC4; + /* 0xC4 */ Color_RGB8 unkC4; /* 0xC7 */ s8 unkC7; /* 0xC8 */ s8 unkC8; /* 0xC9 */ s8 unkC9; - /* 0xCA */ RGB unkCA; + /* 0xCA */ Color_RGB8 unkCA; /* 0xCD */ s8 unkCD; /* 0xCE */ s8 unkCE; /* 0xCF */ s8 unkCF; - /* 0xD0 */ RGB unkD0; - /* 0xD3 */ RGB unkD3; + /* 0xD0 */ Color_RGB8 unkD0; + /* 0xD3 */ Color_RGB8 unkD3; /* 0xD6 */ s16 unkD6; /* 0xD8 */ s16 unkD8; /* 0xDA */ UNK_TYPE1 unkDA; @@ -1278,8 +1276,6 @@ typedef void(*draw_func)(GlobalContext* ctxt, s16 index); typedef void(*global_context_func)(GlobalContext*); -typedef void(*light_map_positional_func)(LightMapper* mapper, void* params, GlobalContext* ctxt); - typedef void(*room_draw_func)(GlobalContext* ctxt, Room* room, u32 flags); typedef struct { @@ -1416,7 +1412,7 @@ typedef struct ActorContext ActorContext; typedef struct s800B948C s800B948C; struct FireObjLight { - /* 0x00 */ z_Light* light; + /* 0x00 */ LightNode* light; /* 0x04 */ LightInfoPositional lightInfo; /* 0x12 */ u8 unk12; }; // size = 0x13 @@ -1610,7 +1606,7 @@ struct GlobalContext { /* 0x00814 */ u8 unk814; /* 0x00815 */ u8 unk815; /* 0x00816 */ UNK_TYPE1 pad816[0x2]; - /* 0x00818 */ LightingContext lightCtx; + /* 0x00818 */ LightContext lightCtx; /* 0x00828 */ u32 unk828; /* 0x0082C */ UNK_TYPE1 pad82C[0x4]; /* 0x00830 */ CollisionContext colCtx; @@ -1787,22 +1783,22 @@ struct ActorBgIknvObj { typedef struct { /* 0x00 */ u32 type; /* 0x04 */ u32 setScissor; - /* 0x08 */ ColorRGBA8 color; - /* 0x0C */ ColorRGBA8 envColor; + /* 0x08 */ Color_RGBA8 color; + /* 0x0C */ Color_RGBA8 envColor; } struct_801F8010; // size = 0x10 typedef struct { /* 0x00 */ u32 useRgba; /* 0x04 */ u32 setScissor; - /* 0x08 */ ColorRGBA8 primColor; - /* 0x08 */ ColorRGBA8 envColor; + /* 0x08 */ Color_RGBA8 primColor; + /* 0x08 */ Color_RGBA8 envColor; } struct_801F8020; // size = 0x10 typedef struct { /* 0x00 */ u32 unk_00; /* 0x04 */ u32 setScissor; - /* 0x08 */ ColorRGBA8 primColor; - /* 0x0C */ ColorRGBA8 envColor; + /* 0x08 */ Color_RGBA8 primColor; + /* 0x0C */ Color_RGBA8 envColor; /* 0x10 */ u16* tlut; /* 0x14 */ Gfx* monoDl; } VisMono; // size = 0x18 diff --git a/include/z64actor.h b/include/z64actor.h index 34520966a..8de48871f 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -11,7 +11,7 @@ struct Actor; struct GlobalContext; -struct LightMapper; +struct Lights; struct BgPolygon; typedef void(*ActorFunc)(struct Actor* this, struct GlobalContext* ctxt); @@ -106,7 +106,7 @@ typedef struct { /* 0x1F */ UNK_TYPE1 pad1F[0x1]; } ActorOverlay; // size = 0x20 -typedef void(*ActorShadowFunc)(struct Actor* actor, struct LightMapper* mapper, struct GlobalContext* ctxt); +typedef void(*ActorShadowFunc)(struct Actor* actor, struct Lights* mapper, struct GlobalContext* ctxt); typedef struct { /* 0x00 */ Vec3s rot; // Current actor shape rotation diff --git a/include/z64effect.h b/include/z64effect.h index aa5519de0..4c96a296d 100644 --- a/include/z64effect.h +++ b/include/z64effect.h @@ -40,8 +40,8 @@ typedef struct { /* 0x490 */ f32 gravity; /* 0x494 */ u32 particleFactor1; /* 0x498 */ u32 particleFactor2; - /* 0x49C */ ColorRGBA8 colorStart[4]; - /* 0x4AC */ ColorRGBA8 colorEnd[4]; + /* 0x49C */ Color_RGBA8 colorStart[4]; + /* 0x4AC */ Color_RGBA8 colorEnd[4]; /* 0x4BC */ s32 age; /* 0x4C0 */ s32 duration; } EffSparkParams; // size = 0x4C4 @@ -57,19 +57,19 @@ typedef struct { typedef struct { /* 0x000 */ UNK_TYPE1 pad0[0x184]; - /* 0x184 */ ColorRGBA8 unk184; - /* 0x188 */ ColorRGBA8 unk188; - /* 0x18C */ ColorRGBA8 unk18C; - /* 0x190 */ ColorRGBA8 unk190; + /* 0x184 */ Color_RGBA8 unk184; + /* 0x188 */ Color_RGBA8 unk188; + /* 0x18C */ Color_RGBA8 unk18C; + /* 0x190 */ Color_RGBA8 unk190; /* 0x194 */ UNK_TYPE1 pad194[0xC]; } EffBlureInit1; // size = 0x1A0 typedef struct { /* 0x00 */ UNK_TYPE1 pad0[0x8]; - /* 0x08 */ ColorRGBA8 unk8; - /* 0x0C */ ColorRGBA8 unkC; - /* 0x10 */ ColorRGBA8 unk10; - /* 0x14 */ ColorRGBA8 unk14; + /* 0x08 */ Color_RGBA8 unk8; + /* 0x0C */ Color_RGBA8 unkC; + /* 0x10 */ Color_RGBA8 unk10; + /* 0x14 */ Color_RGBA8 unk14; /* 0x18 */ UNK_TYPE1 pad18[0xC]; } EffBlureInit2; // size = 0x24 @@ -79,10 +79,10 @@ typedef struct { /* 0x184 */ f32 unk184; /* 0x188 */ u16 unk188; /* 0x18A */ UNK_TYPE1 pad18A[0x4]; - /* 0x18E */ ColorRGBA8 unk18E; - /* 0x192 */ ColorRGBA8 unk192; - /* 0x196 */ ColorRGBA8 unk196; - /* 0x19A */ ColorRGBA8 unk19A; + /* 0x18E */ Color_RGBA8 unk18E; + /* 0x192 */ Color_RGBA8 unk192; + /* 0x196 */ Color_RGBA8 unk196; + /* 0x19A */ Color_RGBA8 unk19A; /* 0x19E */ u8 unk19E; /* 0x19F */ u8 unk19F; /* 0x1A0 */ u8 unk1A0; @@ -108,17 +108,17 @@ typedef struct { typedef struct { /* 0x00 */ u8 numParticles; /* 0x02 */ Vec3s position; - /* 0x08 */ ColorRGBA8 primColorStart; - /* 0x0C */ ColorRGBA8 envColorStart; - /* 0x10 */ ColorRGBA8 primColorMid; - /* 0x14 */ ColorRGBA8 envColorMid; - /* 0x18 */ ColorRGBA8 primColorEnd; - /* 0x1C */ ColorRGBA8 envColorEnd; + /* 0x08 */ Color_RGBA8 primColorStart; + /* 0x0C */ Color_RGBA8 envColorStart; + /* 0x10 */ Color_RGBA8 primColorMid; + /* 0x14 */ Color_RGBA8 envColorMid; + /* 0x18 */ Color_RGBA8 primColorEnd; + /* 0x1C */ Color_RGBA8 envColorEnd; /* 0x20 */ f32 acceleration; /* 0x24 */ f32 maxInitialSpeed; /* 0x28 */ f32 lengthCutoff; /* 0x2C */ u8 duration; - /* 0x2E */ LightInfoPositionalParams lightParams; + /* 0x2E */ LightPoint lightPoint; /* 0x3C */ s32 hasLight; } EffShieldParticleInit; // size = 0x40 @@ -127,12 +127,12 @@ typedef struct { /* 0x180 */ u8 numParticles; /* 0x181 */ UNK_TYPE1 pad181[0x1]; /* 0x182 */ Vec3s position; - /* 0x188 */ ColorRGBA8 primColorStart; - /* 0x18C */ ColorRGBA8 envColorStart; - /* 0x190 */ ColorRGBA8 primColorMid; - /* 0x194 */ ColorRGBA8 envColorMid; - /* 0x198 */ ColorRGBA8 primColorEnd; - /* 0x19C */ ColorRGBA8 envColorEnd; + /* 0x188 */ Color_RGBA8 primColorStart; + /* 0x18C */ Color_RGBA8 envColorStart; + /* 0x190 */ Color_RGBA8 primColorMid; + /* 0x194 */ Color_RGBA8 envColorMid; + /* 0x198 */ Color_RGBA8 primColorEnd; + /* 0x19C */ Color_RGBA8 envColorEnd; /* 0x1A0 */ f32 acceleration; /* 0x1A4 */ UNK_TYPE1 pad1A4[0x4]; /* 0x1A8 */ f32 maxInitialSpeed; @@ -140,7 +140,7 @@ typedef struct { /* 0x1B0 */ u8 duration; /* 0x1B1 */ u8 age; /* 0x1B2 */ LightInfo lightInfo; - /* 0x1C0 */ z_Light* light; + /* 0x1C0 */ LightNode* light; /* 0x1C4 */ s32 hasLight; } EffShieldParticleParams; // size = 0x1C8 @@ -161,7 +161,7 @@ typedef struct { typedef struct { /* 0x0 */ s16 unk0; /* 0x2 */ s16 maxLife; - /* 0x4 */ ColorRGBA8 color; + /* 0x4 */ Color_RGBA8 color; } EffTireMarkInit; // size = 0x8 typedef struct { @@ -169,7 +169,7 @@ typedef struct { /* 0x600 */ s16 unk600; /* 0x602 */ s16 numParticles; /* 0x604 */ s16 maxLife; - /* 0x606 */ ColorRGBA8 color; + /* 0x606 */ Color_RGBA8 color; /* 0x60A */ UNK_TYPE1 pad60A[0x2]; } EffTireMarkParams; // size = 0x60C @@ -198,8 +198,8 @@ typedef struct { /* 0x00 */ Vec3f position; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f acceleration; - /* 0x24 */ ColorRGBA8 color1; - /* 0x28 */ ColorRGBA8 color2; + /* 0x24 */ Color_RGBA8 color1; + /* 0x28 */ Color_RGBA8 color2; /* 0x2C */ s16 scale; /* 0x2E */ s16 scaleChangePerFrame; /* 0x30 */ s16 life; diff --git a/include/z64light.h b/include/z64light.h index eeb1cbac4..cbfe66351 100644 --- a/include/z64light.h +++ b/include/z64light.h @@ -3,72 +3,79 @@ #include <ultra64.h> #include <PR/gbi.h> +#include <color.h> typedef struct { - /* 0x0 */ u8 type; - /* 0x2 */ u16 params[6]; -} LightInfo; // size = 0xE - -typedef struct z_Light_t { - /* 0x0 */ LightInfo* info; - /* 0x4 */ struct z_Light_t* prev; - /* 0x8 */ struct z_Light_t* next; -} z_Light; // size = 0xC - -typedef struct { - /* 0x0 */ z_Light* lightsHead; - /* 0x4 */ u8 ambientRed; - /* 0x5 */ u8 ambientGreen; - /* 0x6 */ u8 ambientBlue; - /* 0x7 */ u8 unk7; - /* 0x8 */ u8 unk8; - /* 0x9 */ u8 unk9; - /* 0xA */ s16 unkA; - /* 0xC */ s16 unkC; -} LightingContext; // size = 0x10 + /* 0x0 */ s16 x; + /* 0x2 */ s16 y; + /* 0x4 */ s16 z; + /* 0x6 */ u8 color[3]; + /* 0x9 */ u8 drawGlow; + /* 0xA */ s16 radius; +} LightPoint; // size = 0xC typedef struct { - /* 0x000 */ s32 numOccupied; - /* 0x004 */ s32 nextFree; - /* 0x008 */ z_Light lights[32]; -} LightsList; // size = 0x188 + /* 0x0 */ s8 x; + /* 0x1 */ s8 y; + /* 0x2 */ s8 z; + /* 0x3 */ u8 color[3]; +} LightDirectional; // size = 0x6 -typedef struct { - /* 0x0 */ s8 dirX; - /* 0x1 */ s8 dirY; - /* 0x2 */ s8 dirZ; - /* 0x3 */ u8 red; - /* 0x4 */ u8 green; - /* 0x5 */ u8 blue; - /* 0x6 */ u16 pad[3]; -} LightInfoDirectionalParams; // size = 0xC +typedef union { + LightPoint point; + LightDirectional dir; +} LightParams; // size = 0xC typedef struct { - /* 0x0 */ s16 posX; - /* 0x2 */ s16 posY; - /* 0x4 */ s16 posZ; - /* 0x6 */ u8 red; - /* 0x7 */ u8 green; - /* 0x8 */ u8 blue; - /* 0x9 */ u8 unk9; // func_80102880 sets this only for type 2, func_80102A64 draws something if this is set - /* 0xA */ s16 radius; -} LightInfoPositionalParams; // size = 0xC + /* 0x0 */ u8 type; + /* 0x2 */ LightParams params; +} LightInfo; // size = 0xE typedef struct { /* 0x00 */ u8 enablePosLights; /* 0x01 */ u8 numLights; - /* 0x02 */ UNK_TYPE1 pad2[6]; - /* 0x08 */ Lights7 lights; -} LightMapper; // size = 0x80 + /* 0x08 */ Lightsn l; +} Lights; // size = 0x80 typedef struct { /* 0x0 */ u8 type; - /* 0x2 */ LightInfoDirectionalParams params; -} LightInfoDirectional; // size = 0xE + /* 0x2 */ LightPoint params; +} LightInfoPositional; // size = 0xE + +typedef struct LightNode { + /* 0x0 */ LightInfo* info; + /* 0x4 */ struct LightNode* prev; + /* 0x8 */ struct LightNode* next; +} LightNode; // size = 0xC + +// TODO move LightsBuffer to .c file once .bss has been split +#define LIGHTS_BUFFER_SIZE 32 typedef struct { - /* 0x0 */ u8 type; - /* 0x2 */ LightInfoPositionalParams params; -} LightInfoPositional; // size = 0xE + /* 0x000 */ s32 numOccupied; + /* 0x004 */ s32 searchIndex; + /* 0x008 */ LightNode lights[LIGHTS_BUFFER_SIZE]; +} LightsBuffer; // size = 0x188 + +typedef struct { + /* 0x0 */ LightNode* listHead; + /* 0x4 */ Color_RGB8 ambient; + /* 0x7 */ u8 unk7; + /* 0x8 */ u8 unk8; + /* 0x9 */ u8 unk9; + /* 0xA */ s16 unkA; + /* 0xC */ s16 unkC; +} LightContext; // size = 0x10 + +typedef enum { + /* 0x00 */ LIGHT_POINT_NOGLOW, + /* 0x01 */ LIGHT_DIRECTIONAL, + /* 0x02 */ LIGHT_POINT_GLOW +} LightType; + +typedef struct GlobalContext GlobalContext; + +typedef void (*LightsBindFunc)(Lights* lights, LightParams* params, Vec3f* vec); +typedef void (*LightsPosBindFunc)(Lights* lights, LightParams* params, GlobalContext* globalCtx); #endif |
