1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-05 23:44:53 +00:00

Decompile z_kankyo (#956)

* working

* start color switch

* progress

* progress

* progress on bgm func

* progress

* game over matched (except the rodata meme)

* start update

* progress

* lightning docs done

* progress

* progress

* progress

* progress

* progress

* can compile at least

* suns state, progress on kankyo_update

* some new names

* progress

* progress

* progress

* new functions

* cleanup

* more matches

* another match

* now functional

* format

* better match

* hugely improved update

* cleanup/review

* remove old changes

* review2

* review3

* missed one

* review4

* change asm filenames

* update doorwarp1

* review5

* Kankyo_ -> Environment_

* format

* merge master and format functions.h

Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>
Co-authored-by: fig <fig02srl@gmail.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
This commit is contained in:
petrie911 2021-09-20 11:51:35 -05:00 committed by GitHub
parent 50095d427c
commit e51f50f0ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
139 changed files with 3478 additions and 6277 deletions

View file

@ -547,7 +547,7 @@ f32 Camera_GetWaterSurface(Camera* camera, Vec3f* chkPos, s32* envProp) {
if (waterY < chkPos->y) {
// the water's y position is below the check position
// the aka the position is NOT in the water.
// meaning the position is NOT in the water.
return BGCHECK_Y_MIN;
}
@ -1778,7 +1778,7 @@ s32 Camera_Normal2(Camera* camera) {
if (camera->status == CAM_STAT_ACTIVE) {
bgChk.pos = *eyeNext;
if ((camera->globalCtx->envCtx.skyDisabled == 0) || norm2->interfaceFlags & 0x10) {
if (!camera->globalCtx->envCtx.skyboxDisabled || norm2->interfaceFlags & 0x10) {
Camera_BGCheckInfo(camera, at, &bgChk);
*eye = bgChk.pos;
} else {
@ -2110,7 +2110,7 @@ s32 Camera_Parallel1(Camera* camera) {
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &spA8);
if (camera->status == CAM_STAT_ACTIVE) {
sp6C.pos = *eyeNext;
if (camera->globalCtx->envCtx.skyDisabled == 0 || para1->interfaceFlags & 0x10) {
if (!camera->globalCtx->envCtx.skyboxDisabled || para1->interfaceFlags & 0x10) {
Camera_BGCheckInfo(camera, at, &sp6C);
*eye = sp6C.pos;
} else {
@ -2903,7 +2903,7 @@ s32 Camera_Battle1(Camera* camera) {
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &spB4);
spBC.pos = *eyeNext;
if (camera->status == CAM_STAT_ACTIVE) {
if (camera->globalCtx->envCtx.skyDisabled == 0 || batt1->flags & 1) {
if (!camera->globalCtx->envCtx.skyboxDisabled || batt1->flags & 1) {
Camera_BGCheckInfo(camera, at, &spBC);
} else if (batt1->flags & 2) {
func_80043F94(camera, at, &spBC);
@ -3225,7 +3225,7 @@ s32 Camera_KeepOn1(Camera* camera) {
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &spD8);
sp8C.pos = *eyeNext;
if (camera->status == CAM_STAT_ACTIVE) {
if ((camera->globalCtx->envCtx.skyDisabled == 0) || keep1->interfaceFlags & 1) {
if (!camera->globalCtx->envCtx.skyboxDisabled || keep1->interfaceFlags & 1) {
Camera_BGCheckInfo(camera, at, &sp8C);
} else if (keep1->interfaceFlags & 2) {
func_80043F94(camera, at, &sp8C);
@ -4205,7 +4205,7 @@ s32 Camera_Subj3(Camera* camera) {
*eye = *eyeNext;
anim->animTimer--;
if (camera->globalCtx->envCtx.skyDisabled == 0) {
if (!camera->globalCtx->envCtx.skyboxDisabled) {
Camera_BGCheck(camera, at, eye);
} else {
func_80044340(camera, at, eye);
@ -7047,7 +7047,7 @@ void Camera_PrintSettings(Camera* camera) {
s32 Camera_CheckWater(Camera* camera) {
f32 waterY;
s16 newQuakeId;
s32 waterBoxProp;
s32 waterLightsIndex;
s32* waterPrevCamSetting = &camera->waterPrevCamSetting;
s16 waterCamIdx;
s16* quakeId = (s16*)&camera->waterQuakeId;
@ -7115,12 +7115,12 @@ s32 Camera_CheckWater(Camera* camera) {
}
}
if (waterY = Camera_GetWaterSurface(camera, &camera->eye, &waterBoxProp), waterY != BGCHECK_Y_MIN) {
if (waterY = Camera_GetWaterSurface(camera, &camera->eye, &waterLightsIndex), waterY != BGCHECK_Y_MIN) {
camera->waterYPos = waterY;
if (!(camera->unk_14C & 0x100)) {
camera->unk_14C |= 0x100;
osSyncPrintf("kankyo changed water, sound on\n");
func_80070600(camera->globalCtx, waterBoxProp);
Environment_EnableUnderwaterLights(camera->globalCtx, waterLightsIndex);
camera->unk_150 = 0x50;
}
@ -7152,7 +7152,7 @@ s32 Camera_CheckWater(Camera* camera) {
if (camera->unk_14C & 0x100) {
camera->unk_14C &= ~0x100;
osSyncPrintf("kankyo changed water off, sound off\n");
func_800706A0(camera->globalCtx);
Environment_DisableUnderwaterLights(camera->globalCtx);
if (*quakeId != 0) {
Quake_RemoveFromIdx(*quakeId);
}
@ -7567,7 +7567,7 @@ void Camera_Finish(Camera* camera) {
camera->childCamIdx = camera->parentCamIdx = SUBCAM_FREE;
camera->timer = -1;
camera->globalCtx->envCtx.unk_E1 = 0;
camera->globalCtx->envCtx.fillScreen = false;
Gameplay_ClearCamera(camera->globalCtx, camera->thisIdx);
}