[Scummvm-git-logs] scummvm master -> 642efa7f6a0772099a555b8bf612052ce8d5baff

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


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

Summary:
642efa7f6a GLK: FROTZ: Hooked up window property reading


Commit: 642efa7f6a0772099a555b8bf612052ce8d5baff
    https://github.com/scummvm/scummvm/commit/642efa7f6a0772099a555b8bf612052ce8d5baff
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-01-03T14:16:34-08:00

Commit Message:
GLK: FROTZ: Hooked up window property reading

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


diff --git a/engines/glk/frotz/processor_windows.cpp b/engines/glk/frotz/processor_windows.cpp
index f0f6ffa..74ffdcc 100644
--- a/engines/glk/frotz/processor_windows.cpp
+++ b/engines/glk/frotz/processor_windows.cpp
@@ -178,18 +178,16 @@ void Processor::z_set_margins() {
 }
 
 void Processor::z_move_window(void) {
-	zword win = winarg0();
-
 	flush_buffer();
 
+	zword win = winarg0();
 	_wp[win].setPosition(Point(zargs[2], zargs[1]));
 }
 
 void Processor::z_window_size() {
-	zword win = winarg0();
-
 	flush_buffer();
 
+	zword win = winarg0();
 	_wp[win].setSize(Point(zargs[2], zargs[1]));
 }
 
@@ -220,28 +218,15 @@ void Processor::z_window_style() {
 }
 
 void Processor::z_get_wind_prop() {
-#ifdef TODO
 	flush_buffer();
 
-	if (zargs[1] < 16)
-		store(((zword *)(wp + winarg0()))[zargs[1]]);
-
-	else if (zargs[1] == 16)
-		store(os_to_true_colour(lo(wp[winarg0()].colour)));
-
-	else if (zargs[1] == 17) {
-
-		zword bg = hi(wp[winarg0()].colour);
-
-		if (bg == TRANSPARENT_COLOUR)
-			store((zword)-4);
-		else
-			store(os_to_true_colour(bg));
+	zword win = winarg0();
+	zword prop = zargs[1];
 
-	}
+	if (prop <= TRUE_BG_COLOR)
+		store(_wp[win][(WindowProperty)prop]);
 	else
 		runtimeError(ERR_ILL_WIN_PROP);
-#endif
 }
 
 void Processor::z_put_wind_prop() {
diff --git a/engines/glk/frotz/windows.cpp b/engines/glk/frotz/windows.cpp
index 4fa291e..fcb57ce 100644
--- a/engines/glk/frotz/windows.cpp
+++ b/engines/glk/frotz/windows.cpp
@@ -46,7 +46,6 @@ Window &Windows::operator[](uint idx) {
 
 Window::Window() : _windows(nullptr), _win(nullptr), _tempVal(0) {}
 
-
 winid_t Window::getWindow() {
 	if (!_win) {
 		// Window doesn't exist, so create it
@@ -94,24 +93,36 @@ uint16 Window::getProperty(WindowProperty propType) {
 
 	switch (propType) {
 	case Y_POS:
-		return win->_bbox.top;
+		return win->_bbox.top / g_conf->_monoInfo._cellH;
 	case X_POS:
-		return win->_bbox.left;
+		return win->_bbox.left / g_conf->_monoInfo._cellW;
 	case Y_SIZE:
-		return win->_bbox.height();
+		return win->_bbox.height() / g_conf->_monoInfo._cellH;
 	case X_SIZE:
-		return win->_bbox.width();
+		return win->_bbox.width() / g_conf->_monoInfo._cellW;
 	case Y_CURSOR:
 		return win->getCursor().y;
 	case X_CURSOR:
 		return win->getCursor().x;
+
 	default:
 		error("Read of an unimplemented property");
 		/*
 			LEFT_MARGIN = 6, RIGHT_MARGIN = 7, NEWLINE_INTERRUPT = 8, INTERRUPT_COUNTDOWN = 9,
 			TEXT_STYLE = 10, COLOUR_DATA = 11, FONT_NUMBER = 12, FONT_SIZE = 13, ATTRIBUTES = 14,
 			LINE_COUNT = 15, TRUE_FG_COLOR = 16, TRUE_BG_COLOR = 17
-		*/
+
+	case TRUE_FG_COLOR:
+		store(os_to_true_colour(lo(wp[winarg0()].colour)));
+
+	case TRUE_BG_COLOR:
+		zword bg = hi(wp[winarg0()].colour);
+
+		if (bg == TRANSPARENT_COLOUR)
+			store((zword)-4);
+		else
+			store(os_to_true_colour(bg));
+			*/
 	}
 }
 





More information about the Scummvm-git-logs mailing list