From 47b9878e3e7dae6efb6b83fed0ab22ea5dfab95a Mon Sep 17 00:00:00 2001 From: superp00t Date: Thu, 30 Nov 2023 16:11:40 -0500 Subject: [PATCH] fix(gx): restore old behavior to GLSDL --- src/gx/glsdl/CGxDeviceGLSDL.cpp | 2 +- src/gx/glsdl/GLSDLDevice.cpp | 42 +++++++++++++++------------------ 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/gx/glsdl/CGxDeviceGLSDL.cpp b/src/gx/glsdl/CGxDeviceGLSDL.cpp index 4c814d8..ff5cfc3 100644 --- a/src/gx/glsdl/CGxDeviceGLSDL.cpp +++ b/src/gx/glsdl/CGxDeviceGLSDL.cpp @@ -186,7 +186,7 @@ int32_t CGxDeviceGLSDL::DeviceCreate(int32_t (*windowProc)(void* window, uint32_ } this->m_GLSDLWindow.Create("World of Warcraft", rect, GLTF_D24, 1); - this->m_GLSDLDevice.Init(&this->m_GLSDLWindow, "WoW", 0); + this->m_GLSDLDevice.Init(&this->m_GLSDLWindow, "WoW", 0x4); // this->m_GLSDLDevice.Init(&this->m_GLSDLWindow, "WoW", 4); GLSDLDevice::SetOption(GLSDLDevice::eShaderConstantBindings, false); diff --git a/src/gx/glsdl/GLSDLDevice.cpp b/src/gx/glsdl/GLSDLDevice.cpp index 76e5b68..1d0d72b 100644 --- a/src/gx/glsdl/GLSDLDevice.cpp +++ b/src/gx/glsdl/GLSDLDevice.cpp @@ -2739,32 +2739,28 @@ void GLSDLDevice::Sub38460(bool a2) { } void GLSDLDevice::Swap() { - // if (this->m_Context.m_Window) { - // if (this->m_FlippedSystemBuffer) { - // GLRect rect = { - // 0, - // 0, - // static_cast(this->m_BackBufferColor->m_Width), - // static_cast(this->m_BackBufferColor->m_Height) - // }; + if (this->m_Window) { + if (this->m_FlippedSystemBuffer) { + GLRect rect = { + 0, + 0, + static_cast(this->m_BackBufferColor->m_Width), + static_cast(this->m_BackBufferColor->m_Height) + }; - // GLMipmap* image = this->m_BackBufferColor->GetMipmap(0, GL_TEXTURE_CUBE_MAP_POSITIVE_X); - // this->CopyTex(0, 0, image, &rect); - // } + GLMipmap* image = this->m_BackBufferColor->GetMipmap(0, GL_TEXTURE_CUBE_MAP_POSITIVE_X); + this->CopyTex(0, 0, image, &rect); + } - // this->DrawRect(); + this->DrawRect(); - // this->m_FrameNumber++; - // this->m_DrawCount = 0; - // } else { - // // glFlushRender(); - // this->m_DrawCount = 0; - // } - - this->DrawRect(); - this->m_FrameNumber++; - this->m_DrawCount = 0; -} + this->m_FrameNumber++; + this->m_DrawCount = 0; + } else { + // glFlushRender(); + this->m_DrawCount = 0; + } +}s void GLSDLDevice::UpdateFFPTexturing() { // TODO