From 7c7a1d659ba8180803f01c7433ab6fb6e9a29209 Mon Sep 17 00:00:00 2001 From: mightymax Date: Sun, 14 Jan 2007 19:27:18 +0000 Subject: [PATCH] missed one touchscreen calculation for scaling, done now --- desmume/src/windows/main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/desmume/src/windows/main.c b/desmume/src/windows/main.c index d0720aec5..76a1029ca 100644 --- a/desmume/src/windows/main.c +++ b/desmume/src/windows/main.c @@ -753,8 +753,25 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM case WM_LBUTTONDOWN: if(HIWORD(lParam)>=192) { + RECT r ; s32 x = (s32)((s16)LOWORD(lParam)); s32 y = (s32)((s16)HIWORD(lParam)); + GetClientRect(hwnd,&r) ; + /* translate from scaling (screen reoltution to 256x384 or 512x192) */ + switch (GPU_rotation) + { + case 0: + case 180: + x = (x*256) / (r.right - r.left) ; + y = (y*384) / (r.bottom - r.top) ; + break ; + case 90: + case 270: + x = (x*512) / (r.right - r.left) ; + y = (y*192) / (r.bottom - r.top) ; + break ; + } + /* translate for rotation */ if (GPU_rotation != 0) translateXY(&x,&y); else