Skip to content

Commit

Permalink
Fixed bug #803
Browse files Browse the repository at this point in the history
 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.
  • Loading branch information
slouken committed Sep 23, 2009
1 parent 12a0cbb commit 2b9690c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/video/gapi/SDL_gapivideo.c
Expand Up @@ -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) )
{
Expand Down
6 changes: 6 additions & 0 deletions src/video/windib/SDL_dibevents.c
Expand Up @@ -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)
{
Expand Down

0 comments on commit 2b9690c

Please sign in to comment.