From 9e2f47f4a0862e05f05cebbc5fae4e322c5b5d9f Mon Sep 17 00:00:00 2001
From: Arisotura <thetotalworm@gmail.com>
Date: Fri, 24 May 2019 02:35:25 +0200
Subject: fix more bugs

---
 src/GPU3D.cpp          | 1 +
 src/GPU3D_OpenGL.cpp   | 2 +-
 src/libui_sdl/main.cpp | 4 ++--
 3 files changed, 4 insertions(+), 3 deletions(-)

(limited to 'src')

diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp
index 770c874..98aa6eb 100644
--- a/src/GPU3D.cpp
+++ b/src/GPU3D.cpp
@@ -624,6 +624,7 @@ int InitRenderer(bool hasGL)
     if (renderer == 0) SoftRenderer::Init();
 
     Renderer = renderer;
+    UpdateRendererConfig();
     GPU::SetDisplaySettings(Renderer != 0);
     return renderer;
 }
diff --git a/src/GPU3D_OpenGL.cpp b/src/GPU3D_OpenGL.cpp
index cbf5abd..ceefbaf 100644
--- a/src/GPU3D_OpenGL.cpp
+++ b/src/GPU3D_OpenGL.cpp
@@ -955,7 +955,7 @@ u32* GetLine(int line)
 }
 
 void SetupAccelFrame()
-{printf("morp %04X\n", glGetError());
+{
     glBindTexture(GL_TEXTURE_2D, FramebufferTex[FrontBuffer]);
 }
 
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index e17827d..c302b7e 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -375,7 +375,7 @@ void GLScreen_DrawScreen()
     glActiveTexture(GL_TEXTURE0);
     glBindTexture(GL_TEXTURE_2D, GL_ScreenTexture);
 
-    if (GPU::Framebuffer[frontbuf][1])
+    if (GPU::Framebuffer[frontbuf][0] && GPU::Framebuffer[frontbuf][1])
     {
         if (GPU3D::Renderer == 0)
         {
@@ -922,7 +922,7 @@ void OnAreaDraw(uiAreaHandler* handler, uiArea* area, uiAreaDrawParams* params)
 
     int frontbuf = GPU::FrontBuffer;
     if (!ScreenBitmap[0] || !ScreenBitmap[1]) return;
-    if (!GPU::Framebuffer[frontbuf][1]) return;
+    if (!GPU::Framebuffer[frontbuf][0] || !GPU::Framebuffer[frontbuf][1]) return;
 
     uiRect top = {0, 0, 256, 192};
     uiRect bot = {0, 0, 256, 192};
-- 
cgit v1.2.3