From 84bcc3146a0975e3c1c3b5307dc760891c34eb0e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 22 May 2003 08:37:15 +0000 Subject: [PATCH] fix latent viewport bug --- stepmania/src/RageDisplay_D3D.cpp | 2 +- stepmania/src/RageDisplay_OGL.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index a3e17efa4a..5d3c88f85b 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -357,7 +357,7 @@ void RageDisplay::SetViewport(int shift_left, int shift_down) /* left and down are on a 0..SCREEN_WIDTH, 0..SCREEN_HEIGHT scale. * Scale them to the actual viewport range. */ shift_left = int( shift_left * float(g_CurrentWidth) / SCREEN_WIDTH ); - shift_down = int( shift_down * float(g_CurrentWidth) / SCREEN_WIDTH ); + shift_down = int( shift_down * float(g_CurrentHeight) / SCREEN_HEIGHT ); D3DVIEWPORT8 viewData = { shift_left, -shift_down, g_CurrentWidth, g_CurrentHeight, 0.f, 1.f }; g_pd3dDevice->SetViewport( &viewData ); diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index a8174ee2f7..08d4bf08c8 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -293,7 +293,7 @@ void RageDisplay::SetViewport(int shift_left, int shift_down) /* left and down are on a 0..SCREEN_WIDTH, 0..SCREEN_HEIGHT scale. * Scale them to the actual viewport range. */ shift_left = int( shift_left * float(wind->GetWidth()) / SCREEN_WIDTH ); - shift_down = int( shift_down * float(wind->GetWidth()) / SCREEN_WIDTH ); + shift_down = int( shift_down * float(wind->GetHeight()) / SCREEN_HEIGHT ); glViewport(shift_left, -shift_down, wind->GetWidth(), wind->GetHeight()); }