mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
- Do not set the mouse pointer if the display is 8 bit, since such displays don't support color cursors.
SVN r3734 (trunk)
This commit is contained in:
parent
ca33d55bd3
commit
8673743139
6 changed files with 27 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ public:
|
|||
#ifdef _WIN32
|
||||
void PaletteChanged() {}
|
||||
int QueryNewPalette() { return 0; }
|
||||
bool Is8BitMode() { return false; }
|
||||
#endif
|
||||
|
||||
float Gamma;
|
||||
|
|
|
@ -406,6 +406,7 @@ public:
|
|||
#ifdef _WIN32
|
||||
virtual void PaletteChanged () = 0;
|
||||
virtual int QueryNewPalette () = 0;
|
||||
virtual bool Is8BitMode() = 0;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue