Skip to content

Commit

Permalink
GLK: FROTZ: Default white color for v6 game background
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jan 6, 2019
1 parent 302d26b commit 8a84e3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions engines/glk/frotz/windows.cpp
Expand Up @@ -48,6 +48,8 @@ void Windows::setup(bool isVersion6) {
// For graphic games we have a background window covering the entire screen for greater
// flexibility of wher we draw pictures, and the lower and upper areas sit on top of them
_background = g_vm->glk_window_open(0, 0, 0, wintype_Graphics, 0);
_background->setBackgroundColor(0xffffff);

_lower = g_vm->glk_window_open(g_vm->glk_window_get_root(),
winmethod_Arbitrary | winmethod_Fixed, 0, wintype_TextBuffer, 0);
_upper = g_vm->glk_window_open(g_vm->glk_window_get_root(),
Expand Down
6 changes: 4 additions & 2 deletions engines/glk/window_graphics.cpp
Expand Up @@ -62,7 +62,9 @@ void GraphicsWindow::rearrange(const Rect &box) {
if (newhgt < bothhgt)
bothhgt = newhgt;

newSurface = new Graphics::ManagedSurface(newwid, newhgt, g_system->getScreenFormat());
Graphics::PixelFormat pixelFormat = g_system->getScreenFormat();
newSurface = new Graphics::ManagedSurface(newwid, newhgt, pixelFormat);
newSurface->clear(pixelFormat.RGBToColor(_bgnd[0], _bgnd[1], _bgnd[2]));

// If the new surface is equal or bigger than the old one, copy it over
if (_surface && bothwid && bothhgt)
Expand Down Expand Up @@ -145,7 +147,7 @@ void GraphicsWindow::eraseRect(bool whole, const Rect &box) {
// zero out hyperlinks for these coordinates
g_vm->_selection->putHyperlink(0, hx0, hy0, hx1, hy1);

_surface->fillRect(Rect(x0, y0, x1, y1), MKTAG(_bgnd[0], _bgnd[1], _bgnd[2], 0));
_surface->fillRect(Rect(x0, y0, x1, y1), _surface->format.RGBToColor(_bgnd[0], _bgnd[1], _bgnd[2]));
touch();
}

Expand Down

0 comments on commit 8a84e3d

Please sign in to comment.