General Cleanup (#155)

* minor fixes

* Consolidate into globalCtx

* fix error

* Fix Warnings

Co-authored-by: engineer124 <engineer124enginer124@gmail.com>
This commit is contained in:
engineer124 2021-05-21 11:24:47 +10:00 committed by GitHub
parent 8c62c102cf
commit f4687fbbe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 1198 additions and 1195 deletions

File diff suppressed because it is too large Load Diff

View File

@ -279,6 +279,7 @@ extern ActorInit En_Invadepoh_InitVars;
extern ActorInit En_Invadepoh_Demo_InitVars;
extern ActorInit En_Invisible_Ruppe_InitVars;
extern ActorInit En_Ishi_InitVars;
extern ActorInit En_Item00_InitVars;
extern ActorInit En_Ja_InitVars;
extern ActorInit En_Jc_Mato_InitVars;
extern ActorInit En_Jg_InitVars;

View File

@ -373,9 +373,6 @@ extern ActorInit En_A_Obj_InitVars;
extern ColliderCylinderInit enAObjCylinderInit;
extern InitChainEntry enAObjInitVar;
extern u32 enAObjDisplayLists[2];
extern ActorInit En_Item00_InitVars;
extern ColliderCylinderInit enItem00CylinderInit;
extern InitChainEntry enItem00InitVars[1];
extern Color_RGBA8 D_801ADF10;
extern Color_RGBA8 D_801ADF14;
extern Vec3f D_801ADF18;

View File

@ -1120,7 +1120,7 @@ typedef struct {
typedef struct FileChooseContext FileChooseContext;
typedef void(*filechoose_update_func)(FileChooseContext* ctxt);
typedef void(*filechoose_update_func)(FileChooseContext* globalCtx);
typedef struct FireObj FireObj;
@ -1268,17 +1268,17 @@ typedef void (*ColChkVsFunc)(GlobalContext*, CollisionCheckContext*, Collider*,
typedef s32 (*ColChkLineFunc)(GlobalContext*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*);
typedef struct {
/* 0x0 */ GlobalContext* ctxt;
/* 0x0 */ GlobalContext* globalCtx;
/* 0x4 */ s32 type; // bitfield, highest set bit determines type
/* 0x8 */ s16 countdown;
/* 0xA */ s16 state; // 0 - stopped, 1 - active, 2 - setup
} Quake2Context; // size = 0xC
typedef void(*cutscene_update_func)(GlobalContext* ctxt, CutsceneContext* cCtxt);
typedef void(*cutscene_update_func)(GlobalContext* globalCtx, CutsceneContext* cCtxt);
typedef void(*draw_func)(GlobalContext* ctxt, s16 index);
typedef void(*draw_func)(GlobalContext* globalCtx, s16 index);
typedef void(*room_draw_func)(GlobalContext* ctxt, Room* room, u32 flags);
typedef void(*room_draw_func)(GlobalContext* globalCtx, Room* room, u32 flags);
typedef struct {
/* 0x00 */ draw_func unk0;
@ -1450,7 +1450,7 @@ struct Camera {
/* 0x080 */ f32 unk80;
/* 0x084 */ f32 unk84;
/* 0x088 */ f32 unk88;
/* 0x08C */ GlobalContext* ctxt;
/* 0x08C */ GlobalContext* globalCtx;
/* 0x090 */ ActorPlayer* player;
/* 0x094 */ PosRot unk94;
/* 0x0A8 */ Actor* unkA8;
@ -1554,7 +1554,7 @@ struct TargetContext {
}; // size = 0x98
struct s800B948C {
/* 0x00 */ GlobalContext* ctxt;
/* 0x00 */ GlobalContext* globalCtx;
/* 0x04 */ Actor* actor;
/* 0x08 */ u32 updateActorIfSet;
/* 0x0C */ u32 unkC;

View File

@ -15,7 +15,7 @@ struct GlobalContext;
struct Lights;
struct CollisionPoly;
typedef void(*ActorFunc)(struct Actor* this, struct GlobalContext* ctxt);
typedef void(*ActorFunc)(struct Actor* this, struct GlobalContext* globalCtx);
typedef struct {
/* 0x00 */ Vec3f pos;
@ -107,7 +107,7 @@ typedef struct {
/* 0x1F */ UNK_TYPE1 pad1F[0x1];
} ActorOverlay; // size = 0x20
typedef void(*ActorShadowFunc)(struct Actor* actor, struct Lights* mapper, struct GlobalContext* ctxt);
typedef void(*ActorShadowFunc)(struct Actor* actor, struct Lights* mapper, struct GlobalContext* globalCtx);
typedef struct {
/* 0x00 */ Vec3s rot; // Current actor shape rotation

View File

@ -209,7 +209,7 @@ typedef struct {
} EffInfo; // size = 0x14
typedef struct {
/* 0x0000 */ struct GlobalContext* ctxt;
/* 0x0000 */ struct GlobalContext* globalCtx;
/* 0x0004 */ EffSpark sparks[3];
/* 0x0E5C */ EffBlure blures[25];
/* 0x388C */ EffShieldParticle shieldParticles[3];

View File

@ -3,49 +3,49 @@
// This file is most likely z_en_a_obj.c
void EnAObj_Init(ActorEnAObj* this, GlobalContext* ctxt) {
void EnAObj_Init(ActorEnAObj* this, GlobalContext* globalCtx) {
ActorEnAObj* s0 = (ActorEnAObj*)this;
s0->base.textId = ((s0->base.params >> 8) & 0xFF) | 0x300;
s0->base.params = (s0->base.params & 0xFF) - 9;
Actor_ProcessInitChain((Actor*)s0, &enAObjInitVar);
ActorShape_Init(&s0->base.shape, 0, (ActorShadowFunc)func_800B3FC0, 12);
Collider_InitAndSetCylinder(ctxt, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
Collider_InitAndSetCylinder(globalCtx, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
Collider_UpdateCylinder((Actor*)s0, &s0->collision);
s0->base.colChkInfo.mass = 255;
s0->update = (ActorFunc)EnAObj_Update1;
}
void EnAObj_Destroy(ActorEnAObj* this, GlobalContext* ctxt) {
void EnAObj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx) {
ColliderCylinder* a2 = &this->collision;
Collider_DestroyCylinder(ctxt, a2);
Collider_DestroyCylinder(globalCtx, a2);
}
void EnAObj_Update1(ActorEnAObj* this, GlobalContext* ctxt) {
void EnAObj_Update1(ActorEnAObj* this, GlobalContext* globalCtx) {
s16 v0;
s32 v1;
if (func_800B84D0((Actor*)this, ctxt) != 0) {
if (func_800B84D0((Actor*)this, globalCtx) != 0) {
this->update = (ActorFunc)EnAObj_Update2;
} else {
v0 = this->base.yawTowardsPlayer - this->base.shape.rot.y;
v1 = (v0 < 0) ? -v0 : v0;
if ((v1 < 10240) || ((this->base.params == 1) && (v1 > 22528))) {
func_800B863C((Actor*)this, ctxt);
func_800B863C((Actor*)this, globalCtx);
}
}
}
void EnAObj_Update2(ActorEnAObj* this, GlobalContext* ctxt) {
if (func_800B867C((Actor*)this, ctxt) != 0) {
void EnAObj_Update2(ActorEnAObj* this, GlobalContext* globalCtx) {
if (func_800B867C((Actor*)this, globalCtx) != 0) {
this->update = (ActorFunc)EnAObj_Update1;
}
}
void EnAObj_Update(ActorEnAObj* this, GlobalContext* ctxt) {
(this->update)((Actor*)this, (GlobalContext*)ctxt);
void EnAObj_Update(ActorEnAObj* this, GlobalContext* globalCtx) {
(this->update)((Actor*)this, (GlobalContext*)globalCtx);
Actor_SetHeight((Actor*)this, 45.0f);
CollisionCheck_SetOC(ctxt, &ctxt->colCheckCtx, (Collider*)&this->collision);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, (Collider*)&this->collision);
}
void EnAObj_Draw(ActorEnAObj* this, GlobalContext* ctxt) {
func_800BDFC0(ctxt, enAObjDisplayLists[this->base.params]);
void EnAObj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) {
func_800BDFC0(globalCtx, enAObjDisplayLists[this->base.params]);
}

View File

@ -40,7 +40,7 @@ EffInfo sEffInfoTable[] = {
};
GlobalContext* Effect_GetContext(void) {
return sEffTable.ctxt;
return sEffTable.globalCtx;
}
void* Effect_GetParams(s32 index) {
@ -92,7 +92,7 @@ void Effect_InitCommon(EffCommon* common) {
common->unk2 = 0;
}
void Effect_Init(GlobalContext* ctxt) {
void Effect_Init(GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < 3; i++) {
@ -112,10 +112,10 @@ void Effect_Init(GlobalContext* ctxt) {
Effect_InitCommon(&sEffTable.tireMarks[i].base);
}
sEffTable.ctxt = ctxt;
sEffTable.globalCtx = globalCtx;
}
void Effect_Add(GlobalContext* ctxt, s32* index, s32 type, u8 param_4, u8 param_5, void* initParams) {
void Effect_Add(GlobalContext* globalCtx, s32* index, s32 type, u8 param_4, u8 param_5, void* initParams) {
u32 slotFound;
s32 i;
void* params;
@ -125,7 +125,7 @@ void Effect_Add(GlobalContext* ctxt, s32* index, s32 type, u8 param_4, u8 param_
*index = 46;
common = NULL;
if (func_8016A01C(ctxt) != 1) {
if (func_8016A01C(globalCtx) != 1) {
slotFound = 0;
switch (type) {
case 0:
@ -219,13 +219,13 @@ void Effect_DrawAll(GraphicsContext* gCtxt) {
#ifdef NON_MATCHING
// 15 is being placed in s5 instead of at
void Effect_UpdateAll(GlobalContext* ctxt) {
void Effect_UpdateAll(GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < 3; i++) {
if (sEffTable.sparks[i].base.active) {
if (sEffInfoTable[0].update(&sEffTable.sparks[i].params) == 1) {
Effect_Destroy(ctxt, i);
Effect_Destroy(globalCtx, i);
}
}
}
@ -233,7 +233,7 @@ void Effect_UpdateAll(GlobalContext* ctxt) {
for (i = 0; i < 25; i++) {
if (sEffTable.blures[i].base.active) {
if (sEffInfoTable[1].update(&sEffTable.blures[i].params) == 1) {
Effect_Destroy(ctxt, i + 3);
Effect_Destroy(globalCtx, i + 3);
}
}
}
@ -241,7 +241,7 @@ void Effect_UpdateAll(GlobalContext* ctxt) {
for (i = 0; i < 3; i++) {
if (sEffTable.shieldParticles[i].base.active) {
if (sEffInfoTable[3].update(&sEffTable.shieldParticles[i].params) == 1) {
Effect_Destroy(ctxt, i + 28);
Effect_Destroy(globalCtx, i + 28);
}
}
}
@ -249,7 +249,7 @@ void Effect_UpdateAll(GlobalContext* ctxt) {
for (i = 0; i < 15; i++) {
if (sEffTable.tireMarks[i].base.active) {
if (sEffInfoTable[4].update(&sEffTable.tireMarks[i].params) == 1) {
Effect_Destroy(ctxt, i + 31);
Effect_Destroy(globalCtx, i + 31);
}
}
}
@ -258,7 +258,7 @@ void Effect_UpdateAll(GlobalContext* ctxt) {
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x800AF710/Effect_UpdateAll.asm")
#endif
void Effect_Destroy(GlobalContext* ctxt, s32 index) {
void Effect_Destroy(GlobalContext* globalCtx, s32 index) {
if (index == 46) {
return;
}
@ -291,7 +291,7 @@ void Effect_Destroy(GlobalContext* ctxt, s32 index) {
}
}
void Effect_DestroyAll(GlobalContext* ctxt) {
void Effect_DestroyAll(GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < 3; i++) {

View File

@ -9,12 +9,12 @@ void BcCheck3_BgActorInit(DynaPolyActor* actor, UNK_TYPE4 param_2) {
actor->unk_158 = 0;
}
void BgCheck3_LoadMesh(GlobalContext* ctxt, DynaPolyActor* actor, CollisionHeader* meshHeader) {
void BgCheck3_LoadMesh(GlobalContext* globalCtx, DynaPolyActor* actor, CollisionHeader* meshHeader) {
CollisionHeader* header;
header = NULL;
BgCheck_RelocateMeshHeader(meshHeader, &header);
actor->bgId = BgCheck_AddActorMesh(ctxt, &ctxt->colCtx.dyna, actor, header);
actor->bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, actor, header);
}
void BgCheck3_ResetFlags(DynaPolyActor* actor) {

View File

@ -1,8 +1,8 @@
#include <ultra64.h>
#include <global.h>
void func_800E8EA0(GlobalContext* ctxt, Actor* actor, u16 param_3) {
func_80151938(ctxt, param_3);
void func_800E8EA0(GlobalContext* globalCtx, Actor* actor, u16 param_3) {
func_80151938(globalCtx, param_3);
actor->textId = param_3;
}
@ -54,16 +54,15 @@ s32 func_800E8FA4(Actor* actor, Vec3f* param_2, Vec3s* param_3, Vec3s* param_4)
return 1;
}
s32 func_800E9138(GlobalContext* ctxt, Actor* actor, Vec3s* param_3, Vec3s* param_4, f32 param_5) {
s32 func_800E9138(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s* param_4, f32 param_5) {
ActorPlayer* player = PLAYER;
s16 sVar3;
Actor* player;
Vec3f local_14;
player = (ctxt->actorCtx).actorList[2].first;
actor->focus.pos = actor->world.pos;
actor->focus.pos.y += param_5;
if (((ctxt->csCtx).state == 0) && (D_801D0D50 == 0)) {
if (((globalCtx->csCtx).state == 0) && (D_801D0D50 == 0)) {
sVar3 = actor->yawTowardsPlayer - actor->shape.rot.y;
// TODO is this shifting because of a missing cast?
if (0x42ff < (sVar3 < 0 ? ((-sVar3 << 0x10) >> 0x10) : ((sVar3 << 0x10) >> 0x10))) {
@ -72,25 +71,24 @@ s32 func_800E9138(GlobalContext* ctxt, Actor* actor, Vec3s* param_3, Vec3s* para
}
}
if (((ctxt->csCtx).state != 0) || (D_801D0D50 != 0)) {
local_14 = ctxt->view.eye;
if (((globalCtx->csCtx).state != 0) || (D_801D0D50 != 0)) {
local_14 = globalCtx->view.eye;
} else {
local_14 = player->focus.pos;
local_14 = player->base.focus.pos;
}
func_800E8FA4(actor, &local_14, param_3, param_4);
return 1;
}
s32 func_800E9250(GlobalContext* ctxt, Actor* actor, Vec3s* param_3, Vec3s* param_4, Vec3f param_5) {
s32 func_800E9250(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s* param_4, Vec3f param_5) {
ActorPlayer* player = PLAYER;
s16 sVar3;
Actor* player;
Vec3f local_14;
player = (ctxt->actorCtx).actorList[2].first;
actor->focus.pos = param_5;
if (((ctxt->csCtx).state == 0) && (D_801D0D50 == 0)) {
if (((globalCtx->csCtx).state == 0) && (D_801D0D50 == 0)) {
sVar3 = actor->yawTowardsPlayer - actor->shape.rot.y;
// TODO is this shifting because of a missing cast?
if (0x42ff < (sVar3 < 0 ? ((-sVar3 << 0x10) >> 0x10) : ((sVar3 << 0x10) >> 0x10))) {
@ -99,10 +97,10 @@ s32 func_800E9250(GlobalContext* ctxt, Actor* actor, Vec3s* param_3, Vec3s* para
}
}
if (((ctxt->csCtx).state != 0) || (D_801D0D50 != 0)) {
local_14 = ctxt->view.eye;
if (((globalCtx->csCtx).state != 0) || (D_801D0D50 != 0)) {
local_14 = globalCtx->view.eye;
} else {
local_14 = player->focus.pos;
local_14 = player->base.focus.pos;
}
func_800E8FA4(actor, &local_14, param_3, param_4);

View File

@ -147,7 +147,7 @@ void func_800B40E0(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3,
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B5040.asm")
void Actor_TargetContextInit(TargetContext* targetCtxt, Actor* actor, GlobalContext* ctxt) {
void Actor_TargetContextInit(TargetContext* targetCtxt, Actor* actor, GlobalContext* globalCtx) {
targetCtxt->unk90 = NULL;
targetCtxt->unk8C = NULL;
targetCtxt->unk3C = NULL;
@ -155,94 +155,94 @@ void Actor_TargetContextInit(TargetContext* targetCtxt, Actor* actor, GlobalCont
targetCtxt->unk4B = 0;
targetCtxt->unk4C = 0;
targetCtxt->unk40 = 0;
func_800B5040(targetCtxt, actor, actor->category, ctxt);
func_800B4F78(targetCtxt, actor->category, ctxt);
func_800B5040(targetCtxt, actor, actor->category, globalCtx);
func_800B4F78(targetCtxt, actor->category, globalCtx);
}
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B5208.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B5814.asm")
u32 Flags_GetSwitch(GlobalContext* ctxt, s32 flag) {
u32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag) {
if (flag >= 0 && flag < 0x80) {
return ctxt->actorCtx.switchFlags[(flag & -0x20) >> 5] & (1 << (flag & 0x1F));
return globalCtx->actorCtx.switchFlags[(flag & -0x20) >> 5] & (1 << (flag & 0x1F));
}
return 0;
}
void Actor_SetSwitchFlag(GlobalContext* ctxt, s32 flag) {
void Actor_SetSwitchFlag(GlobalContext* globalCtx, s32 flag) {
if (flag >= 0 && flag < 0x80) {
ctxt->actorCtx.switchFlags[(flag & -0x20) >> 5] |= 1 << (flag & 0x1F);
globalCtx->actorCtx.switchFlags[(flag & -0x20) >> 5] |= 1 << (flag & 0x1F);
}
}
void Actor_UnsetSwitchFlag(GlobalContext* ctxt, s32 flag) {
void Actor_UnsetSwitchFlag(GlobalContext* globalCtx, s32 flag) {
if (flag >= 0 && flag < 0x80) {
ctxt->actorCtx.switchFlags[(flag & -0x20) >> 5] &= ~(1 << (flag & 0x1F));
globalCtx->actorCtx.switchFlags[(flag & -0x20) >> 5] &= ~(1 << (flag & 0x1F));
}
}
u32 Actor_GetChestFlag(GlobalContext* ctxt, u32 flag) {
return ctxt->actorCtx.chestFlags & (1 << flag);
u32 Actor_GetChestFlag(GlobalContext* globalCtx, u32 flag) {
return globalCtx->actorCtx.chestFlags & (1 << flag);
}
void Actor_SetChestFlag(GlobalContext* ctxt, u32 flag) {
ctxt->actorCtx.chestFlags |= (1 << flag);
void Actor_SetChestFlag(GlobalContext* globalCtx, u32 flag) {
globalCtx->actorCtx.chestFlags |= (1 << flag);
}
void Actor_SetAllChestFlag(GlobalContext* ctxt, u32 flag) {
ctxt->actorCtx.chestFlags = flag;
void Actor_SetAllChestFlag(GlobalContext* globalCtx, u32 flag) {
globalCtx->actorCtx.chestFlags = flag;
}
u32 Actor_GetAllChestFlag(GlobalContext* ctxt) {
return ctxt->actorCtx.chestFlags;
u32 Actor_GetAllChestFlag(GlobalContext* globalCtx) {
return globalCtx->actorCtx.chestFlags;
}
u32 Actor_GetRoomCleared(GlobalContext* ctxt, u32 roomNumber) {
return ctxt->actorCtx.clearedRooms & (1 << roomNumber);
u32 Actor_GetRoomCleared(GlobalContext* globalCtx, u32 roomNumber) {
return globalCtx->actorCtx.clearedRooms & (1 << roomNumber);
}
void Actor_SetRoomCleared(GlobalContext* ctxt, u32 roomNumber) {
ctxt->actorCtx.clearedRooms |= (1 << roomNumber);
void Actor_SetRoomCleared(GlobalContext* globalCtx, u32 roomNumber) {
globalCtx->actorCtx.clearedRooms |= (1 << roomNumber);
}
void Actor_UnsetRoomCleared(GlobalContext* ctxt, u32 roomNumber) {
ctxt->actorCtx.clearedRooms &= ~(1 << roomNumber);
void Actor_UnsetRoomCleared(GlobalContext* globalCtx, u32 roomNumber) {
globalCtx->actorCtx.clearedRooms &= ~(1 << roomNumber);
}
u32 Actor_GetRoomClearedTemp(GlobalContext* ctxt, u32 roomNumber) {
return ctxt->actorCtx.clearedRoomsTemp & (1 << roomNumber);
u32 Actor_GetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber) {
return globalCtx->actorCtx.clearedRoomsTemp & (1 << roomNumber);
}
void Actor_SetRoomClearedTemp(GlobalContext* ctxt, u32 roomNumber) {
ctxt->actorCtx.clearedRoomsTemp |= (1 << roomNumber);
void Actor_SetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber) {
globalCtx->actorCtx.clearedRoomsTemp |= (1 << roomNumber);
}
void Actor_UnsetRoomClearedTemp(GlobalContext* ctxt, u32 roomNumber) {
ctxt->actorCtx.clearedRoomsTemp &= ~(1 << roomNumber);
void Actor_UnsetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber) {
globalCtx->actorCtx.clearedRoomsTemp &= ~(1 << roomNumber);
}
u32 Actor_GetCollectibleFlag(GlobalContext* ctxt, s32 index) {
u32 Actor_GetCollectibleFlag(GlobalContext* globalCtx, s32 index) {
if (index > 0 && index < 0x80) {
return ctxt->actorCtx.collectibleFlags[(index & -0x20) >> 5] & (1 << (index & 0x1F));
return globalCtx->actorCtx.collectibleFlags[(index & -0x20) >> 5] & (1 << (index & 0x1F));
}
return 0;
}
void Actor_SetCollectibleFlag(GlobalContext* ctxt, s32 index) {
void Actor_SetCollectibleFlag(GlobalContext* globalCtx, s32 index) {
if (index > 0 && index < 0x80) {
ctxt->actorCtx.collectibleFlags[(index & -0x20) >> 5] |= 1 << (index & 0x1F);
globalCtx->actorCtx.collectibleFlags[(index & -0x20) >> 5] |= 1 << (index & 0x1F);
}
}
void Actor_TitleCardContextInit(GlobalContext* ctxt, TitleCardContext* titleCtxt) {
void Actor_TitleCardContextInit(GlobalContext* globalCtx, TitleCardContext* titleCtxt) {
titleCtxt->fadeOutDelay = 0;
titleCtxt->fadeInDelay = 0;
titleCtxt->color = 0;
titleCtxt->alpha = 0;
}
void Actor_TitleCardCreate(GlobalContext* ctxt, TitleCardContext* titleCtxt, u32 texture, s16 param_4, s16 param_5,
void Actor_TitleCardCreate(GlobalContext* globalCtx, TitleCardContext* titleCtxt, u32 texture, s16 param_4, s16 param_5,
u8 param_6, u8 param_7) {
titleCtxt->texture = texture;
titleCtxt->unk4 = param_4;
@ -255,7 +255,7 @@ void Actor_TitleCardCreate(GlobalContext* ctxt, TitleCardContext* titleCtxt, u32
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//Actor_Nop800B5E50.asm")
void Actor_TitleCardUpdate(GlobalContext* ctxt, TitleCardContext* titleCtxt) {
void Actor_TitleCardUpdate(GlobalContext* globalCtx, TitleCardContext* titleCtxt) {
if (DECR(titleCtxt->fadeInDelay) == 0) {
if (DECR(titleCtxt->fadeOutDelay) == 0) {
Math_StepToS(&titleCtxt->alpha, 0, 30);
@ -318,13 +318,13 @@ void Actor_SetScale(Actor* actor, f32 scale) {
actor->scale.x = scale;
}
void Actor_SetObjectSegment(GlobalContext* ctxt, Actor* actor) {
void Actor_SetObjectSegment(GlobalContext* globalCtx, Actor* actor) {
// TODO: Segment number enum
gSegments[6] = PHYSICAL_TO_VIRTUAL(ctxt->objectCtx.status[actor->objBankIndex].segment);
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[actor->objBankIndex].segment);
}
#if 0
void Actor_InitToDefaultValues(Actor* actor, GlobalContext* ctxt) {
void Actor_InitToDefaultValues(Actor* actor, GlobalContext* globalCtx) {
Actor_InitCurrPosition(actor);
Actor_InitDrawRotation(actor);
Actor_SetHeight(actor, 0);
@ -344,9 +344,9 @@ void Actor_InitToDefaultValues(Actor* actor, GlobalContext* ctxt) {
actor->naviMsgId = 255;
Actor_Setshape(&actor->shape, 0, 0, 0);
if (Object_IsLoaded(&ctxt->objectCtx, actor->objBankIndex) != 0) {
Actor_SetObjectSegment(ctxt, actor);
actor->init(actor, ctxt);
if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex) != 0) {
Actor_SetObjectSegment(globalCtx, actor);
actor->init(actor, globalCtx);
actor->init = NULL;
}
}
@ -354,10 +354,10 @@ void Actor_InitToDefaultValues(Actor* actor, GlobalContext* ctxt) {
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//Actor_InitToDefaultValues.asm")
#endif
void Actor_FiniActor(Actor* actor, GlobalContext* ctxt) {
void Actor_FiniActor(Actor* actor, GlobalContext* globalCtx) {
if (actor->init == NULL) {
if (actor->destroy != NULL) {
actor->destroy(actor, ctxt);
actor->destroy(actor, globalCtx);
actor->destroy = NULL;
}
}
@ -622,7 +622,7 @@ s32 Actor_IsActorFacingActorAndWithinRange(Actor* actor, Actor* other, f32 range
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B8934.asm")
u32 Actor_HasParent(Actor* actor, GlobalContext* ctxt) {
u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) {
if (actor->parent != NULL) {
return 1;
} else {
@ -698,9 +698,9 @@ u32 Actor_HasParent(Actor* actor, GlobalContext* ctxt) {
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B9D1C.asm")
void Actor_DrawAllSetup(GlobalContext* ctxt) {
ctxt->actorCtx.undrawnActorCount = 0;
ctxt->actorCtx.unkB = 0;
void Actor_DrawAllSetup(GlobalContext* globalCtx) {
globalCtx->actorCtx.undrawnActorCount = 0;
globalCtx->actorCtx.unkB = 0;
}
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//Actor_RecordUndrawnActor.asm")

View File

@ -26,13 +26,13 @@ void BgCheck_PolygonLinkedListNodeInsert(DynaSSNodeList* list, u16* head, s16* p
*head = index;
}
void BgCheck_PolygonLinkedListInit(GlobalContext* ctxt, DynaSSNodeList* list) {
void BgCheck_PolygonLinkedListInit(GlobalContext* globalCtx, DynaSSNodeList* list) {
list->tbl = NULL;
list->count = 0;
}
void BgCheck_PolygonLinkedListAlloc(GlobalContext* ctxt, DynaSSNodeList* list, u32 numNodes) {
list->tbl = (SSNode*)THA_AllocEndAlign(&ctxt->state.heap, numNodes << 2, 0xfffffffe);
void BgCheck_PolygonLinkedListAlloc(GlobalContext* globalCtx, DynaSSNodeList* list, u32 numNodes) {
list->tbl = (SSNode*)THA_AllocEndAlign(&globalCtx->state.heap, numNodes << 2, 0xfffffffe);
list->max = numNodes;
list->count = 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
#include <ultra64.h>
#include <global.h>
void EffFootmark_Init(GlobalContext* ctxt) {
void EffFootmark_Init(GlobalContext* globalCtx) {
EffFootmark* footmark;
s32 i;
for (footmark = ctxt->footmarks, i = 0; i < 100; i++, footmark++) {
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
footmark->actor = NULL;
footmark->location.x = 0;
footmark->location.y = 0;
@ -17,7 +17,7 @@ void EffFootmark_Init(GlobalContext* ctxt) {
}
}
void EffFootmark_Add(GlobalContext* ctxt, MtxF* displayMatrix, Actor* actor, u8 id, Vec3f* location, u16 size, u8 red,
void EffFootmark_Add(GlobalContext* globalCtx, MtxF* displayMatrix, Actor* actor, u8 id, Vec3f* location, u16 size, u8 red,
u8 green, u8 blue, u16 alpha, u16 alphaChange, u16 fadeoutDelay) {
s32 i;
EffFootmark* footmark;
@ -25,7 +25,7 @@ void EffFootmark_Add(GlobalContext* ctxt, MtxF* displayMatrix, Actor* actor, u8
EffFootmark* oldest = NULL;
s32 isNew = 1;
for (footmark = ctxt->footmarks, i = 0; i < 100; i++, footmark++) {
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
if (((actor == footmark->actor) && (footmark->id == id)) && ((footmark->flags & 1) == 0)) {
if (fabsf((footmark->location).x - location->x) <= 1) {
if (fabsf((footmark->location).z - location->z) <= 1) {
@ -71,11 +71,11 @@ void EffFootmark_Add(GlobalContext* ctxt, MtxF* displayMatrix, Actor* actor, u8
}
}
void EffFootmark_Update(GlobalContext* ctxt) {
void EffFootmark_Update(GlobalContext* globalCtx) {
EffFootmark* footmark;
s32 i;
for (footmark = ctxt->footmarks, i = 0; i < 100; i++, footmark++) {
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
if (footmark->actor != NULL) {
if ((footmark->flags & 1) == 1) {
if (footmark->age < 0xFFFFu) { // TODO replace with MAX_U16 or something
@ -96,21 +96,21 @@ void EffFootmark_Update(GlobalContext* ctxt) {
}
}
void EffFootmark_Draw(GlobalContext* ctxt) {
void EffFootmark_Draw(GlobalContext* globalCtx) {
EffFootmark* footmark;
s32 i;
GraphicsContext* gfxCtx = ctxt->state.gfxCtx;
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
func_8012C448(ctxt->state.gfxCtx);
func_8012C448(globalCtx->state.gfxCtx);
gSPDisplayList(gfxCtx->polyXlu.p++, D_801BC240);
for (footmark = ctxt->footmarks, i = 0; i < 100; i++, footmark++) {
for (footmark = globalCtx->footmarks, i = 0; i < 100; i++, footmark++) {
if (footmark->actor != NULL) {
Matrix_Put(&footmark->displayMatrix);
Matrix_Scale(footmark->size * 0.00390625f * 0.7f, 1, footmark->size * 0.00390625f, 1);
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(ctxt->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD);
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD);
gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, footmark->red, footmark->green, footmark->blue,
footmark->alpha >> 8);

View File

@ -1,12 +1,12 @@
#include <ultra64.h>
#include <global.h>
void EffectSS_Init(GlobalContext* ctxt, s32 numEntries) {
void EffectSS_Init(GlobalContext* globalCtx, s32 numEntries) {
u32 i;
EffectSs* iter;
ParticleOverlay* iter2;
EffectSS2Info.data_table = (EffectSs*)THA_AllocEndAlign16(&ctxt->state.heap, numEntries * sizeof(EffectSs));
EffectSS2Info.data_table = (EffectSs*)THA_AllocEndAlign16(&globalCtx->state.heap, numEntries * sizeof(EffectSs));
EffectSS2Info.searchIndex = 0;
EffectSS2Info.size = numEntries;
@ -19,7 +19,7 @@ void EffectSS_Init(GlobalContext* ctxt, s32 numEntries) {
}
}
void EffectSS_Clear(GlobalContext* ctxt) {
void EffectSS_Clear(GlobalContext* globalCtx) {
u32 i;
EffectSs* iter;
ParticleOverlay* iter2;
@ -149,9 +149,9 @@ s32 EffectSS_FindFreeSpace(u32 priority, u32* tableEntry) {
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_effect_soft_sprite/EffectSS_FindFreeSpace.asm")
#endif
void EffectSS_Copy(GlobalContext* ctxt, EffectSs* a1) {
void EffectSS_Copy(GlobalContext* globalCtx, EffectSs* a1) {
u32 index;
if (func_8016A01C(ctxt) != 1) {
if (func_8016A01C(globalCtx) != 1) {
if (EffectSS_FindFreeSpace(a1->priority, &index) == 0) {
EffectSS2Info.searchIndex = index + 1;
EffectSS2Info.data_table[index] = *a1;
@ -160,7 +160,7 @@ void EffectSS_Copy(GlobalContext* ctxt, EffectSs* a1) {
}
#ifdef NON_MATCHING
void EffectSs_Spawn(GlobalContext* ctxt, s32 type, s32 priority, void* initData) {
void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* initData) {
u32 index;
u32 initRet;
u32 overlaySize;
@ -202,7 +202,7 @@ void EffectSs_Spawn(GlobalContext* ctxt, s32 type, s32 priority, void* initData)
EffectSS2Info.data_table[index].type = type;
EffectSS2Info.data_table[index].priority = priority;
initRet = (*overlayInfo->init)(ctxt, index, &EffectSS2Info.data_table[index], initData);
initRet = (*overlayInfo->init)(globalCtx, index, &EffectSS2Info.data_table[index], initData);
if (initRet == 0) {
EffectSS_ResetEntry(&EffectSS2Info.data_table[index]);
@ -213,7 +213,7 @@ void EffectSs_Spawn(GlobalContext* ctxt, s32 type, s32 priority, void* initData)
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_effect_soft_sprite/EffectSs_Spawn.asm")
#endif
void EffectSS_UpdateParticle(GlobalContext* ctxt, s32 index) {
void EffectSS_UpdateParticle(GlobalContext* globalCtx, s32 index) {
EffectSs* particle = &EffectSS2Info.data_table[index];
if (particle->update != NULL) {
@ -225,11 +225,11 @@ void EffectSS_UpdateParticle(GlobalContext* ctxt, s32 index) {
particle->pos.y += particle->velocity.y;
particle->pos.z += particle->velocity.z;
particle->update(ctxt, index, particle);
particle->update(globalCtx, index, particle);
}
}
void EffectSS_UpdateAllParticles(GlobalContext* ctxt) {
void EffectSS_UpdateAllParticles(GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < EffectSS2Info.size; i++) {
@ -242,25 +242,25 @@ void EffectSS_UpdateAllParticles(GlobalContext* ctxt) {
}
if (EffectSS2Info.data_table[i].life > -1) {
EffectSS_UpdateParticle(ctxt, i);
EffectSS_UpdateParticle(globalCtx, i);
}
}
}
void EffectSS_DrawParticle(GlobalContext* ctxt, s32 index) {
void EffectSS_DrawParticle(GlobalContext* globalCtx, s32 index) {
EffectSs* entry = &EffectSS2Info.data_table[index];
if (entry->draw != 0) {
entry->draw(ctxt, index, entry);
entry->draw(globalCtx, index, entry);
}
}
void EffectSS_DrawAllParticles(GlobalContext* ctxt) {
void EffectSS_DrawAllParticles(GlobalContext* globalCtx) {
Lights* s0;
s32 i;
s0 = LightContext_NewLights(&ctxt->lightCtx, ctxt->state.gfxCtx);
Lights_BindAll(s0, ctxt->lightCtx.listHead, 0, ctxt);
Lights_Draw(s0, ctxt->state.gfxCtx);
s0 = LightContext_NewLights(&globalCtx->lightCtx, globalCtx->state.gfxCtx);
Lights_BindAll(s0, globalCtx->lightCtx.listHead, 0, globalCtx);
Lights_Draw(s0, globalCtx->state.gfxCtx);
for (i = 0; i < EffectSS2Info.size; i++) {
if (EffectSS2Info.data_table[i].life > -1) {
@ -269,7 +269,7 @@ void EffectSS_DrawAllParticles(GlobalContext* ctxt) {
EffectSS2Info.data_table[i].pos.z > 32000 || EffectSS2Info.data_table[i].pos.z < -32000) {
EffectSS_Delete(&EffectSS2Info.data_table[i]);
} else {
EffectSS_DrawParticle(ctxt, i);
EffectSS_DrawParticle(globalCtx, i);
}
}
}

View File

@ -16,7 +16,7 @@ void func_800A6650(EnItem00* this, GlobalContext* globalCtx);
void func_800A6780(EnItem00* this, GlobalContext* globalCtx);
void func_800A6A40(EnItem00* this, GlobalContext* globalCtx);
ActorInit En_Item00_InitVars = {
const ActorInit En_Item00_InitVars = {
ACTOR_EN_ITEM00,
ACTORCAT_MISC,
FLAGS,
@ -28,7 +28,7 @@ ActorInit En_Item00_InitVars = {
(ActorFunc)EnItem00_Draw,
};
ColliderCylinderInit enItem00CylinderInit = {
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_NONE, AT_NONE, AC_ON | AT_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER },
{ ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
@ -39,7 +39,9 @@ ColliderCylinderInit enItem00CylinderInit = {
{ 10, 30, 0, { 0, 0, 0 } },
};
InitChainEntry enItem00InitVars[1] = { ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP) };
static InitChainEntry sInitChain[] = {
ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP),
};
void EnItem00_SetObject(EnItem00* this, GlobalContext* globalCtx, f32* shadowOffset, f32* shadowScale) {
Actor_SetObjectSegment(globalCtx, &this->actor);
@ -76,8 +78,8 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.params = ITEM00_HEART;
}
Actor_ProcessInitChain(&this->actor, enItem00InitVars);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &enItem00CylinderInit);
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->unk150 = 1;
@ -273,7 +275,7 @@ void EnItem00_WaitForHeartObject(EnItem00* this, GlobalContext* globalCtx) {
}
}
void func_800A640C(EnItem00* this, GlobalContext* ctxt) {
void func_800A640C(EnItem00* this, GlobalContext* globalCtx) {
if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk152 < 0)) ||
(this->actor.params == ITEM00_HEART_PIECE) || (this->actor.params == ITEM00_HEART_CONTAINER)) {
this->actor.shape.rot.y = this->actor.shape.rot.y + 960;

View File

@ -1,12 +1,12 @@
#include <ultra64.h>
#include <global.h>
void Kanfont_Nop800F4F40(GlobalContext* ctxt, UNK_TYPE param_2, UNK_TYPE param_3) {
void Kanfont_Nop800F4F40(GlobalContext* globalCtx, UNK_TYPE param_2, UNK_TYPE param_3) {
}
void Kanfont_LoadAsciiChar(GlobalContext* ctxt, u8 character, s32 iParm3) {
void Kanfont_LoadAsciiChar(GlobalContext* globalCtx, u8 character, s32 iParm3) {
// UB to convert pointer to u32
DmaMgr_SendRequest0((void*)((u32)&ctxt->msgCtx.font.unk0[(ctxt->msgCtx).unk11EF0] + iParm3),
DmaMgr_SendRequest0((void*)((u32)&globalCtx->msgCtx.font.unk0[(globalCtx->msgCtx).unk11EF0] + iParm3),
(u32)_nes_font_staticSegmentRomStart + character * 0x80 - 0x1000, 0x80);
}

View File

@ -897,8 +897,8 @@ void func_8012C240(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyXlu.p++, &sSetupDL[6 * 0x19]);
}
void func_8012C268(GlobalContext* ctxt) {
func_8012C28C(ctxt->state.gfxCtx);
void func_8012C268(GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
}
void func_8012C28C(GraphicsContext* gCtxt) {

View File

@ -1,31 +1,31 @@
#include <ultra64.h>
#include <global.h>
void Room_nop8012D510(GlobalContext* ctxt, Room* room, UNK_PTR param_3, UNK_TYPE1 param_4) {
void Room_nop8012D510(GlobalContext* globalCtx, Room* room, UNK_PTR param_3, UNK_TYPE1 param_4) {
}
void Room_DrawType3Mesh(GlobalContext* ctxt, Room* room, u32 flags) {
void Room_DrawType3Mesh(GlobalContext* globalCtx, Room* room, u32 flags) {
}
void Room_DrawType0Mesh(GlobalContext* ctxt, Room* room, u32 flags) {
void Room_DrawType0Mesh(GlobalContext* globalCtx, Room* room, u32 flags) {
RoomMeshType0* mesh;
s32 i;
RoomMeshType0Params* meshParams;
GraphicsContext* gfxCtx;
UNK_TYPE4 pad;
gfxCtx = ctxt->state.gfxCtx;
gfxCtx = globalCtx->state.gfxCtx;
if (flags & 1) {
func_800BCBF4(&D_801C1D10, ctxt);
func_800BCBF4(&D_801C1D10, globalCtx);
gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment);
func_8012C268(ctxt);
func_8012C268(globalCtx);
gSPMatrix(gfxCtx->polyOpa.p++, &D_801D1DE0, G_MTX_MODELVIEW | G_MTX_LOAD);
}
if (flags & 2) {
func_800BCC68(&D_801C1D10, ctxt);
func_800BCC68(&D_801C1D10, globalCtx);
gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment);
func_8012C2DC(ctxt->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
gSPMatrix(gfxCtx->polyXlu.p++, &D_801D1DE0, G_MTX_MODELVIEW | G_MTX_LOAD);
}
@ -52,18 +52,18 @@ void Room_DrawType0Mesh(GlobalContext* ctxt, Room* room, u32 flags) {
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_room/func_8012E32C.asm")
void Room_DrawType1Mesh(GlobalContext* ctxt, Room* room, u32 flags) {
void Room_DrawType1Mesh(GlobalContext* globalCtx, Room* room, u32 flags) {
RoomMeshType1* mesh = &room->mesh->type1;
if (mesh->format == 1) {
func_8012DEE8(ctxt, room, flags);
func_8012DEE8(globalCtx, room, flags);
} else if (mesh->format == 2) {
func_8012E32C(ctxt, room, flags);
func_8012E32C(globalCtx, room, flags);
} else {
assert_fail(D_801DDFAC, 0x3c5);
}
}
void Room_Init(GlobalContext* ctxt, RoomContext* roomCtxt) {
void Room_Init(GlobalContext* globalCtx, RoomContext* roomCtxt) {
s32 i;
roomCtxt->currRoom.num = -1;
roomCtxt->currRoom.segment = NULL;
@ -77,7 +77,7 @@ void Room_Init(GlobalContext* ctxt, RoomContext* roomCtxt) {
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_room/Room_AllocateAndLoad.asm")
#ifdef NON_MATCHING
s32 Room_StartRoomTransition(GlobalContext* ctxt, RoomContext* roomCtxt, s32 index) {
s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtxt, s32 index) {
u32 size;
// XXX: this should use a branch-likely
@ -87,13 +87,13 @@ s32 Room_StartRoomTransition(GlobalContext* ctxt, RoomContext* roomCtxt, s32 ind
roomCtxt->currRoom.segment = NULL;
roomCtxt->unk31 = 1;
size = ctxt->roomAddrs[index].vromEnd - ctxt->roomAddrs[index].vromStart;
size = globalCtx->roomAddrs[index].vromEnd - globalCtx->roomAddrs[index].vromStart;
roomCtxt->activeRoomVram =
(void*)((s32)roomCtxt->roomMemPages[roomCtxt->activeMemPage] - (size + 8) * roomCtxt->activeMemPage + 8) &
0xfffffff0;
osCreateMesgQueue(&roomCtxt->loadQueue, roomCtxt->loadMsg, 1);
DmaMgr_SendRequestImpl(&roomCtxt->dmaRequest, roomCtxt->activeRoomVram, ctxt->roomAddrs[index].vromStart, size,
DmaMgr_SendRequestImpl(&roomCtxt->dmaRequest, roomCtxt->activeRoomVram, globalCtx->roomAddrs[index].vromStart, size,
0, &roomCtxt->loadQueue, NULL);
roomCtxt->activeMemPage ^= 1;
@ -106,7 +106,7 @@ s32 Room_StartRoomTransition(GlobalContext* ctxt, RoomContext* roomCtxt, s32 ind
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_room/Room_StartRoomTransition.asm")
#endif
s32 Room_HandleLoadCallbacks(GlobalContext* ctxt, RoomContext* roomCtxt) {
s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtxt) {
if (roomCtxt->unk31 == 1) {
if (!osRecvMesg(&roomCtxt->loadQueue, NULL, OS_MESG_NOBLOCK)) {
roomCtxt->unk31 = 0;
@ -114,18 +114,18 @@ s32 Room_HandleLoadCallbacks(GlobalContext* ctxt, RoomContext* roomCtxt) {
// TODO: Segment number enum
gSegments[3] = PHYSICAL_TO_VIRTUAL(roomCtxt->activeRoomVram);
Scene_ProcessHeader(ctxt, (SceneCmd*)roomCtxt->currRoom.segment);
func_80123140(ctxt, (ActorPlayer*)ctxt->actorCtx.actorList[2].first);
Actor_SpawnTransitionActors(ctxt, &ctxt->actorCtx);
Scene_ProcessHeader(globalCtx, (SceneCmd*)roomCtxt->currRoom.segment);
func_80123140(globalCtx, PLAYER);
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
if (((ctxt->sceneNum != SCENE_IKANA) || (roomCtxt->currRoom.num != 1)) &&
(ctxt->sceneNum != SCENE_IKNINSIDE)) {
ctxt->kankyoContext.unkC3 = 0xff;
ctxt->kankyoContext.unkE0 = 0;
if (((globalCtx->sceneNum != SCENE_IKANA) || (roomCtxt->currRoom.num != 1)) &&
(globalCtx->sceneNum != SCENE_IKNINSIDE)) {
globalCtx->kankyoContext.unkC3 = 0xff;
globalCtx->kankyoContext.unkE0 = 0;
}
func_800FEAB0();
if (!func_800FE4B8(ctxt)) {
func_800FD858(ctxt);
if (!func_800FE4B8(globalCtx)) {
func_800FD858(globalCtx);
}
} else {
return 0;
@ -135,23 +135,23 @@ s32 Room_HandleLoadCallbacks(GlobalContext* ctxt, RoomContext* roomCtxt) {
return 1;
}
void Room_Draw(GlobalContext* ctxt, Room* room, u32 flags) {
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
if (room->segment != NULL) {
// TODO: Segment number enum
gSegments[3] = PHYSICAL_TO_VIRTUAL(room->segment);
roomDrawFuncs[room->mesh->type0.type](ctxt, room, flags);
roomDrawFuncs[room->mesh->type0.type](globalCtx, room, flags);
}
return;
}
void func_8012EBF8(GlobalContext* ctxt, RoomContext* roomCtxt) {
void func_8012EBF8(GlobalContext* globalCtx, RoomContext* roomCtxt) {
roomCtxt->prevRoom.num = -1;
roomCtxt->prevRoom.segment = NULL;
func_800BA798(ctxt, &ctxt->actorCtx);
Actor_SpawnTransitionActors(ctxt, &ctxt->actorCtx);
func_800BA798(globalCtx, &globalCtx->actorCtx);
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
if (-1 < roomCtxt->currRoom.num) {
func_8010A33C(ctxt, roomCtxt->currRoom.num);
func_8010A2DC(ctxt);
func_8010A33C(globalCtx, roomCtxt->currRoom.num);
func_8010A2DC(globalCtx);
}
func_801A3CD8(ctxt->roomContext.currRoom.echo);
func_801A3CD8(globalCtx->roomContext.currRoom.echo);
}

View File

@ -3,10 +3,10 @@
typedef struct {
Actor actor;
s32 (*pictoFunc)(GlobalContext* ctxt, Actor* actor);
s32 (*pictoFunc)(GlobalContext* globalCtx, Actor* actor);
} PictoActor;
s32 func_8013A240(GlobalContext* ctxt) {
s32 func_8013A240(GlobalContext* globalCtx) {
PictoActor* pictoActor;
Actor* actor;
s32 type = 0;
@ -16,15 +16,15 @@ s32 func_8013A240(GlobalContext* ctxt) {
gSaveContext.perm.pictoFlags0 = 0;
gSaveContext.perm.pictoFlags1 = 0;
if (ctxt->sceneNum == SCENE_20SICHITAI) {
if (globalCtx->sceneNum == SCENE_20SICHITAI) {
func_8013A41C(1);
}
for (; type < 12; type++) {
for (actor = ctxt->actorCtx.actorList[type].first; actor != NULL; actor = actor->next) {
for (actor = globalCtx->actorCtx.actorList[type].first; actor != NULL; actor = actor->next) {
seen = 0;
switch (ctxt->sceneNum) {
switch (globalCtx->sceneNum) {
case SCENE_20SICHITAI:
if ((actor->id == ACTOR_EN_MNK) || (actor->id == ACTOR_EN_BIGOKUTA)) {
seen = 1;
@ -64,7 +64,7 @@ s32 func_8013A240(GlobalContext* ctxt) {
if (seen != 0) {
pictoActor = (PictoActor*)actor;
if (pictoActor->pictoFunc != NULL) {
if ((pictoActor->pictoFunc)(ctxt, actor) == 0) {
if ((pictoActor->pictoFunc)(globalCtx, actor) == 0) {
count++;
}
}
@ -148,7 +148,7 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
}
actors[0] = actor;
actors[1] = globalCtx->actorCtx.actorList[2].first; // TODO PLAYER macro
actors[1] = &PLAYER->base;
if (CollisionCheck_LineOCCheck(globalCtx, &globalCtx->colCheckCtx, pos, &camera->eye, actors, 2) != 0) {
func_8013A41C(0x3b);
ret |= 0x3b;

View File

@ -83,7 +83,7 @@ static InitChainEntry sInitChainOrgan[] = {
static Gfx* D_80AD32E8[] = { D_06010828, D_06017018, D_06018118 };
void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* GlobalContext) {
void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) {
int i;
s32 flags;
Vec3f splashSpawnPos;
@ -107,7 +107,7 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* GlobalContext) {
splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f);
splashSpawnPos.y += this->dyna.actor.world.pos.y;
splashSpawnPos.z += this->dyna.actor.world.pos.z + ((Rand_ZeroOne() * 20.0f) - 10.0f);
EffectSsGSplash_Spawn(GlobalContext, &splashSpawnPos, NULL, NULL, 0, ((u32)Rand_Next() >> 25) + 340);
EffectSsGSplash_Spawn(globalCtx, &splashSpawnPos, NULL, NULL, 0, ((u32)Rand_Next() >> 25) + 340);
}
}
}
@ -125,7 +125,7 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* GlobalContext) {
splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f);
splashSpawnPos.y += this->dyna.actor.world.pos.y;
splashSpawnPos.z += this->dyna.actor.world.pos.z + ((Rand_ZeroOne() * 20.0f) - 10.0f);
EffectSsGSplash_Spawn(GlobalContext, &splashSpawnPos, NULL, NULL, 0,
EffectSsGSplash_Spawn(globalCtx, &splashSpawnPos, NULL, NULL, 0,
((u32)Rand_Next() >> 25) + 280);
}
}

View File

@ -31,7 +31,7 @@ const ActorInit Bg_Haka_Curtain_InitVars = {
(ActorFunc)BgHakaCurtain_Draw,
};
static InitChainEntry D_80B6DFA0[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 700, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 600, ICHAIN_CONTINUE),
@ -44,7 +44,7 @@ extern UNK_TYPE D_06001410;
void BgHakaCurtain_Init(Actor* thisx, GlobalContext* globalCtx) {
BgHakaCurtain* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, D_80B6DFA0);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
BcCheck3_BgActorInit(&this->dyna, 1);
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06001588);
if (Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) {

View File

@ -26,7 +26,7 @@ const ActorInit Bg_Ikana_Ray_InitVars = {
(ActorFunc)BgIkanaRay_Draw,
};
ColliderCylinderInit bgIkanaRayCylinderInit = {
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_NONE,
AT_ON | AT_TYPE_OTHER,
@ -46,7 +46,7 @@ ColliderCylinderInit bgIkanaRayCylinderInit = {
{ 90, 420, -420, { 0, 0, 0 } },
};
InitChainEntry bgIkanaRayCompInit[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE),
@ -54,26 +54,27 @@ InitChainEntry bgIkanaRayCompInit[] = {
};
void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) {
ColliderCylinder* collision = &THIS->collision;
u32 pad;
Actor_ProcessInitChain(thisx, bgIkanaRayCompInit);
BgIkanaRay* this = THIS;
ColliderCylinder* collision = &this->collision;
Actor_ProcessInitChain(&this->base, sInitChain);
Collider_InitCylinder(globalCtx, collision);
Collider_SetCylinder(globalCtx, collision, thisx, &bgIkanaRayCylinderInit);
Collider_UpdateCylinder(thisx, &THIS->collision);
Collider_SetCylinder(globalCtx, collision, &this->base, &sCylinderInit);
Collider_UpdateCylinder(&this->base, &this->collision);
THIS->animatedTextures = (AnimatedMaterial*)Lib_SegmentedToVirtual(object_ikana_obj_001228);
this->animatedTextures = (AnimatedMaterial*)Lib_SegmentedToVirtual(object_ikana_obj_001228);
if (Flags_GetSwitch(globalCtx, THIS->base.params & 0x7F) != 0) {
BgIkanaRay_SetActivated(THIS);
if (Flags_GetSwitch(globalCtx, this->base.params & 0x7F) != 0) {
BgIkanaRay_SetActivated(this);
} else {
BgIkanaRay_SetDeactivated(THIS);
BgIkanaRay_SetDeactivated(this);
}
}
void BgIkanaRay_Destroy(Actor* thisx, GlobalContext* globalCtx) {
ColliderCylinder* collision = &THIS->collision;
BgIkanaRay* this = THIS;
ColliderCylinder* collision = &this->collision;
Collider_DestroyCylinder(globalCtx, collision);
}
@ -90,8 +91,8 @@ void BgIkanaRay_UpdateCheckForActivation(BgIkanaRay* this, GlobalContext* global
}
void BgIkanaRay_SetActivated(BgIkanaRay* this) {
this->base.draw = (ActorFunc)BgIkanaRay_Draw;
this->base.flags &= 0xFFFFFFEF;
this->base.draw = BgIkanaRay_Draw;
this->base.flags &= ~0x10;
this->update = BgIkanaRay_UpdateActivated;
}
@ -100,10 +101,14 @@ void BgIkanaRay_UpdateActivated(BgIkanaRay* this, GlobalContext* globalCtx) {
}
void BgIkanaRay_Update(Actor* thisx, GlobalContext* globalCtx) {
THIS->update(THIS, globalCtx);
BgIkanaRay* this = THIS;
this->update(this, globalCtx);
}
void BgIkanaRay_Draw(Actor* thisx, GlobalContext* globalCtx) {
AnimatedMat_Draw(globalCtx, THIS->animatedTextures);
BgIkanaRay* this = THIS;
AnimatedMat_Draw(globalCtx, this->animatedTextures);
func_800BE03C(globalCtx, object_ikana_obj_001100);
}

View File

@ -40,7 +40,7 @@ const ActorInit Bg_Ikana_Shutter_InitVars = {
(ActorFunc)BgIkanaShutter_Draw,
};
static InitChainEntry D_80BD5D10[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 500, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 500, ICHAIN_CONTINUE),
@ -60,7 +60,7 @@ s32 BgIkanaShutter_AllSwitchesPressed(BgIkanaShutter* this, GlobalContext* globa
void BgIkanaShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
BgIkanaShutter* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, D_80BD5D10);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
BcCheck3_BgActorInit(&this->dyna, 0);
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000F28);
if (!((this->dyna.actor.params >> 8) & 1)) {

View File

@ -20,7 +20,7 @@ const ActorInit Bg_Lbfshot_InitVars = {
(ActorFunc)BgLbfshot_Draw,
};
static InitChainEntry D_80C18200[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
@ -30,7 +30,7 @@ extern UNK_TYPE D_06000228;
void BgLbfshot_Init(Actor* thisx, GlobalContext* globalCtx) {
BgLbfshot* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, D_80C18200);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->dyna.actor.uncullZoneForward = 4000.0f;
BcCheck3_BgActorInit(&this->dyna, 1);
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060014D8);

View File

@ -21,7 +21,7 @@ const ActorInit Bg_Mbar_Chair_InitVars = {
(ActorFunc)BgMbarChair_Draw,
};
static InitChainEntry bgMbarChairInitVars[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 60, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 80, ICHAIN_CONTINUE),
@ -34,7 +34,7 @@ extern UNK_TYPE D_06000288;
void BgMbarChair_Init(Actor* thisx, GlobalContext* globalCtx) {
BgMbarChair* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, bgMbarChairInitVars);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
BcCheck3_BgActorInit(&this->dyna, 0);
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060019B4);
}

View File

@ -56,7 +56,7 @@ static ColliderJntSphInit sJntSphInit = {
sJntSphElementsInit,
};
DamageTable damageTable[] = {
static DamageTable sDamageTable = {
0xF0, 0xF0, 0x00, 0xF0, 0xE1, 0xE1, 0x00, 0xE1, 0xF0, 0xF0, 0xF0, 0xE1, 0xE1, 0xE1, 0xF0, 0xF0,
0xE1, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0xE1, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0,
};
@ -93,7 +93,7 @@ void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->collider.elements->dim.modelSphere.center.y = -4;
this->collider.elements->dim.modelSphere.center.z = 0;
this->dynaActor.actor.colChkInfo.damageTable = damageTable;
this->dynaActor.actor.colChkInfo.damageTable = &sDamageTable;
EnEncount2_SetIdle(this);
}

View File

@ -31,7 +31,7 @@ const ActorInit En_Jc_Mato_InitVars = {
(ActorFunc)EnJcMato_Draw,
};
ColliderSphereInit sSphereInit = {
static ColliderSphereInit sSphereInit = {
{
COLTYPE_NONE,
AT_NONE,
@ -51,7 +51,7 @@ ColliderSphereInit sSphereInit = {
{ 0, { { 0, 0, 0 }, 15 }, 100 },
};
DamageTable EnJcMatoDamageTable = {
static DamageTable sDamageTable = {
0x01, 0x01, 0x01, 0x01, 0x01, 0xF1, 0x01, 0x01, 0x01, 0x01, 0x01, 0xF1, 0xF1, 0xF1, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
};
@ -100,7 +100,7 @@ void EnJcMato_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitSphere(globalCtx, &this->collider);
Collider_SetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit);
this->collider.dim.worldSphere.radius = 0xF;
this->actor.colChkInfo.damageTable = &EnJcMatoDamageTable;
this->actor.colChkInfo.damageTable = &sDamageTable;
Actor_SetScale(&this->actor, 0.008f);
this->hitFlag = 0;
this->despawnTimer = 25;

View File

@ -26,7 +26,7 @@ const ActorInit En_Nnh_InitVars = {
(ActorFunc)EnNnh_Draw,
};
ColliderCylinderInit D_80C08A00 = {
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_TREE,
AT_NONE,
@ -53,7 +53,7 @@ void EnNnh_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.01f);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &D_80C08A00);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.targetMode = 1;
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 30.0f;

View File

@ -16,10 +16,10 @@ void EnPoFusen_Draw(Actor* thisx, GlobalContext* globalCtx);
u16 EnPoFusen_CheckParent(EnPoFusen* this, GlobalContext* globalCtx);
void EnPoFusen_InitNoFuse(EnPoFusen* this);
void EnPoFusen_InitFuse(EnPoFusen* this);
void EnPoFusen_Pop(EnPoFusen* this, GlobalContext* gCtx);
void EnPoFusen_Idle(EnPoFusen* this, GlobalContext* gCtx);
void EnPoFusen_IdleFuse(EnPoFusen* this, GlobalContext* gCtx);
s32 EnPoFusen_OverrideLimbDraw(GlobalContext* gCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
void EnPoFusen_Pop(EnPoFusen* this, GlobalContext* globalCtx);
void EnPoFusen_Idle(EnPoFusen* this, GlobalContext* globalCtx);
void EnPoFusen_IdleFuse(EnPoFusen* this, GlobalContext* globalCtx);
s32 EnPoFusen_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* actor);
extern AnimationHeader D_06000040;
@ -57,7 +57,7 @@ static ColliderSphereInit sSphereInit = {
{ 0, { { 0, 0, 0 }, 200 }, 100 },
};
DamageTable EnPoFusenDamageTable = {
static DamageTable sDamageTable = {
0x00, 0x00, 0x00, 0x00, 0x00, 0xF1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF1, 0xF1, 0xF1, 0xF1, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
@ -68,7 +68,7 @@ void EnPoFusen_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 0.00700000021607;
this->actor.targetMode = 6;
this->actor.colChkInfo.damageTable = &EnPoFusenDamageTable;
this->actor.colChkInfo.damageTable = &sDamageTable;
Collider_InitSphere(globalCtx, &this->collider);
Collider_SetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit);
@ -106,15 +106,15 @@ void EnPoFusen_Init(Actor* thisx, GlobalContext* globalCtx) {
EnPoFusen_InitNoFuse(this);
}
void EnPoFusen_Destroy(Actor* thisx, GlobalContext* gCtx) {
void EnPoFusen_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnPoFusen* this = THIS;
Collider_DestroySphere(gCtx, &this->collider);
Collider_DestroySphere(globalCtx, &this->collider);
}
u16 EnPoFusen_CheckParent(EnPoFusen* this, GlobalContext* globalCtx) {
struct Actor* actorPtr;
actorPtr = globalCtx->actorCtx.actorList[4].first;
actorPtr = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first;
if (GET_IS_FUSE_TYPE_PARAM(this)) {
return 1;
}
@ -132,7 +132,7 @@ u16 EnPoFusen_CheckParent(EnPoFusen* this, GlobalContext* globalCtx) {
return 0;
}
u16 EnPoFusen_CheckCollision(EnPoFusen* this, GlobalContext* gCtx) {
u16 EnPoFusen_CheckCollision(EnPoFusen* this, GlobalContext* globalCtx) {
if ((u32)this->actionFunc == (u32)EnPoFusen_IdleFuse) {
return 0;
}
@ -145,9 +145,9 @@ u16 EnPoFusen_CheckCollision(EnPoFusen* this, GlobalContext* gCtx) {
this->collider.base.acFlags &= ~0x2;
return 1;
}
CollisionCheck_SetOC(gCtx, &gCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(gCtx, &gCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
return 0;
}
@ -157,7 +157,7 @@ void EnPoFusen_InitNoFuse(EnPoFusen* this) {
this->actionFunc = EnPoFusen_Idle;
}
void EnPoFusen_Idle(EnPoFusen* this, GlobalContext* gCtx) {
void EnPoFusen_Idle(EnPoFusen* this, GlobalContext* globalCtx) {
f32 shadowScaleTmp;
f32 shadowAlphaTmp;
f32 heightOffset;
@ -204,8 +204,8 @@ void EnPoFusen_IncrementMalonPop(EnPoFusen* this) {
this->actionFunc = EnPoFusen_Pop;
}
void EnPoFusen_Pop(EnPoFusen* this, GlobalContext* gCtx) {
Actor_Spawn(&gCtx->actorCtx, gCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y + 20.0f,
void EnPoFusen_Pop(EnPoFusen* this, GlobalContext* globalCtx) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y + 20.0f,
this->actor.world.pos.z, 255, 255, 200, 2);
Audio_PlayActorSound2(&this->actor, 0x180E); // NA_SE_IT_BOMB_EXPLOSION sfx
Actor_MarkForDeath(&this->actor);
@ -219,8 +219,8 @@ void EnPoFusen_InitFuse(EnPoFusen* this) {
this->actionFunc = EnPoFusen_IdleFuse;
}
void EnPoFusen_IdleFuse(EnPoFusen* this, GlobalContext* gCtx) {
EnPoFusen_Idle(this, gCtx);
void EnPoFusen_IdleFuse(EnPoFusen* this, GlobalContext* globalCtx) {
EnPoFusen_Idle(this, globalCtx);
if (this->fuse-- == 0) {
EnPoFusen_IncrementMalonPop(this);
}
@ -234,7 +234,7 @@ void EnPoFusen_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
s32 EnPoFusen_OverrideLimbDraw(GlobalContext* gCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
s32 EnPoFusen_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* actor) {
EnPoFusen* this = (EnPoFusen*)actor;
f32 zScale;

View File

@ -8,7 +8,7 @@ void EnTagObj_Init(Actor* thisx, GlobalContext* globalCtx);
void EnTagObj_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnTagObj_Update(Actor* thisx, GlobalContext* globalCtx);
static ColliderCylinderInit unusedColliderInit = {
static ColliderCylinderInit sUnusedColliderInit = {
{
COLTYPE_NONE,
AT_NONE,

View File

@ -24,7 +24,7 @@ const ActorInit En_Tanron6_InitVars = {
(ActorFunc)EnTanron6_Draw,
};
DamageTable D_80BE6170 = {
static DamageTable sDamageTable = {
0xF0, 0xF0, 0x00, 0xF1, 0xE1, 0xE1, 0x00, 0xE1, 0xF0, 0xF0, 0xF0, 0xE1, 0xE1, 0x46, 0xF0, 0xF0,
0xE1, 0xF0, 0xF0, 0x00, 0x00, 0xF0, 0xE1, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0,
};
@ -35,7 +35,7 @@ void EnTanron6_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = 10;
ActorShape_Init(&this->actor.shape, 0, func_800B3FC0, 19.0f);
this->actor.colChkInfo.health = 1;
this->actor.colChkInfo.damageTable = &D_80BE6170;
this->actor.colChkInfo.damageTable = &sDamageTable;
this->actor.targetMode = 6;
EnTanron6_DoNothing(this);
}

View File

@ -231,7 +231,7 @@ void func_80930DDC(EnTuboTrap* this, GlobalContext* globalCtx) {
// Wait For Proximity (idle)
// NON-MATCHING: wrong register used, v instead of t for the weirdValues[] pointer
void func_80931004(EnTuboTrap* this, GlobalContext* globalCtx) {
Actor* player = PLAYER;
ActorPlayer* player = PLAYER;
f32 currentHeight;
s8 weirdvalue;
s16 startingRotation;
@ -240,7 +240,7 @@ void func_80931004(EnTuboTrap* this, GlobalContext* globalCtx) {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
if ((this->actor.xzDistToPlayer < 200.0f) && (this->actor.world.pos.y <= player->world.pos.y)) {
if ((this->actor.xzDistToPlayer < 200.0f) && (this->actor.world.pos.y <= player->base.world.pos.y)) {
startingRotation = this->actor.home.rot.z;
if ((startingRotation == 0) || (this->actor.yDistToPlayer <= ((f32)startingRotation * 10.0f))) {
func_800BC154(globalCtx, &globalCtx->actorCtx, this, ACTORCAT_ENEMY);
@ -249,9 +249,9 @@ void func_80931004(EnTuboTrap* this, GlobalContext* globalCtx) {
// hard to know what this value is even used for without knowing what ActorPlayer::unk14B is
// wild guess: this is player animation state, height is modified to always point at center of link model
weirdvalue = D_8093146C[((ActorPlayer*)player)->unk14B & 0xFF];
weirdvalue = D_8093146C[player->unk14B & 0xFF];
this->targetHeight = player->world.pos.y + (f32)weirdvalue;
this->targetHeight = player->base.world.pos.y + (f32)weirdvalue;
if (this->targetHeight < currentHeight) {
this->targetHeight = currentHeight;
this->targetHeight += weirdvalue;

View File

@ -32,7 +32,7 @@ const ActorInit En_Warp_Uzu_InitVars = {
(ActorFunc)EnWarpUzu_Draw,
};
static ColliderCylinderInit D_80A664C0 = {
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_HIT0,
AT_NONE,
@ -52,7 +52,7 @@ static ColliderCylinderInit D_80A664C0 = {
{ 25, 43, -20, { 0, 0, 0 } },
};
static InitChainEntry D_80A664EC[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneScale, 1500, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE),
@ -64,8 +64,8 @@ extern UNK_TYPE D_06000EC0;
void EnWarpUzu_Init(Actor* thisx, GlobalContext* globalCtx) {
EnWarpUzu* this = THIS;
Actor_ProcessInitChain(&this->actor, D_80A664EC);
Collider_InitAndSetCylinder(globalCtx, &this->collider, thisx, &D_80A664C0);
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitAndSetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
thisx->targetMode = 0;
func_80A66208(this, globalCtx);
}
@ -89,18 +89,18 @@ void func_80A66208(EnWarpUzu* this, GlobalContext* globalCtx) {
}
void func_80A66278(EnWarpUzu* this, GlobalContext* globalCtx) {
Actor* sp24;
ActorPlayer* player;
s16 temp_v0;
s16 phi_a0;
s16 phi_v1;
do {
sp24 = globalCtx->actorCtx.actorList[2].first;
player = PLAYER;
if (func_800B84D0(&this->actor, globalCtx)) {
func_80A66384(this, globalCtx);
} else {
phi_a0 = ABS((s16)(Actor_YawBetweenActors(&this->actor, sp24) - this->actor.shape.rot.y));
temp_v0 = sp24->shape.rot.y - this->actor.shape.rot.y;
phi_a0 = ABS((s16)(Actor_YawBetweenActors(&this->actor, &player->base) - this->actor.shape.rot.y));
temp_v0 = player->base.shape.rot.y - this->actor.shape.rot.y;
phi_v1 = ABS(temp_v0);
if (phi_a0 >= 0x2AAB) {
if (phi_v1 < 0x238E) {

View File

@ -104,7 +104,7 @@ Actor* ObjBoyo_GetCollidedActor(ObjBoyo* this, GlobalContext* globalCtx, s32* nu
if (this->collider.base.ocFlags2 & 1) {
*num = 0;
return globalCtx->actorCtx.actorList[2].first;
return &PLAYER->base;
}
if (this->collider.base.ocFlags1 & 2) {

View File

@ -21,7 +21,7 @@ const ActorInit Obj_Kepn_Koya_InitVars = {
(ActorFunc)ObjKepnKoya_Draw,
};
static InitChainEntry D_80C07C40[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneScale, 1200, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 900, ICHAIN_STOP),
};
@ -32,7 +32,7 @@ extern UNK_TYPE D_06003478;
void ObjKepnKoya_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjKepnKoya* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, D_80C07C40);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
Actor_SetScale(&this->dyna.actor, 0.1f);
BcCheck3_BgActorInit(&this->dyna, 0);
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_0600805C);

View File

@ -20,7 +20,7 @@ const ActorInit Obj_Visiblock_InitVars = {
(ActorFunc)ObjVisiblock_Draw,
};
static InitChainEntry D_80ADEB50[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 200, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 150, ICHAIN_CONTINUE),
@ -33,7 +33,7 @@ extern Gfx D_06000140[];
void ObjVisiblock_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjVisiblock* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, D_80ADEB50);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
BcCheck3_BgActorInit(&this->dyna, 0);
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000AD0);
}