From a5f2d8b91672b13a856e8e21975607767479ce5e Mon Sep 17 00:00:00 2001 From: Marc Date: Sat, 7 Mar 2009 21:34:45 +0000 Subject: [PATCH] 2085 part 2: ported '4 pixels width increment' bugfix to linux, and to 1.72-maintenance git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2086 127b21dd-08f5-0310-b4b7-95ae10353056 --- src/SDL/MyOpenGLView.m | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/SDL/MyOpenGLView.m b/src/SDL/MyOpenGLView.m index a94cc5f9..5fb982dc 100644 --- a/src/SDL/MyOpenGLView.m +++ b/src/SDL/MyOpenGLView.m @@ -161,7 +161,7 @@ MA 02110-1301, USA. #if !SDL_SPLASH - //Windows TODO: decouple mouse boundaries, snapshots & planet roundness from initial setVideoMode resolution. + // new SDL.dll decouples mouse boundaries, snapshots & planet roundness from SetVideoMode. surface = SDL_SetVideoMode(firstScreen.width, firstScreen.height, 32, videoModeFlags); // blank the surface / go to fullscreen [self initialiseGLWithSize: firstScreen]; @@ -225,6 +225,7 @@ MA 02110-1301, USA. videoModeFlags |= (fullScreen) ? SDL_FULLSCREEN : SDL_RESIZABLE; surface = SDL_SetVideoMode(firstScreen.width, firstScreen.height, 32, videoModeFlags); + SDL_putenv ("SDL_VIDEO_WINDOW_POS=none"); //stop linux from auto centering on resize #endif @@ -639,7 +640,7 @@ MA 02110-1301, USA. GetClientRect(SDL_Window, &wDC); - // change width only in 4 pixels steps! (see snapShot method) + // change width in 4 pixels steps! (see snapShot method) if (!fullScreen && (bounds.size.width != wDC.right - wDC.left || bounds.size.height != wDC.bottom - wDC.top)) { @@ -669,9 +670,13 @@ MA 02110-1301, USA. } else { - videoModeFlags |= SDL_RESIZABLE;; + videoModeFlags |= SDL_RESIZABLE; } - surface = SDL_SetVideoMode((int)v_size.width, (int)v_size.height, 32, videoModeFlags); + // change width in 4 pixels steps! (see snapShot method) + int w=viewSize.width; + if (w & 3) w = w + 4 - (w & 3); + viewSize.width=w; + surface = SDL_SetVideoMode((int)viewSize.width, (int)viewSize.height, 32, videoModeFlags); bounds.size.width = surface->w; bounds.size.height = surface->h;