summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Peterson <jpeterson57@gmail.com>2009-06-06 17:34:54 +0000
committerJohn Peterson <jpeterson57@gmail.com>2009-06-06 17:34:54 +0000
commit401ae629d4e7638ea7feb115fec2e3cba97344f6 (patch)
tree40a617efd23f4af4b1da4c4c3156c08a66c356dc
parent695fe31b2c58b09138afff9593fd1fc837d1182e (diff)
OpenGL: Adjustment to my last commit, forgot a return for example
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3338 8ced0084-cf51-0410-be5f-012b33b47a6e
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/Render.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
index 932daf6f89..87557c76fe 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
@@ -876,16 +876,6 @@ void Renderer::Swap(const TRectangle& rc)
{
s_criticalScreenshot.Enter();
- /*
- // Logging
- char msg[255];
- sprintf(msg, "Target: %i | %i %i %i %i\n",
- (int)v_min,
- //back_rc.top, back_rc.left, back_rc.right, back_rc.bottom);
- rc.right, rc.bottom - (int)(v_min), rc.right, rc.bottom);
- OSD::AddMessage(msg, 5000);
- */
-
// Save screenshot
SaveRenderTarget(s_sScreenshotName.c_str(), rc.right, rc.bottom, (int)(v_min));
// Reset settings
@@ -1281,14 +1271,18 @@ bool Renderer::SaveRenderTarget(const char *filename, int W, int H, int YOffset)
if (H == 479) H = 480;
if (H == 599) H = 600;
if (H == 767) H = 768;
+ if (H == 959) H = 960;
if (H == 1023) H = 1024;
u8 *data = (u8 *)malloc(3 * W * H);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, YOffset, W, H, GL_RGB, GL_UNSIGNED_BYTE, data);
- // Show failure messages
+ // Show failure message
if (glGetError() != GL_NO_ERROR)
+ {
OSD::AddMessage("Error capturing or saving screenshot.", 2000);
+ return false;
+ }
// Turn image upside down
FlipImageData(data, W, H);
#if defined(HAVE_WX) && HAVE_WX
@@ -1296,7 +1290,7 @@ bool Renderer::SaveRenderTarget(const char *filename, int W, int H, int YOffset)
wxImage a(W, H, data);
// ---------------------------------------------------------------------
- // If it's not a 4:3 picture rescale it to 4:3. This only applied to native resolutions.
+ // If it's not a 4:3 picture rescale it to 4:3. This only applies to native resolutions.
// ŻŻŻŻŻŻŻŻŻŻŻŻŻ
// Todo: There is currently no adjustment for non-16:9 source pictures that are intended for a 16:9
// size because I think all Wii 16:9 source pictures are 16:9 to begin with. If not, add a 16:9 adjustment
@@ -1304,8 +1298,7 @@ bool Renderer::SaveRenderTarget(const char *filename, int W, int H, int YOffset)
// ŻŻŻŻŻŻŻŻŻŻŻŻŻ
/**/
float Ratio = (float)W / (float)(H);
- // Don't bother with 1.25 resolutions either, for example 1280 x 1024
- if (g_Config.bNativeResolution && Ratio != 4.0/3.0 && Ratio != 1.25 && Ratio != 16.0/9.0)
+ if (g_Config.bNativeResolution && Ratio != 4.0/3.0 && Ratio != 16.0/9.0)
{
// Check if the height or width should be changed
if (Ratio < 4.0/3.0)