summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-02 19:42:02 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-02 19:42:02 +0300
commite8f92c8a476c35f76212ccaccbbb55901a49058e (patch)
tree741bdd9b2068ded23ab92a06586422b400c53d24 /src/client.cpp
parent2d0696abd547cf00fda04f070fb713c92acaf91b (diff)
downloadmv-e8f92c8a476c35f76212ccaccbbb55901a49058e.tar.gz
mv-e8f92c8a476c35f76212ccaccbbb55901a49058e.tar.bz2
mv-e8f92c8a476c35f76212ccaccbbb55901a49058e.tar.xz
mv-e8f92c8a476c35f76212ccaccbbb55901a49058e.zip
Add "no frame" option to hide window frame. Disabled by default.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp14
1 files changed, 9 insertions, 5 deletions
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))
{