Struct update & formatting

This commit is contained in:
Ethan Roseman 2020-09-21 20:59:58 -04:00
parent a1d39c1c1e
commit 5121395a7e
3 changed files with 12 additions and 13 deletions

View File

@ -156,9 +156,8 @@ typedef struct PlayerData {
typedef struct Trigger { typedef struct Trigger {
/* 0x00 */ s16 genericFlagIndex; /* 0x00 */ s16 genericFlagIndex;
/* 0x02 */ char unk_02[2]; /* 0x02 */ char unk_02[2];
/* 0x04 */ s32 crateFlagIndex; /* 0x04 */ s32 params1;
///* 0x06 */ s16 panelFlagIndex; /* 0x08 */ s32 params2;
/* 0x08 */ s32 colliderID;
/* 0x0C */ UNK_FUN_PTR(functionHandler); /* 0x0C */ UNK_FUN_PTR(functionHandler);
/* 0x10 */ Bytecode* scriptStart; /* 0x10 */ Bytecode* scriptStart;
/* 0x14 */ struct ScriptInstance* runningScript; /* 0x14 */ struct ScriptInstance* runningScript;

View File

@ -9,9 +9,9 @@ void player_enter_blue_pipe(Entity* bluePipe) {
Trigger* pipeTrigger = bluePipe->trigger; Trigger* pipeTrigger = bluePipe->trigger;
playerStatus->targetYaw = gCameras[gCurrentCameraID].currentYaw + 180.0f; playerStatus->targetYaw = gCameras[gCurrentCameraID].currentYaw + 180.0f;
pipeTrigger->crateFlagIndex = 0x19; pipeTrigger->params1 = 0x19;
playerStatus->renderMode = 0xD; playerStatus->renderMode = 0xD;
func_802DDFF8(0x10002, 5, 2, 1, 1, 0, 0); func_802DDFF8(0x10002, 5, 2, 1, 1, 0, 0);
play_sound(0x163); play_sound(0x163);
disable_player_shadow(); disable_player_shadow();
@ -22,9 +22,9 @@ void func_802E8D74(Entity* entity) {
Trigger* entityTrigger = entity->trigger; Trigger* entityTrigger = entity->trigger;
playerStatus->position.y--; playerStatus->position.y--;
entityTrigger->crateFlagIndex--; entityTrigger->params1--;
if (entityTrigger->crateFlagIndex == -1) { if (entityTrigger->params1 == -1) {
playerStatus->renderMode = 0xD; playerStatus->renderMode = 0xD;
playerStatus->position.y -= 50.0f; playerStatus->position.y -= 50.0f;
func_802DDFF8(0x10002, 0, 0, 0, 0, 0, 0); func_802DDFF8(0x10002, 0, 0, 0, 0, 0, 0);
@ -34,7 +34,7 @@ void func_802E8D74(Entity* entity) {
void func_802E8E10(Entity* entity) { void func_802E8E10(Entity* entity) {
Bytecode* triggerScriptStart = entity->trigger->scriptStart; Bytecode* triggerScriptStart = entity->trigger->scriptStart;
D_8009A650[0] &= ~0x40; D_8009A650[0] &= ~0x40;
entity->boundScript = triggerScriptStart; entity->boundScript = triggerScriptStart;
func_80110678(); func_80110678();

View File

@ -34,7 +34,7 @@ void clear_area_flags(void) {
for (i = ARRAY_COUNT(saveFile->areaFlags) - 1; i >= 0; i--) { for (i = ARRAY_COUNT(saveFile->areaFlags) - 1; i >= 0; i--) {
saveFile->areaFlags[i] = 0; saveFile->areaFlags[i] = 0;
} }
for (i = ARRAY_COUNT(saveFile->areaBytes) - 1; i >= 0; i--) { for (i = ARRAY_COUNT(saveFile->areaBytes) - 1; i >= 0; i--) {
saveFile->areaBytes[i] = 0; saveFile->areaBytes[i] = 0;
} }
@ -56,7 +56,7 @@ s32 clear_global_flag(s32 index) {
wordIdx = index / 32; wordIdx = index / 32;
bitIdx = index % 32; bitIdx = index % 32;
saveFile = &gCurrentSaveFile; saveFile = &gCurrentSaveFile;
flag = saveFile->globalFlags[wordIdx] & (1 << bitIdx); flag = saveFile->globalFlags[wordIdx] & (1 << bitIdx);
@ -80,7 +80,7 @@ s32 set_global_flag(s32 index) {
wordIdx = index / 32; wordIdx = index / 32;
bitIdx = index % 32; bitIdx = index % 32;
saveFile = &gCurrentSaveFile; saveFile = &gCurrentSaveFile;
flag = saveFile->globalFlags[wordIdx] & (1 << bitIdx); flag = saveFile->globalFlags[wordIdx] & (1 << bitIdx);
@ -128,7 +128,7 @@ s8 get_global_byte(s32 index) {
s32 clear_area_flag(s32 index) { s32 clear_area_flag(s32 index) {
s32 wordIdx = index / 32; s32 wordIdx = index / 32;
s32 bitIdx = index % 32; s32 bitIdx = index % 32;
SaveData *saveFile = &gCurrentSaveFile; SaveData* saveFile = &gCurrentSaveFile;
s32 flag = saveFile->areaFlags[wordIdx] & (1 << bitIdx); s32 flag = saveFile->areaFlags[wordIdx] & (1 << bitIdx);
if (flag != 0) { if (flag != 0) {
@ -142,7 +142,7 @@ s32 clear_area_flag(s32 index) {
s32 set_area_flag(s32 index) { s32 set_area_flag(s32 index) {
s32 wordIdx = index / 32; s32 wordIdx = index / 32;
s32 bitIdx = index % 32; s32 bitIdx = index % 32;
SaveData *saveFile = &gCurrentSaveFile; SaveData* saveFile = &gCurrentSaveFile;
s32 flag = saveFile->areaFlags[wordIdx] & (1 << bitIdx); s32 flag = saveFile->areaFlags[wordIdx] & (1 << bitIdx);
if (flag != 0) { if (flag != 0) {