General Cleanup 2 (#681)

* cleanup

* Clean up toto

* More ClockTime macro

* rename pad

* EnGo and format

* EntityLineTest booleans

* Other bgcheck tests

* Graph Allocs

* Lib_Segmented

* Fix toto comment

* Remove macro comment for EnBigpo_DrawLantern

* Format and remove sym from undefined_syms.txt

* PR suggestions

* BgIkanaRay params

* One day i'll remember

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
This commit is contained in:
Derek Hensley 2022-03-05 07:03:20 -08:00 committed by GitHub
parent 7fcefd8d3f
commit 1e4411a871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
63 changed files with 252 additions and 254 deletions

View File

@ -2405,7 +2405,7 @@ void Animation_MorphToLoop(SkelAnime* skelAnime, AnimationHeader* animation, f32
void Animation_PlayLoopSetSpeed(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed);
void Animation_EndLoop(SkelAnime* skelAnime);
void Animation_Reverse(SkelAnime* skelAnime);
void SkelAnime_CopyFrameTableTrue(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src, u8* index);
void SkelAnime_CopyFrameTableTrue(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src, u8* copyFlag);
void SkelAnime_CopyFrameTableFalse(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src, u8* copyFlag);
void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* pos, s16 angle);
s32 Animation_OnFrame(SkelAnime* skelAnime, f32 frame);

View File

@ -57,15 +57,13 @@ s32 func_800E9138(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s*
Player* player = GET_PLAYER(globalCtx);
s16 sVar3;
Vec3f local_14;
s16 sVar3A;
actor->focus.pos = actor->world.pos;
actor->focus.pos.y += param_5;
if (((globalCtx->csCtx).state == 0) && (D_801D0D50 == 0)) {
sVar3 = actor->yawTowardsPlayer - actor->shape.rot.y;
sVar3A = ABS_ALT(sVar3);
if (sVar3A >= 0x4300) {
sVar3 = ABS_ALT(BINANG_SUB(actor->yawTowardsPlayer, actor->shape.rot.y));
if (sVar3 >= 0x4300) {
func_800E8F08(param_3, param_4);
return 0;
}
@ -86,14 +84,12 @@ s32 func_800E9250(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s*
Player* player = GET_PLAYER(globalCtx);
s16 sVar3;
Vec3f local_14;
s16 sVar3A;
actor->focus.pos = param_5;
if (((globalCtx->csCtx).state == 0) && (D_801D0D50 == 0)) {
sVar3 = actor->yawTowardsPlayer - actor->shape.rot.y;
sVar3A = ABS_ALT(sVar3);
if (sVar3A >= 0x4300) {
sVar3 = ABS_ALT(BINANG_SUB(actor->yawTowardsPlayer, actor->shape.rot.y));
if (sVar3 >= 0x4300) {
func_800E8F08(param_3, param_4);
return 0;
}

View File

@ -3405,7 +3405,8 @@ void func_800BB604(GameState* gameState, ActorContext* actorCtx, Player* player,
if (((phi_s2) || (phi_s2_2)) && (func_800B83BC(actor, temp_f0_2))) {
if (func_800BB59C(globalCtx, actor)) {
if (((!BgCheck_CameraLineTest1(&globalCtx->colCtx, &player->actor.focus.pos,
&actor->focus.pos, &sp70, &sp80, 1, 1, 1, 1, &sp7C)) ||
&actor->focus.pos, &sp70, &sp80, true, true, true, true,
&sp7C)) ||
(SurfaceType_IsIgnoredByProjectiles(&globalCtx->colCtx, sp80, sp7C)))) {
if (actor->targetPriority != 0) {
if ((phi_s2 != 0) && (actor->targetPriority < D_801ED8D4)) {

View File

@ -30,13 +30,22 @@ const ActorInit En_Item00_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_NONE, AT_NONE, AC_ON | AT_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER },
{ ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000010, 0x00, 0x00 },
TOUCH_NONE | TOUCH_SFX_NORMAL,
BUMP_ON,
OCELEM_NONE },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AT_TYPE_PLAYER,
OC1_NONE,
OC2_NONE,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000010, 0x00, 0x00 },
TOUCH_NONE | TOUCH_SFX_NORMAL,
BUMP_ON,
OCELEM_NONE,
},
{ 10, 30, 0, { 0, 0, 0 } },
};

View File

@ -14,10 +14,10 @@ void SkelCurve_Clear(SkelAnimeCurve* skelCurve) {
s32 SkelCurve_Init(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve, SkelCurveLimbList* limbListSeg,
TransformUpdateIndex* transUpdIdx) {
SkelCurveLimb** limbs;
SkelCurveLimbList* limbList = (SkelCurveLimbList*)Lib_SegmentedToVirtual(limbListSeg);
SkelCurveLimbList* limbList = Lib_SegmentedToVirtual(limbListSeg);
skelCurve->limbCount = limbList->limbCount;
skelCurve->limbList = (SkelCurveLimb**)Lib_SegmentedToVirtual(limbList->limbs);
skelCurve->limbList = Lib_SegmentedToVirtual(limbList->limbs);
skelCurve->transforms = ZeldaArena_Malloc(sizeof(*skelCurve->transforms) * skelCurve->limbCount);
@ -100,7 +100,7 @@ s32 SkelCurve_Update(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve) {
void SkelCurve_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, SkelAnimeCurve* skelCurve,
OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, Actor* thisx) {
SkelCurveLimb* limb = (SkelCurveLimb*)Lib_SegmentedToVirtual(skelCurve->limbList[limbIndex]);
SkelCurveLimb* limb = Lib_SegmentedToVirtual(skelCurve->limbList[limbIndex]);
OPEN_DISPS(globalCtx->state.gfxCtx);

View File

@ -74,7 +74,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
gSaveContext.nextTransition = 2;
gSaveContext.health = 48;
gameOverCtx->state++;
if (gSaveContext.inventory.items[SLOT(ITEM_MASK_DEKU)] == ITEM_MASK_DEKU) {
if (INV_CONTENT(ITEM_MASK_DEKU) == ITEM_MASK_DEKU) {
gSaveContext.playerForm = PLAYER_FORM_HUMAN;
gSaveContext.equippedMask = PLAYER_MASK_NONE;
}

View File

@ -29,7 +29,7 @@ void Room_DrawType0Mesh(GlobalContext* globalCtx, Room* room, u32 flags) {
}
mesh = &room->mesh->type0;
meshParams = (RoomMeshType0Params*)Lib_SegmentedToVirtual(mesh->paramsStart);
meshParams = Lib_SegmentedToVirtual(mesh->paramsStart);
for (i = 0; i < mesh->count; i++) {
if ((flags & 1) && (meshParams->opaqueDl != NULL)) {
gSPDisplayList(gfxCtx->polyOpa.p++, meshParams->opaqueDl);

View File

@ -13,8 +13,7 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 id) {
}
if (objectCtx->num < OBJECT_EXCHANGE_BANK_MAX - 1) {
objectCtx->status[objectCtx->num + 1].segment =
(void*)ALIGN16((u32)objectCtx->status[objectCtx->num].segment + size);
objectCtx->status[objectCtx->num + 1].segment = ALIGN16((u32)objectCtx->status[objectCtx->num].segment + size);
}
objectCtx->num++;
@ -172,9 +171,9 @@ void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x01: Actor List
void Scene_HeaderCmdActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->numSetupActors = (u16)cmd->actorList.num;
globalCtx->setupActorList = (ActorEntry*)Lib_SegmentedToVirtual(cmd->actorList.segment);
globalCtx->actorCtx.unkC = (u16)0;
globalCtx->numSetupActors = cmd->actorList.num;
globalCtx->setupActorList = Lib_SegmentedToVirtual(cmd->actorList.segment);
globalCtx->actorCtx.unkC = 0;
}
// SceneTableEntry Header Command 0x02: List of cameras for actor cutscenes
@ -187,21 +186,21 @@ void Scene_HeaderCmdColHeader(GlobalContext* globalCtx, SceneCmd* cmd) {
CollisionHeader* colHeaderTemp;
CollisionHeader* colHeader;
colHeaderTemp = (CollisionHeader*)Lib_SegmentedToVirtual(cmd->colHeader.segment);
colHeaderTemp = Lib_SegmentedToVirtual(cmd->colHeader.segment);
colHeader = colHeaderTemp;
colHeader->vtxList = (Vec3s*)Lib_SegmentedToVirtual(colHeaderTemp->vtxList);
colHeader->polyList = (CollisionPoly*)Lib_SegmentedToVirtual(colHeader->polyList);
colHeader->vtxList = Lib_SegmentedToVirtual(colHeaderTemp->vtxList);
colHeader->polyList = Lib_SegmentedToVirtual(colHeader->polyList);
if (colHeader->surfaceTypeList != NULL) {
colHeader->surfaceTypeList = (SurfaceType*)Lib_SegmentedToVirtual(colHeader->surfaceTypeList);
colHeader->surfaceTypeList = Lib_SegmentedToVirtual(colHeader->surfaceTypeList);
}
if (colHeader->cameraDataList != NULL) {
colHeader->cameraDataList = (void*)Lib_SegmentedToVirtual(colHeader->cameraDataList);
colHeader->cameraDataList = Lib_SegmentedToVirtual(colHeader->cameraDataList);
}
if (colHeader->waterBoxes != NULL) {
colHeader->waterBoxes = (WaterBox*)Lib_SegmentedToVirtual(colHeader->waterBoxes);
colHeader->waterBoxes = Lib_SegmentedToVirtual(colHeader->waterBoxes);
}
BgCheck_Allocate(&globalCtx->colCtx, globalCtx, colHeader);
@ -210,12 +209,12 @@ void Scene_HeaderCmdColHeader(GlobalContext* globalCtx, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x04: Room List
void Scene_HeaderCmdRoomList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->numRooms = cmd->roomList.num;
globalCtx->roomList = (RomFile*)Lib_SegmentedToVirtual(cmd->roomList.segment);
globalCtx->roomList = Lib_SegmentedToVirtual(cmd->roomList.segment);
}
// SceneTableEntry Header Command 0x06: Entrance List
void Scene_HeaderCmdEntranceList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupEntranceList = (EntranceEntry*)Lib_SegmentedToVirtual(cmd->entranceList.segment);
globalCtx->setupEntranceList = Lib_SegmentedToVirtual(cmd->entranceList.segment);
}
// SceneTableEntry Header Command 0x07: Special Files
@ -248,19 +247,21 @@ void Scene_HeaderCmdRoomBehavior(GlobalContext* globalCtx, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x0A: Mesh Header
void Scene_HeaderCmdMesh(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->roomCtx.currRoom.mesh = (RoomMesh*)Lib_SegmentedToVirtual(cmd->mesh.segment);
globalCtx->roomCtx.currRoom.mesh = Lib_SegmentedToVirtual(cmd->mesh.segment);
}
// SceneTableEntry Header Command 0x0B: Object List
void Scene_HeaderCmdObjectList(GlobalContext* globalCtx, SceneCmd* cmd) {
s32 i, j, k;
s32 i;
s32 j;
s32 k;
ObjectStatus* firstObject;
ObjectStatus* status;
ObjectStatus* status2;
s16* objectEntry;
void* nextPtr;
objectEntry = (s16*)Lib_SegmentedToVirtual(cmd->objectList.segment);
objectEntry = Lib_SegmentedToVirtual(cmd->objectList.segment);
k = 0;
i = globalCtx->objectCtx.spawnedObjectCount;
status = &globalCtx->objectCtx.status[i];
@ -305,7 +306,7 @@ void Scene_HeaderCmdObjectList(GlobalContext* globalCtx, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x0C: Light List
void Scene_HeaderCmdLightList(GlobalContext* globalCtx, SceneCmd* cmd) {
s32 i;
LightInfo* lightInfo = (LightInfo*)Lib_SegmentedToVirtual(cmd->lightList.segment);
LightInfo* lightInfo = Lib_SegmentedToVirtual(cmd->lightList.segment);
for (i = 0; i < cmd->lightList.num; i++) {
LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, lightInfo);
@ -315,14 +316,13 @@ void Scene_HeaderCmdLightList(GlobalContext* globalCtx, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x0D: Path List
void Scene_HeaderCmdPathList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupPathList = (Path*)Lib_SegmentedToVirtual(cmd->pathList.segment);
globalCtx->setupPathList = Lib_SegmentedToVirtual(cmd->pathList.segment);
}
// SceneTableEntry Header Command 0x0E: Transition Actor List
void Scene_HeaderCmdTransiActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->doorCtx.numTransitionActors = cmd->transiActorList.num;
globalCtx->doorCtx.transitionActorList =
(TransitionActorEntry*)Lib_SegmentedToVirtual((void*)cmd->transiActorList.segment);
globalCtx->doorCtx.transitionActorList = Lib_SegmentedToVirtual(cmd->transiActorList.segment);
func_80105818(globalCtx, globalCtx->doorCtx.numTransitionActors, globalCtx->doorCtx.transitionActorList);
}
@ -334,7 +334,7 @@ void Door_InitContext(GameState* state, DoorContext* doorCtx) {
// SceneTableEntry Header Command 0x0F: Environment Light Settings List
void Scene_HeaderCmdEnvLightSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->envCtx.numLightSettings = cmd->lightSettingList.num;
globalCtx->envCtx.lightSettingsList = (void*)Lib_SegmentedToVirtual(cmd->lightSettingList.segment);
globalCtx->envCtx.lightSettingsList = Lib_SegmentedToVirtual(cmd->lightSettingList.segment);
}
/**
@ -440,7 +440,7 @@ void Scene_HeaderCmdWindSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x13: Exit List
void Scene_HeaderCmdExitList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupExitList = (u16*)Lib_SegmentedToVirtual(cmd->exitList.segment);
globalCtx->setupExitList = Lib_SegmentedToVirtual(cmd->exitList.segment);
}
// SceneTableEntry Header Command 0x09: Undefined
@ -468,11 +468,11 @@ void Scene_HeaderCmdAltHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
SceneCmd* altHeader;
if (gSaveContext.sceneSetupIndex) {
altHeaderList = (SceneCmd**)Lib_SegmentedToVirtual(cmd->altHeaders.segment);
altHeaderList = Lib_SegmentedToVirtual(cmd->altHeaders.segment);
altHeader = altHeaderList[gSaveContext.sceneSetupIndex - 1];
if (altHeader != NULL) {
Scene_ProcessHeader(globalCtx, (SceneCmd*)Lib_SegmentedToVirtual(altHeader));
Scene_ProcessHeader(globalCtx, Lib_SegmentedToVirtual(altHeader));
(cmd + 1)->base.code = 0x14;
}
}
@ -480,14 +480,13 @@ void Scene_HeaderCmdAltHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x17: Cutscene List
void Scene_HeaderCmdCutsceneList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->csCtx.sceneCsCount = (u8)cmd->base.data1;
globalCtx->csCtx.sceneCsList = (CutsceneEntry*)Lib_SegmentedToVirtual((void*)cmd->base.data2);
globalCtx->csCtx.sceneCsCount = cmd->base.data1;
globalCtx->csCtx.sceneCsList = Lib_SegmentedToVirtual(cmd->base.data2);
}
// SceneTableEntry Header Command 0x1B: Actor Cutscene List
void Scene_HeaderCmdActorCutsceneList(GlobalContext* globalCtx, SceneCmd* cmd) {
ActorCutscene_Init(globalCtx, (ActorCutscene*)Lib_SegmentedToVirtual(cmd->cutsceneActorList.segment),
cmd->cutsceneActorList.num);
ActorCutscene_Init(globalCtx, Lib_SegmentedToVirtual(cmd->cutsceneActorList.segment), cmd->cutsceneActorList.num);
}
// SceneTableEntry Header Command 0x1C: Mini Maps

View File

@ -114,7 +114,7 @@ void AnimatedMat_DrawTwoTexScroll(GlobalContext* globalCtx, s32 segment, void* p
* Generates a displaylist that sets the prim and env color, and stores it in the provided segment ID.
*/
void AnimatedMat_SetColor(GlobalContext* globalCtx, s32 segment, F3DPrimColor* primColorResult, F3DEnvColor* envColor) {
Gfx* colorDList = (Gfx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(Gfx) * 4);
Gfx* colorDList = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(Gfx) * 4);
OPEN_DISPS(globalCtx->state.gfxCtx);
@ -141,13 +141,10 @@ void AnimatedMat_SetColor(GlobalContext* globalCtx, s32 segment, F3DPrimColor* p
*/
void AnimatedMat_DrawColor(GlobalContext* globalCtx, s32 segment, void* params) {
AnimatedMatColorParams* colorAnimParams = (AnimatedMatColorParams*)params;
F3DPrimColor* primColor;
F3DPrimColor* primColor = Lib_SegmentedToVirtual(colorAnimParams->primColors);
F3DEnvColor* envColor;
s32 curFrame;
s32 curFrame = sMatAnimStep % colorAnimParams->keyFrameLength;
primColor = (F3DPrimColor*)Lib_SegmentedToVirtual(colorAnimParams->primColors);
curFrame = sMatAnimStep % colorAnimParams->keyFrameLength;
primColor += curFrame;
envColor = (colorAnimParams->envColors != NULL)
? (F3DEnvColor*)Lib_SegmentedToVirtual(colorAnimParams->envColors) + curFrame
@ -169,10 +166,10 @@ s32 AnimatedMat_Lerp(s32 min, s32 max, f32 norm) {
*/
void AnimatedMat_DrawColorLerp(GlobalContext* globalCtx, s32 segment, void* params) {
AnimatedMatColorParams* colorAnimParams = (AnimatedMatColorParams*)params;
F3DPrimColor* primColorMax;
F3DPrimColor* primColorMax = Lib_SegmentedToVirtual(colorAnimParams->primColors);
F3DEnvColor* envColorMax;
u16* keyFrames;
s32 curFrame;
u16* keyFrames = Lib_SegmentedToVirtual(colorAnimParams->keyFrames);
s32 curFrame = sMatAnimStep % colorAnimParams->keyFrameLength;
s32 endFrame;
s32 relativeFrame; // relative to the start frame
s32 startFrame;
@ -183,9 +180,6 @@ void AnimatedMat_DrawColorLerp(GlobalContext* globalCtx, s32 segment, void* para
F3DEnvColor envColorResult;
s32 i;
primColorMax = (F3DPrimColor*)Lib_SegmentedToVirtual(colorAnimParams->primColors);
keyFrames = (u16*)Lib_SegmentedToVirtual(colorAnimParams->keyFrames);
curFrame = sMatAnimStep % colorAnimParams->keyFrameLength;
keyFrames++;
i = 1;
@ -211,7 +205,7 @@ void AnimatedMat_DrawColorLerp(GlobalContext* globalCtx, s32 segment, void* para
primColorResult.lodFrac = AnimatedMat_Lerp(primColorMin->lodFrac, primColorMax->lodFrac, norm);
if (colorAnimParams->envColors) {
envColorMax = (F3DEnvColor*)Lib_SegmentedToVirtual(colorAnimParams->envColors);
envColorMax = Lib_SegmentedToVirtual(colorAnimParams->envColors);
envColorMax += i;
envColorMin = envColorMax - 1;
envColorResult.r = AnimatedMat_Lerp(envColorMin->r, envColorMax->r, norm);
@ -370,8 +364,8 @@ void AnimatedMat_DrawColorNonLinearInterp(GlobalContext* globalCtx, s32 segment,
*/
void AnimatedMat_DrawTexCycle(GlobalContext* globalCtx, s32 segment, void* params) {
AnimatedMatTexCycleParams* texAnimParams = params;
void** texList = (void**)Lib_SegmentedToVirtual(texAnimParams->textureList);
u8* texId = (u8*)Lib_SegmentedToVirtual(texAnimParams->textureIndexList);
void** texList = Lib_SegmentedToVirtual(texAnimParams->textureList);
u8* texId = Lib_SegmentedToVirtual(texAnimParams->textureIndexList);
s32 curFrame = sMatAnimStep % texAnimParams->keyFrameLength;
void* tex = Lib_SegmentedToVirtual(texList[texId[curFrame]]);
@ -408,9 +402,9 @@ void AnimatedMat_DrawMain(GlobalContext* globalCtx, AnimatedMaterial* matAnim, f
do {
segment = matAnim->segment;
segmentAbs = ((segment < 0) ? -segment : segment) + 7;
matAnimDrawHandlers[matAnim->type](globalCtx, segmentAbs, (void*)Lib_SegmentedToVirtual(matAnim->params));
matAnimDrawHandlers[matAnim->type](globalCtx, segmentAbs, Lib_SegmentedToVirtual(matAnim->params));
matAnim++;
} while (segment > -1);
} while (segment >= 0);
}
}
@ -726,7 +720,7 @@ void Scene_DrawConfigGreatBayTemple(GlobalContext* globalCtx) {
BgCheck_UnsetContextFlags(&globalCtx->colCtx, BGCHECK_FLAG_REVERSE_CONVEYOR_FLOW);
}
dList = (Gfx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(Gfx) * 18);
dList = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(Gfx) * 18);
AnimatedMat_Draw(globalCtx, globalCtx->sceneMaterialAnims);

View File

@ -87,7 +87,7 @@ static InitChainEntry sInitChain[] = {
};
void func_80A9ACD0(BgHakuginPostUnkStruct* arg0) {
bzero((void*)arg0, sizeof(BgHakuginPostUnkStruct));
bzero(arg0, sizeof(BgHakuginPostUnkStruct));
}
void func_80A9ACF0(void) {

View File

@ -69,9 +69,9 @@ void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, collision, &this->actor, &sCylinderInit);
Collider_UpdateCylinder(&this->actor, &this->collision);
this->animatedTextures = (AnimatedMaterial*)Lib_SegmentedToVirtual(object_ikana_obj_Matanimheader_001228);
this->animatedTextures = Lib_SegmentedToVirtual(object_ikana_obj_Matanimheader_001228);
if (Flags_GetSwitch(globalCtx, this->actor.params & 0x7F)) {
if (Flags_GetSwitch(globalCtx, BGIKANARAY_GET_SWITCH_FLAG(&this->actor))) {
BgIkanaRay_SetActivated(this);
} else {
BgIkanaRay_SetDeactivated(this);
@ -88,11 +88,11 @@ void BgIkanaRay_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void BgIkanaRay_SetDeactivated(BgIkanaRay* this) {
this->actor.draw = NULL;
this->actor.flags |= ACTOR_FLAG_10;
this->update = BgIkanaRay_UpdateCheckForActivation;
this->actionFunc = BgIkanaRay_UpdateCheckForActivation;
}
void BgIkanaRay_UpdateCheckForActivation(BgIkanaRay* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->actor.params & 0x7F)) {
if (Flags_GetSwitch(globalCtx, BGIKANARAY_GET_SWITCH_FLAG(&this->actor))) {
BgIkanaRay_SetActivated(this);
}
}
@ -100,7 +100,7 @@ void BgIkanaRay_UpdateCheckForActivation(BgIkanaRay* this, GlobalContext* global
void BgIkanaRay_SetActivated(BgIkanaRay* this) {
this->actor.draw = BgIkanaRay_Draw;
this->actor.flags &= ~ACTOR_FLAG_10;
this->update = BgIkanaRay_UpdateActivated;
this->actionFunc = BgIkanaRay_UpdateActivated;
}
void BgIkanaRay_UpdateActivated(BgIkanaRay* this, GlobalContext* globalCtx) {
@ -110,7 +110,7 @@ void BgIkanaRay_UpdateActivated(BgIkanaRay* this, GlobalContext* globalCtx) {
void BgIkanaRay_Update(Actor* thisx, GlobalContext* globalCtx) {
BgIkanaRay* this = THIS;
this->update(this, globalCtx);
this->actionFunc(this, globalCtx);
}
void BgIkanaRay_Draw(Actor* thisx, GlobalContext* globalCtx) {

View File

@ -5,11 +5,15 @@
struct BgIkanaRay;
typedef void (*BgIkanaRayActionFunc)(struct BgIkanaRay*, GlobalContext*);
#define BGIKANARAY_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F)
typedef struct BgIkanaRay {
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderCylinder collision;
/* 0x190 */ AnimatedMaterial* animatedTextures;
/* 0x194 */ void (*update)(struct BgIkanaRay*, GlobalContext*);
/* 0x194 */ BgIkanaRayActionFunc actionFunc;
} BgIkanaRay; // size = 0x198
extern const ActorInit Bg_Ikana_Ray_InitVars;

View File

@ -162,7 +162,7 @@ void func_80BD7ED8(BgIknvObj* this, GlobalContext* globalCtx) {
}
void func_80BD7F4C(BgIknvObj* this, GlobalContext* globalCtx) {
if (gSaveContext.time > 0xD000) {
if (gSaveContext.time > CLOCK_TIME(19, 30)) {
this->actionFunc = func_80BD7ED8;
}
if ((this->dyna.actor.home.rot.x == 1) && !(gSaveContext.weekEventReg[58] & 0x80)) {

View File

@ -1347,7 +1347,7 @@ void Boss02_Draw(Actor* thisx, GlobalContext* globalCtx2) {
f32 sp9C;
f32 sp98;
matrix = (RSPMatrix*)GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(RSPMatrix) * 23);
matrix = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(RSPMatrix) * 23);
OPEN_DISPS(globalCtx->state.gfxCtx);

View File

@ -179,8 +179,8 @@ void Boss04_Init(Actor* thisx, GlobalContext* globalCtx2) {
for (i = 0; i < ARRAY_COUNT(D_809EE1F8); i++) {
spA8.x = D_809EE1F8[i].x + this->actor.world.pos.x;
spA8.z = D_809EE1F8[i].z + this->actor.world.pos.z;
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &spA8, &spB4, &spC0, 1, 0, 0, 1,
&spA4)) {
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &spA8, &spB4, &spC0, true, false, false,
true, &spA4)) {
if (i == 0) {
this->unk_6D8 = spB4.x;
} else if (i == 1) {

View File

@ -28,7 +28,7 @@ const ActorInit Dm_Nb_InitVars = {
(ActorFunc)DmNb_Draw,
};
static AnimationInfoS D_80C1E200[] = { &object_nb_Anim_000990, 1.0f, 0, -1, ANIMMODE_LOOP, 0 };
static AnimationInfoS D_80C1E200[] = { { &object_nb_Anim_000990, 1.0f, 0, -1, ANIMMODE_LOOP, 0 } };
s32 func_80C1DED0(DmNb* this, s32 arg1) {
s32 ret = false;

View File

@ -472,7 +472,7 @@ void func_8088ACE0(EnArrow* this, GlobalContext* globalCtx) {
}
this->unk_262 = BgCheck_ProjectileLineTest(&globalCtx->colCtx, &this->actor.prevPos, &this->actor.world.pos,
&sp9C, &this->actor.wallPoly, 1, 1, 1, 1, &spA8);
&sp9C, &this->actor.wallPoly, true, true, true, true, &spA8);
if (this->unk_262 != 0) {
func_800B90AC(globalCtx, &this->actor, this->actor.wallPoly, spA8, &sp9C);
Math_Vec3f_Copy(&this->actor.world.pos, &sp9C);

View File

@ -1359,10 +1359,6 @@ void EnBigpo_DrawScoopSoul(Actor* thisx, GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
/*
* this matches without OPENDISPS but with it has stack issues,
* might be able to find an alternative match with the macros, so far no success
*/
void EnBigpo_DrawLantern(Actor* thisx, GlobalContext* globalCtx) {
EnBigpo* this = THIS;
f32 magnitude;
@ -1381,42 +1377,41 @@ void EnBigpo_DrawLantern(Actor* thisx, GlobalContext* globalCtx) {
Math_Vec3f_Copy(&vec1, &gZeroVec3f);
}
{
GraphicsContext* gfx = globalCtx->state.gfxCtx;
OPEN_DISPS(globalCtx->state.gfxCtx);
// fully visible OR fully transparent
if ((this->mainColor.a == 255) || (this->mainColor.a == 0)) {
Scene_SetRenderModeXlu(globalCtx, 0, 1);
dispHead = gfx->polyOpa.p;
} else {
Scene_SetRenderModeXlu(globalCtx, 1, 2);
dispHead = gfx->polyXlu.p;
}
gSPDisplayList(&dispHead[0], &sSetupDL[6 * 0x19]);
gSPSegment(&dispHead[1], 0x0A, Gfx_EnvColor(globalCtx->state.gfxCtx, 160, 0, 255, this->mainColor.a));
Matrix_GetStateTranslationAndScaledY(1400.0f, &vec2);
Lights_PointGlowSetInfo(&this->fires[0].info, vec2.x + vec1.x, vec2.y + vec1.y, vec2.z + vec1.z,
this->lanternColor.r, this->lanternColor.g, this->lanternColor.b, this->lanternColor.a);
gDPSetEnvColor(&dispHead[2], this->lanternColor.r, this->lanternColor.g, this->lanternColor.b,
this->mainColor.a);
gSPMatrix(&dispHead[3], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(&dispHead[4], &gBigpoDrawLanternMainDL);
gSPDisplayList(&dispHead[5], &gBigpoDrawLanternPurpleTopDL);
// fully transparent OR fully invisible
if ((this->mainColor.a == 255) || (this->mainColor.a == 0)) {
gfx->polyOpa.p = &dispHead[6];
} else {
gfx->polyXlu.p = &dispHead[6];
}
// fully visible OR fully transparent
if ((this->mainColor.a == 255) || (this->mainColor.a == 0)) {
Scene_SetRenderModeXlu(globalCtx, 0, 1);
dispHead = POLY_OPA_DISP;
} else {
Scene_SetRenderModeXlu(globalCtx, 1, 2);
dispHead = POLY_XLU_DISP;
}
gSPDisplayList(&dispHead[0], &sSetupDL[6 * 0x19]);
gSPSegment(&dispHead[1], 0x0A, Gfx_EnvColor(globalCtx->state.gfxCtx, 160, 0, 255, this->mainColor.a));
Matrix_GetStateTranslationAndScaledY(1400.0f, &vec2);
Lights_PointGlowSetInfo(&this->fires[0].info, vec2.x + vec1.x, vec2.y + vec1.y, vec2.z + vec1.z,
this->lanternColor.r, this->lanternColor.g, this->lanternColor.b, this->lanternColor.a);
gDPSetEnvColor(&dispHead[2], this->lanternColor.r, this->lanternColor.g, this->lanternColor.b, this->mainColor.a);
gSPMatrix(&dispHead[3], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(&dispHead[4], &gBigpoDrawLanternMainDL);
gSPDisplayList(&dispHead[5], &gBigpoDrawLanternPurpleTopDL);
// fully transparent OR fully invisible
if ((this->mainColor.a == 255) || (this->mainColor.a == 0)) {
POLY_OPA_DISP = &dispHead[6];
} else {
POLY_XLU_DISP = &dispHead[6];
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
void EnBigpo_DrawCircleFlames(Actor* thisx, GlobalContext* globalCtx) {

View File

@ -268,7 +268,7 @@ void func_80BFE67C(EnBomjima* this, GlobalContext* globalCtx) {
abs = ABS_ALT(BINANG_SUB(this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp54)));
if ((abs < 0x4000) && !BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp54, &sp6C,
&sp50, 1, 0, 0, 1, &sp4C)) {
&sp50, true, false, false, true, &sp4C)) {
func_80BFE494(this, 5, 1.0f);
Math_Vec3f_Copy(&this->unk_2A4, &sp54);
this->unk_2BE = Rand_S16Offset(30, 50);
@ -290,8 +290,8 @@ void func_80BFE67C(EnBomjima* this, GlobalContext* globalCtx) {
sp60.x += Math_SinS(this->actor.world.rot.y) * 60.0f;
sp60.z += Math_CosS(this->actor.world.rot.y) * 60.0f;
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp60, &sp6C, &sp50, 1, 0, 0, 1,
&sp4C)) {
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp60, &sp6C, &sp50, true,
false, false, true, &sp4C)) {
this->unk_2C0 = 0;
if (Rand_ZeroOne() < 0.5f) {
func_80BFE494(this, 19, 1.0f);

View File

@ -276,7 +276,7 @@ void func_80C014E4(EnBomjimb* this, GlobalContext* globalCtx) {
abs = ABS_ALT(BINANG_SUB(this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp48)));
if ((abs < 0x4000) && !BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp48, &sp60,
&colPoly, 1, 0, 0, 1, &sp44)) {
&colPoly, true, false, false, true, &sp44)) {
func_80C0113C(this, 5, 1.0f);
Math_Vec3f_Copy(&this->unk_294, &sp48);
this->unk_2B0 = Rand_S16Offset(30, 50);
@ -295,8 +295,8 @@ void func_80C014E4(EnBomjimb* this, GlobalContext* globalCtx) {
Math_Vec3f_Copy(&sp54, &this->actor.world.pos);
sp54.x += Math_SinS(this->actor.world.rot.y) * 60.0f;
sp54.z += Math_CosS(this->actor.world.rot.y) * 60.0f;
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp54, &sp60, &colPoly, 1, 0, 0,
1, &sp44)) {
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp54, &sp60, &colPoly, true,
false, false, true, &sp44)) {
this->unk_2AE = 0;
if (Rand_ZeroOne() < 0.5f) {
func_80C0113C(this, 20, 1.0f);
@ -556,7 +556,8 @@ void func_80C0217C(EnBomjimb* this, GlobalContext* globalCtx) {
sp74.y += 20.0f;
sp74.z += Math_CosS(this->actor.world.rot.y) * 50.0f;
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp74, &sp64, &sp70, 1, 0, 0, 1, &sp60)) {
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp74, &sp64, &sp70, true, false, false,
true, &sp60)) {
s16 temp = BINANG_SUB((this->actor.world.rot.y - this->actor.yawTowardsPlayer), 0x8000);
this->unk_2D6 = temp;

View File

@ -269,7 +269,7 @@ void EnCow_Idle(EnCow* this, GlobalContext* globalCtx) {
this->flags &= ~EN_COW_FLAG_WONT_GIVE_MILK;
D_801BDAA4 = 0;
} else if ((this->actor.xzDistToPlayer < 150.0f) &&
ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 25000) {
ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y)) < 25000) {
D_801BDAA4 = 0;
this->actionFunc = EnCow_Talk;
this->actor.flags |= ACTOR_FLAG_10000;

View File

@ -206,7 +206,7 @@ void func_8098933C(EnDg* this, Vec3f* arg1) {
}
s32 func_80989418(EnDg* this, Path* arg1, s32 arg2) {
Vec3s* sp5C = (Vec3s*)Lib_SegmentedToVirtual(arg1->points);
Vec3s* sp5C = Lib_SegmentedToVirtual(arg1->points);
s32 count = arg1->count;
s32 idx = arg2;
s32 sp50 = false;
@ -243,7 +243,7 @@ s16 func_809895B4(Path* path, s32 idx, Vec3f* pos, f32* distSQ) {
f32 diffZ;
if (path != NULL) {
points = (Vec3s*)Lib_SegmentedToVirtual(path->points);
points = Lib_SegmentedToVirtual(path->points);
points = &points[idx];
diffX = points->x - pos->x;
diffZ = points->z - pos->z;

View File

@ -280,7 +280,7 @@ void EnDinofos_Init(Actor* thisx, GlobalContext* globalCtx) {
if (D_8089E364 == 0) {
for (i = 0; i < ARRAY_COUNT(D_8089E33C); i++) {
D_8089E33C[i] = (Gfx*)Lib_SegmentedToVirtual(D_8089E33C[i]);
D_8089E33C[i] = Lib_SegmentedToVirtual(D_8089E33C[i]);
}
D_8089E364 = 1;
}

View File

@ -107,7 +107,7 @@ void EnDnb_Init(Actor* thisx, GlobalContext* globalCtx) {
DynaPolyActor_Init(&this->dyna, 1);
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_hanareyama_obj_Colheader_004D8C);
alloc = (s16*)Lib_SegmentedToVirtual(object_hanareyama_obj_Vec_004710);
alloc = Lib_SegmentedToVirtual(object_hanareyama_obj_Vec_004710);
for (i = 0; i < ARRAY_COUNT(this->particles); i++) {
func_80A4FDD0(&this->particles[i], this, alloc, i);
}

View File

@ -40,8 +40,6 @@ void func_80A732C8(EnDno* this, GlobalContext* globalCtx);
s32 EnDno_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx);
void EnDno_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx);
extern u8 D_801C20C0;
static AnimationSpeedInfo sAnimations[] = {
{ &object_dno_Anim_000470, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_0008F0, 1.0f, ANIMMODE_ONCE, 0.0f },
{ &object_dno_Anim_000F6C, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_001A50, 1.0f, ANIMMODE_ONCE, 0.0f },
@ -611,7 +609,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) {
case 0x802:
if (func_80147624(globalCtx)) {
if (gSaveContext.inventory.items[D_801C20C0] == ITEM_MASK_SCENTS) {
if (INV_CONTENT(ITEM_MASK_SCENTS) == ITEM_MASK_SCENTS) {
this->unk_458 = GI_RUPEE_RED;
} else {
this->unk_458 = GI_MASK_SCENTS;

View File

@ -176,7 +176,7 @@ void func_809619D0(EnFu* this, GlobalContext* globalCtx) {
}
this->unk_520 = path->count;
this->unk_538 = (Vec3s*)Lib_SegmentedToVirtual(path->points);
this->unk_538 = Lib_SegmentedToVirtual(path->points);
func_809616E0(this, globalCtx);
}

View File

@ -266,7 +266,8 @@ void func_80932784(EnFz* this, GlobalContext* globalCtx) {
sp44.z = 440.0f;
Matrix_MultiplyVector3fByState(&sp44, &this->unk_22C);
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp5C, &this->unk_22C, &sp50, &sp3C, 1, 0, 0, 1, &sp40)) {
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp5C, &this->unk_22C, &sp50, &sp3C, true, false, false, true,
&sp40)) {
Math_Vec3f_Copy(&this->unk_22C, &sp50);
}

View File

@ -907,7 +907,7 @@ s32 func_8094F7D0(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
if ((actor != NULL) && (actor->update != NULL)) {
if (this->unk_234 != NULL) {
sp48 = (Vec3s*)Lib_SegmentedToVirtual(this->unk_234->points);
sp48 = Lib_SegmentedToVirtual(this->unk_234->points);
Math_Vec3s_ToVec3f(&sp3C, &sp48[this->unk_234->count - 2]);
Math_Vec3s_ToVec3f(&sp30, &sp48[this->unk_234->count - 1]);
this->actor.shape.shadowDraw = NULL;
@ -938,7 +938,7 @@ s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
if (this->unk_234 != NULL) {
sp4C = (Vec3s*)Lib_SegmentedToVirtual(this->unk_234->points);
sp4C = Lib_SegmentedToVirtual(this->unk_234->points);
Math_Vec3s_ToVec3f(&sp40, &sp4C[0]);
Math_Vec3s_ToVec3f(&sp34, &sp4C[1]);
Math_Vec3f_Copy(&this->unk_278, &sp40);
@ -1080,7 +1080,7 @@ s32 func_8094FF04(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
}
if (this->unk_234 != NULL) {
sp48 = (Vec3s*)Lib_SegmentedToVirtual(this->unk_234->points);
sp48 = Lib_SegmentedToVirtual(this->unk_234->points);
Math_Vec3s_ToVec3f(&sp3C, &sp48[this->unk_234->count - 2]);
Math_Vec3s_ToVec3f(&sp30, &sp48[this->unk_234->count - 1]);
this->actor.shape.shadowDraw = NULL;

View File

@ -301,7 +301,7 @@ void func_80A1143C(EnGoStruct ptr[], Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 arg
void func_80A115B4(EnGoStruct ptr[], GlobalContext* globalCtx) {
static TexturePtr D_80A16644[] = {
&gDust8Tex, &gDust7Tex, &gDust6Tex, &gDust5Tex, &gDust4Tex, &gDust3Tex, &gDust2Tex, &gDust1Tex,
gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex,
};
static Color_RGBA8 D_80A16664[] = {
{ 255, 255, 255, 0 },
@ -1449,7 +1449,11 @@ void func_80A146CC(EnGo* this, GlobalContext* globalCtx) {
}
void func_80A14798(EnGo* this, GlobalContext* globalCtx) {
s32 sp38[2] = { 0x0000003E, 0x00000F64 };
EffectTireMarkInit sp38 = {
0,
62,
{ 0, 0, 15, 100 },
};
if ((this->unk_288 < 0) || SubS_IsObjectLoaded(this->unk_288, globalCtx) || (this->unk_289 < 0) ||
SubS_IsObjectLoaded(this->unk_289, globalCtx)) {
@ -1464,7 +1468,7 @@ void func_80A14798(EnGo* this, GlobalContext* globalCtx) {
Collider_InitAndSetSphere(globalCtx, &this->colliderSphere, &this->actor, &sSphereInit);
Collider_InitAndSetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit2);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
Effect_Add(globalCtx, &this->unk_3E8, 4, 0, 0, &sp38);
Effect_Add(globalCtx, &this->unk_3E8, EFFECT_TIRE_MARK, 0, 0, &sp38);
this->actor.targetMode = 1;
this->unk_3A4 = 0.01f;

View File

@ -992,7 +992,7 @@ void EnGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.shape.shadowAlpha = 200;
func_8093EB58(this, globalCtx);
this->unk_1D0 = (Vec3s*)Lib_SegmentedToVirtual(sp2C->points);
this->unk_1D0 = Lib_SegmentedToVirtual(sp2C->points);
func_8093EE18(this, globalCtx);
func_8093EE64(this, this->actor.home.rot.y);

View File

@ -1025,8 +1025,8 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx) {
if ((this->actor.flags & ACTOR_FLAG_40) || (this->unk_19A & 0x100) || (this->unk_19A & 0x200)) {
func_80999BC8(&this->actor, globalCtx);
Actor_GetScreenPos(globalCtx, &this->actor, &sp2E, &sp2C);
if ((this->actor.xyzDistToPlayerSq > SQ(400.0f)) || (sp2E < 0) || (sp2E > 320) || (sp2C < 0) ||
(sp2C > 240)) {
if ((this->actor.xyzDistToPlayerSq > SQ(400.0f)) || (sp2E < 0) || (sp2E > SCREEN_WIDTH) || (sp2C < 0) ||
(sp2C > SCREEN_HEIGHT)) {
this->unk_216 = 0;
} else if (this->unk_21C > 0) {
func_800BC848(&this->actor, globalCtx, this->unk_21C, this->unk_21E);

View File

@ -1208,7 +1208,6 @@ s32 func_808F5674(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
s32 func_808F5728(GlobalContext* globalCtx, EnIn* this, s32 arg2, s32* arg3) {
s16 rotDiff;
s16 yawDiff;
s16 yawDiffA;
Player* player;
if (*arg3 == 4) {
@ -1253,9 +1252,8 @@ s32 func_808F5728(GlobalContext* globalCtx, EnIn* this, s32 arg2, s32* arg3) {
if (!func_800B8934(globalCtx, &this->actor)) {
return 0;
}
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
yawDiffA = ABS_ALT(yawDiff);
if (yawDiffA >= 0x4300) {
yawDiff = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y));
if (yawDiff >= 0x4300) {
return 0;
}
if (this->actor.xyzDistToPlayerSq > SQ(160.0f) && !this->actor.isTargeted) {

View File

@ -514,7 +514,7 @@ void EnJa_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
}
}
void EnJa_TransformDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
void EnJa_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnJa* this = THIS;
s32 phi_v1;
s32 phi_v0;
@ -602,7 +602,7 @@ void EnJa_Draw(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnJa_OverrideLimbDraw, EnJa_PostLimbDraw,
EnJa_TransformDraw, &this->actor);
EnJa_TransformLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}

View File

@ -46,9 +46,6 @@ void EnKakasi_SetupSongTeach(EnKakasi* this, GlobalContext* globalCtx);
void EnKakasi_SetupDialogue(EnKakasi* this);
void EnKakasi_PostLimbDraw(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
struct Actor* thisx);
static ColliderCylinderInit D_80971D80 = {
{
COLTYPE_NONE,
@ -336,8 +333,8 @@ void EnKakasi_SetupIdleStanding(EnKakasi* this) {
void EnKakasi_IdleStanding(EnKakasi* this, GlobalContext* globalCtx) {
u32 saveContextDay = gSaveContext.day;
s16 passedValue1;
s16 passedValue2;
s16 x;
s16 y;
// first talk to scarecrow dialogue
this->actor.textId = 0x1644;
@ -352,9 +349,9 @@ void EnKakasi_IdleStanding(EnKakasi* this, GlobalContext* globalCtx) {
return;
}
if (globalCtx->actorCtx.unk5 & 0x4) {
Actor_GetScreenPos(globalCtx, &this->actor, &passedValue1, &passedValue2);
if (this->actor.projectedPos.z > -20.0f && passedValue1 > 0 && passedValue1 < 0x140 && passedValue2 > 0 &&
passedValue2 < 0xF0 && this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
Actor_GetScreenPos(globalCtx, &this->actor, &x, &y);
if (this->actor.projectedPos.z > -20.0f && x > 0 && x < SCREEN_WIDTH && y > 0 && y < SCREEN_HEIGHT &&
this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
// faster shaking
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
this->skelanime.playSpeed = 2.0f;

View File

@ -1038,7 +1038,7 @@ void EnOt_Draw(Actor* thisx, GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx);
AnimatedMat_Draw(globalCtx, (AnimatedMaterial*)Lib_SegmentedToVirtual(object_ot_Matanimheader_0005F8));
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_ot_Matanimheader_0005F8));
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
NULL, EnOt_PostLimbDraw, &this->actor);
Matrix_InsertTranslation(this->unk_378.x, this->unk_378.y, this->unk_378.z, MTXMODE_NEW);

View File

@ -408,7 +408,7 @@ s32 func_8095B06C(EnOwl* this) {
void func_8095B0C8(EnOwl* this) {
s32 pad;
Vec3s* points = (Vec3s*)Lib_SegmentedToVirtual(this->path->points);
Vec3s* points = Lib_SegmentedToVirtual(this->path->points);
points += this->unk_3F8;
this->unk_3EC = Math_FAtan2F(points->z - this->actor.world.pos.z, points->x - this->actor.world.pos.x);
@ -542,7 +542,7 @@ void func_8095B76C(EnOwl* this, GlobalContext* globalCtx) {
this->actor.shape.rot.y = this->actor.world.rot.y;
if (sp44 < SQ(this->actor.speedXZ)) {
this->actor.speedXZ = 0.0f;
points = (Vec3s*)Lib_SegmentedToVirtual(this->path->points);
points = Lib_SegmentedToVirtual(this->path->points);
points += this->unk_3F8;
do {

View File

@ -797,8 +797,8 @@ void EnPeehat_Update(Actor* thisx, GlobalContext* globalCtx2) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderTris.base);
for (i = 1; i >= 0; i--) {
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &thisx->world.pos, &this->unk_2D4[i], &sp74, &sp70, 1,
1, 0, 1, &sp6C)) {
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &thisx->world.pos, &this->unk_2D4[i], &sp74, &sp70,
true, true, false, true, &sp6C)) {
func_800BBFB0(globalCtx, &sp74, 0.0f, 1, 300, 150, 1);
func_80897258(globalCtx, this, &sp74, 0.0f, 1.5f);
}

View File

@ -919,7 +919,7 @@ s32 func_80AF8ED4(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
if ((sp2C != NULL) && (sp2C->update != NULL)) {
if (this->unk_234 != NULL) {
sp48 = (Vec3s*)Lib_SegmentedToVirtual(this->unk_234->points);
sp48 = Lib_SegmentedToVirtual(this->unk_234->points);
Math_Vec3s_ToVec3f(&sp3C, &sp48[this->unk_234->count - 2]);
Math_Vec3s_ToVec3f(&sp30, &sp48[this->unk_234->count - 1]);
this->actor.shape.shadowDraw = NULL;
@ -950,7 +950,7 @@ s32 func_80AF9008(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
if (this->unk_234 != 0) {
sp4C = (Vec3s*)Lib_SegmentedToVirtual(this->unk_234->points);
sp4C = Lib_SegmentedToVirtual(this->unk_234->points);
Math_Vec3s_ToVec3f(&sp40, &sp4C[0]);
Math_Vec3s_ToVec3f(&sp34, &sp4C[1]);
Math_Vec3f_Copy(&this->unk_26C, &sp40);
@ -1074,7 +1074,7 @@ s32 func_80AF94AC(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
}
if ((this->unk_234 != 0) && (this->unk_234->count >= 2)) {
sp30 = (Vec3s*)Lib_SegmentedToVirtual(this->unk_234->points);
sp30 = Lib_SegmentedToVirtual(this->unk_234->points);
Math_Vec3s_ToVec3f(&sp40, &sp30[0]);
Math_Vec3s_ToVec3f(&sp34, &sp30[1]);
this->actor.world.rot.y = Math_Vec3f_Yaw(&sp40, &sp34);
@ -1127,7 +1127,7 @@ s32 func_80AF95E8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
}
if ((this->unk_234 != 0) && (this->unk_234->count >= 2)) {
sp30 = (Vec3s*)Lib_SegmentedToVirtual(this->unk_234->points);
sp30 = Lib_SegmentedToVirtual(this->unk_234->points);
Math_Vec3s_ToVec3f(&sp40, &sp30[this->unk_234->count - 1]);
Math_Vec3s_ToVec3f(&sp34, &sp30[this->unk_234->count - 2]);
this->actor.world.rot.y = Math_Vec3f_Yaw(&sp34, &sp40);

View File

@ -147,7 +147,7 @@ void EnPoFusen_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
u16 EnPoFusen_CheckParent(EnPoFusen* this, GlobalContext* globalCtx) {
struct Actor* actorPtr;
Actor* actorPtr;
actorPtr = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first;
if (GET_IS_FUSE_TYPE_PARAM(this)) {

View File

@ -875,7 +875,7 @@ void EnRr_Draw(Actor* thisx, GlobalContext* globalCtx2) {
Vec3f spA4;
f32 temp_f20;
matrix = GRAPH_ALLOC(globalCtx->state.gfxCtx, 256);
matrix = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(Mtx) * 4);
OPEN_DISPS(globalCtx->state.gfxCtx);

View File

@ -892,7 +892,7 @@ void func_80ADCD3C(EnSellnuts* this, GlobalContext* globalCtx) {
}
s32 func_80ADCE4C(EnSellnuts* this, Path* path, s32 arg2) {
Vec3s* points = (Vec3s*)Lib_SegmentedToVirtual(path->points);
Vec3s* points = Lib_SegmentedToVirtual(path->points);
s32 count = path->count;
s32 var = arg2;
s32 ret = false;
@ -929,7 +929,7 @@ f32 func_80ADCFE8(Path* path, s32 arg1, Vec3f* pos, Vec3s* arg3) {
Vec3s* points;
if (path != NULL) {
points = (Vec3s*)Lib_SegmentedToVirtual(path->points);
points = Lib_SegmentedToVirtual(path->points);
points = &points[arg1];
sp20.x = points->x;
sp20.y = points->y;

View File

@ -814,10 +814,10 @@ void func_809964DC(EnSkb* this, GlobalContext* globalCtx) {
}
}
s32 func_80996544(EnSkbVec2f arg0, EnSkbVec2f arg1) {
s32 func_80996544(Vec2f arg0, Vec2f arg1) {
s32 ret;
if ((arg1.x * arg0.z) < (arg0.x * arg1.z)) {
if ((arg1.x * arg0.y) < (arg0.x * arg1.y)) {
ret = 1;
} else {
ret = -1;
@ -829,8 +829,8 @@ s32 func_80996544(EnSkbVec2f arg0, EnSkbVec2f arg1) {
s32 func_80996594(EnSkb* this, GlobalContext* globalCtx) {
s32 temp_s2;
s32 j;
EnSkbVec2f sp60;
EnSkbVec2f sp58;
Vec2f sp60;
Vec2f sp58;
s32 sp54 = true;
f32 worldZ;
s32 i = 0;
@ -840,9 +840,9 @@ s32 func_80996594(EnSkb* this, GlobalContext* globalCtx) {
worldX = this->actor.world.pos.x;
sp60.x = D_80997468[0].z - worldZ;
sp60.z = D_80997468[0].x - worldX;
sp60.y = D_80997468[0].x - worldX;
sp58.x = D_80997468[1].z - worldZ;
sp58.z = D_80997468[1].x - worldX;
sp58.y = D_80997468[1].x - worldX;
j = 1;
temp_s2 = func_80996544(sp60, sp58);
@ -856,9 +856,9 @@ s32 func_80996594(EnSkb* this, GlobalContext* globalCtx) {
j = 0;
}
sp60.x = D_80997468[i].z - worldZ;
sp60.z = D_80997468[i].x - worldX;
sp60.y = D_80997468[i].x - worldX;
sp58.x = D_80997468[j].z - worldZ;
sp58.z = D_80997468[j].x - worldX;
sp58.y = D_80997468[j].x - worldX;
if (func_80996544(sp60, sp58) != temp_s2) {
sp54 = false;
break;

View File

@ -9,11 +9,6 @@ typedef void (*EnSkbActionFunc)(struct EnSkb*, GlobalContext*);
#define ENSKB_GET_F0(thisx) (((thisx)->params >> 4) & 0xF)
typedef struct {
f32 x;
f32 z;
} EnSkbVec2f;
typedef struct EnSkb {
/* 0x0000 */ Actor actor;
/* 0x0144 */ SkelAnime skelAnime;

View File

@ -1255,7 +1255,7 @@ s16 EnSob1_GetXZAngleAndDistanceSqToPoint(Path* path, s32 pointIdx, Vec3f* pos,
f32 diffZ;
if (path != NULL) {
points = (Vec3s*)Lib_SegmentedToVirtual(path->points);
points = Lib_SegmentedToVirtual(path->points);
points = &points[pointIdx];
diffX = points->x - pos->x;
diffZ = points->z - pos->z;

View File

@ -151,8 +151,8 @@ s32 EnSsh_CheckCeilingPos(EnSsh* this, GlobalContext* globalCtx) {
posB.x = this->actor.world.pos.x;
posB.y = this->actor.world.pos.y + 1000.0f;
posB.z = this->actor.world.pos.z;
if (!BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &posB, &this->ceilingPos, &poly, 0, 0, 1,
1, &bgId)) {
if (!BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &posB, &this->ceilingPos, &poly, false,
false, true, true, &bgId)) {
return false;
}
return true;

View File

@ -510,7 +510,7 @@ s16 func_80BAB698(Path* path, s32 idx, Vec3f* pos, f32* distSQ) {
f32 diffZ;
if (path != NULL) {
points = (Vec3s*)Lib_SegmentedToVirtual(path->points);
points = Lib_SegmentedToVirtual(path->points);
points = &points[idx];
diffX = points->x - pos->x;
diffZ = points->z - pos->z;
@ -691,7 +691,7 @@ s32 func_80BABDD8(EnSuttari* this, GlobalContext* globalCtx, struct_80133038_arg
if ((sp48 == NULL) || (this->unk404 == NULL)) {
return 0;
}
sp28 = (Vec3s*)Lib_SegmentedToVirtual(this->unk404->points);
sp28 = Lib_SegmentedToVirtual(this->unk404->points);
Math_Vec3s_ToVec3f(&sp38, &sp28[0]);
Math_Vec3s_ToVec3f(&sp2C, &sp28[1]);
this->unk434 = sp44 - unkStruct->unk4;

View File

@ -921,7 +921,7 @@ void func_808DAA60(EnSw* this, GlobalContext* globalCtx) {
Vec3f sp34;
f32 temp_f16;
sp44 = (Vec3s*)Lib_SegmentedToVirtual(this->unk_1E4->points);
sp44 = Lib_SegmentedToVirtual(this->unk_1E4->points);
sp40 = 0;
if (DECR(this->unk_454) == 0) {

View File

@ -32,9 +32,22 @@ const ActorInit En_Torch2_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1 | OC1_TYPE_2,
OC2_TYPE_2, COLSHAPE_CYLINDER },
{ ELEMTYPE_UNK2, { 0x00100000, 0, 0 }, { 0xF7CFFFFF, 0, 0 }, TOUCH_NONE, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON },
{
COLTYPE_METAL,
AT_NONE,
AC_ON | AC_HARD | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1 | OC1_TYPE_2,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK2,
{ 0x00100000, 0, 0 },
{ 0xF7CFFFFF, 0, 0 },
TOUCH_NONE,
BUMP_ON | BUMP_HOOKABLE,
OCELEM_ON,
},
{ 20, 60, 0, { 0, 0, 0 } },
};
@ -147,10 +160,9 @@ void EnTorch2_UpdateDeath(Actor* thisx, GlobalContext* globalCtx) {
}
}
void EnTorch2_Draw(Actor* thisx, GlobalContext* globalCtx) {
void EnTorch2_Draw(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
EnTorch2* this = THIS;
GlobalContext* unused = globalCtx;
Gfx* gfx = sShellDLists[thisx->params];
OPEN_DISPS(globalCtx->state.gfxCtx);

View File

@ -184,7 +184,8 @@ void EnToto_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
if (globalCtx->sceneNum == SCENE_MILK_BAR && (gSaveContext.time >= 0x4000 && gSaveContext.time < 0xE555)) {
if (globalCtx->sceneNum == SCENE_MILK_BAR &&
(gSaveContext.time >= CLOCK_TIME(6, 0) && gSaveContext.time < CLOCK_TIME(21, 30))) {
Actor_MarkForDeath(&this->actor);
return;
}
@ -250,7 +251,9 @@ void func_80BA39C8(EnToto* this, GlobalContext* globalCtx) {
return;
}
if ((globalCtx->sceneNum == SCENE_MILK_BAR && !(gSaveContext.time >= 0x4000 && gSaveContext.time < 0xED02)) ||
//! @TODO: 0xED02 nor 0xED01 match CLOCK_TIME macro
if ((globalCtx->sceneNum == SCENE_MILK_BAR &&
!(gSaveContext.time >= CLOCK_TIME(6, 0) && gSaveContext.time < 0xED02)) ||
(globalCtx->sceneNum != SCENE_MILK_BAR && func_80BA397C(this, 0x2000))) {
if (this->unk2B6 != 0) {
this->text = D_80BA5044;
@ -503,7 +506,6 @@ s32 func_80BA4530(EnToto* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
EnTotoUnkStruct2* temp_s0;
s32 i;
u16 tmp;
func_80BA3C88(this);
if (player->actor.world.pos.z > -270.0f) {
@ -527,8 +529,8 @@ s32 func_80BA4530(EnToto* this, GlobalContext* globalCtx) {
if (this->unk2B1 < 10) {
this->unk2B1++;
if (this->unk2B1 >= 10) {
tmp = gSaveContext.playerForm; // Needed for regalloc possible FAKE MATCH
Message_StartTextbox(globalCtx, D_80BA50DC[tmp - 1].unk2, NULL);
Message_StartTextbox(globalCtx, D_80BA50DC[((void)0, gSaveContext.playerForm) - 1].unk2,
NULL);
}
}
return 0;

View File

@ -904,7 +904,7 @@ void EnTrt2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
}
}
void EnTrt2_UnkDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
void EnTrt2_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnTrt2* this = THIS;
if (limbIndex == 21) {
@ -934,7 +934,7 @@ void func_80AD56E8(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnTrt2_OverrideLimbDraw, EnTrt2_PostLimbDraw,
EnTrt2_UnkDraw, &this->actor);
EnTrt2_TransformLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}

View File

@ -722,7 +722,7 @@ s32 func_80A87400(EnTru* this, GlobalContext* globalCtx) {
Math_ApproachF(&this->actor.speedXZ, 30.0f, 0.2f, 1000.0f);
if (this->path != NULL) {
sp4C = (Vec3s*)Lib_SegmentedToVirtual(this->path->points);
sp4C = Lib_SegmentedToVirtual(this->path->points);
if (func_8013BD40(&this->actor, this->path, this->unk_384)) {
if (this->unk_384 > this->unk_384 + 1) {
this->unk_384 = this->path->count - 2;

View File

@ -452,7 +452,8 @@ void func_809674C8(EnWeatherTag* this, GlobalContext* globalCtx) {
if (Actor_XZDistanceBetweenActors(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(this)) {
if (CURRENT_DAY == 2) {
if ((gSaveContext.time >= 0x4AAA) && (gSaveContext.time < 0xBAAA) && (globalCtx->envCtx.unk_F2[2] == 0)) {
if ((gSaveContext.time >= CLOCK_TIME(7, 0)) && (gSaveContext.time < CLOCK_TIME(17, 30)) &&
(globalCtx->envCtx.unk_F2[2] == 0)) {
D_801BDBB0 = 1;
func_800FD78C(globalCtx);

View File

@ -67,7 +67,7 @@ void func_80B965D0(EnZot* this, GlobalContext* globalCtx) {
s32 i;
if ((this->path != NULL) && (this->path->count >= 5)) {
Vec3s* points = (Vec3s*)Lib_SegmentedToVirtual(this->path->points);
Vec3s* points = Lib_SegmentedToVirtual(this->path->points);
for (i = 0; i < ARRAY_COUNT(this->unk_2D8); i++, points++) {
if (this->unk_2D8[i] == NULL) {
@ -520,20 +520,21 @@ void func_80B975F8(EnZot* this, GlobalContext* globalCtx) {
}
void func_80B9765C(EnZot* this, GlobalContext* globalCtx) {
if (1) {
do { } while (0); }
func_80B96D4C(this);
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
u16 temp = globalCtx->msgCtx.unk11F04;
u32 temp2;
s32 requiredScopeTemp;
if ((temp == 0x1262) || (temp == 0x1267) || (temp == 0x126A) || (temp == 0x126B)) {
temp2 = temp;
func_80151938(globalCtx, temp2 + 1);
} else {
func_801477B4(globalCtx);
this->actionFunc = func_80B97708;
switch (globalCtx->msgCtx.unk11F04) {
case 0x1262:
case 0x1267:
case 0x126A:
case 0x126B:
func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
break;
default:
func_801477B4(globalCtx);
this->actionFunc = func_80B97708;
break;
}
}
}

View File

@ -147,8 +147,8 @@ s32 func_80936D58(ObjBean* this, GlobalContext* globalCtx) {
Math_Vec3f_Sum(&this->dyna.actor.world.pos, &spAC, &spA0);
Math_Vec3f_Diff(&this->dyna.actor.world.pos, &spAC, &sp94);
if (BgCheck_EntityLineTest2(&globalCtx->colCtx, &spA0, &sp94, &sp88, &this->dyna.actor.floorPoly, 1, 1, 1, 1, &spB8,
&this->dyna.actor)) {
if (BgCheck_EntityLineTest2(&globalCtx->colCtx, &spA0, &sp94, &sp88, &this->dyna.actor.floorPoly, true, true, true,
true, &spB8, &this->dyna.actor)) {
this->dyna.actor.world.pos.x = (COLPOLY_GET_NORMAL(this->dyna.actor.floorPoly->normal.x) * 1.9f) + sp88.x;
this->dyna.actor.world.pos.y = (COLPOLY_GET_NORMAL(this->dyna.actor.floorPoly->normal.y) * 1.9f) + sp88.y;
this->dyna.actor.world.pos.z = (COLPOLY_GET_NORMAL(this->dyna.actor.floorPoly->normal.z) * 1.9f) + sp88.z;

View File

@ -44,7 +44,7 @@ void ObjEnding_Init(Actor* thisx, GlobalContext* globalCtx) {
this->modelInfo = &sModelInfo[thisx->params];
animMat = this->modelInfo->animMat;
if (animMat != NULL) {
this->animMat = (AnimatedMaterial*)Lib_SegmentedToVirtual(animMat);
this->animMat = Lib_SegmentedToVirtual(animMat);
}
}

View File

@ -37,14 +37,14 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 180, ICHAIN_STOP),
};
static Vec3f iceSmokeAccel = { 0.0f, 0.0f, 0.0f };
static Vec3f sIceSmokeAccel = { 0.0f, 0.0f, 0.0f };
void ObjHsStump_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjHsStump* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->isHidden = OBJHSSTUMP_GET_ISHIDDEN(thisx);
this->switchFlag = OBJHSSTUMP_GET_SWITCHFLAG(thisx); // Must be thisx to match
this->switchFlag = OBJHSSTUMP_GET_SWITCHFLAG(thisx);
DynaPolyActor_Init(&this->dyna, 1);
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_hsstump_Colheader_0011B0);
switch (this->isHidden) {
@ -87,43 +87,43 @@ void ObjHsStump_Appear(ObjHsStump* this, GlobalContext* globalCtx) {
this->dyna.actor.shape.rot.z = (Math_SinS(this->rotAngle * 2) * this->rotFactor) + this->dyna.actor.home.rot.z;
this->rotAngle += 0x2000;
}
if (this->framesAppeared < 11) {
if (this->framesAppeared <= 10) {
if (this->framesAppeared == 0) {
s32 i;
f32 angle;
f32 angleDeg;
s16 numDirections = 4;
Vec3f iceSmokePosOffset;
Vec3f iceSmokeVelOffset;
s16 offsetAngle;
Vec3f iceSmokeVel;
f32 angleBinary;
f32 angleBrad;
Vec3f iceSmokePos;
iceSmokePosOffset.x = 1.0f;
iceSmokePosOffset.y = 0.5f;
iceSmokePosOffset.z = 0.0f;
iceSmokeVelOffset.x = 1.0f;
iceSmokeVelOffset.y = 0.5f;
iceSmokeVelOffset.z = 0.0f;
angle = 360.0f / numDirections;
i = angle * (0x10000 / 360.0f);
angleBinary = i;
angleDeg = (360.0f / numDirections);
angleBrad = (s32)(angleDeg * (0x10000 / 360.0f));
for (i = 0; i < numDirections; i++) {
offsetAngle = i * angleBinary;
offsetAngle = i * angleBrad;
Lib_Vec3f_TranslateAndRotateY(&this->dyna.actor.world.pos, offsetAngle, &iceSmokePosOffset,
&iceSmokePos);
Lib_Vec3f_TranslateAndRotateY(&gZeroVec3f, offsetAngle, &iceSmokeVelOffset, &iceSmokeVel);
EffectSsIceSmoke_Spawn(globalCtx, &iceSmokePos, &iceSmokeVel, &iceSmokeAccel, 100);
EffectSsIceSmoke_Spawn(globalCtx, &iceSmokePos, &iceSmokeVel, &sIceSmokeAccel, 100);
}
}
}
if (this->framesAppeared >= 10) {
Math_SmoothStepToF(&this->dyna.actor.scale.x, 0.17999999f, 1.0f, 0.01f, 0.001f);
Math_SmoothStepToF(&this->dyna.actor.scale.x, 18.0f * 0.01f, 1.0f, 0.01f, 0.001f);
Actor_SetScale(&this->dyna.actor, this->dyna.actor.scale.x);
}
if (this->dyna.actor.scale.x == 0.17999999f) {
if (this->dyna.actor.scale.x == 18.0f * 0.01f) {
this->isHidden = false;
func_800C6314(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
ObjHsStump_SetupIdle(this, globalCtx);

View File

@ -460,7 +460,7 @@ s32 func_80A24118(ObjIceblock* this, GlobalContext* globalCtx, f32 arg2, Vec3f*
spD0.y = spDC.y;
spD0.z = temp_f26 + spDC.z;
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &spDC, &spD0, &spB8, &spA8, 1, 0, 0, 1, &spAC,
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &spDC, &spD0, &spB8, &spA8, true, false, false, true, &spAC,
&this->dyna.actor, 0.0f)) {
temp_f20 = Math3D_Vec3fDistSq(&spDC, &spB8);
if (temp_f20 < phi_f20) {
@ -536,7 +536,7 @@ s32 func_80A243E0(ObjIceblock* this, GlobalContext* globalCtx, Vec3f* arg0) {
spE0.y = spEC.y;
spE0.z = temp_f30 + spEC.z;
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &spEC, &spE0, &spC8, &spB8, 1, 0, 0, 1, &spBC,
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &spEC, &spE0, &spC8, &spB8, true, false, false, true, &spBC,
&this->dyna.actor, 0.0f)) {
temp_f12 = Math3D_Vec3fDistSq(&spEC, &spC8);
if (temp_f12 < phi_f22) {
@ -600,7 +600,7 @@ s32 func_80A246D8(ObjIceblock* this, GlobalContext* globalCtx, Vec3f* arg2) {
spB4.y = spC0.y;
spB4.z = (Math_CosS(phi_s3) * temp_f20) + spC0.z;
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &spC0, &spB4, &sp9C, &sp94, 1, 0, 0, 1, &sp98,
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &spC0, &spB4, &sp9C, &sp94, true, false, false, true, &sp98,
&this->dyna.actor, 0.0f)) {
ret = true;
temp_v0 = (ObjIceblock*)DynaPoly_GetActor(&globalCtx->colCtx, sp98);

View File

@ -16,8 +16,6 @@ void ObjMilkBin_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjMilkBin_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjMilkBin_Draw(Actor* thisx, GlobalContext* globalCtx);
// gMilkBinMilkJarDL
const ActorInit Obj_Milk_Bin_InitVars = {
ACTOR_OBJ_MILK_BIN,
ACTORCAT_PROP,

View File

@ -345,8 +345,8 @@ s32 ObjOshihiki_CheckWall(GlobalContext* globalCtx, s16 angle, f32 direction, Ob
faceVtxNext.y = faceVtx.y;
faceVtxNext.z = (maxDist * cs) + faceVtx.z;
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &faceVtx, &faceVtxNext, &posResult, &outPoly, 1, 0, 0, 1, &bgId,
&this->dyna.actor, 0.0f)) {
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &faceVtx, &faceVtxNext, &posResult, &outPoly, true, false,
false, true, &bgId, &this->dyna.actor, 0.0f)) {
return true;
}
}

View File

@ -89,7 +89,7 @@ void ObjRaillift_Init(Actor* thisx, GlobalContext* globalCtx) {
this->curPoint = OBJRAILLIFT_GET_STARTING_POINT(thisx);
this->endPoint = path->count - 1;
this->direction = 1;
this->points = (Vec3s*)Lib_SegmentedToVirtual(path->points);
this->points = Lib_SegmentedToVirtual(path->points);
ObjRaillift_UpdatePosition(this, this->curPoint);
if (OBJRAILLIFT_HAS_FLAG(thisx) && !Flags_GetSwitch(globalCtx, OBJRAILLIFT_GET_FLAG(thisx))) {
this->actionFunc = ObjRaillift_Idle;

View File

@ -38,7 +38,7 @@ void ObjYado_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjYado* this = THIS;
Actor_ProcessInitChain(&this->actor, sInitChain);
D_80C16470 = (AnimatedMaterial*)Lib_SegmentedToVirtual(object_yado_obj_Matanimheader_0012E8);
D_80C16470 = Lib_SegmentedToVirtual(object_yado_obj_Matanimheader_0012E8);
this->isNight = gSaveContext.isNight;
}

View File

@ -12208,7 +12208,7 @@
0x80AD5394:("func_80AD5394",),
0x80AD54C8:("EnTrt2_OverrideLimbDraw",),
0x80AD5584:("EnTrt2_PostLimbDraw",),
0x80AD566C:("EnTrt2_UnkDraw",),
0x80AD566C:("EnTrt2_TransformLimbDraw",),
0x80AD56E8:("func_80AD56E8",),
0x80AD5BB0:("ObjTokeiStep_SetSysMatrix",),
0x80AD5BE8:("ObjTokeiStep_AddQuake",),
@ -15505,7 +15505,7 @@
0x80BC24C4:("EnJa_Update",),
0x80BC25E0:("EnJa_OverrideLimbDraw",),
0x80BC2620:("EnJa_PostLimbDraw",),
0x80BC2B30:("EnJa_TransformDraw",),
0x80BC2B30:("EnJa_TransformLimbDraw",),
0x80BC2CE4:("EnJa_Draw",),
0x80BC2EA4:("func_80BC2EA4",),
0x80BC3154:("func_80BC3154",),
@ -16317,7 +16317,7 @@
0x80BF2E04:("EnIg_Update",),
0x80BF2EDC:("EnIg_OverrideLimbDraw",),
0x80BF2EFC:("EnIg_PostLimbDraw",),
0x80BF302C:("EnIg_UnkDraw",),
0x80BF302C:("EnIg_TransformLimbDraw",),
0x80BF312C:("EnIg_Draw",),
0x80BF3920:("func_80BF3920",),
0x80BF3C64:("func_80BF3C64",),

View File

@ -1258,10 +1258,6 @@ D_0600D640 = 0x0600D640;
D_06002950 = 0x06002950;
// ovl_En_Dno
D_801C20C0 = 0x801C20C0;
// ovl_En_Dragon
D_06004398 = 0x06004398;
@ -1358,10 +1354,6 @@ D_0600A344 = 0x0600A344;
D_06001EFC = 0x06001EFC;
D_0600A808 = 0x0600A808;
// ovl_En_Goron_Oyu
D_06000988 = 0x06000988;
// ovl_En_Grasshopper
D_06000F9C = 0x06000F9C;