Fix Dock/Handheld mode.
This commit is contained in:
@@ -412,6 +412,21 @@ CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blu
|
|||||||
}
|
}
|
||||||
|
|
||||||
PUSH_RENDERGROUP("CPostFX::Render");
|
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)
|
if(pFrontBuffer == nil)
|
||||||
Open(cam);
|
Open(cam);
|
||||||
assert(pFrontBuffer);
|
assert(pFrontBuffer);
|
||||||
@@ -470,6 +485,11 @@ CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blu
|
|||||||
}else
|
}else
|
||||||
bJustInitialised = true;
|
bJustInitialised = true;
|
||||||
|
|
||||||
|
#ifdef __SWITCH__
|
||||||
|
swCamRas->width = swSavedW;
|
||||||
|
swCamRas->height = swSavedH;
|
||||||
|
#endif
|
||||||
|
|
||||||
POP_RENDERGROUP();
|
POP_RENDERGROUP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user