Enter Warpzone cutscene recording

This commit is contained in:
Sonic Dreamcaster
2025-12-27 03:07:05 -03:00
parent c3b4a8158a
commit 23d07e9949
2 changed files with 32 additions and 1 deletions
+27
View File
@@ -22,6 +22,13 @@
#include "fox_co.h"
#include "fox_record.h"
int gWarpzoneCsFrameCount = 0;
Record gWarpzoneCsRecord[] = {
{ 2, 1 }, { 3, 3 }, { 4, 4 }, { 3, 8 }, { 2, 9 }, { 3, 52 }, { 2, 54 }, { 3, 69 }, { 2, 70 }, { 3, 75 },
{ 2, 76 }, { 3, 79 }, { 2, 117 }, { 3, 118 }, { 2, 120 }, { 3, 145 }, { 2, 215 }, { 3, 216 }, { 2, 230 },
};
void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames) {
int i;
@@ -36,6 +43,20 @@ void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames) {
}
}
void UpdateVisPerFrameFromRecording_Warpzone(Record* record, s32 maxFrames) {
int i;
if (gWarpzoneCsFrameCount > record[maxFrames - 1].frame) {
return;
}
for (i = 0; i < maxFrames; i++) {
if (gWarpzoneCsFrameCount == record[i].frame) {
gVIsPerFrame = record[i].vis;
}
}
}
void func_demo_80048AC0(TeamId teamId) {
s32 teamShield;
@@ -413,6 +434,9 @@ void Cutscene_EnterWarpZone(Player* player) {
s32 var_v0;
s32 pad[4];
gWarpzoneCsFrameCount++;
UpdateVisPerFrameFromRecording_Warpzone(gWarpzoneCsRecord, ARRAY_COUNT(gWarpzoneCsRecord));
player->pos.x += player->vel.x;
player->flags_228 = 0;
player->alternateView = false;
@@ -440,6 +464,9 @@ void Cutscene_EnterWarpZone(Player* player) {
switch (player->csState) {
case 0:
// @port: Initialize warpzone frame counter for recording.
gWarpzoneCsFrameCount = 0;
player->somersault = false;
gStarWarpDistortion = 100.0f;
player->csState = 1;
+5 -1
View File
@@ -2071,10 +2071,14 @@ void Display_Update(void) {
#if 0
RCP_SetupDL(&gMasterDisp, SETUPDL_83);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255);
Graphics_DisplaySmallText(10 + 210, 180, 1.0f, 1.0f, "VIS:");
Graphics_DisplaySmallNumber(60 + 210, 180, (int) gVIsPerFrame);
Graphics_DisplaySmallText(10 + 210, 190, 1.0f, 1.0f, "CSFMS:");
Graphics_DisplaySmallNumber(60 + 210, 190, (int) gCsFrameCount);
Graphics_DisplaySmallText(10 + 210, 200, 1.0f, 1.0f, "PLTIM:");
Graphics_DisplaySmallNumber(60 + 210, 200, (int) gPlayer->csTimer);
Graphics_DisplaySmallNumber(60 + 220, 200, (int) gPlayer->csTimer);
Graphics_DisplaySmallText(10 + 210, 210, 1.0f, 1.0f, "CSSTATE:");
Graphics_DisplaySmallNumber(60 + 220, 210, (int) gPlayer->csState);
#endif
// @port: @event: Call DisplayPostUpdateEvent