From 5fcac9b5f1848aa7f90a274e67ac06dab69b3175 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 14 Sep 2010 20:53:12 +0000 Subject: [PATCH] - fixed: The default GetPixelDoubling function in DFrameBuffer returned 1 instead of 0. - copied a NULL pointer check for screen from GZDoom. SVN r2776 (trunk) --- src/v_video.h | 2 +- src/win32/i_input.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/v_video.h b/src/v_video.h index 14782519cc..8d492c7b4f 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -412,7 +412,7 @@ public: virtual void WipeEndScreen(); virtual bool WipeDo(int ticks); virtual void WipeCleanup(); - virtual int GetPixelDoubling() const { return 1; } + virtual int GetPixelDoubling() const { return 0; } uint32 GetLastFPS() const { return LastCount; } diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index f302d807d0..49915bf29a 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -320,8 +320,12 @@ bool GUIWndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESU { ev.subtype = EV_GUI_MouseMove; } - ev.data1 = LOWORD(lParam) >> screen->GetPixelDoubling(); - ev.data2 = HIWORD(lParam) >> screen->GetPixelDoubling(); + + { + int shift = screen? screen->GetPixelDoubling() : 0; + ev.data1 = LOWORD(lParam) >> shift; + ev.data2 = HIWORD(lParam) >> shift; + } if (wParam & MK_SHIFT) ev.data3 |= GKM_SHIFT; if (wParam & MK_CONTROL) ev.data3 |= GKM_CTRL;