aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2019-01-27 20:19:37 -0800
committerPaul Gilbert2019-01-29 21:17:18 -0800
commitb92f8f08567f328a9781f0cf467469ca61d9c5ff (patch)
tree8e62bdc73542f367646977756b295de34d463748 /engines
parent53a1426cc398568f8e707e132ad0d7f1a7782c0f (diff)
downloadscummvm-rg350-b92f8f08567f328a9781f0cf467469ca61d9c5ff.tar.gz
scummvm-rg350-b92f8f08567f328a9781f0cf467469ca61d9c5ff.tar.bz2
scummvm-rg350-b92f8f08567f328a9781f0cf467469ca61d9c5ff.zip
GLK: FROTZ: Make window transparent for V6 games to not obscure upper area
Diffstat (limited to 'engines')
-rw-r--r--engines/glk/events.cpp4
-rw-r--r--engines/glk/frotz/screen.cpp3
-rw-r--r--engines/glk/frotz/windows.cpp1
-rw-r--r--engines/glk/screen.cpp6
-rw-r--r--engines/glk/screen.h1
5 files changed, 10 insertions, 5 deletions
diff --git a/engines/glk/events.cpp b/engines/glk/events.cpp
index 6589b512f8..4897b1898f 100644
--- a/engines/glk/events.cpp
+++ b/engines/glk/events.cpp
@@ -68,7 +68,7 @@ void Events::initializeCursors() {
const Graphics::PixelFormat format = g_system->getScreenFormat();
const int WHITE = format.RGBToColor(0xff, 0xff, 0xff);
const int BLACK = 0;
- const int TRANSPARENT = format.RGBToColor(0x80, 0x80, 0x80);
+ const int TRANSPARENT = format.RGBToColor(TRANSPARENT_RGB, TRANSPARENT_RGB, TRANSPARENT_RGB);
// Setup arrow cursor
Surface &arr = _cursors[CURSOR_ARROW];
@@ -384,7 +384,7 @@ void Events::setCursor(CursorId cursorId) {
CursorMan.showMouse(true);
const Surface &s = _cursors[cursorId];
- const int TRANSPARENT = s.format.RGBToColor(0x80, 0x80, 0x80);
+ const int TRANSPARENT = s.format.RGBToColor(TRANSPARENT_RGB, TRANSPARENT_RGB, TRANSPARENT_RGB);
CursorMan.replaceCursor(s.getPixels(), s.w, s.h, s._hotspot.x, s._hotspot.y, TRANSPARENT, true, &s.format);
}
diff --git a/engines/glk/frotz/screen.cpp b/engines/glk/frotz/screen.cpp
index f2b85a9a41..05090769f9 100644
--- a/engines/glk/frotz/screen.cpp
+++ b/engines/glk/frotz/screen.cpp
@@ -66,7 +66,8 @@ void FrotzScreen::loadVersion6Fonts(Common::Archive *archive) {
pi._lineSeparation = 0;
g_vm->_defaultForeground = 0;
- g_vm->_defaultBackground = 0xffffff;
+ g_vm->_defaultBackground = TRANSPARENT_RGB | (TRANSPARENT_RGB << 8) | (TRANSPARENT_RGB << 16);
+ g_conf->_tMarginX = 3;
_fonts.resize(8);
diff --git a/engines/glk/frotz/windows.cpp b/engines/glk/frotz/windows.cpp
index 0c7237cbd0..8e0435e842 100644
--- a/engines/glk/frotz/windows.cpp
+++ b/engines/glk/frotz/windows.cpp
@@ -54,6 +54,7 @@ void Windows::setup(bool isVersion6) {
winmethod_Arbitrary | winmethod_Fixed, 0, wintype_TextBuffer, 0);
_upper = g_vm->glk_window_open(g_vm->glk_window_get_root(),
winmethod_Arbitrary | winmethod_Fixed, 0, wintype_TextGrid, 0);
+
} else {
_lower = g_vm->glk_window_open(0, 0, 0, wintype_TextBuffer, 0);
_upper = g_vm->glk_window_open(_lower, winmethod_Above | winmethod_Fixed, 0, wintype_TextGrid, 0);
diff --git a/engines/glk/screen.cpp b/engines/glk/screen.cpp
index 8322e9c246..465adab082 100644
--- a/engines/glk/screen.cpp
+++ b/engines/glk/screen.cpp
@@ -65,8 +65,10 @@ void Screen::fill(const byte *rgb) {
}
void Screen::fillRect(const Rect &box, const byte *rgb) {
- uint color = format.RGBToColor(rgb[0], rgb[1], rgb[2]);
- Graphics::Screen::fillRect(box, color);
+ if (rgb[0] != TRANSPARENT_RGB || rgb[1] != TRANSPARENT_RGB || rgb[2] != TRANSPARENT_RGB) {
+ uint color = format.RGBToColor(rgb[0], rgb[1], rgb[2]);
+ Graphics::Screen::fillRect(box, color);
+ }
}
bool Screen::loadFonts() {
diff --git a/engines/glk/screen.h b/engines/glk/screen.h
index d4f3874d71..85c99ea75d 100644
--- a/engines/glk/screen.h
+++ b/engines/glk/screen.h
@@ -33,6 +33,7 @@
namespace Glk {
#define FONTS_TOTAL 8
+#define TRANSPARENT_RGB 0x7f
enum CaretShape {
SMALL_DOT = 0, FAT_DOT = 1, THIN_LINE = 2, FAT_LINE = 3, BLOCK = 4