Changeset View
Changeset View
Standalone View
Standalone View
source/ps/VideoMode.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void CVideoMode::ReadConfig() | void CVideoMode::ReadConfig() | ||||
{ | { | ||||
bool windowed = !m_ConfigFullscreen; | bool windowed = !m_ConfigFullscreen; | ||||
CFG_GET_VAL("windowed", windowed); | CFG_GET_VAL("windowed", windowed); | ||||
m_ConfigFullscreen = !windowed; | m_ConfigFullscreen = !windowed; | ||||
CFG_GET_VAL("gui.scale", m_Scale); | |||||
CFG_GET_VAL("xres", m_ConfigW); | CFG_GET_VAL("xres", m_ConfigW); | ||||
CFG_GET_VAL("yres", m_ConfigH); | CFG_GET_VAL("yres", m_ConfigH); | ||||
CFG_GET_VAL("bpp", m_ConfigBPP); | CFG_GET_VAL("bpp", m_ConfigBPP); | ||||
CFG_GET_VAL("display", m_ConfigDisplay); | CFG_GET_VAL("display", m_ConfigDisplay); | ||||
CFG_GET_VAL("hidpi", m_ConfigEnableHiDPI); | CFG_GET_VAL("hidpi", m_ConfigEnableHiDPI); | ||||
CFG_GET_VAL("vsync", m_ConfigVSync); | CFG_GET_VAL("vsync", m_ConfigVSync); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | bool CVideoMode::ResizeWindow(int w, int h) | ||||
m_WindowedW = w; | m_WindowedW = w; | ||||
m_WindowedH = h; | m_WindowedH = h; | ||||
UpdateRenderer(w, h); | UpdateRenderer(w, h); | ||||
return true; | return true; | ||||
} | } | ||||
void CVideoMode::Rescale(float scale) | |||||
{ | |||||
ENSURE(m_IsInitialised); | |||||
m_Scale = scale; | |||||
UpdateRenderer(m_CurrentW, m_CurrentH); | |||||
} | |||||
float CVideoMode::GetScale() const | |||||
{ | |||||
return m_Scale; | |||||
} | |||||
bool CVideoMode::SetFullscreen(bool fullscreen) | bool CVideoMode::SetFullscreen(bool fullscreen) | ||||
{ | { | ||||
// This might get called before initialisation by psDisplayError; | // This might get called before initialisation by psDisplayError; | ||||
// if so then silently fail | // if so then silently fail | ||||
if (!m_IsInitialised) | if (!m_IsInitialised) | ||||
return false; | return false; | ||||
// Check whether this is actually a change | // Check whether this is actually a change | ||||
▲ Show 20 Lines • Show All 196 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator