Index: ddraw/glDirectDraw.cpp |
— | — | @@ -1750,6 +1750,7 @@ |
1751 | 1751 | }
|
1752 | 1752 | extern "C" BOOL glDirectDraw7_GetFullscreen(glDirectDraw7 *glDD7)
|
1753 | 1753 | {
|
| 1754 | + if (!glDD7) return FALSE;
|
1754 | 1755 | if (glDD7->GetFullscreen()) return TRUE;
|
1755 | 1756 | else return FALSE;
|
1756 | 1757 | }
|
Index: ddraw/glRenderWindow.cpp |
— | — | @@ -177,28 +177,7 @@ |
178 | 178 | case WM_XBUTTONDBLCLK:
|
179 | 179 | case WM_MOUSEHWHEEL:
|
180 | 180 | hParent = GetParent(hwnd);
|
181 | | - if(((dxglcfg.scaler != 0) || ((dxglcfg.fullmode >= 2) && (dxglcfg.fullmode <= 4)))
|
182 | | - && ddInterface->GetFullscreen())
|
183 | | - {
|
184 | | - oldx = LOWORD(lParam);
|
185 | | - oldy = HIWORD(lParam);
|
186 | | - ddInterface->GetSizes(sizes);
|
187 | | - mulx = (float)sizes[2] / (float)sizes[0];
|
188 | | - muly = (float)sizes[3] / (float)sizes[1];
|
189 | | - translatex = (sizes[4]-sizes[0])/2;
|
190 | | - translatey = (sizes[5]-sizes[1])/2;
|
191 | | - oldx -= translatex;
|
192 | | - oldy -= translatey;
|
193 | | - oldx = (int)((float)oldx * mulx);
|
194 | | - oldy = (int)((float)oldy * muly);
|
195 | | - if(oldx < 0) oldx = 0;
|
196 | | - if(oldy < 0) oldy = 0;
|
197 | | - if(oldx >= sizes[2]) oldx = sizes[2]-1;
|
198 | | - if(oldy >= sizes[3]) oldy = sizes[3]-1;
|
199 | | - newpos = oldx + (oldy << 16);
|
200 | | - return SendMessage(hParent,msg,wParam,newpos);
|
201 | | - }
|
202 | | - else return SendMessage(hParent,msg,wParam,lParam);
|
| 181 | + return SendMessage(hParent,msg,wParam,lParam);
|
203 | 182 | case WM_CLOSE:
|
204 | 183 | DestroyWindow(hWnd);
|
205 | 184 | return 0;
|
Index: ddraw/hooks.c |
— | — | @@ -272,10 +272,15 @@ |
273 | 273 | HWND_HOOK *wndhook;
|
274 | 274 | STYLESTRUCT *style;
|
275 | 275 | RECT r1, r2;
|
| 276 | + POINT pt;
|
276 | 277 | LONG sizes[6];
|
277 | 278 | BOOL fixstyle = FALSE;
|
278 | 279 | LONG winstyle, exstyle;
|
279 | 280 | LPDIRECTDRAW7 lpDD7;
|
| 281 | + int oldx, oldy;
|
| 282 | + float mulx, muly;
|
| 283 | + int translatex, translatey;
|
| 284 | + LPARAM newpos;
|
280 | 285 | wndhook = GetWndHook(hWnd);
|
281 | 286 | if (!wndhook)
|
282 | 287 | {
|
— | — | @@ -398,6 +403,78 @@ |
399 | 404 | if (lpDD7 && (dxglcfg.fullmode < 2)) glDirectDraw7_UnrestoreDisplayMode(lpDD7);
|
400 | 405 | }
|
401 | 406 | break;
|
| 407 | + case WM_MOUSEMOVE:
|
| 408 | + case WM_LBUTTONDOWN:
|
| 409 | + case WM_LBUTTONUP:
|
| 410 | + case WM_LBUTTONDBLCLK:
|
| 411 | + case WM_RBUTTONDOWN:
|
| 412 | + case WM_RBUTTONUP:
|
| 413 | + case WM_RBUTTONDBLCLK:
|
| 414 | + case WM_MBUTTONDOWN:
|
| 415 | + case WM_MBUTTONUP:
|
| 416 | + case WM_MBUTTONDBLCLK:
|
| 417 | + case WM_XBUTTONDOWN:
|
| 418 | + case WM_XBUTTONUP:
|
| 419 | + case WM_XBUTTONDBLCLK:
|
| 420 | + if (lpDD7)
|
| 421 | + {
|
| 422 | + if (((dxglcfg.scaler != 0) || ((dxglcfg.fullmode >= 2) && (dxglcfg.fullmode <= 4)))
|
| 423 | + && glDirectDraw7_GetFullscreen(lpDD7))
|
| 424 | + {
|
| 425 | + oldx = LOWORD(lParam);
|
| 426 | + oldy = HIWORD(lParam);
|
| 427 | + glDirectDraw7_GetSizes(lpDD7, sizes);
|
| 428 | + mulx = (float)sizes[2] / (float)sizes[0];
|
| 429 | + muly = (float)sizes[3] / (float)sizes[1];
|
| 430 | + translatex = (sizes[4] - sizes[0]) / 2;
|
| 431 | + translatey = (sizes[5] - sizes[1]) / 2;
|
| 432 | + oldx -= translatex;
|
| 433 | + oldy -= translatey;
|
| 434 | + oldx = (int)((float)oldx * mulx);
|
| 435 | + oldy = (int)((float)oldy * muly);
|
| 436 | + if (oldx < 0) oldx = 0;
|
| 437 | + if (oldy < 0) oldy = 0;
|
| 438 | + if (oldx >= sizes[2]) oldx = sizes[2] - 1;
|
| 439 | + if (oldy >= sizes[3]) oldy = sizes[3] - 1;
|
| 440 | + newpos = oldx + (oldy << 16);
|
| 441 | + return CallWindowProc(parentproc, hWnd, uMsg, wParam, newpos);
|
| 442 | + }
|
| 443 | + else return CallWindowProc(parentproc, hWnd, uMsg, wParam, lParam);
|
| 444 | + }
|
| 445 | + else return CallWindowProc(parentproc, hWnd, uMsg, wParam, lParam);
|
| 446 | + case WM_MOUSEWHEEL:
|
| 447 | + case WM_MOUSEHWHEEL:
|
| 448 | + if (lpDD7)
|
| 449 | + {
|
| 450 | + if (((dxglcfg.scaler != 0) || ((dxglcfg.fullmode >= 2) && (dxglcfg.fullmode <= 4)))
|
| 451 | + && glDirectDraw7_GetFullscreen(lpDD7))
|
| 452 | + {
|
| 453 | + oldx = LOWORD(lParam);
|
| 454 | + oldy = HIWORD(lParam);
|
| 455 | + glDirectDraw7_GetSizes(lpDD7, sizes);
|
| 456 | + mulx = (float)sizes[2] / (float)sizes[0];
|
| 457 | + muly = (float)sizes[3] / (float)sizes[1];
|
| 458 | + translatex = (sizes[4] - sizes[0]) / 2;
|
| 459 | + translatey = (sizes[5] - sizes[1]) / 2;
|
| 460 | + oldx -= translatex;
|
| 461 | + oldy -= translatey;
|
| 462 | + pt.x = 0;
|
| 463 | + pt.y = 0;
|
| 464 | + ClientToScreen(hWnd, &pt);
|
| 465 | + oldx -= pt.x;
|
| 466 | + oldy -= pt.y;
|
| 467 | + oldx = (int)((float)oldx * mulx);
|
| 468 | + oldy = (int)((float)oldy * muly);
|
| 469 | + if (oldx < 0) oldx = 0;
|
| 470 | + if (oldy < 0) oldy = 0;
|
| 471 | + if (oldx >= sizes[2]) oldx = sizes[2] - 1;
|
| 472 | + if (oldy >= sizes[3]) oldy = sizes[3] - 1;
|
| 473 | + newpos = oldx + (oldy << 16);
|
| 474 | + return CallWindowProc(parentproc, hWnd, uMsg, wParam, newpos);
|
| 475 | + }
|
| 476 | + else return CallWindowProc(parentproc, hWnd, uMsg, wParam, lParam);
|
| 477 | + }
|
| 478 | + else return CallWindowProc(parentproc, hWnd, uMsg, wParam, lParam);
|
402 | 479 | case WM_SIZE:
|
403 | 480 | if (wParam != SIZE_MINIMIZED)
|
404 | 481 | {
|