missed one touchscreen calculation for scaling, done now

This commit is contained in:
mightymax 2007-01-14 19:27:18 +00:00
parent 04efc44e8d
commit 7c7a1d659b
1 changed files with 17 additions and 0 deletions

View File

@ -753,8 +753,25 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
if(HIWORD(lParam)>=192) if(HIWORD(lParam)>=192)
{ {
RECT r ;
s32 x = (s32)((s16)LOWORD(lParam)); s32 x = (s32)((s16)LOWORD(lParam));
s32 y = (s32)((s16)HIWORD(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) if (GPU_rotation != 0)
translateXY(&x,&y); translateXY(&x,&y);
else else