From e8f92c8a476c35f76212ccaccbbb55901a49058e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 2 Feb 2012 19:42:02 +0300 Subject: Add "no frame" option to hide window frame. Disabled by default. --- src/client.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 634fa1e80..c21194834 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -525,10 +525,11 @@ void Client::gameInit() const bool fullscreen = config.getBoolValue("screen"); const bool hwaccel = config.getBoolValue("hwaccel"); const bool enableResize = config.getBoolValue("enableresize"); + const bool noFrame = config.getBoolValue("noframe"); // Try to set the desired video mode if (!mainGraphics->setVideoMode(width, height, bpp, - fullscreen, hwaccel, enableResize)) + fullscreen, hwaccel, enableResize, noFrame)) { logger->log(strprintf("Couldn't set %dx%dx%d video mode: %s", width, height, bpp, SDL_GetError())); @@ -546,7 +547,7 @@ void Client::gameInit() config.setValueInt("screenheight", oldHeight); config.setValue("screen", oldFullscreen); if (!mainGraphics->setVideoMode(oldWidth, oldHeight, bpp, - oldFullscreen, hwaccel, enableResize)) + oldFullscreen, hwaccel, enableResize, noFrame)) { logger->error(strprintf("Couldn't restore %dx%dx%d " "video mode: %s", oldWidth, oldHeight, bpp, @@ -843,7 +844,7 @@ int Client::gameExec() break; case SDL_VIDEORESIZE: - resizeVideo(event.resize.w, event.resize.h); + resizeVideo(event.resize.w, event.resize.h, false); break; } @@ -2360,7 +2361,7 @@ bool Client::isTmw() return false; } -void Client::resizeVideo(int width, int height) +void Client::resizeVideo(int width, int height, bool always) { // Keep a minimum size. This isn't adhered to by the actual window, but // it keeps some window positions from getting messed up. @@ -2369,8 +2370,11 @@ void Client::resizeVideo(int width, int height) if (!mainGraphics) return; - if (mainGraphics->mWidth == width && mainGraphics->mHeight == height) + if (!always && mainGraphics->mWidth == width + && mainGraphics->mHeight == height) + { return; + } if (mainGraphics->resizeScreen(width, height)) { -- cgit v1.2.3-70-g09d2