Fix clamping of screen index value

This commit is contained in:
Jordy Ruiz 2019-02-21 11:58:15 +01:00
parent 8e8e05c4f3
commit a9b4f8ad8c

View file

@ -657,7 +657,7 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
m_NumScreens = SDL_GetNumVideoDisplays(); m_NumScreens = SDL_GetNumVideoDisplays();
if(m_NumScreens > 0) if(m_NumScreens > 0)
{ {
clamp(*Screen, 0, m_NumScreens-1); *Screen = clamp(*Screen, 0, m_NumScreens-1);
if(SDL_GetDisplayBounds(*Screen, &ScreenPos) != 0) if(SDL_GetDisplayBounds(*Screen, &ScreenPos) != 0)
{ {
dbg_msg("gfx", "unable to retrieve screen information: %s", SDL_GetError()); dbg_msg("gfx", "unable to retrieve screen information: %s", SDL_GetError());