mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
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:
co-authored by
Anghelo Carvajal
parent
7fcefd8d3f
commit
1e4411a871
+1
-1
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+2
-1
@@ -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)) {
|
||||
|
||||
+16
-7
@@ -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 } },
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+27
-28
@@ -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
|
||||
|
||||
+12
-18
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user