aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2019-06-02 14:57:59 +0200
committerArisotura <thetotalworm@gmail.com>2019-06-02 14:57:59 +0200
commit6de19645f8fdd309cdf9f53d846b70f45ed66e62 (patch)
tree83698e02c314980c585d077b15de007dfac5c304
parent3aa971403bdf3ebd21082025a6b9d9e181f9816a (diff)
fix potential crash when running the software renderer (oops)
-rw-r--r--melonDS.cbp2
-rw-r--r--src/GPU2D.cpp8
2 files changed, 7 insertions, 3 deletions
diff --git a/melonDS.cbp b/melonDS.cbp
index b517353..3003b84 100644
--- a/melonDS.cbp
+++ b/melonDS.cbp
@@ -143,6 +143,8 @@
<Unit filename="src/libui_sdl/LAN_PCap.h" />
<Unit filename="src/libui_sdl/LAN_Socket.cpp" />
<Unit filename="src/libui_sdl/LAN_Socket.h" />
+ <Unit filename="src/libui_sdl/OSD.cpp" />
+ <Unit filename="src/libui_sdl/OSD.h" />
<Unit filename="src/libui_sdl/Platform.cpp" />
<Unit filename="src/libui_sdl/PlatformConfig.cpp" />
<Unit filename="src/libui_sdl/PlatformConfig.h" />
diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp
index 212372c..c51b252 100644
--- a/src/GPU2D.cpp
+++ b/src/GPU2D.cpp
@@ -882,10 +882,12 @@ void GPU2D::VBlankEnd()
OBJMosaicY = 0;
OBJMosaicYMax = OBJMosaicSize[1];
- // TODO: make optional
- if ((Num == 0) && (CaptureCnt & (1<<31)) && (((CaptureCnt >> 29) & 0x3) != 1))
+ if (GPU3D::Renderer != 0)
{
- GPU3D::GLRenderer::PrepareCaptureFrame();
+ if ((Num == 0) && (CaptureCnt & (1<<31)) && (((CaptureCnt >> 29) & 0x3) != 1))
+ {
+ GPU3D::GLRenderer::PrepareCaptureFrame();
+ }
}
}