From 909c0ec5a140e7aef25e454fa413e93c5eb226e3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 23 Sep 2009 07:01:50 +0000 Subject: [PATCH] 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. --HG-- branch : SDL-1.2 extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403887 --- src/video/gapi/SDL_gapivideo.c | 7 ++++++- src/video/windib/SDL_dibevents.c | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/video/gapi/SDL_gapivideo.c b/src/video/gapi/SDL_gapivideo.c index 34e3b129e..2cb05a432 100644 --- a/src/video/gapi/SDL_gapivideo.c +++ b/src/video/gapi/SDL_gapivideo.c @@ -776,9 +776,14 @@ SDL_Surface *GAPI_SetVideoMode(_THIS, SDL_Surface *current, */ WIN_FlushMessageQueue(); - /* Open GAPI display */ + /* Open GAPI display */ if( !gapi->useVga && gapi->useGXOpenDisplay && !gapi->alreadyGXOpened ) { +#if REPORT_VIDEO_INFO + printf("system display width (orig): %d\n", GetSystemMetrics(SM_CXSCREEN)); + printf("system display height (orig): %d\n", GetSystemMetrics(SM_CYSCREEN)); +#endif + gapi->hiresFix = (width > GetSystemMetrics(SM_CXSCREEN)) || (height > GetSystemMetrics(SM_CYSCREEN)); gapi->alreadyGXOpened = 1; if( !gapi->gxFunc.GXOpenDisplay(SDL_Window, GX_FULLSCREEN) ) { diff --git a/src/video/windib/SDL_dibevents.c b/src/video/windib/SDL_dibevents.c index af9ceee74..06548778e 100644 --- a/src/video/windib/SDL_dibevents.c +++ b/src/video/windib/SDL_dibevents.c @@ -92,6 +92,12 @@ static void GapiTransform(GapiInfo *gapiInfo, LONG *x, LONG *y) { Sint16 rotatedX; Sint16 rotatedY; + if(gapiInfo->hiresFix) + { + *x *= 2; + *y *= 2; + } + if(gapiInfo->userOrientation == SDL_ORIENTATION_UP && gapiInfo->gapiOrientation == SDL_ORIENTATION_RIGHT) {