diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2024-01-30 13:08:35 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-29 21:08:35 -0500 |
| commit | 6d09437c2162a156a843f3f10b1f864437eee6ed (patch) | |
| tree | 85f0516df72e2ccc8e3f3cc04107aceb4db27e3f /src/code | |
| parent | 5ba625b171a236a39ea59548ffd1a5e393748750 (diff) | |
Retail `z_quake.c` and `z_room.c` OK (#1661)
* quake OK
* z_room OK
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_quake.c | 8 | ||||
| -rw-r--r-- | src/code/z_room.c | 40 |
2 files changed, 27 insertions, 21 deletions
diff --git a/src/code/z_quake.c b/src/code/z_quake.c index 51d784449..50cc448be 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -411,10 +411,6 @@ s16 Quake_Update(Camera* camera, ShakeInfo* camShake) { zeroVec.y = 0.0f; zeroVec.z = 0.0f; - camShake->upPitchOffset = 0; - camShake->upYawOffset = 0; - camShake->fovOffset = 0; - camShake->atOffset.x = 0.0f; camShake->atOffset.y = 0.0f; camShake->atOffset.z = 0.0f; @@ -423,6 +419,10 @@ s16 Quake_Update(Camera* camera, ShakeInfo* camShake) { camShake->eyeOffset.y = 0.0f; camShake->eyeOffset.z = 0.0f; + camShake->upPitchOffset = 0; + camShake->upYawOffset = 0; + camShake->fovOffset = 0; + camShake->maxOffset = 0.0f; if (sQuakeRequestCount == 0) { diff --git a/src/code/z_room.c b/src/code/z_room.c index 68047dcd4..9c16a53b6 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -385,18 +385,20 @@ void Room_DrawImageSingle(PlayState* play, Room* room, u32 flags) { if (drawBackground) { gSPLoadUcodeL(POLY_OPA_DISP++, gspS2DEX2d_fifo); + gfx = POLY_OPA_DISP; + { Vec3f quakeOffset; - gfx = POLY_OPA_DISP; quakeOffset = Camera_GetQuakeOffset(activeCam); Room_DrawBackground2D(&gfx, roomShape->source, roomShape->tlut, roomShape->width, roomShape->height, roomShape->fmt, roomShape->siz, roomShape->tlutMode, roomShape->tlutCount, (quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f, quakeOffset.y * 2.4f + (quakeOffset.x + quakeOffset.z) * 0.3f); - POLY_OPA_DISP = gfx; } + POLY_OPA_DISP = gfx; + gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData()); } } @@ -483,18 +485,20 @@ void Room_DrawImageMulti(PlayState* play, Room* room, u32 flags) { if (drawBackground) { gSPLoadUcodeL(POLY_OPA_DISP++, gspS2DEX2d_fifo); + gfx = POLY_OPA_DISP; + { Vec3f quakeOffset; - gfx = POLY_OPA_DISP; quakeOffset = Camera_GetQuakeOffset(activeCam); Room_DrawBackground2D(&gfx, bgEntry->source, bgEntry->tlut, bgEntry->width, bgEntry->height, bgEntry->fmt, bgEntry->siz, bgEntry->tlutMode, bgEntry->tlutCount, (quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f, quakeOffset.y * 2.4f + (quakeOffset.x + quakeOffset.z) * 0.3f); - POLY_OPA_DISP = gfx; } + POLY_OPA_DISP = gfx; + gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData()); } } @@ -528,7 +532,6 @@ void func_80096FD4(PlayState* play, Room* room) { u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) { u32 maxRoomSize = 0; - RomFile* roomList = play->roomList; u32 roomSize; s32 i; s32 j; @@ -537,16 +540,21 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) { u32 frontRoomSize; u32 backRoomSize; u32 cumulRoomSize; + s32 pad; + + { + RomFile* roomList = play->roomList; - for (i = 0; i < play->numRooms; i++) { - roomSize = roomList[i].vromEnd - roomList[i].vromStart; - PRINTF("ROOM%d size=%d\n", i, roomSize); - if (maxRoomSize < roomSize) { - maxRoomSize = roomSize; + for (i = 0; i < play->numRooms; i++) { + roomSize = roomList[i].vromEnd - roomList[i].vromStart; + PRINTF("ROOM%d size=%d\n", i, roomSize); + if (maxRoomSize < roomSize) { + maxRoomSize = roomSize; + } } } - if (play->transiActorCtx.numActors != 0) { + if ((u32)play->transiActorCtx.numActors != 0) { RomFile* roomList = play->roomList; TransitionActorEntry* transitionActor = &play->transiActorCtx.list[0]; @@ -589,9 +597,9 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) { } s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) { - u32 size; - if (roomCtx->status == 0) { + u32 size; + roomCtx->prevRoom = roomCtx->curRoom; roomCtx->curRoom.num = roomNum; roomCtx->curRoom.segment = NULL; @@ -624,11 +632,9 @@ s32 func_800973FC(PlayState* play, RoomContext* roomCtx) { Scene_ExecuteCommands(play, roomCtx->curRoom.segment); Player_SetBootData(play, GET_PLAYER(play)); Actor_SpawnTransitionActors(play, &play->actorCtx); - - return 1; + } else { + return 0; } - - return 0; } return 1; |
