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

Environment documentation pass (#1115)

* some docs, start introducing time macro

* most usages of CLOCK_TIME

* finish up clock time defines, format

* saving incase i need to revert

* more docs

* more docs progress

* some more docs

* format with 11

* change sos to storm

* update functions.h

* some depth stuff

* review 1 and 2

* whoops

* update zbuf stuff

* most of review 3

* enum name

* storm state enum

* review 4

* fix enum

* add comment to skyboxischanging

* review

* things dont match, committing so i can change branches

* revert struct changes

* define for override_full_control

* new clock_time macro

* fill alpha -> glare strength

* update comment

* remove indoor/outdoor, new name for underwater light variable

* remove copy pasted comment

* fix comments

* remove whitespave

* review
This commit is contained in:
fig02 2022-05-20 14:40:13 -04:00 committed by GitHub
parent d7bbe43ba7
commit 4f0018bf36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 1339 additions and 1087 deletions

View file

@ -256,12 +256,12 @@ void Play_Init(GameState* thisx) {
gSaveContext.cutsceneIndex = 0;
}
if (gSaveContext.nextDayTime != 0xFFFF) {
if (gSaveContext.nextDayTime != NEXT_TIME_NONE) {
gSaveContext.dayTime = gSaveContext.nextDayTime;
gSaveContext.skyboxTime = gSaveContext.nextDayTime;
}
if (gSaveContext.dayTime > 0xC000 || gSaveContext.dayTime < 0x4555) {
if (gSaveContext.dayTime > CLOCK_TIME(18, 0) || gSaveContext.dayTime < CLOCK_TIME(6, 30)) {
gSaveContext.nightFlag = 1;
} else {
gSaveContext.nightFlag = 0;
@ -315,8 +315,8 @@ void Play_Init(GameState* thisx) {
KaleidoScopeCall_Init(this);
func_801109B0(this);
if (gSaveContext.nextDayTime != 0xFFFF) {
if (gSaveContext.nextDayTime == 0x8001) {
if (gSaveContext.nextDayTime != NEXT_TIME_NONE) {
if (gSaveContext.nextDayTime == NEXT_TIME_DAY) {
gSaveContext.totalDays++;
gSaveContext.bgsDayCount++;
gSaveContext.dogIsLost = true;
@ -324,9 +324,9 @@ void Play_Init(GameState* thisx) {
Inventory_ReplaceItem(this, ITEM_POCKET_EGG, ITEM_POCKET_CUCCO)) {
Message_StartTextbox(this, 0x3066, NULL);
}
gSaveContext.nextDayTime = 0xFFFE;
gSaveContext.nextDayTime = NEXT_TIME_DAY_SET;
} else {
gSaveContext.nextDayTime = 0xFFFD;
gSaveContext.nextDayTime = NEXT_TIME_NIGHT_SET;
}
}
@ -1256,7 +1256,7 @@ void Play_Draw(GlobalContext* this) {
}
}
if (this->envCtx.unk_EE[1] != 0) {
if (this->envCtx.precipitation[PRECIP_RAIN_CUR] != 0) {
Environment_DrawRain(this, &this->view, gfxCtx);
}
@ -1515,17 +1515,17 @@ void Play_SpawnScene(GlobalContext* this, s32 sceneNum, s32 spawn) {
osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(this, &this->roomCtx) / 1024.0f);
}
void func_800C016C(GlobalContext* this, Vec3f* src, Vec3f* dest) {
f32 temp;
void Play_GetScreenPos(GlobalContext* this, Vec3f* src, Vec3f* dest) {
f32 w;
Matrix_Mult(&this->viewProjectionMtxF, MTXMODE_NEW);
Matrix_MultVec3f(src, dest);
temp = this->viewProjectionMtxF.ww + (this->viewProjectionMtxF.wx * src->x + this->viewProjectionMtxF.wy * src->y +
this->viewProjectionMtxF.wz * src->z);
w = this->viewProjectionMtxF.ww + (this->viewProjectionMtxF.wx * src->x + this->viewProjectionMtxF.wy * src->y +
this->viewProjectionMtxF.wz * src->z);
dest->x = 160.0f + ((dest->x / temp) * 160.0f);
dest->y = 120.0f - ((dest->y / temp) * 120.0f);
dest->x = (SCREEN_WIDTH / 2) + ((dest->x / w) * (SCREEN_WIDTH / 2));
dest->y = (SCREEN_HEIGHT / 2) - ((dest->y / w) * (SCREEN_HEIGHT / 2));
}
s16 Play_CreateSubCamera(GlobalContext* this) {