1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-19 13:35:18 +00:00

PlayState Rename (#1231)

* global context -> play

* fix PlayState* PlayState
This commit is contained in:
fig02 2022-05-21 14:23:43 -04:00 committed by GitHub
parent 154f44b6da
commit 2e6279bc8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
912 changed files with 40489 additions and 41078 deletions

View file

@ -13,29 +13,29 @@
#define FLAGS ACTOR_FLAG_4
void Demo6K_Init(Actor* thisx, GlobalContext* globalCtx);
void Demo6K_Destroy(Actor* thisx, GlobalContext* globalCtx);
void Demo6K_Update(Actor* thisx, GlobalContext* globalCtx);
void Demo6K_Init(Actor* thisx, PlayState* play);
void Demo6K_Destroy(Actor* thisx, PlayState* play);
void Demo6K_Update(Actor* thisx, PlayState* play);
void func_80966DB0(Demo6K* this, GlobalContext* globalCtx);
void func_80966E04(Demo6K* this, GlobalContext* globalCtx);
void func_80966E98(Demo6K* this, GlobalContext* globalCtx);
void func_80966F84(Demo6K* this, GlobalContext* globalCtx);
void func_8096712C(Demo6K* this, GlobalContext* globalCtx);
void func_80967410(Demo6K* this, GlobalContext* globalCtx);
void func_809674E0(Demo6K* this, GlobalContext* globalCtx);
void func_8096784C(Demo6K* this, GlobalContext* globalCtx);
void func_80966DB0(Demo6K* this, PlayState* play);
void func_80966E04(Demo6K* this, PlayState* play);
void func_80966E98(Demo6K* this, PlayState* play);
void func_80966F84(Demo6K* this, PlayState* play);
void func_8096712C(Demo6K* this, PlayState* play);
void func_80967410(Demo6K* this, PlayState* play);
void func_809674E0(Demo6K* this, PlayState* play);
void func_8096784C(Demo6K* this, PlayState* play);
void func_80967A04(Demo6K* this, s32 i);
void func_80967AD0(Demo6K* this, GlobalContext* globalCtx);
void func_80967DBC(Demo6K* this, GlobalContext* globalCtx);
void func_80967F10(Demo6K* this, GlobalContext* globalCtx);
void func_80967FFC(Actor* thisx, GlobalContext* globalCtx);
void func_80968298(Actor* thisx, GlobalContext* globalCtx);
void func_8096865C(Actor* thisx, GlobalContext* globalCtx);
void func_809688C4(Actor* thisx, GlobalContext* globalCtx);
void func_80968B70(Actor* thisx, GlobalContext* globalCtx);
void func_80968FB0(Actor* thisx, GlobalContext* globalCtx);
void func_809691BC(Demo6K* this, GlobalContext* globalCtx, s32 params);
void func_80967AD0(Demo6K* this, PlayState* play);
void func_80967DBC(Demo6K* this, PlayState* play);
void func_80967F10(Demo6K* this, PlayState* play);
void func_80967FFC(Actor* thisx, PlayState* play);
void func_80968298(Actor* thisx, PlayState* play);
void func_8096865C(Actor* thisx, PlayState* play);
void func_809688C4(Actor* thisx, PlayState* play);
void func_80968B70(Actor* thisx, PlayState* play);
void func_80968FB0(Actor* thisx, PlayState* play);
void func_809691BC(Demo6K* this, PlayState* play, s32 params);
const ActorInit Demo_6K_InitVars = {
ACTOR_DEMO_6K,
@ -65,7 +65,7 @@ void Demo6K_SetupAction(Demo6K* this, Demo6KActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
void Demo6K_Init(Actor* thisx, GlobalContext* globalCtx) {
void Demo6K_Init(Actor* thisx, PlayState* play) {
Demo6K* this = (Demo6K*)thisx;
s32 pad;
s32 params = this->actor.params;
@ -75,7 +75,7 @@ void Demo6K_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("no = %d\n", params);
if (sObjectIds[params] != OBJECT_GAMEPLAY_KEEP) {
objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIds[params]);
objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[params]);
} else {
objBankIndex = 0;
}
@ -148,7 +148,7 @@ void Demo6K_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.0f);
this->initActionFunc = func_80967F10;
this->drawFunc = func_80968B70;
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ITEMACTION);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ITEMACTION);
break;
case 13:
Actor_SetScale(&this->actor, 0.14f);
@ -188,52 +188,52 @@ void Demo6K_Init(Actor* thisx, GlobalContext* globalCtx) {
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 255, 255, 255, 100);
this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo);
this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo);
}
void Demo6K_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void Demo6K_Destroy(Actor* thisx, PlayState* play) {
Demo6K* this = (Demo6K*)thisx;
LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode);
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
}
void func_80966DB0(Demo6K* this, GlobalContext* globalCtx) {
if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) {
void func_80966DB0(Demo6K* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
this->actor.objBankIndex = this->objBankIndex;
this->actor.draw = this->drawFunc;
this->actionFunc = this->initActionFunc;
}
}
void func_80966E04(Demo6K* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.frames > 214) {
void func_80966E04(Demo6K* this, PlayState* play) {
if (play->csCtx.frames > 214) {
func_8002F948(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG);
}
if (globalCtx->csCtx.frames > 264) {
if (play->csCtx.frames > 264) {
func_8002F948(&this->actor, NA_SE_EV_GOD_LIGHTBALL_2 - SFX_FLAG);
}
if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[6] != NULL) &&
(globalCtx->csCtx.npcActions[6]->action == 2)) {
if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.npcActions[6] != NULL) &&
(play->csCtx.npcActions[6]->action == 2)) {
Demo6K_SetupAction(this, func_80966E98);
}
}
void func_80966E98(Demo6K* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.frames < 353) {
void func_80966E98(Demo6K* this, PlayState* play) {
if (play->csCtx.frames < 353) {
func_8002F948(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG);
func_8002F948(&this->actor, NA_SE_EV_GOD_LIGHTBALL_2 - SFX_FLAG);
}
if (globalCtx->csCtx.frames == 342) {
if (play->csCtx.frames == 342) {
func_800F3F3C(2);
}
if (this->timer1 == 39) {
func_800788CC(NA_SE_EV_CONSENTRATION);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x,
this->actor.world.pos.y + 10.0f, this->actor.world.pos.z, 0, 0, 0, 2);
Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_6K, this->actor.world.pos.x, this->actor.world.pos.y + 10.0f,
this->actor.world.pos.z, 0, 0, 0, 2);
}
if (this->timer1 == 64) {
@ -243,7 +243,7 @@ void func_80966E98(Demo6K* this, GlobalContext* globalCtx) {
this->timer1++;
}
void func_80966F84(Demo6K* this, GlobalContext* globalCtx) {
void func_80966F84(Demo6K* this, PlayState* play) {
if (this->timer1 < 5) {
this->unk_168 = D_8096930C[this->timer1 & 3];
} else if (this->timer1 < 15) {
@ -253,7 +253,7 @@ void func_80966F84(Demo6K* this, GlobalContext* globalCtx) {
this->unk_168 = 1.0f;
} else {
if (this->timer1 == 15) {
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EFF_DUST, this->actor.world.pos.x,
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EFF_DUST, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, EFF_DUST_TYPE_1);
}
Math_StepToF(&this->unk_16C, 1.0f, 0.02f);
@ -263,7 +263,7 @@ void func_80966F84(Demo6K* this, GlobalContext* globalCtx) {
this->timer1++;
}
void func_809670AC(Demo6K* this, GlobalContext* globalCtx) {
void func_809670AC(Demo6K* this, PlayState* play) {
this->timer2++;
if (this->timer1 < 10) {
@ -276,9 +276,9 @@ void func_809670AC(Demo6K* this, GlobalContext* globalCtx) {
}
}
void func_8096712C(Demo6K* this, GlobalContext* globalCtx) {
void func_8096712C(Demo6K* this, PlayState* play) {
static u16 D_8096932C[] = { 275, 275, 275, 275, 275, 275 };
u32 frames = globalCtx->state.frames;
u32 frames = play->state.frames;
if (this->actor.scale.x < 0.1f) {
this->actor.scale.x += 0.0017f;
@ -288,8 +288,8 @@ void func_8096712C(Demo6K* this, GlobalContext* globalCtx) {
this->actor.scale.x = 0.1f;
}
if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[6] != NULL) &&
(globalCtx->csCtx.npcActions[6]->action == 2)) {
if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.npcActions[6] != NULL) &&
(play->csCtx.npcActions[6]->action == 2)) {
Demo6K_SetupAction(this, func_809670AC);
this->timer1 = 0;
this->actor.scale.x = 0.1f;
@ -299,12 +299,12 @@ void func_8096712C(Demo6K* this, GlobalContext* globalCtx) {
this->timer2++;
if ((globalCtx->sceneNum == SCENE_GANONTIKA) && (globalCtx->csCtx.frames < D_8096932C[this->actor.params - 3])) {
if ((play->sceneNum == SCENE_GANONTIKA) && (play->csCtx.frames < D_8096932C[this->actor.params - 3])) {
func_8002F974(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG);
}
}
void func_80967244(Demo6K* this, GlobalContext* globalCtx) {
void func_80967244(Demo6K* this, PlayState* play) {
static Vec3f velocity = { 0.0f, 0.0f, 0.0f };
static Vec3f accel = { 0.0f, 0.0f, 0.0f };
static Color_RGBA8 primColor = { 255, 255, 255, 0 };
@ -331,30 +331,30 @@ void func_80967244(Demo6K* this, GlobalContext* globalCtx) {
envColor.g = sEnvColors[this->unk_293].g;
envColor.b = sEnvColors[this->unk_293].b;
if (globalCtx->sceneNum == SCENE_TOKINOMA) {
if (play->sceneNum == SCENE_TOKINOMA) {
scale = 6000;
} else if (globalCtx->csCtx.frames < 419) {
} else if (play->csCtx.frames < 419) {
scale = 6000;
} else {
scale = 18000;
}
EffectSsKiraKira_SpawnFocused(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, scale, 20);
EffectSsKiraKira_SpawnFocused(play, &pos, &velocity, &accel, &primColor, &envColor, scale, 20);
}
void func_80967410(Demo6K* this, GlobalContext* globalCtx) {
void func_80967410(Demo6K* this, PlayState* play) {
s32 params = this->actor.params - 14;
this->timer2++;
Actor_SetScale(&this->actor, 0.2f);
if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[params] != NULL)) {
func_809691BC(this, globalCtx, params);
if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.npcActions[params] != NULL)) {
func_809691BC(this, play, params);
if (globalCtx->csCtx.npcActions[params]->action == 3) {
if (play->csCtx.npcActions[params]->action == 3) {
this->flags &= ~1;
func_80967244(this, globalCtx);
func_80967244(this, play);
} else {
this->flags |= 1;
}
@ -363,8 +363,8 @@ void func_80967410(Demo6K* this, GlobalContext* globalCtx) {
}
}
void func_809674E0(Demo6K* this, GlobalContext* globalCtx) {
u32 frames = globalCtx->state.frames;
void func_809674E0(Demo6K* this, PlayState* play) {
u32 frames = play->state.frames;
if (this->actor.scale.x < 0.05f) {
this->actor.scale.x += 0.005f;
@ -396,7 +396,7 @@ void func_809674E0(Demo6K* this, GlobalContext* globalCtx) {
sEnvColors[this->unk_293].b, this->actor.scale.x * 4000.0f);
}
void func_809676A4(Demo6K* this, GlobalContext* globalCtx) {
void func_809676A4(Demo6K* this, PlayState* play) {
static Vec3f velocity = { 0.0f, 0.0f, 0.0f };
static Vec3f accel = { 0.0f, 0.0f, 0.0f };
static Color_RGBA8 primColor = { 255, 255, 255, 0 };
@ -416,12 +416,12 @@ void func_809676A4(Demo6K* this, GlobalContext* globalCtx) {
accel.y = 0.0f;
EffectSsKiraKira_SpawnFocused(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, 500, 20);
EffectSsKiraKira_SpawnFocused(play, &pos, &velocity, &accel, &primColor, &envColor, 500, 20);
}
}
void func_8096784C(Demo6K* this, GlobalContext* globalCtx) {
u32 frames = globalCtx->state.frames;
void func_8096784C(Demo6K* this, PlayState* play) {
u32 frames = play->state.frames;
this->timer2++;
@ -438,7 +438,7 @@ void func_8096784C(Demo6K* this, GlobalContext* globalCtx) {
this->actor.scale.x -= 0.0015f;
func_809676A4(this, globalCtx);
func_809676A4(this, play);
} else if (frames & 1) {
this->actor.scale.x = 0.033f;
} else {
@ -459,16 +459,16 @@ void func_80967A04(Demo6K* this, s32 i) {
this->unk_234[i] = Rand_ZeroFloat(0.02f) + 0.01f;
}
void func_80967AD0(Demo6K* this, GlobalContext* globalCtx) {
void func_80967AD0(Demo6K* this, PlayState* play) {
s32 i;
if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[1] != NULL)) {
if (globalCtx->csCtx.npcActions[1]->action == 2) {
if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.npcActions[1] != NULL)) {
if (play->csCtx.npcActions[1]->action == 2) {
this->unk_170++;
func_8002F948(&this->actor, NA_SE_EV_RAINBOW_SHOWER - SFX_FLAG);
}
func_809691BC(this, globalCtx, 1);
func_809691BC(this, play, 1);
}
for (i = 0; (i < (s32)this->unk_170) && (i < 16); i++) {
@ -481,7 +481,7 @@ void func_80967AD0(Demo6K* this, GlobalContext* globalCtx) {
this->timer1++;
}
void func_80967BF8(Player* player, GlobalContext* globalCtx) {
void func_80967BF8(Player* player, PlayState* play) {
static Vec3f velocity = { 0.0f, 0.0f, 0.0f };
static Vec3f accel = { 0.0f, 0.0f, 0.0f };
static Color_RGBA8 primColor = { 255, 255, 255, 0 };
@ -500,12 +500,12 @@ void func_80967BF8(Player* player, GlobalContext* globalCtx) {
accel.y = 0.0f;
EffectSsKiraKira_SpawnFocused(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, 1000,
EffectSsKiraKira_SpawnFocused(play, &pos, &velocity, &accel, &primColor, &envColor, 1000,
(s32)Rand_ZeroFloat(60.0f) + 60);
}
}
void func_80967DBC(Demo6K* this, GlobalContext* globalCtx) {
void func_80967DBC(Demo6K* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_ATTACK_DEMO - SFX_FLAG);
this->timer2++;
@ -518,9 +518,9 @@ void func_80967DBC(Demo6K* this, GlobalContext* globalCtx) {
}
if (this->timer2 > 104) {
func_80967BF8(GET_PLAYER(globalCtx), globalCtx);
func_80967BF8(GET_PLAYER(play), play);
Actor_Kill(&this->actor);
Audio_PlayActorSound2(&GET_PLAYER(globalCtx)->actor, NA_SE_EN_FANTOM_HIT_THUNDER);
Audio_PlayActorSound2(&GET_PLAYER(play)->actor, NA_SE_EN_FANTOM_HIT_THUNDER);
} else if (this->timer2 > 94) {
Actor_SetScale(&this->actor, this->actor.scale.x + 0.03f);
@ -535,9 +535,9 @@ void func_80967DBC(Demo6K* this, GlobalContext* globalCtx) {
}
}
void func_80967F10(Demo6K* this, GlobalContext* globalCtx) {
void func_80967F10(Demo6K* this, PlayState* play) {
if (this->timer2 == 0) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, this->actor.world.pos.y,
Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_6K, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, 13);
}
@ -550,23 +550,23 @@ void func_80967F10(Demo6K* this, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.05f - (this->timer2 * 0.00075f));
}
void Demo6K_Update(Actor* thisx, GlobalContext* globalCtx) {
void Demo6K_Update(Actor* thisx, PlayState* play) {
Demo6K* this = (Demo6K*)thisx;
this->actionFunc(this, globalCtx);
this->actionFunc(this, play);
}
void func_80967FFC(Actor* thisx, GlobalContext* globalCtx) {
void func_80967FFC(Actor* thisx, PlayState* play) {
Demo6K* this = (Demo6K*)thisx;
s32 pad;
u16 timer1 = this->timer1;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1070);
OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1070);
func_80093D84(globalCtx->state.gfxCtx);
func_80093D84(play->state.gfxCtx);
Matrix_RotateX(-M_PI / 2, MTXMODE_APPLY);
gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0x7FFF - ((timer1 * 8) & 0x7FFF), 16, 512, 1, 0,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0x7FFF - ((timer1 * 8) & 0x7FFF), 16, 512, 1, 0,
0x7FFF - ((timer1 * 8) & 0x7FFF), 16, 32));
{
@ -582,7 +582,7 @@ void func_80967FFC(Actor* thisx, GlobalContext* globalCtx) {
for (i = 0; i < 6; i++) {
Matrix_RotateZ(M_PI / 3, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1115),
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_6k.c", 1115),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, colors[i][0].r, colors[i][0].g, colors[i][0].b, 255);
@ -594,10 +594,10 @@ void func_80967FFC(Actor* thisx, GlobalContext* globalCtx) {
if ((s16)i) {}
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1127);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1127);
}
void func_80968298(Actor* thisx, GlobalContext* globalCtx) {
void func_80968298(Actor* thisx, PlayState* play) {
static u8 skipIndices[] = { 6, 7, 11, 16, 20, 24, 28, 33, 35, 41, 45, 50, 57, 58, 62, 255 };
Demo6K* this = (Demo6K*)thisx;
s32 pad;
@ -608,7 +608,7 @@ void func_80968298(Actor* thisx, GlobalContext* globalCtx) {
s32 i2;
u8 alpha;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1145);
OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1145);
alpha = (s32)(this->unk_170 * 255.0f);
POLY_XLU_DISP = func_800937C0(POLY_XLU_DISP);
@ -616,7 +616,7 @@ void func_80968298(Actor* thisx, GlobalContext* globalCtx) {
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
func_80093D84(globalCtx->state.gfxCtx);
func_80093D84(play->state.gfxCtx);
alpha = (s32)(this->unk_16C * 255.0f);
for (i2 = 0, i = 0; i < 63; i++) {
@ -628,31 +628,31 @@ void func_80968298(Actor* thisx, GlobalContext* globalCtx) {
}
Matrix_RotateX(-M_PI / 2, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1170),
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_6k.c", 1170),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 210, 210, 210, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 100, 100, 100, 255);
gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (0xFFF - (timer1 * 6)) & 0xFFF, (timer1 * 12) & 0xFFF, 128,
64, 1, (0xFFF - (timer1 * 6)) & 0xFFF, (timer1 * 12) & 0xFFF, 64, 32));
Gfx_TwoTexScroll(play->state.gfxCtx, 0, (0xFFF - (timer1 * 6)) & 0xFFF, (timer1 * 12) & 0xFFF, 128, 64,
1, (0xFFF - (timer1 * 6)) & 0xFFF, (timer1 * 12) & 0xFFF, 64, 32));
gSPDisplayList(POLY_XLU_DISP++, object_demo_6k_DL_0039D0);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1189),
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_6k.c", 1189),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_80093D84(globalCtx->state.gfxCtx);
func_80093D84(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 50, 50, 50, 255);
gSPDisplayList(POLY_XLU_DISP++, object_demo_6k_DL_001040);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1198);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1198);
}
void func_8096865C(Actor* thisx, GlobalContext* globalCtx) {
void func_8096865C(Actor* thisx, PlayState* play) {
Demo6K* this = (Demo6K*)thisx;
s32 pad;
Gfx* displayList;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1208);
OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1208);
if (!(this->flags & 1)) {
if (this->actor.params > 8) {
@ -661,39 +661,39 @@ void func_8096865C(Actor* thisx, GlobalContext* globalCtx) {
displayList = gEffFlash2DL;
}
func_80093D84(globalCtx->state.gfxCtx);
func_80093D84(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 255, 255);
gDPSetEnvColor(POLY_XLU_DISP++, sEnvColors[this->unk_293].r, sEnvColors[this->unk_293].g,
sEnvColors[this->unk_293].b, 255);
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
Matrix_Push();
Matrix_RotateZ(DEG_TO_RAD(this->timer2 * 6), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1230),
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_6k.c", 1230),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, displayList);
Matrix_Pop();
Matrix_RotateZ(DEG_TO_RAD(-(f32)(this->timer2 * 6)), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1236),
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_6k.c", 1236),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, displayList);
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1242);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1242);
}
void func_809688C4(Actor* thisx, GlobalContext* globalCtx2) {
void func_809688C4(Actor* thisx, PlayState* play2) {
Demo6K* this = (Demo6K*)thisx;
GlobalContext* globalCtx = globalCtx2;
u32 frames = globalCtx->state.frames;
PlayState* play = play2;
u32 frames = play->state.frames;
s32 i;
if ((i = (globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[1] != NULL)) &&
(globalCtx->csCtx.npcActions[1]->action != 1)) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1277);
if ((i = (play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.npcActions[1] != NULL)) &&
(play->csCtx.npcActions[1]->action != 1)) {
OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1277);
func_80093D84(globalCtx->state.gfxCtx);
func_80093D84(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 255, 255);
Matrix_RotateY(BINANG_TO_RAD((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x8000)), MTXMODE_APPLY);
Matrix_RotateY(BINANG_TO_RAD((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000)), MTXMODE_APPLY);
for (i = 0; i < 16; i++) {
gDPPipeSync(POLY_XLU_DISP++);
@ -704,8 +704,8 @@ void func_809688C4(Actor* thisx, GlobalContext* globalCtx2) {
Matrix_Scale(this->unk_234[i] * D_8096931C[(frames + i) & 3],
this->unk_234[i] * D_8096931C[(frames + i) & 3],
this->unk_234[i] * D_8096931C[(frames + i) & 3], MTXMODE_APPLY);
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1297),
Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_6k.c", 1297),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL);
Matrix_Pop();
@ -713,11 +713,11 @@ void func_809688C4(Actor* thisx, GlobalContext* globalCtx2) {
gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1305);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1305);
}
}
void func_80968B70(Actor* thisx, GlobalContext* globalCtx) {
void func_80968B70(Actor* thisx, PlayState* play) {
s32 pad;
Demo6K* this = (Demo6K*)thisx;
u32 timer2 = this->timer2;
@ -726,15 +726,15 @@ void func_80968B70(Actor* thisx, GlobalContext* globalCtx) {
if (1) {}
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1316);
OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1316);
func_80093D84(globalCtx->state.gfxCtx);
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
func_80093D84(play->state.gfxCtx);
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
Matrix_RotateX(M_PI / 2, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1322),
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_6k.c", 1322),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0xFF - ((timer2 * 2) & 0xFF), 0, 32, 32, 1,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0xFF - ((timer2 * 2) & 0xFF), 0, 32, 32, 1,
0xFF - ((timer2 * 2) & 0xFF), (timer2 * 15) & 0x3FF, 16, 64));
if (this->timer2 < 40) {
@ -763,26 +763,26 @@ void func_80968B70(Actor* thisx, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_XLU_DISP++, envColor[0], envColor[1], envColor[2], 128);
gSPDisplayList(POLY_XLU_DISP++, object_gnd_magic_DL_001190);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1368);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1368);
}
void func_80968FB0(Actor* thisx, GlobalContext* globalCtx) {
void func_80968FB0(Actor* thisx, PlayState* play) {
static u8 D_809693CC[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1 };
Demo6K* this = (Demo6K*)thisx;
Gfx* displayList = Graph_Alloc(globalCtx->state.gfxCtx, 4 * sizeof(Gfx));
u16 frames = globalCtx->gameplayFrames;
Gfx* displayList = Graph_Alloc(play->state.gfxCtx, 4 * sizeof(Gfx));
u16 frames = play->gameplayFrames;
f32 scaleFactor;
s32 pad;
if (1) {}
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1386);
OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1386);
func_80093D84(globalCtx->state.gfxCtx);
func_80093D84(play->state.gfxCtx);
scaleFactor = ((s16)D_809693CC[(frames * 4) & 0xF] * 0.01f) + 1.0f;
Matrix_Scale(this->actor.scale.x * scaleFactor, this->actor.scale.y * scaleFactor,
this->actor.scale.z * scaleFactor, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1394),
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_6k.c", 1394),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08, displayList);
gDPPipeSync(displayList++);
@ -792,14 +792,14 @@ void func_80968FB0(Actor* thisx, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_XLU_DISP++, 255, 200, 0, 255);
gSPDisplayList(POLY_XLU_DISP++, gGlowCircleSmallDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1411);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1411);
}
void func_809691BC(Demo6K* this, GlobalContext* globalCtx, s32 params) {
void func_809691BC(Demo6K* this, PlayState* play, s32 params) {
Vec3f startPos;
Vec3f endPos;
f32 temp;
CsCmdActorAction* csAction = globalCtx->csCtx.npcActions[params];
CsCmdActorAction* csAction = play->csCtx.npcActions[params];
startPos.x = csAction->startPos.x;
startPos.y = csAction->startPos.y;
@ -809,7 +809,7 @@ void func_809691BC(Demo6K* this, GlobalContext* globalCtx, s32 params) {
endPos.y = csAction->endPos.y;
endPos.z = csAction->endPos.z;
temp = Environment_LerpWeight(csAction->endFrame, csAction->startFrame, globalCtx->csCtx.frames);
temp = Environment_LerpWeight(csAction->endFrame, csAction->startFrame, play->csCtx.frames);
this->actor.world.pos.x = (((endPos.x - startPos.x) * temp) + startPos.x);
this->actor.world.pos.y = (((endPos.y - startPos.y) * temp) + startPos.y);

View file

@ -6,7 +6,7 @@
struct Demo6K;
typedef void (*Demo6KActionFunc)(struct Demo6K*, GlobalContext*);
typedef void (*Demo6KActionFunc)(struct Demo6K*, PlayState*);
typedef struct Demo6K {
/* 0x0000 */ Actor actor;