From c2351483dc7c918a592f2a1f52745c6552fb7d0c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 30 Jan 2012 17:03:58 +0300 Subject: Add option for enable/disable window resize. --- src/client.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 2d4de8a9f..18318acb6 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -524,9 +524,11 @@ void Client::gameInit() const int bpp = 0; const bool fullscreen = config.getBoolValue("screen"); const bool hwaccel = config.getBoolValue("hwaccel"); + const bool enableResize = config.getBoolValue("enableresize"); // Try to set the desired video mode - if (!mainGraphics->setVideoMode(width, height, bpp, fullscreen, hwaccel)) + if (!mainGraphics->setVideoMode(width, height, bpp, + fullscreen, hwaccel, enableResize)) { logger->log(strprintf("Couldn't set %dx%dx%d video mode: %s", width, height, bpp, SDL_GetError())); @@ -544,7 +546,7 @@ void Client::gameInit() config.setValueInt("screenheight", oldHeight); config.setValue("screen", oldFullscreen); if (!mainGraphics->setVideoMode(oldWidth, oldHeight, bpp, - oldFullscreen, hwaccel)) + oldFullscreen, hwaccel, enableResize)) { logger->error(strprintf("Couldn't restore %dx%dx%d " "video mode: %s", oldWidth, oldHeight, bpp, @@ -2368,7 +2370,7 @@ void Client::resizeVideo(int width, int height) if (mainGraphics->mWidth == width && mainGraphics->mHeight == height) return; - if (mainGraphics->resize(width, height)) + if (mainGraphics->resizeScreen(width, height)) { if (gui) gui->videoResized(); -- cgit v1.2.3-60-g2f50