diff --git a/src/d_main.cpp b/src/d_main.cpp index 0919d3acb..a9e02edff 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -682,6 +682,8 @@ void D_Display () // Reload crosshair if transitioned to a different size ST_LoadCrosshair (true); AM_NewResolution (); + // Reset the mouse cursor in case the bit depth changed + vid_cursor.Callback(); } } diff --git a/src/v_video.cpp b/src/v_video.cpp index 17fede1a9..310ca5b2e 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -100,6 +100,7 @@ public: #ifdef _WIN32 void PaletteChanged() {} int QueryNewPalette() { return 0; } + bool Is8BitMode() { return false; } #endif float Gamma; diff --git a/src/v_video.h b/src/v_video.h index 6d97256f9..6aee6d203 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -406,6 +406,7 @@ public: #ifdef _WIN32 virtual void PaletteChanged () = 0; virtual int QueryNewPalette () = 0; + virtual bool Is8BitMode() = 0; #endif protected: diff --git a/src/win32/fb_ddraw.cpp b/src/win32/fb_ddraw.cpp index 937fba046..046c7ed4f 100644 --- a/src/win32/fb_ddraw.cpp +++ b/src/win32/fb_ddraw.cpp @@ -786,6 +786,25 @@ void DDrawFB::RebuildColorTable () } } +bool DDrawFB::Is8BitMode() +{ + if (Windowed) + { + return Write8bit; + } + DDPIXELFORMAT fmt = { sizeof(fmt), }; + HRESULT hr; + + hr = PrimarySurf->GetPixelFormat(&fmt); + if (SUCCEEDED(hr)) + { + return !!(fmt.dwFlags & DDPF_PALETTEINDEXED8); + } + // Can't get the primary surface's pixel format, so assume + // vid_displaybits is accurate. + return vid_displaybits == 8; +} + bool DDrawFB::IsValid () { return PrimarySurf != NULL; diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 7d3dde74a..ae2e86d32 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -1187,7 +1187,8 @@ bool I_SetCursor(FTexture *cursorpic) { HCURSOR cursor; - if (cursorpic != NULL && cursorpic->UseType != FTexture::TEX_Null) + if (cursorpic != NULL && cursorpic->UseType != FTexture::TEX_Null && + (screen == NULL || !screen->Is8BitMode())) { // Must be no larger than 32x32. if (cursorpic->GetWidth() > 32 || cursorpic->GetHeight() > 32) diff --git a/src/win32/win32iface.h b/src/win32/win32iface.h index 66c396a96..ec64f2164 100644 --- a/src/win32/win32iface.h +++ b/src/win32/win32iface.h @@ -164,6 +164,7 @@ public: void NewRefreshRate(); HRESULT GetHR (); virtual int GetTrueHeight() { return TrueHeight; } + bool Is8BitMode(); void Blank (); bool PaintToWindow (); @@ -269,6 +270,7 @@ public: void WipeCleanup(); HRESULT GetHR (); virtual int GetTrueHeight() { return TrueHeight; } + bool Is8BitMode() { return false; } private: friend class D3DTex;