mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 17:32:19 -05:00
Fix 0xabababab crash (#617)
* Unconditionally setup the normal skybox * Only call Skybox_Setup once ever
This commit is contained in:
parent
ef3dd96eb4
commit
4371b58223
@ -433,6 +433,7 @@ static void RunFrame()
|
|||||||
{
|
{
|
||||||
u32 size;
|
u32 size;
|
||||||
char faultMsg[0x50];
|
char faultMsg[0x50];
|
||||||
|
static bool hasSetupSkybox = false;
|
||||||
|
|
||||||
switch (runFrameContext.state) {
|
switch (runFrameContext.state) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -465,6 +466,14 @@ static void RunFrame()
|
|||||||
}
|
}
|
||||||
GameState_Init(runFrameContext.gameState, runFrameContext.ovl->init, &runFrameContext.gfxCtx);
|
GameState_Init(runFrameContext.gameState, runFrameContext.ovl->init, &runFrameContext.gfxCtx);
|
||||||
|
|
||||||
|
// Setup the normal skybox once before entering any game states to avoid the 0xabababab crash.
|
||||||
|
// The crash is due to certain skyboxes not loading all the data they need from Skybox_Setup.
|
||||||
|
if (!hasSetupSkybox) {
|
||||||
|
GlobalContext* globalCtx = (GlobalContext*)runFrameContext.gameState;
|
||||||
|
Skybox_Setup(globalCtx, &globalCtx->skyboxCtx, SKYBOX_NORMAL_SKY);
|
||||||
|
hasSetupSkybox = true;
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t freq = GetFrequency();
|
uint64_t freq = GetFrequency();
|
||||||
|
|
||||||
while (GameState_IsRunning(runFrameContext.gameState))
|
while (GameState_IsRunning(runFrameContext.gameState))
|
||||||
|
Loading…
Reference in New Issue
Block a user