1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-13 11:24:40 +00:00

Merge commit '324db1d578^' into doc_pause_menu

This commit is contained in:
Dragorn421 2024-01-27 22:45:29 +01:00
commit f53d0adebb
No known key found for this signature in database
GPG key ID: 381AEBAF3D429335
495 changed files with 8605 additions and 9774 deletions

View file

@ -25,8 +25,8 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn);
} \
} while (0)
void Play_ChangeViewpointBgCamIndex(PlayState* this) {
Camera_ChangeBgCamIndex(GET_ACTIVE_CAM(this), this->viewpoint - 1);
void Play_RequestViewpointBgCam(PlayState* this) {
Camera_RequestBgCam(GET_ACTIVE_CAM(this), this->viewpoint - 1);
}
void Play_SetViewpoint(PlayState* this, s16 viewpoint) {
@ -42,7 +42,7 @@ void Play_SetViewpoint(PlayState* this, s16 viewpoint) {
&gSfxDefaultReverb);
}
Play_ChangeViewpointBgCamIndex(this);
Play_RequestViewpointBgCam(this);
}
/**
@ -255,8 +255,9 @@ void Play_Init(GameState* thisx) {
this->cameraPtrs[CAM_ID_MAIN] = &this->mainCamera;
this->cameraPtrs[CAM_ID_MAIN]->uid = 0;
this->activeCamId = CAM_ID_MAIN;
Camera_OverwriteStateFlags(&this->mainCamera, CAM_STATE_0 | CAM_STATE_1 | CAM_STATE_2 | CAM_STATE_3 | CAM_STATE_4 |
CAM_STATE_5 | CAM_STATE_6 | CAM_STATE_7);
Camera_OverwriteStateFlags(&this->mainCamera, CAM_STATE_CHECK_BG_ALT | CAM_STATE_CHECK_WATER | CAM_STATE_CHECK_BG |
CAM_STATE_EXTERNAL_FINISHED | CAM_STATE_CAM_FUNC_FINISH |
CAM_STATE_LOCK_MODE | CAM_STATE_DISTORTION | CAM_STATE_PLAY_INIT);
Sram_Init(this, &this->sramCtx);
Regs_InitData(this);
Message_Init(this);
@ -396,7 +397,7 @@ void Play_Init(GameState* thisx) {
osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetRemaining(&this->state.tha));
zAllocSize = THA_GetRemaining(&this->state.tha);
zAlloc = (uintptr_t)GameState_Alloc(&this->state, zAllocSize, "../z_play.c", 2918);
zAlloc = (uintptr_t)GAME_STATE_ALLOC(&this->state, zAllocSize, "../z_play.c", 2918);
zAllocAligned = (zAlloc + 8) & ~0xF;
ZeldaArena_Init((void*)zAllocAligned, zAllocSize - (zAllocAligned - zAlloc));
// "Zelda Heap"
@ -412,12 +413,12 @@ void Play_Init(GameState* thisx) {
player = GET_PLAYER(this);
Camera_InitDataUsingPlayer(&this->mainCamera, player);
Camera_ChangeMode(&this->mainCamera, CAM_MODE_NORMAL);
Camera_RequestMode(&this->mainCamera, CAM_MODE_NORMAL);
playerStartBgCamIndex = player->actor.params & 0xFF;
if (playerStartBgCamIndex != 0xFF) {
osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartBgCamIndex);
Camera_ChangeBgCamIndex(&this->mainCamera, playerStartBgCamIndex);
Camera_RequestBgCam(&this->mainCamera, playerStartBgCamIndex);
}
if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT) {
@ -943,7 +944,7 @@ void Play_Update(PlayState* this) {
}
}
Play_ChangeViewpointBgCamIndex(this);
Play_RequestViewpointBgCam(this);
}
PLAY_LOG(3708);
@ -1076,8 +1077,8 @@ void Play_Draw(PlayState* this) {
this->billboardMtxF.mf[3][0] = this->billboardMtxF.mf[3][1] = this->billboardMtxF.mf[3][2] = 0.0f;
// This transpose is where the viewing matrix is properly converted into a billboard matrix
Matrix_Transpose(&this->billboardMtxF);
this->billboardMtx = Matrix_MtxFToMtx(Matrix_CheckFloats(&this->billboardMtxF, "../z_play.c", 4005),
Graph_Alloc(gfxCtx, sizeof(Mtx)));
this->billboardMtx = Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(&this->billboardMtxF, "../z_play.c", 4005),
GRAPH_ALLOC(gfxCtx, sizeof(Mtx)));
gSPSegment(POLY_OPA_DISP++, 0x01, this->billboardMtx);
@ -1199,7 +1200,7 @@ void Play_Draw(PlayState* this) {
(GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) {
Vec3f quakeOffset;
Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(this));
quakeOffset = Camera_GetQuakeOffset(GET_ACTIVE_CAM(this));
Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + quakeOffset.x,
this->view.eye.y + quakeOffset.y, this->view.eye.z + quakeOffset.z);
}
@ -1412,8 +1413,8 @@ void* Play_LoadFile(PlayState* this, RomFile* file) {
void* allocp;
size = file->vromEnd - file->vromStart;
allocp = GameState_Alloc(&this->state, size, "../z_play.c", 4692);
DmaMgr_RequestSyncDebug(allocp, file->vromStart, size, "../z_play.c", 4694);
allocp = GAME_STATE_ALLOC(&this->state, size, "../z_play.c", 4692);
DMA_REQUEST_SYNC(allocp, file->vromStart, size, "../z_play.c", 4694);
return allocp;
}
@ -1447,6 +1448,7 @@ void Play_InitScene(PlayState* this, s32 spawn) {
void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
SceneTableEntry* scene = &gSceneTable[sceneId];
u32 size;
scene->unk_13 = 0;
this->loadedScene = scene;
@ -1463,7 +1465,9 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
Play_InitScene(this, spawn);
osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(this, &this->roomCtx) / 1024.0f);
size = func_80096FE8(this, &this->roomCtx);
osSyncPrintf("ROOM SIZE=%fK\n", size / 1024.0f);
}
void Play_GetScreenPos(PlayState* this, Vec3f* src, Vec3f* dest) {
@ -1640,11 +1644,11 @@ s32 Play_InitCameraDataUsingPlayer(PlayState* this, s16 camId, Player* player, s
camera = this->cameraPtrs[camIdx];
Camera_InitDataUsingPlayer(camera, player);
return Camera_ChangeSetting(camera, setting);
return Camera_RequestSetting(camera, setting);
}
s32 Play_ChangeCameraSetting(PlayState* this, s16 camId, s16 setting) {
return Camera_ChangeSetting(Play_GetCamera(this, camId), setting);
s32 Play_RequestCameraSetting(PlayState* this, s16 camId, s16 setting) {
return Camera_RequestSetting(Play_GetCamera(this, camId), setting);
}
/**