mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-25 13:21:27 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
887014c322
4 changed files with 27 additions and 37 deletions
|
@ -1028,28 +1028,6 @@ bool D3DFB::IsFullscreen ()
|
|||
return !Windowed;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// D3DFB :: ScaleCoordsFromWindow
|
||||
//
|
||||
// Given coordinates in window space, return coordinates in what the game
|
||||
// thinks screen space is.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void D3DFB::ScaleCoordsFromWindow(SWORD &x, SWORD &y)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
if (GetClientRect(Window, &rect))
|
||||
{
|
||||
x = SWORD(x * Width / (rect.right - rect.left));
|
||||
y = SWORD(y * TrueHeight / (rect.bottom - rect.top));
|
||||
}
|
||||
// Subtract letterboxing borders
|
||||
y -= (TrueHeight - Height) / 2;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// D3DFB :: Lock
|
||||
|
|
|
@ -806,19 +806,6 @@ bool DDrawFB::Is8BitMode()
|
|||
return vid_displaybits == 8;
|
||||
}
|
||||
|
||||
void DDrawFB::ScaleCoordsFromWindow(SWORD &x, SWORD &y)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
if (GetClientRect(Window, &rect))
|
||||
{
|
||||
x = SWORD(x * Width / (rect.right - rect.left));
|
||||
y = SWORD(y * TrueHeight / (rect.bottom - rect.top));
|
||||
}
|
||||
// Subtract letterboxing borders
|
||||
y -= (TrueHeight - Height) / 2;
|
||||
}
|
||||
|
||||
bool DDrawFB::IsValid ()
|
||||
{
|
||||
return PrimarySurf != NULL;
|
||||
|
|
|
@ -127,10 +127,12 @@ public:
|
|||
virtual void Blank () = 0;
|
||||
virtual bool PaintToWindow () = 0;
|
||||
virtual HRESULT GetHR () = 0;
|
||||
virtual void ScaleCoordsFromWindow(SWORD &x, SWORD &y);
|
||||
|
||||
protected:
|
||||
virtual bool CreateResources () = 0;
|
||||
virtual void ReleaseResources () = 0;
|
||||
virtual int GetTrueHeight() { return GetHeight(); }
|
||||
|
||||
bool Windowed;
|
||||
|
||||
|
@ -165,7 +167,7 @@ public:
|
|||
void NewRefreshRate();
|
||||
HRESULT GetHR ();
|
||||
bool Is8BitMode();
|
||||
void ScaleCoordsFromWindow(SWORD &x, SWORD &y);
|
||||
virtual int GetTrueHeight() { return TrueHeight; }
|
||||
|
||||
void Blank ();
|
||||
bool PaintToWindow ();
|
||||
|
@ -270,7 +272,7 @@ public:
|
|||
void WipeCleanup();
|
||||
HRESULT GetHR ();
|
||||
bool Is8BitMode() { return false; }
|
||||
void ScaleCoordsFromWindow(SWORD &x, SWORD &y);
|
||||
virtual int GetTrueHeight() { return TrueHeight; }
|
||||
|
||||
private:
|
||||
friend class D3DTex;
|
||||
|
|
|
@ -736,6 +736,29 @@ void Win32Video::SetWindowedScale (float scale)
|
|||
// FIXME
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// BaseWinFB :: ScaleCoordsFromWindow
|
||||
//
|
||||
// Given coordinates in window space, return coordinates in what the game
|
||||
// thinks screen space is.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void BaseWinFB::ScaleCoordsFromWindow(SWORD &x, SWORD &y)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
int TrueHeight = GetTrueHeight();
|
||||
if (GetClientRect(Window, &rect))
|
||||
{
|
||||
x = SWORD(x * Width / (rect.right - rect.left));
|
||||
y = SWORD(y * TrueHeight / (rect.bottom - rect.top));
|
||||
}
|
||||
// Subtract letterboxing borders
|
||||
y -= (TrueHeight - Height) / 2;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SetFPSLimit
|
||||
|
|
Loading…
Reference in a new issue