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

Global Context And General Cleanup (#863)

* door context

* renames

* done

* fix unintended change

* all nb gone

* more nb gone

* merge fishing

* fix size commentX

* door changes suggested by dragorn

* fix accidental semicolon

* another

* change all texture pointers to void*

* error fix and format

* Update src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c

Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl>

* fix ostime

* correct mistake in SkyboxContext

* probably fix nonmatching

* Update include/z64.h

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* roman's suggestions, fix incorrect type definition in z64scene.h

* typo in struct

* make typedef use u8 array

* forgot one

* pull in master and format.sh

Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Zelllll 2021-08-15 18:15:58 -05:00 committed by GitHub
parent 1890e751b9
commit 7551dc2b71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 496 additions and 508 deletions

View file

@ -680,7 +680,7 @@ void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 x, s32 y,
s32 width, s32 height, s32 delay) {
Scene* loadedScene = globalCtx->loadedScene;
SceneTableEntry* loadedScene = globalCtx->loadedScene;
u32 size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart;
if ((size != 0) && (size <= 0x3000)) {
@ -1757,7 +1757,7 @@ void func_8002F994(Actor* actor, s32 arg1) {
// Tests if something hit Jabu Jabu surface, displaying hit splash and playing sfx if true
s32 func_8002F9EC(GlobalContext* globalCtx, Actor* actor, CollisionPoly* poly, s32 bgId, Vec3f* pos) {
if (func_80041D4C(&globalCtx->colCtx, poly, bgId) == 8) {
globalCtx->unk_11D30[0] = 1;
globalCtx->roomCtx.unk_74[0] = 1;
CollisionCheck_BlueBlood(globalCtx, NULL, pos);
Audio_PlayActorSound2(actor, NA_SE_IT_WALL_HIT_BUYO);
return true;
@ -1993,7 +1993,7 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry*
overlayEntry = &gActorOverlayTable[0];
for (i = 0; i < ARRAY_COUNT(gActorOverlayTable); i++) {
overlayEntry->loadedRamAddr = NULL;
overlayEntry->nbLoaded = 0;
overlayEntry->numLoaded = 0;
overlayEntry++;
}
@ -2037,12 +2037,12 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) {
sp74 = NULL;
unkFlag = 0;
if (globalCtx->nbSetupActors != 0) {
if (globalCtx->numSetupActors != 0) {
actorEntry = &globalCtx->setupActorList[0];
for (i = 0; i < globalCtx->nbSetupActors; i++) {
for (i = 0; i < globalCtx->numSetupActors; i++) {
Actor_SpawnEntry(&globalCtx->actorCtx, actorEntry++, globalCtx);
}
globalCtx->nbSetupActors = 0;
globalCtx->numSetupActors = 0;
}
if (actorCtx->unk_02 != 0) {
@ -2275,7 +2275,7 @@ void func_80030FA8(GraphicsContext* gfxCtx) {
CLOSE_DISPS(gfxCtx, "../z_actor.c", 6183);
}
void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invisibleActors) {
void func_8003115C(GlobalContext* globalCtx, s32 numInvisibleActors, Actor** invisibleActors) {
Actor** invisibleActor;
GraphicsContext* gfxCtx;
s32 i;
@ -2313,17 +2313,17 @@ void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invi
func_80030FA8(gfxCtx);
// Translates to: "MAGIC LENS INVISIBLE ACTOR DISPLAY START"
gDPNoOpString(POLY_OPA_DISP++, "魔法のメガネ 見えないc表示 START", nbInvisibleActors);
gDPNoOpString(POLY_OPA_DISP++, "魔法のメガネ 見えないc表示 START", numInvisibleActors);
invisibleActor = &invisibleActors[0];
for (i = 0; i < nbInvisibleActors; i++) {
for (i = 0; i < numInvisibleActors; i++) {
// Translates to: "MAGIC LENS INVISIBLE ACTOR DISPLAY"
gDPNoOpString(POLY_OPA_DISP++, "魔法のメガネ 見えないc表示", i);
Actor_Draw(globalCtx, *(invisibleActor++));
}
// Translates to: "MAGIC LENS INVISIBLE ACTOR DISPLAY END"
gDPNoOpString(POLY_OPA_DISP++, "魔法のメガネ 見えないc表示 END", nbInvisibleActors);
gDPNoOpString(POLY_OPA_DISP++, "魔法のメガネ 見えないc表示 END", numInvisibleActors);
if (globalCtx->roomCtx.curRoom.showInvisActors != 0) {
// Translates to: "BLUE SPECTACLES (EXTERIOR)"
@ -2615,7 +2615,7 @@ Actor* Actor_RemoveFromCategory(GlobalContext* globalCtx, ActorContext* actorCtx
void Actor_FreeOverlay(ActorOverlay* actorOverlay) {
osSyncPrintf(VT_FGCOL(CYAN));
if (actorOverlay->nbLoaded == 0) {
if (actorOverlay->numLoaded == 0) {
if (HREG(20) != 0) {
// Translates to: "ACTOR CLIENT IS NOW 0"
osSyncPrintf("アクタークライアントが0になりました\n");
@ -2644,7 +2644,7 @@ void Actor_FreeOverlay(ActorOverlay* actorOverlay) {
}
} else if (HREG(20) != 0) {
// Translates to: "%d OF ACTOR CLIENT REMAINS"
osSyncPrintf("アクタークライアントはあと %d 残っています\n", actorOverlay->nbLoaded);
osSyncPrintf("アクタークライアントはあと %d 残っています\n", actorOverlay->numLoaded);
}
osSyncPrintf(VT_RST);
@ -2727,7 +2727,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
(u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr, name);
osSyncPrintf(VT_RST);
overlayEntry->nbLoaded = 0;
overlayEntry->numLoaded = 0;
}
actorInit = (void*)(u32)((overlayEntry->initInfo != NULL)
@ -2757,13 +2757,13 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
return NULL;
}
ASSERT(overlayEntry->nbLoaded < 255, "actor_dlftbl->clients < 255", "../z_actor.c", 7031);
ASSERT(overlayEntry->numLoaded < 255, "actor_dlftbl->clients < 255", "../z_actor.c", 7031);
overlayEntry->nbLoaded++;
overlayEntry->numLoaded++;
if (HREG(20) != 0) {
// Translates to: "ACTOR CLIENT No. %d"
osSyncPrintf("アクタークライアントは %d 個目です\n", overlayEntry->nbLoaded);
osSyncPrintf("アクタークライアントは %d 個目です\n", overlayEntry->numLoaded);
}
Lib_MemSet((u8*)actor, actorInit->instanceSize, 0);
@ -2819,13 +2819,13 @@ Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, GlobalContext*
void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCtx) {
TransitionActorEntry* transitionActor;
u8 nbTransitionActors;
u8 numActors;
s32 i;
transitionActor = globalCtx->transitionActorList;
nbTransitionActors = globalCtx->nbTransitionActors;
transitionActor = globalCtx->transiActorCtx.list;
numActors = globalCtx->transiActorCtx.numActors;
for (i = 0; i < nbTransitionActors; i++) {
for (i = 0; i < numActors; i++) {
if (transitionActor->id >= 0) {
if (((transitionActor->sides[0].room >= 0) &&
((transitionActor->sides[0].room == globalCtx->roomCtx.curRoom.num) ||
@ -2838,7 +2838,7 @@ void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCt
(i << 0xA) + transitionActor->params);
transitionActor->id = -transitionActor->id;
nbTransitionActors = globalCtx->nbTransitionActors;
numActors = globalCtx->transiActorCtx.numActors;
}
}
transitionActor++;
@ -2897,8 +2897,8 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
}
} else {
ASSERT(overlayEntry->loadedRamAddr != NULL, "actor_dlftbl->allocp != NULL", "../z_actor.c", 7251);
ASSERT(overlayEntry->nbLoaded > 0, "actor_dlftbl->clients > 0", "../z_actor.c", 7252);
overlayEntry->nbLoaded--;
ASSERT(overlayEntry->numLoaded > 0, "actor_dlftbl->clients > 0", "../z_actor.c", 7252);
overlayEntry->numLoaded--;
Actor_FreeOverlay(overlayEntry);
}