diff options
Diffstat (limited to 'engines/glk')
-rw-r--r-- | engines/glk/frotz/processor_windows.cpp | 27 | ||||
-rw-r--r-- | engines/glk/frotz/windows.cpp | 23 |
2 files changed, 23 insertions, 27 deletions
diff --git a/engines/glk/frotz/processor_windows.cpp b/engines/glk/frotz/processor_windows.cpp index f0f6ffaa66..74ffdcceff 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 4fa291e868..fcb57ceb57 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)); + */ } } |