[Scummvm-git-logs] scummvm master -> 3582fe9a60834d08514018d22f1861cb5259096e
dreammaster
paulfgilbert at gmail.com
Mon Aug 12 05:07:04 CEST 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:
ec3af0e0c6 GLK: FROTZ: Allow window positioning before creating Glk window
3582fe9a60 GLK: FROTZ: Properly have first text screen cover title screen in Arthur intro
Commit: ec3af0e0c610bd793a84cbfdfcef1b296d8883ba
https://github.com/scummvm/scummvm/commit/ec3af0e0c610bd793a84cbfdfcef1b296d8883ba
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-08-11T20:05:12-07:00
Commit Message:
GLK: FROTZ: Allow window positioning before creating Glk window
This fixes a bug window with Athur that after the intro an extra
text buffer window was needlessly being created which covered the
play area, simply because one of the frotz windows had it's
properties set
Changed paths:
engines/glk/frotz/windows.cpp
engines/glk/frotz/windows.h
diff --git a/engines/glk/frotz/windows.cpp b/engines/glk/frotz/windows.cpp
index 677b213..824bec5 100644
--- a/engines/glk/frotz/windows.cpp
+++ b/engines/glk/frotz/windows.cpp
@@ -161,8 +161,12 @@ void Window::setSize(const Point &newSize) {
_properties[X_SIZE] = newSize.x;
_properties[Y_SIZE] = newSize.y;
+ setSize();
+}
+
+void Window::setSize() {
if (_win)
- _win->setSize(Point(newSize.x * g_conf->_monoInfo._cellW, newSize.y * g_conf->_monoInfo._cellH));
+ _win->setSize(Point(_properties[X_SIZE] * g_conf->_monoInfo._cellW, _properties[Y_SIZE] * g_conf->_monoInfo._cellH));
}
void Window::setPosition(const Point &newPos) {
@@ -171,8 +175,12 @@ void Window::setPosition(const Point &newPos) {
_properties[X_POS] = newPos.x;
_properties[Y_POS] = newPos.y;
+ setPosition();
+}
+
+void Window::setPosition() {
if (_win)
- _win->setPosition(Point((newPos.x - 1) * g_conf->_monoInfo._cellW, (newPos.y - 1) * g_conf->_monoInfo._cellH));
+ _win->setPosition(Point((_properties[X_POS] - 1) * g_conf->_monoInfo._cellW, (_properties[Y_POS] - 1) * g_conf->_monoInfo._cellH));
}
void Window::setCursor(const Point &newPos) {
@@ -196,7 +204,14 @@ void Window::setCursor(const Point &newPos) {
y = _properties[Y_CURSOR];
}
- g_vm->glk_window_move_cursor(_win, x - 1, y - 1);
+ _properties[X_CURSOR] = x;
+ _properties[Y_CURSOR] = y;
+
+ setCursor();
+}
+
+void Window::setCursor() {
+ g_vm->glk_window_move_cursor(_win, _properties[X_CURSOR] - 1, _properties[Y_CURSOR] - 1);
}
void Window::clear() {
@@ -280,11 +295,10 @@ void Window::setStyle(int style) {
}
void Window::updateStyle() {
- uint style = _currStyle;
-
if (!_win)
- createGlkWindow();
+ return;
+ uint style = _currStyle;
if (style & REVERSE_STYLE)
setReverseVideo(true);
@@ -339,8 +353,10 @@ void Window::createGlkWindow() {
winmethod_Arbitrary | winmethod_Fixed, 0, wintype_TextBuffer, 0);
}
- setSize(Point(_properties[X_SIZE], _properties[Y_SIZE]));
- setPosition(Point(_properties[X_POS], _properties[Y_POS]));
+ updateStyle();
+ setPosition();
+ setSize();
+ setCursor();
g_vm->glk_set_window(_win);
}
@@ -366,7 +382,7 @@ void Window::setProperty(WindowProperty propType, uint value) {
}
void Window::checkRepositionLower() {
- if (&_windows->_lower == this) {
+ if (&_windows->_lower == this && _win) {
PairWindow *parent = dynamic_cast<PairWindow *>(_win->_parent);
if (!parent)
error("Parent was not a pair window");
diff --git a/engines/glk/frotz/windows.h b/engines/glk/frotz/windows.h
index d55c928..bd2cfd1 100644
--- a/engines/glk/frotz/windows.h
+++ b/engines/glk/frotz/windows.h
@@ -164,16 +164,31 @@ public:
void setSize(const Point &newSize);
/**
+ * Copys a window's size to the underlying Glk one, if present
+ */
+ void setSize();
+
+ /**
* Set the position of a window
*/
void setPosition(const Point &newPos);
/**
+ * Copys a window's position to the underlying Glk one, if present
+ */
+ void setPosition();
+
+ /**
* Set the cursor position
*/
void setCursor(const Point &newPos);
/**
+ * Copys a window's position to the underlying Glk one, if present
+ */
+ void setCursor();
+
+ /**
* Clear the window
*/
void clear();
Commit: 3582fe9a60834d08514018d22f1861cb5259096e
https://github.com/scummvm/scummvm/commit/3582fe9a60834d08514018d22f1861cb5259096e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-08-11T20:05:12-07:00
Commit Message:
GLK: FROTZ: Properly have first text screen cover title screen in Arthur intro
Changed paths:
engines/glk/frotz/screen.cpp
engines/glk/frotz/windows.cpp
diff --git a/engines/glk/frotz/screen.cpp b/engines/glk/frotz/screen.cpp
index 3ac697c..4a2eff6 100644
--- a/engines/glk/frotz/screen.cpp
+++ b/engines/glk/frotz/screen.cpp
@@ -68,6 +68,7 @@ void FrotzScreen::loadVersion6Fonts(Common::Archive *archive) {
g_vm->_defaultForeground = 0;
g_vm->_defaultBackground = (int)zcolor_Transparent;
g_conf->_tMarginX = 3;
+ g_conf->_tMarginY = 3;
for (uint idx = 0; idx < style_NUMSTYLES; ++idx) {
g_conf->_tStyles[idx].bg = g_conf->_tStylesDefault[idx].bg = zcolor_Transparent;
diff --git a/engines/glk/frotz/windows.cpp b/engines/glk/frotz/windows.cpp
index 824bec5..9f7dd83 100644
--- a/engines/glk/frotz/windows.cpp
+++ b/engines/glk/frotz/windows.cpp
@@ -354,8 +354,8 @@ void Window::createGlkWindow() {
}
updateStyle();
- setPosition();
setSize();
+ setPosition();
setCursor();
g_vm->glk_set_window(_win);
More information about the Scummvm-git-logs
mailing list