z_fireobj.h header (#1179)

* fireobj.h

* name states and cleanups

* minor cleanups

* format

* bss

* review

* bss

* review
This commit is contained in:
Anghelo Carvajal
2023-03-04 15:53:10 -03:00
committed by GitHub
parent e8f3039264
commit 8b025badd1
10 changed files with 120 additions and 95 deletions
+1 -6
View File
@@ -1292,12 +1292,7 @@ s16 ActorCutscene_GetCurrentSubCamId(s16 index);
s16 func_800F21CC(void);
s32 func_800F22C4(s16 param_1, Actor* actor);
void ActorCutscene_SetReturnCamera(s16 index);
void FireObj_SetPosition(FireObj* fire, Vec3f* pos);
void FireObj_Draw(PlayState* play, FireObj* fire);
void FireObj_Init(PlayState* play, FireObj* fire, FireObjInitParams* init, Actor* actor);
void FireObj_Destroy(PlayState* play, FireObj* fire);
void FireObj_SetState2(FireObj* fire, f32 dynamicSizeStep, u8 newState);
void FireObj_Update(PlayState* play, FireObj* fire, Actor* actor);
s32 func_800F3940(PlayState* play);
// void func_800F39B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_800F3A64(void);
-47
View File
@@ -140,28 +140,6 @@ typedef struct {
/* 0xF */ s8 a;
} F3DVertexNormal; // size = 0x10
typedef struct {
/* 0x0 */ f32 size;
/* 0x4 */ f32 dynamicSizeStep;
/* 0x8 */ u8 state;
/* 0x9 */ u8 sizeGrowsCos2;
/* 0xA */ u8 colorsIndex;
/* 0xB */ u8 flags;
/* 0xC */ u8 lightParamsIndex;
} FireObjInitParams; // size = 0x10
typedef struct FireObjColors {
/* 0x0 */ Color_RGBA8 primColor;
/* 0x4 */ u8 lod;
/* 0x5 */ Color_RGB8 envColor;
} FireObjColors; // size = 0x8
typedef struct FireObjLightParams {
/* 0x0 */ s16 radius;
/* 0x2 */ Color_RGB8 color;
/* 0x5 */ Color_RGB8 maxColorAdj;
} FireObjLightParams; // size = 0x8
// Game Info aka. Static Context
// Data normally accessed through REG macros (see regs.h)
typedef struct {
@@ -687,12 +665,6 @@ typedef enum {
STACK_STATUS_OVERFLOW = 2
} StackStatus;
typedef struct FireObjLight {
/* 0x00 */ LightNode* light;
/* 0x04 */ LightInfo lightInfo;
/* 0x12 */ u8 lightParamsIndex;
} FireObjLight; // size = 0x14
#define OS_SC_RETRACE_MSG 1
#define OS_SC_DONE_MSG 2
#define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c
@@ -713,25 +685,6 @@ typedef struct {
/* 0x130 */ OSThread thread;
} AudioMgr; // size = 0x2E0
typedef struct FireObj {
/* 0x00 */ Vec3f position;
/* 0x0C */ f32 size;
/* 0x10 */ f32 sizeInv;
/* 0x14 */ f32 xScale;
/* 0x18 */ f32 yScale;
/* 0x1C */ f32 dynamicSize;
/* 0x20 */ f32 dynamicSizeStep;
/* 0x24 */ u8 state; // 0 - growing, 1 - shrinking, 2 - fully lit, 3 - not lit
/* 0x25 */ u8 sizeGrowsCos2;
/* 0x26 */ u8 unk26;
/* 0x27 */ u8 colorsIndex;
/* 0x28 */ u8 flags; // bit 0 - ?, bit 1 - ?
/* 0x29 */ UNK_TYPE1 pad29[0x1];
/* 0x2A */ s16 ignitionDelay;
/* 0x2C */ ColliderCylinder collision;
/* 0x78 */ FireObjLight light;
} FireObj; // size = 0x8B
typedef struct {
/* 0x0 */ u8 seqId;
/* 0x1 */ u8 ambienceId;
+3
View File
@@ -5,6 +5,9 @@
#include "PR/gbi.h"
#include "color.h"
struct PlayState;
typedef struct {
/* 0x00 */ u8 ambientColor[3];
/* 0x03 */ s8 diffuseDir1[3];
+77
View File
@@ -0,0 +1,77 @@
#ifndef Z_FIREOBJ_H
#define Z_FIREOBJ_H
#include "ultra64.h"
#include "color.h"
#include "z64collision_check.h"
#include "z64light.h"
#include "z64math.h"
struct PlayState;
struct Actor;
typedef struct FireObjInitParams {
/* 0x0 */ f32 size;
/* 0x4 */ f32 dynamicSizeStep;
/* 0x8 */ u8 state;
/* 0x9 */ u8 sizeGrowsCos2;
/* 0xA */ u8 colorsIndex;
/* 0xB */ u8 flags;
/* 0xC */ u8 lightParamsIndex;
} FireObjInitParams; // size = 0x10
typedef struct FireObjColors {
/* 0x0 */ Color_RGBA8 primColor;
/* 0x4 */ u8 lod;
/* 0x5 */ Color_RGB8 envColor;
} FireObjColors; // size = 0x8
typedef struct FireObjLightParams {
/* 0x0 */ s16 radius;
/* 0x2 */ Color_RGB8 color;
/* 0x5 */ Color_RGB8 maxColorAdj;
} FireObjLightParams; // size = 0x8
typedef struct FireObjLight {
/* 0x00 */ LightNode* light;
/* 0x04 */ LightInfo lightInfo;
/* 0x12 */ u8 lightParamsIndex;
} FireObjLight; // size = 0x14
typedef struct FireObj {
/* 0x00 */ Vec3f position;
/* 0x0C */ f32 size;
/* 0x10 */ f32 sizeInv;
/* 0x14 */ f32 xScale;
/* 0x18 */ f32 yScale;
/* 0x1C */ f32 dynamicSize;
/* 0x20 */ f32 dynamicSizeStep;
/* 0x24 */ u8 state; // @see FireState enum
/* 0x25 */ u8 sizeGrowsCos2;
/* 0x26 */ u8 timer;
/* 0x27 */ u8 colorsIndex;
/* 0x28 */ u8 flags; // @see FIRE_FLAG_
/* 0x2A */ s16 ignitionDelay;
/* 0x2C */ ColliderCylinder collision;
/* 0x78 */ FireObjLight light;
} FireObj; // size = 0x8B
typedef enum FireState {
/* 0 */ FIRE_STATE_GROWING,
/* 1 */ FIRE_STATE_SHRINKING,
/* 2 */ FIRE_STATE_FULLY_LIT,
/* 3 */ FIRE_STATE_NOT_LIT,
} FireState;
#define FIRE_FLAG_WATER_EXTINGUISHABLE (1 << 0)
#define FIRE_FLAG_INTERACT_STICK (1 << 1)
void FireObj_SetPosition(FireObj* fire, Vec3f* pos);
void FireObj_Draw(struct PlayState* play, FireObj* fire);
void FireObj_Init(struct PlayState* play, FireObj* fire, FireObjInitParams* init, struct Actor* actor);
void FireObj_Destroy(struct PlayState* play, FireObj* fire);
void FireObj_SetState2(FireObj* fire, f32 dynamicSizeStep, u8 newState);
void FireObj_Update(struct PlayState* play, FireObj* fire, struct Actor* actor);
#endif