summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJohn Peterson <jpeterson57@gmail.com>2009-06-08 03:17:15 +0000
committerJohn Peterson <jpeterson57@gmail.com>2009-06-08 03:17:15 +0000
commit299c4f8f1bf96bc84e35d896c223a958d2fa948e (patch)
treec9d9b11abe60f86b756ad54b4720e50e14ec6f27 /Source
parent669146916476fd6244e7d0dca5dbd88a001a71a5 (diff)
OpenGL: Fixed crop
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3370 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/Render.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
index 4206c80533..8aee7ee867 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
@@ -833,17 +833,15 @@ void ComputeBackbufferRectangle(TRectangle *rc)
// The new width and height
FloatGLWidth = FloatGLWidth * Ratio;
FloatGLHeight = FloatGLHeight * Ratio;
- // We need this adjustment too, the -6 adjustment was needed to never show any pixels outside the actual picture
- // The result in offset in actual pixels is only around 1 or 2 pixels in a 1280 x 1024 resolution. In 1280 x 1024 the
- // picture is only about 2 to 4 pixels (1 up and 1 down for example) to big to produce a minimal margin
- // of error, while rather having a full screen and hiding one pixel, than having a one pixel black border. But it seems
- // to be just enough in all games I tried.
- float WidthRatio = ((float)FloatGLWidth - 6.0) / 640.0;
- float HeightRatio = ((float)FloatGLHeight - 6.0) / 480.0;
+ // The new width and height ratio
+ float WidthRatio = ((float)FloatGLWidth) / 640.0;
+ float HeightRatio = ((float)FloatGLHeight) / 480.0;
// Adjust the X and Y offset
- FloatXOffset = FloatXOffset - (IncreasedWidth / 2.0 / WidthRatio / Ratio);
- FloatYOffset = FloatYOffset - (IncreasedHeight / 2.0 / HeightRatio / Ratio);
- //DEBUG_LOG(CONSOLE, "Crop Ratio:%1.2f IncreasedHeight:%3.0f YOffset:%3.0f", Ratio, IncreasedHeight, FloatYOffset);
+ FloatXOffset = FloatXOffset - (IncreasedWidth / 2.0);
+ FloatYOffset = FloatYOffset - (IncreasedHeight / 2.0);
+ //NOTICE_LOG(OSREPORT, "Crop Ratio:%1.2f IncreasedHeight:%3.0f YOffset:%3.0f", Ratio, IncreasedHeight, FloatYOffset);
+ //NOTICE_LOG(OSREPORT, "Crop FloatGLWidth:%1.2f FloatGLHeight:%3.0f", (float)FloatGLWidth, (float)FloatGLHeight);
+ //NOTICE_LOG(OSREPORT, "");
}
// round(float) = floor(float + 0.5)