OGL plugin: +Autoscale option (attempts to remove borders, even without XFB). Lots of cleanup, especially around aspect ratio and similar stuff. MP2 scanner still broken, wonder when that happened?

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2470 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-02-28 16:33:59 +00:00
parent 11fd8062ad
commit 6dc4194767
22 changed files with 460 additions and 729 deletions

View File

@ -100,9 +100,9 @@ void GetMousePos(float& x, float& y)
// Calculate the new X offset
// ----------------
// Move the left of the picture to the middle of the screen
XOffset = XOffset + WinWidth / 2.0;
XOffset = XOffset + WinWidth / 2.0f;
// Then remove half the picture height to move it to the horizontal center
XOffset = XOffset - PictureWidth / 2.0;
XOffset = XOffset - PictureWidth / 2.0f;
// --------------------
}
// The window is to high, we have to limit the height
@ -112,7 +112,7 @@ void GetMousePos(float& x, float& y)
// Calculate the new width and height for glViewport, this is not the actual size of either the picture or the screen
// ----------------
// Invert the ratio to make it > 1
Ratio = 1.0 / Ratio;
Ratio = 1.0f / Ratio;
PictureHeight = WinHeight / Ratio;
// --------------------
@ -120,9 +120,9 @@ void GetMousePos(float& x, float& y)
// Calculate the new Y offset
// ----------------
// Move the top of the picture to the middle of the screen
YOffset = YOffset + WinHeight / 2.0;
YOffset = YOffset + WinHeight / 2.0f;
// Then remove half the picture height to move it to the vertical center
YOffset = YOffset - PictureHeight / 2.0;
YOffset = YOffset - PictureHeight / 2.0f;
// --------------------
}
// Logging
@ -141,11 +141,11 @@ void GetMousePos(float& x, float& y)
// ------------------
if ((g_Config.bKeepAR43 || g_Config.bKeepAR169) && g_Config.bCrop)
{
float Ratio = g_Config.bKeepAR43 ? ((4.0 / 3.0) / (5.0 / 4.0)) : (((16.0 / 9.0) / (16.0 / 10.0)));
float Ratio = g_Config.bKeepAR43 ? ((4.0f / 3.0f) / (5.0f / 4.0f)) : (((16.0f / 9.0f) / (16.0f / 10.0f)));
// The width and height we will add (calculate this before PictureWidth and PictureHeight is adjusted)
float IncreasedWidth = (Ratio - 1.0) * PictureWidth;
float IncreasedHeight = (Ratio - 1.0) * PictureHeight;
float IncreasedWidth = (Ratio - 1.0f) * PictureWidth;
float IncreasedHeight = (Ratio - 1.0f) * PictureHeight;
// The new width and height
PictureWidth = PictureWidth * Ratio;