[Scummvm-git-logs] scummvm master -> 8d6909608d3faff88a43408b01097a070c45db21

dreammaster paulfgilbert at gmail.com
Thu Jan 3 04:17:23 CET 2019


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
313337eb82 GLK: Remove deprecated _cellW/_cellH from Conf
8d6909608d GLK: FROTZ: Window positions & sizes are in characters, not pixels


Commit: 313337eb82534b23afd31da5c205f96faaea9e24
    https://github.com/scummvm/scummvm/commit/313337eb82534b23afd31da5c205f96faaea9e24
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-01-02T19:09:40-08:00

Commit Message:
GLK: Remove deprecated _cellW/_cellH from Conf

Changed paths:
    engines/glk/conf.cpp
    engines/glk/conf.h
    engines/glk/windows.cpp


diff --git a/engines/glk/conf.cpp b/engines/glk/conf.cpp
index 6aa9fe8..e8362e1 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 7437231..4b4a013 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 d75ba1f..c8ab447 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;


Commit: 8d6909608d3faff88a43408b01097a070c45db21
    https://github.com/scummvm/scummvm/commit/8d6909608d3faff88a43408b01097a070c45db21
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-01-02T19:17:08-08:00

Commit Message:
GLK: FROTZ: Window positions & sizes are in characters, not pixels

Changed paths:
    engines/glk/frotz/windows.cpp


diff --git a/engines/glk/frotz/windows.cpp b/engines/glk/frotz/windows.cpp
index ffee639..e4179ca 100644
--- a/engines/glk/frotz/windows.cpp
+++ b/engines/glk/frotz/windows.cpp
@@ -23,6 +23,7 @@
 #include "glk/frotz/windows.h"
 #include "glk/frotz/frotz.h"
 #include "glk/window_pair.h"
+#include "glk/conf.h"
 
 namespace Glk {
 namespace Frotz {
@@ -63,7 +64,8 @@ void Window::setSize(const Point &newSize) {
 	winid_t win = getWindow();
 	checkRepositionLower();
 
-	win->setSize(newSize);
+	Point s(newSize.x * g_conf->_monoInfo._cellW, newSize.y * g_conf->_monoInfo._cellH);
+	win->setSize(s);
 /* TODO
 
 	// Keep the cursor within the window
@@ -78,7 +80,8 @@ void Window::setPosition(const Point &newPos) {
 	winid_t win = getWindow();
 	checkRepositionLower();
 
-	win->setPosition(newPos);
+	Point pos((newPos.x - 1) * g_conf->_monoInfo._cellW, (newPos.y - 1) * g_conf->_monoInfo._cellH);
+	win->setPosition(pos);
 }
 
 const uint16 &Window::operator[](WindowProperty propType) {





More information about the Scummvm-git-logs mailing list