1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-27 07:07:09 +00:00

Rename scene lists (#1344)

* first pass

* revert unwanted zap change

* review

* name Actor_InitContext, change arg name

* change bzero to use type
This commit is contained in:
fig02 2022-10-16 18:00:18 -04:00 committed by GitHub
parent bea53e1cc3
commit 26d6028ff1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 148 additions and 143 deletions

View file

@ -452,7 +452,7 @@ void func_8002F974(Actor* actor, u16 sfxId);
void func_8002F994(Actor* actor, s32 arg1);
s32 func_8002F9EC(PlayState* play, Actor* actor, CollisionPoly* poly, s32 bgId, Vec3f* pos);
void Actor_DisableLens(PlayState* play);
void func_800304DC(PlayState* play, ActorContext* actorCtx, ActorEntry* actorEntry);
void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* playerEntry);
void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx);
s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3);
void func_800315AC(PlayState* play, ActorContext* actorCtx);

View file

@ -1183,16 +1183,16 @@ typedef struct PlayState {
/* 0x11DE4 */ u32 gameplayFrames;
/* 0x11DE8 */ u8 linkAgeOnLoad;
/* 0x11DE9 */ u8 unk_11DE9;
/* 0x11DEA */ u8 curSpawn;
/* 0x11DEB */ u8 numSetupActors;
/* 0x11DEA */ u8 spawn;
/* 0x11DEB */ u8 numActorEntries;
/* 0x11DEC */ u8 numRooms;
/* 0x11DF0 */ RomFile* roomList;
/* 0x11DF4 */ ActorEntry* linkActorEntry;
/* 0x11DF8 */ ActorEntry* setupActorList;
/* 0x11DF4 */ ActorEntry* playerEntry;
/* 0x11DF8 */ ActorEntry* actorEntryList;
/* 0x11DFC */ void* unk_11DFC;
/* 0x11E00 */ EntranceEntry* setupEntranceList;
/* 0x11E04 */ s16* setupExitList;
/* 0x11E08 */ Path* setupPathList;
/* 0x11E00 */ Spawn* spawnList;
/* 0x11E04 */ s16* exitList;
/* 0x11E08 */ Path* pathList;
/* 0x11E0C */ QuestHintCmd* naviQuestHints;
/* 0x11E10 */ void* specialEffects;
/* 0x11E14 */ u8 skyboxId;

View file

@ -38,9 +38,12 @@ typedef struct {
} TransitionActorEntry; // size = 0x10
typedef struct {
/* 0x00 */ u8 spawn;
/* 0x00 */ u8 playerEntryIndex;
/* 0x01 */ u8 room;
} EntranceEntry;
} Spawn;
// TODO: ZAPD Compatibility
typedef Spawn EntranceEntry;
typedef struct {
/* 0x00 */ u8 ambientColor[3];
@ -179,13 +182,13 @@ typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 length;
/* 0x04 */ ActorEntry* data;
} SCmdSpawnList;
} SCmdPlayerEntryList;
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 length;
/* 0x04 */ ActorEntry* data;
} SCmdActorList;
} SCmdActorEntryList;
typedef struct {
/* 0x00 */ u8 code;
@ -218,8 +221,8 @@ typedef struct {
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ EntranceEntry* data;
} SCmdEntranceList;
/* 0x04 */ Spawn* data;
} SCmdSpawnList;
typedef struct {
/* 0x00 */ u8 code;
@ -342,11 +345,11 @@ typedef struct {
typedef union {
SCmdBase base;
SCmdSpawnList spawnList;
SCmdActorList actorList;
SCmdPlayerEntryList playerEntryList;
SCmdActorEntryList actorEntryList;
SCmdUnused02 unused02;
SCmdRoomList roomList;
SCmdEntranceList entranceList;
SCmdSpawnList spawnList;
SCmdObjectList objectList;
SCmdLightList lightList;
SCmdPathList pathList;

View file

@ -1953,15 +1953,14 @@ void Actor_DisableLens(PlayState* play) {
}
}
// Actor_InitContext
void func_800304DC(PlayState* play, ActorContext* actorCtx, ActorEntry* actorEntry) {
void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* playerEntry) {
ActorOverlay* overlayEntry;
SavedSceneFlags* savedSceneFlags;
s32 i;
savedSceneFlags = &gSaveContext.sceneFlags[play->sceneId];
bzero(actorCtx, sizeof(*actorCtx));
bzero(actorCtx, sizeof(ActorContext));
ActorOverlayTable_Init();
Matrix_MtxFCopy(&play->billboardMtxF, &gMtxFClear);
@ -1983,7 +1982,7 @@ void func_800304DC(PlayState* play, ActorContext* actorCtx, ActorEntry* actorEnt
actorCtx->absoluteSpace = NULL;
Actor_SpawnEntry(actorCtx, actorEntry, play);
Actor_SpawnEntry(actorCtx, playerEntry, play);
func_8002C0C0(&actorCtx->targetCtx, actorCtx->actorLists[ACTORCAT_PLAYER].head, play);
func_8002FA60(play);
}
@ -2024,12 +2023,12 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
sp74 = NULL;
unkFlag = 0;
if (play->numSetupActors != 0) {
actorEntry = &play->setupActorList[0];
for (i = 0; i < play->numSetupActors; i++) {
if (play->numActorEntries != 0) {
actorEntry = &play->actorEntryList[0];
for (i = 0; i < play->numActorEntries; i++) {
Actor_SpawnEntry(&play->actorCtx, actorEntry++, play);
}
play->numSetupActors = 0;
play->numActorEntries = 0;
}
if (actorCtx->unk_02 != 0) {

View file

@ -4,7 +4,7 @@ Path* Path_GetByIndex(PlayState* play, s16 index, s16 max) {
Path* path;
if (index != max) {
path = &play->setupPathList[index];
path = &play->pathList[index];
} else {
path = NULL;
}

View file

@ -403,7 +403,7 @@ void Play_Init(GameState* thisx) {
(s32)(zAllocAligned + zAllocSize) - (s32)(zAllocAligned - zAlloc));
Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL);
func_800304DC(this, &this->actorCtx, this->linkActorEntry);
Actor_InitContext(this, &this->actorCtx, this->playerEntry);
while (!func_800973FC(this, &this->roomCtx)) {
; // Empty Loop
@ -1399,14 +1399,17 @@ void Play_InitEnvironment(PlayState* this, s16 skyboxId) {
}
void Play_InitScene(PlayState* this, s32 spawn) {
this->curSpawn = spawn;
this->linkActorEntry = NULL;
this->spawn = spawn;
this->playerEntry = NULL;
this->unk_11DFC = NULL;
this->setupEntranceList = NULL;
this->setupExitList = NULL;
this->spawnList = NULL;
this->exitList = NULL;
this->naviQuestHints = NULL;
this->setupPathList = NULL;
this->numSetupActors = 0;
this->pathList = NULL;
this->numActorEntries = 0;
Object_InitBank(this, &this->objectCtx);
LightContext_Init(this, &this->lightCtx);
TransitionActor_InitContext(&this->state, &this->transiActorCtx);

View file

@ -582,7 +582,7 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
roomCtx->status = 0;
frontRoom = gSaveContext.respawnFlag > 0 ? ((void)0, gSaveContext.respawn[gSaveContext.respawnFlag - 1].roomIndex)
: play->setupEntranceList[play->curSpawn].room;
: play->spawnList[play->spawn].room;
func_8009728C(play, roomCtx, frontRoom);
return maxRoomSize;

View file

@ -182,22 +182,22 @@ s32 Scene_ExecuteCommands(PlayState* play, SceneCmd* sceneCmd) {
return 0;
}
void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
ActorEntry* linkEntry = play->linkActorEntry =
(ActorEntry*)SEGMENTED_TO_VIRTUAL(cmd->spawnList.data) + play->setupEntranceList[play->curSpawn].spawn;
void Scene_CommandPlayerEntryList(PlayState* play, SceneCmd* cmd) {
ActorEntry* playerEntry = play->playerEntry =
(ActorEntry*)SEGMENTED_TO_VIRTUAL(cmd->playerEntryList.data) + play->spawnList[play->spawn].playerEntryIndex;
s16 linkObjectId;
play->linkAgeOnLoad = ((void)0, gSaveContext.linkAge);
linkObjectId = gLinkObjectIds[((void)0, gSaveContext.linkAge)];
gActorOverlayTable[linkEntry->id].initInfo->objectId = linkObjectId;
gActorOverlayTable[playerEntry->id].initInfo->objectId = linkObjectId;
Object_Spawn(&play->objectCtx, linkObjectId);
}
void Scene_CommandActorList(PlayState* play, SceneCmd* cmd) {
play->numSetupActors = cmd->actorList.length;
play->setupActorList = SEGMENTED_TO_VIRTUAL(cmd->actorList.data);
void Scene_CommandActorEntryList(PlayState* play, SceneCmd* cmd) {
play->numActorEntries = cmd->actorEntryList.length;
play->actorEntryList = SEGMENTED_TO_VIRTUAL(cmd->actorEntryList.data);
}
void Scene_CommandUnused2(PlayState* play, SceneCmd* cmd) {
@ -221,8 +221,8 @@ void Scene_CommandRoomList(PlayState* play, SceneCmd* cmd) {
play->roomList = SEGMENTED_TO_VIRTUAL(cmd->roomList.data);
}
void Scene_CommandEntranceList(PlayState* play, SceneCmd* cmd) {
play->setupEntranceList = SEGMENTED_TO_VIRTUAL(cmd->entranceList.data);
void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
play->spawnList = SEGMENTED_TO_VIRTUAL(cmd->spawnList.data);
}
void Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) {
@ -308,10 +308,10 @@ void Scene_CommandLightList(PlayState* play, SceneCmd* cmd) {
}
void Scene_CommandPathList(PlayState* play, SceneCmd* cmd) {
play->setupPathList = SEGMENTED_TO_VIRTUAL(cmd->pathList.data);
play->pathList = SEGMENTED_TO_VIRTUAL(cmd->pathList.data);
}
void Scene_CommandTransitionActorList(PlayState* play, SceneCmd* cmd) {
void Scene_CommandTransitionActorEntryList(PlayState* play, SceneCmd* cmd) {
play->transiActorCtx.numActors = cmd->transiActorList.length;
play->transiActorCtx.list = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.data);
}
@ -386,7 +386,7 @@ void Scene_CommandWindSettings(PlayState* play, SceneCmd* cmd) {
}
void Scene_CommandExitList(PlayState* play, SceneCmd* cmd) {
play->setupExitList = SEGMENTED_TO_VIRTUAL(cmd->exitList.data);
play->exitList = SEGMENTED_TO_VIRTUAL(cmd->exitList.data);
}
void Scene_CommandUndefined9(PlayState* play, SceneCmd* cmd) {
@ -470,32 +470,32 @@ void Scene_CommandMiscSettings(PlayState* play, SceneCmd* cmd) {
}
void (*gSceneCmdHandlers[SCENE_CMD_ID_MAX])(PlayState*, SceneCmd*) = {
Scene_CommandSpawnList, // SCENE_CMD_ID_SPAWN_LIST
Scene_CommandActorList, // SCENE_CMD_ID_ACTOR_LIST
Scene_CommandUnused2, // SCENE_CMD_ID_UNUSED_2
Scene_CommandCollisionHeader, // SCENE_CMD_ID_COLLISION_HEADER
Scene_CommandRoomList, // SCENE_CMD_ID_ROOM_LIST
Scene_CommandWindSettings, // SCENE_CMD_ID_WIND_SETTINGS
Scene_CommandEntranceList, // SCENE_CMD_ID_ENTRANCE_LIST
Scene_CommandSpecialFiles, // SCENE_CMD_ID_SPECIAL_FILES
Scene_CommandRoomBehavior, // SCENE_CMD_ID_ROOM_BEHAVIOR
Scene_CommandUndefined9, // SCENE_CMD_ID_UNDEFINED_9
Scene_CommandRoomShape, // SCENE_CMD_ID_ROOM_SHAPE
Scene_CommandObjectList, // SCENE_CMD_ID_OBJECT_LIST
Scene_CommandLightList, // SCENE_CMD_ID_LIGHT_LIST
Scene_CommandPathList, // SCENE_CMD_ID_PATH_LIST
Scene_CommandTransitionActorList, // SCENE_CMD_ID_TRANSITION_ACTOR_LIST
Scene_CommandLightSettingsList, // SCENE_CMD_ID_LIGHT_SETTINGS_LIST
Scene_CommandTimeSettings, // SCENE_CMD_ID_TIME_SETTINGS
Scene_CommandSkyboxSettings, // SCENE_CMD_ID_SKYBOX_SETTINGS
Scene_CommandSkyboxDisables, // SCENE_CMD_ID_SKYBOX_DISABLES
Scene_CommandExitList, // SCENE_CMD_ID_EXIT_LIST
NULL, // SCENE_CMD_ID_END
Scene_CommandSoundSettings, // SCENE_CMD_ID_SOUND_SETTINGS
Scene_CommandEchoSettings, // SCENE_CMD_ID_ECHO_SETTINGS
Scene_CommandCutsceneData, // SCENE_CMD_ID_CUTSCENE_DATA
Scene_CommandAlternateHeaderList, // SCENE_CMD_ID_ALTERNATE_HEADER_LIST
Scene_CommandMiscSettings, // SCENE_CMD_ID_MISC_SETTINGS
Scene_CommandPlayerEntryList, // SCENE_CMD_ID_SPAWN_LIST
Scene_CommandActorEntryList, // SCENE_CMD_ID_ACTOR_LIST
Scene_CommandUnused2, // SCENE_CMD_ID_UNUSED_2
Scene_CommandCollisionHeader, // SCENE_CMD_ID_COLLISION_HEADER
Scene_CommandRoomList, // SCENE_CMD_ID_ROOM_LIST
Scene_CommandWindSettings, // SCENE_CMD_ID_WIND_SETTINGS
Scene_CommandSpawnList, // SCENE_CMD_ID_ENTRANCE_LIST
Scene_CommandSpecialFiles, // SCENE_CMD_ID_SPECIAL_FILES
Scene_CommandRoomBehavior, // SCENE_CMD_ID_ROOM_BEHAVIOR
Scene_CommandUndefined9, // SCENE_CMD_ID_UNDEFINED_9
Scene_CommandRoomShape, // SCENE_CMD_ID_ROOM_SHAPE
Scene_CommandObjectList, // SCENE_CMD_ID_OBJECT_LIST
Scene_CommandLightList, // SCENE_CMD_ID_LIGHT_LIST
Scene_CommandPathList, // SCENE_CMD_ID_PATH_LIST
Scene_CommandTransitionActorEntryList, // SCENE_CMD_ID_TRANSITION_ACTOR_LIST
Scene_CommandLightSettingsList, // SCENE_CMD_ID_LIGHT_SETTINGS_LIST
Scene_CommandTimeSettings, // SCENE_CMD_ID_TIME_SETTINGS
Scene_CommandSkyboxSettings, // SCENE_CMD_ID_SKYBOX_SETTINGS
Scene_CommandSkyboxDisables, // SCENE_CMD_ID_SKYBOX_DISABLES
Scene_CommandExitList, // SCENE_CMD_ID_EXIT_LIST
NULL, // SCENE_CMD_ID_END
Scene_CommandSoundSettings, // SCENE_CMD_ID_SOUND_SETTINGS
Scene_CommandEchoSettings, // SCENE_CMD_ID_ECHO_SETTINGS
Scene_CommandCutsceneData, // SCENE_CMD_ID_CUTSCENE_DATA
Scene_CommandAlternateHeaderList, // SCENE_CMD_ID_ALTERNATE_HEADER_LIST
Scene_CommandMiscSettings, // SCENE_CMD_ID_MISC_SETTINGS
};
RomFile sNaviQuestHintFiles[] = {

View file

@ -70,7 +70,7 @@ void BgDyYoseizo_Init(Actor* thisx, PlayState* play2) {
PlayState* play = play2;
BgDyYoseizo* this = (BgDyYoseizo*)thisx;
this->fountainType = play->curSpawn;
this->fountainType = play->spawn;
if (this->fountainType < 0) {
this->fountainType = 0;
@ -82,12 +82,12 @@ void BgDyYoseizo_Init(Actor* thisx, PlayState* play2) {
if (play->sceneId == SCENE_DAIYOUSEI_IZUMI) {
// "Great Fairy Fountain"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 大妖精の泉 ☆☆☆☆☆ %d\n" VT_RST, play->curSpawn);
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 大妖精の泉 ☆☆☆☆☆ %d\n" VT_RST, play->spawn);
SkelAnime_InitFlex(play, &this->skelAnime, &gGreatFairySkel, &gGreatFairySittingTransitionAnim,
this->jointTable, this->morphTable, 28);
} else {
// "Stone/Jewel Fairy Fountain"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 石妖精の泉 ☆☆☆☆☆ %d\n" VT_RST, play->curSpawn);
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 石妖精の泉 ☆☆☆☆☆ %d\n" VT_RST, play->spawn);
SkelAnime_InitFlex(play, &this->skelAnime, &gGreatFairySkel, &gGreatFairyLayingDownTransitionAnim,
this->jointTable, this->morphTable, 28);
}

View file

@ -143,7 +143,7 @@ void BgMizuMovebg_Init(Actor* thisx, PlayState* play) {
((BgMizuMovebg*)thisx)->scrollAlpha4 = 160;
waypointId = MOVEBG_POINT_ID(thisx->params);
((BgMizuMovebg*)thisx)->waypointId = waypointId;
func_8089E108(play->setupPathList, &thisx->world.pos, MOVEBG_PATH_ID(thisx->params), waypointId);
func_8089E108(play->pathList, &thisx->world.pos, MOVEBG_PATH_ID(thisx->params), waypointId);
((BgMizuMovebg*)thisx)->actionFunc = func_8089E650;
break;
}
@ -323,7 +323,7 @@ void func_8089E650(BgMizuMovebg* this, PlayState* play) {
f32 dz;
this->dyna.actor.speedXZ = MOVEBG_SPEED(this->dyna.actor.params) * 0.1f;
func_8089E108(play->setupPathList, &waypoint, MOVEBG_PATH_ID(this->dyna.actor.params), this->waypointId);
func_8089E108(play->pathList, &waypoint, MOVEBG_PATH_ID(this->dyna.actor.params), this->waypointId);
dist = Actor_WorldDistXYZToPoint(&this->dyna.actor, &waypoint);
if (dist < this->dyna.actor.speedXZ) {
this->dyna.actor.speedXZ = dist;
@ -335,9 +335,9 @@ void func_8089E650(BgMizuMovebg* this, PlayState* play) {
dz = waypoint.z - this->dyna.actor.world.pos.z;
if (fabsf(dx) < 2.0f && fabsf(dy) < 2.0f && fabsf(dz) < 2.0f) {
this->waypointId++;
if (this->waypointId >= play->setupPathList[MOVEBG_PATH_ID(this->dyna.actor.params)].count) {
if (this->waypointId >= play->pathList[MOVEBG_PATH_ID(this->dyna.actor.params)].count) {
this->waypointId = 0;
func_8089E108(play->setupPathList, &this->dyna.actor.world.pos, MOVEBG_PATH_ID(this->dyna.actor.params), 0);
func_8089E108(play->pathList, &this->dyna.actor.world.pos, MOVEBG_PATH_ID(this->dyna.actor.params), 0);
}
}
if (!(D_8089EE40 & 1) && MOVEBG_SPEED(this->dyna.actor.params) != 0) {

View file

@ -108,7 +108,7 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) {
CollisionHeader_GetVirtual(&object_spot01_matoyab_col, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
if (IS_DAY) {
func_808AC22C(play->setupPathList, &position, ((s32)thisx->params >> 8) & 0xFF, 0);
func_808AC22C(play->pathList, &position, ((s32)thisx->params >> 8) & 0xFF, 0);
Actor_SpawnAsChild(&play->actorCtx, thisx, play, ACTOR_EN_DAIKU_KAKARIKO, position.x, position.y,
position.z, thisx->world.rot.x, thisx->world.rot.y, thisx->world.rot.z,
((((s32)thisx->params >> 8) & 0xFF) << 8) + 1);

View file

@ -858,7 +858,7 @@ void EnBb_FaceWaypoint(EnBb* this) {
}
void EnBb_SetWaypoint(EnBb* this, PlayState* play) {
Path* path = &play->setupPathList[this->path];
Path* path = &play->pathList[this->path];
Vec3s* point;
if (this->waypoint == (s16)(path->count - 1)) {

View file

@ -287,7 +287,7 @@ s32 EnCs_HandleWalking(EnCs* this, PlayState* play) {
s16 walkAngle1;
s16 walkAngle2;
EnCs_GetPathPoint(play->setupPathList, &pathPos, this->path, this->waypoint);
EnCs_GetPathPoint(play->pathList, &pathPos, this->path, this->waypoint);
xDiff = pathPos.x - this->actor.world.pos.x;
zDiff = pathPos.z - this->actor.world.pos.z;
walkAngle1 = RAD_TO_BINANG(Math_FAtan2F(xDiff, zDiff));
@ -296,13 +296,13 @@ s32 EnCs_HandleWalking(EnCs* this, PlayState* play) {
while (this->walkDist <= 10.44f) {
this->waypoint++;
waypointCount = EnCs_GetwaypointCount(play->setupPathList, this->path);
waypointCount = EnCs_GetwaypointCount(play->pathList, this->path);
if ((this->waypoint < 0) || (!(this->waypoint < waypointCount))) {
this->waypoint = 0;
}
EnCs_GetPathPoint(play->setupPathList, &pathPos, this->path, this->waypoint);
EnCs_GetPathPoint(play->pathList, &pathPos, this->path, this->waypoint);
xDiff = pathPos.x - this->actor.world.pos.x;
zDiff = pathPos.z - this->actor.world.pos.z;
walkAngle2 = RAD_TO_BINANG(Math_FAtan2F(xDiff, zDiff));

View file

@ -407,7 +407,7 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) {
EnDaiku_InitSubCamera(this, play);
exitLoop = false;
path = &play->setupPathList[this->actor.params >> 4 & 0xF];
path = &play->pathList[this->actor.params >> 4 & 0xF];
while (!exitLoop) {
pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint;
dx = pointPos->x - this->actor.world.pos.x;
@ -522,7 +522,7 @@ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play) {
f32 dxz;
Vec3s* pointPos;
path = &play->setupPathList[this->actor.params >> 4 & 0xF];
path = &play->pathList[this->actor.params >> 4 & 0xF];
pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint;
dx = pointPos->x - this->actor.world.pos.x;
dz = pointPos->z - this->actor.world.pos.z;

View file

@ -359,7 +359,7 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) {
s32 run;
do {
path = &play->setupPathList[(this->actor.params >> 8) & 0xFF];
path = &play->pathList[(this->actor.params >> 8) & 0xFF];
pathPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->waypoint];
xDist = pathPos->x - this->actor.world.pos.x;
zDist = pathPos->z - this->actor.world.pos.z;

View file

@ -473,7 +473,7 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) {
return false;
}
path = &play->setupPathList[this->actor.params & 0xF];
path = &play->pathList[this->actor.params & 0xF];
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos += this->unk_218;
xDist = pointPos->x - this->actor.world.pos.x;
@ -507,7 +507,7 @@ s32 EnGo_SetMovedPos(EnGo* this, PlayState* play) {
if ((this->actor.params & 0xF) == 0xF) {
return false;
} else {
path = &play->setupPathList[this->actor.params & 0xF];
path = &play->pathList[this->actor.params & 0xF];
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos += (path->count - 1);
this->actor.world.pos.x = pointPos->x;

View file

@ -137,7 +137,7 @@ void EnGoroiwa_SetSpeed(EnGoroiwa* this, PlayState* play) {
}
void EnGoroiwa_FaceNextWaypoint(EnGoroiwa* this, PlayState* play) {
Path* path = &play->setupPathList[this->actor.params & 0xFF];
Path* path = &play->pathList[this->actor.params & 0xFF];
Vec3s* nextPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint;
Vec3f nextPosF;
@ -150,7 +150,7 @@ void EnGoroiwa_FaceNextWaypoint(EnGoroiwa* this, PlayState* play) {
void EnGoroiwa_GetPrevWaypointDiff(EnGoroiwa* this, PlayState* play, Vec3f* dest) {
s16 loopMode = (this->actor.params >> 8) & 3;
Path* path = &play->setupPathList[this->actor.params & 0xFF];
Path* path = &play->pathList[this->actor.params & 0xFF];
s16 prevWaypoint = this->currentWaypoint - this->pathDirection;
Vec3s* prevPointPos;
Vec3s* currentPointPos;
@ -215,14 +215,14 @@ void EnGoroiwa_ReverseDirection(EnGoroiwa* this) {
}
void EnGoroiwa_InitPath(EnGoroiwa* this, PlayState* play) {
this->endWaypoint = play->setupPathList[this->actor.params & 0xFF].count - 1;
this->endWaypoint = play->pathList[this->actor.params & 0xFF].count - 1;
this->currentWaypoint = 0;
this->nextWaypoint = 1;
this->pathDirection = 1;
}
void EnGoroiwa_TeleportToWaypoint(EnGoroiwa* this, PlayState* play, s32 waypoint) {
Path* path = &play->setupPathList[this->actor.params & 0xFF];
Path* path = &play->pathList[this->actor.params & 0xFF];
Vec3s* pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + waypoint;
this->actor.world.pos.x = pointPos->x;
@ -237,7 +237,7 @@ void EnGoroiwa_InitRotation(EnGoroiwa* this) {
s32 EnGoroiwa_GetAscendDirection(EnGoroiwa* this, PlayState* play) {
s32 pad;
Path* path = &play->setupPathList[this->actor.params & 0xFF];
Path* path = &play->pathList[this->actor.params & 0xFF];
Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint;
Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint;
@ -301,7 +301,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, R_EN_GOROIWA_SPEED * 0.01f, 0.3f);
func_8002D868(&this->actor);
path = &play->setupPathList[this->actor.params & 0xFF];
path = &play->pathList[this->actor.params & 0xFF];
nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint;
result = true;
result &= Math_StepToF(&this->actor.world.pos.x, nextPointPos->x, fabsf(this->actor.velocity.x));
@ -311,7 +311,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) {
}
s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) {
Path* path = &play->setupPathList[this->actor.params & 0xFF];
Path* path = &play->pathList[this->actor.params & 0xFF];
s32 pad;
Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint;
Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint;
@ -343,7 +343,7 @@ s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) {
s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) {
s32 pad;
Path* path = &play->setupPathList[this->actor.params & 0xFF];
Path* path = &play->pathList[this->actor.params & 0xFF];
Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint;
Math_StepToF(&this->actor.velocity.y, (R_EN_GOROIWA_SPEED * 0.01f) * 0.5f, 0.18f);
@ -354,7 +354,7 @@ s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) {
s32 EnGoroiwa_MoveDownToNextWaypoint(EnGoroiwa* this, PlayState* play) {
s32 pad;
Path* path = &play->setupPathList[this->actor.params & 0xFF];
Path* path = &play->pathList[this->actor.params & 0xFF];
Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint;
f32 nextPointY;
f32 thisY;
@ -543,7 +543,7 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) {
Actor_Kill(&this->actor);
return;
}
if (play->setupPathList[pathIdx].count < 2) {
if (play->pathList[pathIdx].count < 2) {
// "Error: Invalid Path Data"
osSyncPrintf(" : レールデータ が不正(%s %d)\n", "../z_en_gr.c", 1043);
Actor_Kill(&this->actor);

View file

@ -153,7 +153,7 @@ void EnHeishi1_Walk(EnHeishi1* this, PlayState* play) {
}
if (!sPlayerIsCaught) {
path = &play->setupPathList[this->path];
path = &play->pathList[this->path];
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos += this->waypoint;

View file

@ -286,7 +286,7 @@ void func_80A6B91C(EnHorseNormal* this, PlayState* play) {
}
void EnHorseNormal_FollowPath(EnHorseNormal* this, PlayState* play) {
Path* path = &play->setupPathList[this->actor.params & 0xF];
Path* path = &play->pathList[this->actor.params & 0xF];
Vec3s* pointPos = SEGMENTED_TO_VIRTUAL(path->points);
f32 dx;
f32 dz;

View file

@ -279,7 +279,7 @@ s32 EnKz_FollowPath(EnKz* this, PlayState* play) {
return 0;
}
path = &play->setupPathList[(this->actor.params & 0xFF00) >> 8];
path = &play->pathList[(this->actor.params & 0xFF00) >> 8];
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos += this->waypoint;
@ -305,7 +305,7 @@ s32 EnKz_SetMovedPos(EnKz* this, PlayState* play) {
return 0;
}
path = &play->setupPathList[(this->actor.params & 0xFF00) >> 8];
path = &play->pathList[(this->actor.params & 0xFF00) >> 8];
lastPointPos = SEGMENTED_TO_VIRTUAL(path->points);
lastPointPos += path->count - 1;

View file

@ -348,7 +348,7 @@ void EnMb_NextWaypoint(EnMb* this, PlayState* play) {
Path* path;
Vec3s* waypointPos;
path = &play->setupPathList[this->path];
path = &play->pathList[this->path];
if (this->waypoint == 0) {
this->direction = 1;
@ -404,7 +404,7 @@ s32 EnMb_IsPlayerInCorridor(EnMb* this, PlayState* play) {
}
void EnMb_FindWaypointTowardsPlayer(EnMb* this, PlayState* play) {
Path* path = &play->setupPathList[this->path];
Path* path = &play->pathList[this->path];
s16 yawToWaypoint;
Vec3f waypointPosF;
Vec3s* waypointPosS;

View file

@ -595,7 +595,7 @@ u8 EnMd_FollowPath(EnMd* this, PlayState* play) {
return 0;
}
path = &play->setupPathList[(this->actor.params & 0xFF00) >> 8];
path = &play->pathList[(this->actor.params & 0xFF00) >> 8];
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos += this->waypoint;
@ -622,7 +622,7 @@ u8 EnMd_SetMovedPos(EnMd* this, PlayState* play) {
return 0;
}
path = &play->setupPathList[(this->actor.params & 0xFF00) >> 8];
path = &play->pathList[(this->actor.params & 0xFF00) >> 8];
lastPointPos = SEGMENTED_TO_VIRTUAL(path->points);
lastPointPos += path->count - 1;

View file

@ -331,7 +331,7 @@ s32 func_80AADEF0(EnMm* this, PlayState* play) {
s32 phi_a2;
s32 phi_v1;
func_80AADE60(play->setupPathList, &waypointPos, this->path, this->waypoint);
func_80AADE60(play->pathList, &waypointPos, this->path, this->waypoint);
xDiff = waypointPos.x - this->actor.world.pos.x;
zDiff = waypointPos.z - this->actor.world.pos.z;
@ -349,7 +349,7 @@ s32 func_80AADEF0(EnMm* this, PlayState* play) {
phi_a2 = 0;
break;
case 1:
phi_a2 = EnMm_GetPointCount(play->setupPathList, this->path) - 1;
phi_a2 = EnMm_GetPointCount(play->pathList, this->path) - 1;
break;
case 2:
phi_a2 = this->unk_1F0;
@ -363,7 +363,7 @@ s32 func_80AADEF0(EnMm* this, PlayState* play) {
phi_v1 = 0;
break;
case 1:
phi_v1 = EnMm_GetPointCount(play->setupPathList, this->path) - 1;
phi_v1 = EnMm_GetPointCount(play->pathList, this->path) - 1;
break;
case 2:
phi_v1 = this->unk_1F0;
@ -376,7 +376,7 @@ s32 func_80AADEF0(EnMm* this, PlayState* play) {
this->waypoint = sPathInfo[this->unk_1E8].unk_08;
}
func_80AADE60(play->setupPathList, &waypointPos, this->path, this->waypoint);
func_80AADE60(play->pathList, &waypointPos, this->path, this->waypoint);
xDiff = waypointPos.x - this->actor.world.pos.x;
zDiff = waypointPos.z - this->actor.world.pos.z;

View file

@ -106,7 +106,7 @@ void EnNb_UpdatePath(EnNb* this, PlayState* play) {
s32 pad;
s32 path;
pathList = play->setupPathList;
pathList = play->pathList;
if (pathList != NULL) {
path = EnNb_GetPath(this);

View file

@ -603,7 +603,7 @@ void func_80AB6A38(EnNiw* this, PlayState* play) {
this->unk_2FC = this->unk_300 = 0.0f;
this->actionFunc = EnNiw_ResetAction;
} else {
path = &play->setupPathList[pathIndex];
path = &play->pathList[pathIndex];
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos += this->waypoint;
pathDiffX = pointPos->x - this->actor.world.pos.x;

View file

@ -101,7 +101,7 @@ void EnNiwGirl_Jump(EnNiwGirl* this, PlayState* play) {
}
void func_80AB9210(EnNiwGirl* this, PlayState* play) {
Path* path = &play->setupPathList[this->path];
Path* path = &play->pathList[this->path];
f32 xDistBetween;
f32 zDistBetween;

View file

@ -471,7 +471,7 @@ void EnOssan_TalkDefaultShopkeeper(PlayState* play) {
}
void EnOssan_TalkKakarikoPotionShopkeeper(PlayState* play) {
if (play->curSpawn == 0) {
if (play->spawn == 0) {
Message_ContinueTextbox(play, 0x5046);
} else {
Message_ContinueTextbox(play, 0x504E);
@ -487,7 +487,7 @@ void EnOssan_TalkKokiriShopkeeper(PlayState* play) {
}
void EnOssan_TalkBazaarShopkeeper(PlayState* play) {
if (play->curSpawn == 0) {
if (play->spawn == 0) {
Message_ContinueTextbox(play, 0x9D);
} else {
Message_ContinueTextbox(play, 0x9C);

View file

@ -87,7 +87,7 @@ void EnPoDesert_Destroy(Actor* thisx, PlayState* play) {
}
void EnPoDesert_SetNextPathPoint(EnPoDesert* this, PlayState* play) {
Path* path = &play->setupPathList[this->actor.params];
Path* path = &play->pathList[this->actor.params];
Vec3s* pathPoint;
Animation_MorphToLoop(&this->skelAnime, &gPoeFieldDisappearAnim, -6.0f);

View file

@ -200,7 +200,7 @@ void EnRiverSound_Update(Actor* thisx, PlayState* play) {
if ((thisx->params == RS_RIVER_DEFAULT_LOW_FREQ) || (thisx->params == RS_RIVER_DEFAULT_MEDIUM_FREQ) ||
(thisx->params == RS_RIVER_DEFAULT_HIGH_FREQ)) {
path = &play->setupPathList[this->pathIndex];
path = &play->pathList[this->pathIndex];
pos = &thisx->world.pos;
if (EnRiverSound_GetSfxPos(SEGMENTED_TO_VIRTUAL(path->points), path->count, &player->actor.world.pos, pos)) {

View file

@ -308,7 +308,7 @@ s32 EnTk_Orient(EnTk* this, PlayState* play) {
return 1;
}
path = &play->setupPathList[0];
path = &play->pathList[0];
point = SEGMENTED_TO_VIRTUAL(path->points);
point += this->currentWaypoint;

View file

@ -1573,7 +1573,7 @@ s32 func_80B56EE4(EnZl3* this, PlayState* play) {
void func_80B56F10(EnZl3* this, PlayState* play) {
s32 waypoint;
Path* pathHead = play->setupPathList;
Path* pathHead = play->pathList;
if (pathHead != NULL) {
waypoint = func_80B54DC4(this);
@ -1838,49 +1838,49 @@ void func_80B57858(PlayState* play) {
s32 func_80B57890(EnZl3* this, PlayState* play) {
s8 pad[2];
u8 curSpawn = play->curSpawn;
u8 spawn = play->spawn;
s16 sceneId = play->sceneId;
s32 result = func_80B54DB4(this);
if (play) {} // Needed to match, this if can be almost anywhere and it still matches
if (sceneId == SCENE_GANON_SONOGO) {
if ((result == 0x24) && (curSpawn == 0)) {
if ((result == 0x24) && (spawn == 0)) {
return 1;
}
if ((result == 0x25) && (curSpawn == 2)) {
if ((result == 0x25) && (spawn == 2)) {
return 1;
}
if ((result == 0x26) && (curSpawn == 4)) {
if ((result == 0x26) && (spawn == 4)) {
return 1;
}
if ((result == 0x27) && (curSpawn == 6)) {
if ((result == 0x27) && (spawn == 6)) {
return 1;
}
if ((result == 0x28) && (curSpawn == 6)) {
if ((result == 0x28) && (spawn == 6)) {
return 1;
}
} else if (sceneId == SCENE_GANON_FINAL) {
if ((result == 0x20) && (curSpawn == 0) && Flags_GetSwitch(play, 0x37)) {
if ((result == 0x20) && (spawn == 0) && Flags_GetSwitch(play, 0x37)) {
if ((play->sceneId == SCENE_GANON_DEMO) || (play->sceneId == SCENE_GANON_FINAL) ||
(play->sceneId == SCENE_GANON_SONOGO) || (play->sceneId == SCENE_GANONTIKA_SONOGO)) {
return 1;
}
}
if ((result == 0x21) && (curSpawn == 2)) {
if ((result == 0x21) && (spawn == 2)) {
return 1;
}
if ((result == 0x22) && (curSpawn == 4)) {
if ((result == 0x22) && (spawn == 4)) {
return 1;
}
if ((result == 0x23) && (curSpawn == 6)) {
if ((result == 0x23) && (spawn == 6)) {
return 1;
}
} else if (sceneId == SCENE_GANONTIKA_SONOGO) {
if ((result == 0x29) && (curSpawn == 0)) {
if ((result == 0x29) && (spawn == 0)) {
return 1;
}
if ((result == 0x2A) && (curSpawn == 0)) {
if ((result == 0x2A) && (spawn == 0)) {
return 1;
}
}
@ -2489,9 +2489,9 @@ s32 func_80B59698(EnZl3* this, PlayState* play) {
(play->sceneId == SCENE_GANON_SONOGO) || (play->sceneId == SCENE_GANONTIKA_SONOGO));
if (cond) {
u8 curSpawn = play->curSpawn;
u8 spawn = play->spawn;
if ((func_80B54DB4(this) == 0x20) && (curSpawn == 0) &&
if ((func_80B54DB4(this) == 0x20) && (spawn == 0) &&
((gSaveContext.timer2Value <= 0) || (gSaveContext.timer2State == 0))) {
return 1;
}
@ -2505,9 +2505,9 @@ s32 func_80B59768(EnZl3* this, PlayState* play) {
(play->sceneId == SCENE_GANON_SONOGO) || (play->sceneId == SCENE_GANONTIKA_SONOGO));
if (cond) {
u8 curSpawn = play->curSpawn;
u8 spawn = play->spawn;
if ((func_80B54DB4(this) == 0x20) && (curSpawn == 0) && (gSaveContext.timer2Value <= 0)) {
if ((func_80B54DB4(this) == 0x20) && (spawn == 0) && (gSaveContext.timer2Value <= 0)) {
return 1;
}
}

View file

@ -226,13 +226,13 @@ void ObjBean_SetDrawMode(ObjBean* this, u8 drawFlag) {
}
void ObjBean_SetupPathCount(ObjBean* this, PlayState* play) {
this->pathCount = play->setupPathList[(this->dyna.actor.params >> 8) & 0x1F].count - 1;
this->pathCount = play->pathList[(this->dyna.actor.params >> 8) & 0x1F].count - 1;
this->currentPointIndex = 0;
this->nextPointIndex = 1;
}
void ObjBean_SetupPath(ObjBean* this, PlayState* play) {
Path* path = &play->setupPathList[(this->dyna.actor.params >> 8) & 0x1F];
Path* path = &play->pathList[(this->dyna.actor.params >> 8) & 0x1F];
Math_Vec3s_ToVec3f(&this->pathPoints, SEGMENTED_TO_VIRTUAL(path->points));
}
@ -250,7 +250,7 @@ void ObjBean_FollowPath(ObjBean* this, PlayState* play) {
f32 mag;
Math_StepToF(&this->dyna.actor.speedXZ, sBeanSpeeds[this->unk_1F6].velocity, sBeanSpeeds[this->unk_1F6].accel);
path = &play->setupPathList[(this->dyna.actor.params >> 8) & 0x1F];
path = &play->pathList[(this->dyna.actor.params >> 8) & 0x1F];
nextPathPoint = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->nextPointIndex];
Math_Vec3s_ToVec3f(&pathPointsFloat, nextPathPoint);
@ -480,7 +480,7 @@ void ObjBean_Init(Actor* thisx, PlayState* play) {
Actor_Kill(&this->dyna.actor);
return;
}
if (play->setupPathList[path].count < 3) {
if (play->pathList[path].count < 3) {
osSyncPrintf(VT_COL(RED, WHITE));
// "Incorrect number of path data"
osSyncPrintf("パスデータ数が不正(%s %d)(arg_data %xH)\n", "../z_obj_bean.c", 921,

View file

@ -4357,7 +4357,7 @@ s32 func_80838FB8(PlayState* play, Player* this) {
* The start of each group is indexed by `sReturnEntranceGroupIndices` values.
* The resulting groups are then indexed by the spawn value.
*
* The spawn value (`PlayState.curSpawn`) is set to a different value depending on the entrance used to enter the
* The spawn value (`PlayState.spawn`) is set to a different value depending on the entrance used to enter the
* scene, which allows these dynamic "return entrances" to link back to the previous scene.
*
* Note: grottos and normal fairy fountains use `ENTR_RETURN_GROTTO`
@ -4428,7 +4428,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId)
Play_TriggerVoidOut(play);
Scene_SetTransitionForNextEntrance(play);
} else {
play->nextEntranceIndex = play->setupExitList[exitIndex - 1];
play->nextEntranceIndex = play->exitList[exitIndex - 1];
if (play->nextEntranceIndex == ENTR_RETURN_GROTTO) {
gSaveContext.respawnFlag = 2;
@ -4439,7 +4439,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId)
play->nextEntranceIndex =
sReturnEntranceGroupData[sReturnEntranceGroupIndices[play->nextEntranceIndex -
ENTR_RETURN_YOUSEI_IZUMI_YOKO] +
play->curSpawn];
play->spawn];
Scene_SetTransitionForNextEntrance(play);
} else {
if (SurfaceType_GetFloorEffect(&play->colCtx, poly, bgId) == FLOOR_EFFECT_2) {