From 6bec79400272177e483d3c9c75250ce84aeafddb Mon Sep 17 00:00:00 2001 From: donkopunchstania Date: Sat, 21 Mar 2009 16:04:44 +0000 Subject: [PATCH] Bug fixes with show EFB copy regions. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2713 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 45fc7035fe..2a66f90724 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -1127,8 +1127,8 @@ void Renderer::DrawDebugText() if (g_Config.bShowEFBCopyRegions) { // Store Line Size - GLint lSize; - glGetIntegerv(GL_SMOOTH_LINE_WIDTH_RANGE, &lSize); + GLfloat lSize; + glGetFloatv(GL_LINE_WIDTH, &lSize); // Set Line Size glLineWidth(8.0f); @@ -1138,10 +1138,12 @@ void Renderer::DrawDebugText() // Draw EFB copy regions rectangles for (std::vector::const_iterator it = stats.efb_regions.begin(); it != stats.efb_regions.end(); ++it) { - GLfloat x = (GLfloat) -1.0f + (it->left / Renderer::GetTargetWidth()); - GLfloat y = (GLfloat) 1.0f + (it->top / Renderer::GetTargetHeight()); - GLfloat x2 = (GLfloat) (x + it->GetWidth()) / Renderer::GetTargetWidth(); - GLfloat y2 = (GLfloat) (y - it->GetHeight()) / Renderer::GetTargetHeight(); + GLfloat halfWidth = Renderer::GetTargetWidth() / 2.0f; + GLfloat halfHeight = Renderer::GetTargetHeight() / 2.0f; + GLfloat x = (GLfloat) -1.0f + ((GLfloat)it->left / halfWidth); + GLfloat y = (GLfloat) 1.0f - ((GLfloat)it->top / halfHeight); + GLfloat x2 = (GLfloat) -1.0f + ((GLfloat)it->right / halfWidth); + GLfloat y2 = (GLfloat) 1.0f - ((GLfloat)it->bottom / halfHeight); // Draw shadow of rect glColor3f(0.0f, 0.0f, 0.0f); @@ -1161,7 +1163,7 @@ void Renderer::DrawDebugText() glEnd(); // Restore Line Size - glLineWidth((GLfloat)lSize); + glLineWidth(lSize); // Clear stored regions stats.efb_regions.clear();