From 313337eb82534b23afd31da5c205f96faaea9e24 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 2 Jan 2019 19:09:40 -0800 Subject: GLK: Remove deprecated _cellW/_cellH from Conf --- engines/glk/conf.cpp | 1 - engines/glk/conf.h | 1 - engines/glk/windows.cpp | 11 ++++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/engines/glk/conf.cpp b/engines/glk/conf.cpp index 6aa9fe8e0e..e8362e1338 100644 --- a/engines/glk/conf.cpp +++ b/engines/glk/conf.cpp @@ -67,7 +67,6 @@ Conf::Conf(InterpreterType interpType) { g_conf = this; _imageW = g_system->getWidth(); _imageH = g_system->getHeight(); - _cellW = _cellH = 8; get("moreprompt", _propInfo._morePrompt, "\207 more \207"); get("morecolor", _propInfo._moreColor); diff --git a/engines/glk/conf.h b/engines/glk/conf.h index 74372312ce..4b4a013f2b 100644 --- a/engines/glk/conf.h +++ b/engines/glk/conf.h @@ -97,7 +97,6 @@ public: WindowStyle _gStylesDefault[style_NUMSTYLES]; int _imageW, _imageH; - int _cellW, _cellH; public: /** * Constructor diff --git a/engines/glk/windows.cpp b/engines/glk/windows.cpp index d75ba1f6e5..c8ab44768d 100644 --- a/engines/glk/windows.cpp +++ b/engines/glk/windows.cpp @@ -76,7 +76,7 @@ Windows::~Windows() { Window *Windows::windowOpen(Window *splitwin, uint method, uint size, uint wintype, uint rock) { - Window *newwin, *oldparent; + Window *newwin, *oldparent = nullptr; PairWindow *pairWin; uint val; @@ -262,21 +262,22 @@ PairWindow *Windows::newPairWindow(uint method, Window *key, uint size) { void Windows::rearrange() { if (_rootWin) { Rect box; + Point cell(g_conf->_monoInfo._cellW, g_conf->_monoInfo._cellH); if (g_conf->_lockCols) { - int desired_width = g_conf->_wMarginSaveX * 2 + g_conf->_cellW * g_conf->_cols; + int desired_width = g_conf->_wMarginSaveX * 2 + cell.x * g_conf->_cols; if (desired_width > g_conf->_imageW) g_conf->_wMarginX = g_conf->_wMarginSaveX; else - g_conf->_wMarginX = (g_conf->_imageW - g_conf->_cellW * g_conf->_cols) / 2; + g_conf->_wMarginX = (g_conf->_imageW - cell.x * g_conf->_cols) / 2; } if (g_conf->_lockRows) { - int desired_height = g_conf->_wMarginSaveY * 2 + g_conf->_cellH * g_conf->_rows; + int desired_height = g_conf->_wMarginSaveY * 2 + cell.y * g_conf->_rows; if (desired_height > g_conf->_imageH) g_conf->_wMarginY = g_conf->_wMarginSaveY; else - g_conf->_wMarginY = (g_conf->_imageH - g_conf->_cellH * g_conf->_rows) / 2; + g_conf->_wMarginY = (g_conf->_imageH - cell.y * g_conf->_rows) / 2; } box.left = g_conf->_wMarginX; -- cgit v1.2.3