forked from Mirrors/openclonk
Change C4AbstractApp:SetVideoMode spatial resolution parameters to signed int.
The magic value -1 is used to denote "current screen mode", but it has trouble fitting into the unsigned concept. An alternative would be to use 0 as the magic value, but that would include quite a few places (including existing configuration settings) to change.Controls
parent
7d9f7aee02
commit
43165e24cd
|
@ -92,7 +92,7 @@ public:
|
|||
virtual void Quit();
|
||||
|
||||
bool GetIndexedDisplayMode(int32_t iIndex, int32_t *piXRes, int32_t *piYRes, int32_t *piBitDepth, int32_t *piRefreshRate, uint32_t iMonitor);
|
||||
bool SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigned int iColorDepth, unsigned int iRefreshRate, unsigned int iMonitor, bool fFullScreen);
|
||||
bool SetVideoMode(int iXRes, int iYRes, unsigned int iColorDepth, unsigned int iRefreshRate, unsigned int iMonitor, bool fFullScreen);
|
||||
void RestoreVideoMode();
|
||||
|
||||
virtual bool DoScheduleProcs(int iTimeout);
|
||||
|
|
|
@ -132,7 +132,7 @@ bool C4AbstractApp::FlushMessages()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool C4AbstractApp::SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigned int iColorDepth, unsigned int iRefreshRate, unsigned int iMonitor, bool fFullScreen)
|
||||
bool C4AbstractApp::SetVideoMode(int iXRes, int iYRes, unsigned int iColorDepth, unsigned int iRefreshRate, unsigned int iMonitor, bool fFullScreen)
|
||||
{
|
||||
Display * const dpy = gdk_x11_display_get_xdisplay(gdk_display_get_default());
|
||||
if (!fFullScreen)
|
||||
|
|
|
@ -156,7 +156,7 @@ StdStrBuf C4AbstractApp::GetGameDataPath()
|
|||
return StdCopyStrBuf([[[NSBundle mainBundle] resourcePath] fileSystemRepresentation]);
|
||||
}
|
||||
|
||||
bool C4AbstractApp::SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigned int iColorDepth, unsigned int iRefreshRate, unsigned int iMonitor, bool fFullScreen)
|
||||
bool C4AbstractApp::SetVideoMode(int iXRes, int iYRes, unsigned int iColorDepth, unsigned int iRefreshRate, unsigned int iMonitor, bool fFullScreen)
|
||||
{
|
||||
fFullScreen &= !lionAndBeyond(); // Always false for Lion since then Lion's true(tm) Fullscreen is used
|
||||
C4WindowController* controller = pWindow->objectiveCObject<C4WindowController>();
|
||||
|
|
|
@ -249,7 +249,7 @@ bool C4AbstractApp::GetIndexedDisplayMode(int32_t iIndex, int32_t *piXRes, int32
|
|||
return true;
|
||||
}
|
||||
|
||||
bool C4AbstractApp::SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigned int iColorDepth, unsigned int RefreshRate, unsigned int iMonitor, bool fFullScreen)
|
||||
bool C4AbstractApp::SetVideoMode(int iXRes, int iYRes, unsigned int iColorDepth, unsigned int RefreshRate, unsigned int iMonitor, bool fFullScreen)
|
||||
{
|
||||
//RECT r;
|
||||
//pWindow->GetSize(&r);
|
||||
|
|
|
@ -873,7 +873,7 @@ void C4AbstractApp::RestoreVideoMode()
|
|||
{
|
||||
}
|
||||
|
||||
bool C4AbstractApp::SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigned int iColorDepth, unsigned int iRefreshRate, unsigned int iMonitor, bool fFullScreen)
|
||||
bool C4AbstractApp::SetVideoMode(int iXRes, int iYRes, unsigned int iColorDepth, unsigned int iRefreshRate, unsigned int iMonitor, bool fFullScreen)
|
||||
{
|
||||
#ifndef USE_CONSOLE
|
||||
SetWindowLong(pWindow->hWindow, GWL_EXSTYLE,
|
||||
|
@ -935,7 +935,7 @@ bool C4AbstractApp::SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigne
|
|||
int i=0;
|
||||
if (!fFound) while (EnumDisplaySettingsW(Mon.GetWideChar(), i++, &dmode))
|
||||
// compare enumerated mode with requested settings
|
||||
if (dmode.dmPelsWidth==iXRes && dmode.dmPelsHeight==iYRes && dmode.dmBitsPerPel==iColorDepth && dmode.dmDisplayOrientation==orientation
|
||||
if (static_cast<int>(dmode.dmPelsWidth) == iXRes && static_cast<int>(dmode.dmPelsHeight) == iYRes && dmode.dmBitsPerPel == iColorDepth && dmode.dmDisplayOrientation == orientation
|
||||
&& (iRefreshRate == 0 || dmode.dmDisplayFrequency == iRefreshRate))
|
||||
{
|
||||
fFound=true;
|
||||
|
|
Loading…
Reference in New Issue