Fix Dock/Handheld mode. Fix Random Crash.

This commit is contained in:
Dima353
2026-07-14 10:39:27 +03:00
parent 03c4366ada
commit b6c62f4952
2 changed files with 27 additions and 0 deletions
+8
View File
@@ -128,7 +128,11 @@ CVector CCutsceneMgr::ms_cutsceneOffset;
float CCutsceneMgr::ms_cutsceneTimer;
bool CCutsceneMgr::ms_wasCutsceneSkipped;
uint32 CCutsceneMgr::ms_cutsceneLoadStatus;
#ifdef __SWITCH__
bool CCutsceneMgr::ms_useCutsceneShadows = false;
#else
bool CCutsceneMgr::ms_useCutsceneShadows = true;
#endif
bool bCamLoaded;
bool bIsEverythingRemovedFromTheWorldForTheBiggestFuckoffCutsceneEver; // pls don't shrink the name :P
@@ -419,7 +423,11 @@ CCutsceneMgr::DeleteCutsceneData(void)
ms_cutsceneProcessing = false;
ms_useLodMultiplier = false;
#ifdef __SWITCH__
ms_useCutsceneShadows = false;
#else
ms_useCutsceneShadows = true;
#endif
for (--ms_numCutsceneObjs; ms_numCutsceneObjs >= 0; ms_numCutsceneObjs--) {
CWorld::Remove(ms_pCutsceneObjects[ms_numCutsceneObjs]);
+19
View File
@@ -391,6 +391,20 @@ CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blu
{
PUSH_RENDERGROUP("CPostFX::Render");
#ifdef __SWITCH__
RwRaster *swCamRas = RwCameraGetRaster(cam);
int swSavedW = swCamRas->width, swSavedH = swCamRas->height;
swCamRas->width = RsGlobal.maximumWidth;
swCamRas->height = RsGlobal.maximumHeight;
if(pFrontBuffer){
uint32 needW = (uint32)Pow(2.0f, int32(log2((float)swCamRas->width ))+1);
uint32 needH = (uint32)Pow(2.0f, int32(log2((float)swCamRas->height))+1);
if((uint32)RwRasterGetWidth(pFrontBuffer) != needW ||
(uint32)RwRasterGetHeight(pFrontBuffer) != needH)
Close();
}
#endif
if(pFrontBuffer == nil)
Open(cam);
assert(pFrontBuffer);
@@ -453,6 +467,11 @@ CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blu
}else
bJustInitialised = true;
#ifdef __SWITCH__
swCamRas->width = swSavedW;
swCamRas->height = swSavedH;
#endif
POP_RENDERGROUP();
}