Fixed bug #803 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Wed, 23 Sep 2009 07:01:50 +0000
branchSDL-1.2
changeset 4238cbe5222d051a
parent 4237 0adda8ff43ef
child 4239 3d467ee2af5e
Fixed bug #803

Andrey 2009-09-21 19:14:43 PDT

gapi->hiresFix depends on the parameters GetSystemMetrics (SM_CXSCREEN) and
GetSystemMetrics (SM_CXSCREEN).
After the "Open GAPI display" they are changing.
Small patch fixed it.
src/video/gapi/SDL_gapivideo.c
src/video/windib/SDL_dibevents.c
     1.1 --- a/src/video/gapi/SDL_gapivideo.c	Wed Sep 23 06:57:12 2009 +0000
     1.2 +++ b/src/video/gapi/SDL_gapivideo.c	Wed Sep 23 07:01:50 2009 +0000
     1.3 @@ -776,9 +776,14 @@
     1.4  	*/
     1.5  	WIN_FlushMessageQueue();
     1.6  
     1.7 -	/* Open GAPI display */
     1.8 +       /* Open GAPI display */
     1.9         if( !gapi->useVga && gapi->useGXOpenDisplay && !gapi->alreadyGXOpened )
    1.10         {
    1.11 +#if REPORT_VIDEO_INFO
    1.12 +               printf("system display width  (orig): %d\n", GetSystemMetrics(SM_CXSCREEN));
    1.13 +               printf("system display height (orig): %d\n", GetSystemMetrics(SM_CYSCREEN));
    1.14 +#endif
    1.15 +               gapi->hiresFix = (width > GetSystemMetrics(SM_CXSCREEN)) || (height > GetSystemMetrics(SM_CYSCREEN));
    1.16                 gapi->alreadyGXOpened = 1;
    1.17  		if( !gapi->gxFunc.GXOpenDisplay(SDL_Window, GX_FULLSCREEN) )
    1.18  		{
     2.1 --- a/src/video/windib/SDL_dibevents.c	Wed Sep 23 06:57:12 2009 +0000
     2.2 +++ b/src/video/windib/SDL_dibevents.c	Wed Sep 23 07:01:50 2009 +0000
     2.3 @@ -92,6 +92,12 @@
     2.4      Sint16 rotatedX;
     2.5      Sint16 rotatedY;
     2.6  
     2.7 +    if(gapiInfo->hiresFix)
     2.8 +    {
     2.9 +	*x *= 2;
    2.10 +	*y *= 2;
    2.11 +    }
    2.12 +
    2.13      if(gapiInfo->userOrientation == SDL_ORIENTATION_UP &&
    2.14         gapiInfo->gapiOrientation == SDL_ORIENTATION_RIGHT)
    2.15      {