mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-02 17:48:21 -04:00
fix crashes on window resize
This commit is contained in:
+14
-5
@@ -32,7 +32,7 @@ public:
|
||||
if (getDrawFlag() == 1) {
|
||||
setDrawFlag();
|
||||
dComIfGp_onPauseFlag();
|
||||
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTexCopySrc(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
@@ -46,17 +46,23 @@ public:
|
||||
#endif
|
||||
GXCopyTex(mDoGph_gInf_c::getFrameBufferTex(), GX_FALSE);
|
||||
GXPixModeSync();
|
||||
} else {
|
||||
TGXTexObj tex;
|
||||
#if TARGET_PC
|
||||
GXInitTexObj(&tex, mDoGph_gInf_c::getFrameBufferTex(), mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(),
|
||||
// init mTexObj at capture time so the gpu ref survives window resizes
|
||||
GXInitTexObj(&mTexObj, mDoGph_gInf_c::getFrameBufferTex(), mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(),
|
||||
(GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(&mTexObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
#endif
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
// reuse the persistent mTexObj
|
||||
GXLoadTexObj(&mTexObj, GX_TEXMAP0);
|
||||
#else
|
||||
TGXTexObj tex;
|
||||
GXInitTexObj(&tex, mDoGph_gInf_c::getFrameBufferTex(), FB_WIDTH / 2, FB_HEIGHT / 2,
|
||||
(GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
#endif
|
||||
GXInitTexObjLOD(&tex, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
GXLoadTexObj(&tex, GX_TEXMAP0);
|
||||
#endif
|
||||
GXSetNumChans(0);
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60, GX_FALSE, 125);
|
||||
@@ -119,6 +125,9 @@ private:
|
||||
/* 0x4 */ u8 mFlag;
|
||||
/* 0x5 */ u8 mAlpha;
|
||||
/* 0x6 */ u8 mTopFlag;
|
||||
#if TARGET_PC
|
||||
TGXTexObj mTexObj;
|
||||
#endif
|
||||
};
|
||||
|
||||
BOOL dMw_UP_TRIGGER() {
|
||||
|
||||
Reference in New Issue
Block a user