1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 14:50:15 +00:00

Decompile PreRender.c (#319)

* Decompile PreRender.c

* use NON_EQUIVALENT and run format.sh

* Get rid of some magic values

* rename dList/dListp to dListHead/dList

* make func_800C213C NON_MATCHING

* replace more values with SCREEN_WIDTH/SCREEN_HEIGHT

* dList/dListHead with gfxp/gfx
This commit is contained in:
Random 2020-09-15 21:10:19 +02:00 committed by GitHub
parent 203cd19f8a
commit bfef7f8d9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 699 additions and 1585 deletions

View file

@ -174,7 +174,7 @@ s32 func_809B55EC(EnAttackNiw* this, GlobalContext* globalCtx) {
Actor_SetHeight(&this->actor, this->unk_2E4);
func_8002F374(globalCtx, &this->actor, &sp1E, &sp1C);
if ((this->actor.projectedPos.z < -20.0f) || (sp1E < 0) || (sp1E >= 0x141) || (sp1C < 0) || (sp1C >= 0xF1)) {
if ((this->actor.projectedPos.z < -20.0f) || (sp1E < 0) || (sp1E > SCREEN_WIDTH) || (sp1C < 0) || (sp1C > SCREEN_HEIGHT)) {
return 0;
} else {
return 1;

View file

@ -143,7 +143,7 @@ void func_80A4E648(EnGs* this, GlobalContext* globalCtx) {
this->unk_19C = 2;
} else {
func_8002F374(globalCtx, &this->actor, &sp26, &sp24);
if ((sp26 >= 0) && (sp26 < 0x141) && (sp24 >= 0) && (sp24 < 0xF1) && (this->unk_19C != 3)) {
if ((sp26 >= 0) && (sp26 <= SCREEN_WIDTH) && (sp24 >= 0) && (sp24 <= SCREEN_HEIGHT) && (this->unk_19C != 3)) {
if (func_8002F2CC(&this->actor, globalCtx, 40.0f) == 1) {
if (func_8008F080(globalCtx) == 8) {
this->actor.textId = 0x2054;

View file

@ -495,7 +495,7 @@ void func_80B128F8(EnSyatekiNiw* this, GlobalContext* globalCtx) {
Actor_SetHeight(&this->actor, this->unk_2D4);
func_8002F374(globalCtx, &this->actor, &sp26, &sp24);
if ((this->actor.projectedPos.z > 200.0f) && (this->actor.projectedPos.z < 800.0f) && (sp26 > 0) &&
(sp26 < 0x140) && (sp24 > 0) && (sp24 < 0xF0)) {
(sp26 < SCREEN_WIDTH) && (sp24 > 0) && (sp24 < SCREEN_HEIGHT)) {
this->actor.speedXZ = 5.0f;
this->unk_298 = Math_Rand_ZeroFloat(1.99f);
this->unk_2D8 = Math_Rand_CenteredFloat(8000.0f) + -10000.0f;
@ -514,8 +514,8 @@ void func_80B129EC(EnSyatekiNiw* this, GlobalContext* globalCtx) {
Actor_SetHeight(&this->actor, this->unk_2D4);
func_8002F374(globalCtx, &this->actor, &sp2E, &sp2C);
if ((this->unk_25E == 0) || (this->actor.projectedPos.z < -70.0f) || (sp2E < 0) || (sp2E >= 0x141) || (sp2C < 0) ||
(sp2C >= 0xF1)) {
if ((this->unk_25E == 0) || (this->actor.projectedPos.z < -70.0f) || (sp2E < 0) || (sp2E > SCREEN_WIDTH) || (sp2C < 0) ||
(sp2C > SCREEN_HEIGHT)) {
Actor_Kill(&this->actor);
return;
}