From 8df7d15664f500d671e19753f2d616f450841eb9 Mon Sep 17 00:00:00 2001 From: rogerman Date: Mon, 7 Aug 2017 12:56:46 -0700 Subject: [PATCH] Cocoa Port: When the OpenGL blitter uses CPU-based pixel upscaling, framebuffer fetches no longer swap R and B colors. - Also silence a compiler warning in DisplayWindowController.h. --- desmume/src/frontend/cocoa/OGLDisplayOutput.cpp | 6 +++--- .../frontend/cocoa/userinterface/DisplayWindowController.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp b/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp index 926693b00..c66a57527 100644 --- a/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp +++ b/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp @@ -4929,11 +4929,11 @@ void OGLClientFetchObject::_FetchNativeDisplayByID(const NDSDisplayID displayID, if (this->_fetchColorFormatOGL == GL_UNSIGNED_SHORT_1_5_5_5_REV) { - ColorspaceConvertBuffer555To8888Opaque((const uint16_t *)this->_fetchDisplayInfo[bufferIndex].nativeBuffer[displayID], this->_srcNativeClone[displayID][bufferIndex], GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT); + ColorspaceConvertBuffer555To8888Opaque((const uint16_t *)this->_fetchDisplayInfo[bufferIndex].nativeBuffer[displayID], this->_srcNativeClone[displayID][bufferIndex], GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT); } else { - ColorspaceConvertBuffer888XTo8888Opaque((const uint32_t *)this->_fetchDisplayInfo[bufferIndex].nativeBuffer[displayID], this->_srcNativeClone[displayID][bufferIndex], GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT); + ColorspaceConvertBuffer888XTo8888Opaque((const uint32_t *)this->_fetchDisplayInfo[bufferIndex].nativeBuffer[displayID], this->_srcNativeClone[displayID][bufferIndex], GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT); } pthread_rwlock_unlock(&this->_srcCloneRWLock[displayID][bufferIndex]); @@ -6909,7 +6909,7 @@ void OGLDisplayLayer::_ProcessDisplayByID(const NDSDisplayID displayID, GLsizei uint32_t *texData = vf->RunFilter(); inoutTexID = this->_output->GetTexCPUFilterDstID(displayID); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, inoutTexID); - glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, vf->GetDstWidth(), vf->GetDstHeight(), GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, texData); + glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, vf->GetDstWidth(), vf->GetDstHeight(), GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, texData); inoutWidth = (GLsizei)vf->GetDstWidth(); inoutHeight = (GLsizei)vf->GetDstHeight(); diff --git a/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h b/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h index bcb4bf1e8..9d0b88cbb 100644 --- a/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h +++ b/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h @@ -183,7 +183,6 @@ class OGLVideoOutput; - (IBAction) changeDisplayOrientation:(id)sender; - (IBAction) changeDisplayOrder:(id)sender; - (IBAction) changeDisplayGap:(id)sender; -- (IBAction) toggleVerticalSync:(id)sender; - (IBAction) toggleVideoFiltersPreferGPU:(id)sender; - (IBAction) toggleVideoSourceDeposterize:(id)sender; - (IBAction) changeVideoOutputFilter:(id)sender;