Scene Changes (#114)

* match function

* major cleanups

* rename switch functions

* use graph_alloc to fix fake matches

* more documentation

* more matches, lots of changes

* lots more work

* format

* Update z_scene_proc.c

* very hard lagrange interpolation function OK!

* remove any remaining

* documentation done, only two functions left

* a few more things

* one function left!

* document another oot leftover

* last function decompiled, not matched yet

* scene_proc complete

* start work on z_scene

* done with z_scene

* remove unessecary typedefs

* fix some things to remove warnings

* Add z_scene_table and decomp data

* Delete ctx.c

* add draw cfg enum

* cleanup

* most scene table functions done

* done for now

* all scene files done

* Update include/z64scene.h

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

* add missing macros

* fix some renames

* scene texture file rename

* added temporary structs so it still builds

* more structs

* even more old structs

* fix boyo

* should fix compile error

* lets hope nothing broke

* ub comment back

Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl>
This commit is contained in:
Zelllll
2021-05-09 22:12:42 -04:00
committed by GitHub
co-authored by Anghelo Carvajal
parent e39141fb3d
commit 874a75f456
34 changed files with 4345 additions and 1573 deletions
+3 -3
View File
@@ -171,7 +171,7 @@ void Actor_TargetContextInit(TargetContext* targetCtxt, Actor* actor, GlobalCont
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B5814.asm")
u32 Actor_GetSwitchFlag(GlobalContext* ctxt, s32 flag) {
u32 Flags_GetSwitch(GlobalContext* ctxt, s32 flag) {
if (flag >= 0 && flag < 0x80) {
return ctxt->actorCtx.switchFlags[(flag & -0x20) >> 5] & (1 << (flag & 0x1F));
}
@@ -327,7 +327,7 @@ void Actor_SetScale(Actor* actor, f32 scale) {
void Actor_SetObjectSegment(GlobalContext* ctxt, Actor* actor) {
// TODO: Segment number enum
gSegments[6] = PHYSICAL_TO_VIRTUAL(ctxt->sceneContext.objects[actor->objBankIndex].segment);
gSegments[6] = PHYSICAL_TO_VIRTUAL(ctxt->objectCtx.status[actor->objBankIndex].segment);
}
#if 0
@@ -351,7 +351,7 @@ void Actor_InitToDefaultValues(Actor* actor, GlobalContext* ctxt) {
actor->naviMsgId = 255;
Actor_Setshape(&actor->shape, 0, 0, 0);
if (Scene_IsObjectLoaded(&ctxt->sceneContext, actor->objBankIndex) != 0) {
if (Object_IsLoaded(&ctxt->objectCtx, actor->objBankIndex) != 0) {
Actor_SetObjectSegment(ctxt, actor);
actor->init(actor, ctxt);
actor->init = NULL;
+1 -1
View File
@@ -10,7 +10,7 @@ void EffectSs_DrawGEffect(GlobalContext* globalCtx, EffectSs* this, void* textur
MtxF mfTrans11DA0;
s32 pad1;
Mtx* mtx;
void* object = globalCtx->sceneContext.objects[this->rgObjBankIdx].segment;
void* object = globalCtx->objectCtx.status[this->rgObjBankIdx].segment;
OPEN_DISPS(gfxCtx);
+10 -10
View File
@@ -149,15 +149,15 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk154 = 0.01f;
break;
case ITEM00_SHIELD_HERO:
this->actor.objBankIndex = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_SHIELD_2);
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_SHIELD_2);
EnItem00_SetObject(this, globalCtx, &shadowOffset, &shadowScale);
break;
case ITEM00_MAP:
this->actor.objBankIndex = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_MAP);
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_MAP);
EnItem00_SetObject(this, globalCtx, &shadowOffset, &shadowScale);
break;
case ITEM00_COMPASS:
this->actor.objBankIndex = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_COMPASS);
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_COMPASS);
EnItem00_SetObject(this, globalCtx, &shadowOffset, &shadowScale);
break;
default:
@@ -263,8 +263,8 @@ void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnItem00_WaitForHeartObject(EnItem00* this, GlobalContext* globalCtx) {
s32 sp1C;
sp1C = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_HEARTS);
if (Scene_IsObjectLoaded(&globalCtx->sceneContext, sp1C)) {
sp1C = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEARTS);
if (Object_IsLoaded(&globalCtx->objectCtx, sp1C)) {
this->actor.objBankIndex = sp1C;
this->actionFunc = func_800A640C;
}
@@ -323,7 +323,7 @@ void func_800A6650(EnItem00* this, GlobalContext* globalCtx) {
if (this->actor.params <= ITEM00_RUPEE_RED) {
this->actor.shape.rot.y = this->actor.shape.rot.y + 960;
}
if ((globalCtx->unk18840 & 1) != 0) {
if ((globalCtx->gameplayFrames & 1) != 0) {
pos.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(10.0f);
pos.y = this->actor.world.pos.y + randPlusMinusPoint5Scaled(10.0f);
pos.z = this->actor.world.pos.z + randPlusMinusPoint5Scaled(10.0f);
@@ -377,7 +377,7 @@ void func_800A6780(EnItem00* this, GlobalContext* globalCtx) {
}
}
if ((globalCtx->unk18840 & 1) == 0) {
if ((globalCtx->gameplayFrames & 1) == 0) {
pos.x = this->actor.world.pos.x + ((Rand_ZeroOne() - 0.5f) * 10.0f);
pos.y = this->actor.world.pos.y + ((Rand_ZeroOne() - 0.5f) * 10.0f);
pos.z = this->actor.world.pos.z + ((Rand_ZeroOne() - 0.5f) * 10.0f);
@@ -639,8 +639,8 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
case ITEM00_HEART:
if (this->unk152 < 0) {
if (this->unk152 == -1) {
s8 bankIndex = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_HEART);
if (Scene_IsObjectLoaded(&globalCtx->sceneContext, bankIndex)) {
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
this->actor.objBankIndex = bankIndex;
Actor_SetObjectSegment(globalCtx, &this->actor);
this->unk152 = -2;
@@ -767,7 +767,7 @@ void EnItem00_DrawHeartContainer(EnItem00* actor, GlobalContext* globalCtx) {
s32 pad;
s32 pad2;
if (Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_HEARTS) == actor->actor.objBankIndex) {
if (Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEARTS) == actor->actor.objBankIndex) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
+341 -285
View File
File diff suppressed because it is too large Load Diff
+668 -389
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff