diff options
author | Paul Gilbert | 2014-12-31 11:12:18 -1000 |
---|---|---|
committer | Paul Gilbert | 2014-12-31 11:12:18 -1000 |
commit | 5c88d2cc42d9b6124f552464b9c02e800f3956df (patch) | |
tree | 8e29758709f81b2bdb431b7e691d81eea79e0642 /engines/xeen/screen.cpp | |
parent | 9506635bad402d58886cc9a47512871b321a10a2 (diff) | |
download | scummvm-rg350-5c88d2cc42d9b6124f552464b9c02e800f3956df.tar.gz scummvm-rg350-5c88d2cc42d9b6124f552464b9c02e800f3956df.tar.bz2 scummvm-rg350-5c88d2cc42d9b6124f552464b9c02e800f3956df.zip |
XEEN: Implement window framing code and dialog event handling
Diffstat (limited to 'engines/xeen/screen.cpp')
-rw-r--r-- | engines/xeen/screen.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/engines/xeen/screen.cpp b/engines/xeen/screen.cpp index 1f8e50cd87..4563e37498 100644 --- a/engines/xeen/screen.cpp +++ b/engines/xeen/screen.cpp @@ -61,6 +61,62 @@ void Window::open2() { create(_bounds.width(), _bounds.height()); copyRectToSurface(*_vm->_screen, 0, 0, _bounds); _dirtyRects.push(_bounds); + frame(); +} + +void Window::frame() { + Screen &screen = *_vm->_screen; + int xCount = (_bounds.width() - 9) / SYMBOL_WIDTH; + int yCount = (_bounds.height() - 9) / SYMBOL_HEIGHT; + + // Write the top line + screen._writePos = Common::Point(_bounds.left, _bounds.top); + screen.writeSymbol(0); + + if (xCount > 0) { + int symbolId = 1; + for (int i = 0; i < xCount; ++i) { + screen.writeSymbol(symbolId); + if (++symbolId == 5) + symbolId = 1; + } + } + + screen._writePos.x = _bounds.right - SYMBOL_WIDTH; + screen.writeSymbol(5); + + // Write the vertical edges + if (yCount > 0) { + int symbolId = 6; + for (int i = 0; i < yCount; ++i) { + screen._writePos.y += 8; + + screen._writePos.x = _bounds.left; + screen.writeSymbol(symbolId); + + screen._writePos.x = _bounds.right - SYMBOL_WIDTH; + screen.writeSymbol(symbolId + 4); + + if (++symbolId == 10) + symbolId = 6; + } + } + + // Write the bottom line + screen._writePos = Common::Point(_bounds.left, _bounds.bottom - SYMBOL_HEIGHT); + screen.writeSymbol(14); + + if (xCount > 0) { + int symbolId = 15; + for (int i = 0; i < xCount; ++i) { + screen.writeSymbol(symbolId); + if (++symbolId == 19) + symbolId = 15; + } + } + + screen._writePos.x = _bounds.right - SYMBOL_WIDTH; + screen.writeSymbol(19); } void Window::close() { @@ -94,6 +150,10 @@ void Window::update() { } } +void Window::addDirtyRect(const Common::Rect &r) { + _dirtyRects.push(r); +} + /*------------------------------------------------------------------------*/ /** |