From a8c99d1986a902aaf65c760b365c49cce2174e30 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 25 Nov 2014 11:33:04 +0100 Subject: [PATCH] ACCESS: Some work on drawHelp (WIP) --- engines/access/amazon/amazon_game.cpp | 64 ++++++++++++++++++++++++++- engines/access/amazon/amazon_game.h | 2 + 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp index 657458fa443c..e864a921f7a4 100644 --- a/engines/access/amazon/amazon_game.cpp +++ b/engines/access/amazon/amazon_game.cpp @@ -624,8 +624,70 @@ void AmazonEngine::updateSummary(int chap) { } } +void AmazonEngine::HELPTITLE() { + warning("TODO: HELPTITLE"); +} + +void AmazonEngine::drawHelpText(const Common::String &msg) { + _screen->_maxChars = 39; + _screen->_printOrg = Common::Point(26, 58); + _screen->_printStart = Common::Point(26, 58); + + Common::String lines = msg; + Common::String line; + int width = 0; + bool lastLine = false; + do { + lastLine = _fonts._font2.getLine(lines, _screen->_maxChars * 6, line, width); + + // Set font colors + _fonts._font2._fontColors[0] = 0; + _fonts._font2._fontColors[1] = 27; + _fonts._font2._fontColors[2] = 28; + _fonts._font2._fontColors[3] = 29; + + _fonts._font2.drawString(_screen, line, _screen->_printOrg); + _screen->_printOrg = Common::Point(_screen->_printStart.x, _screen->_printOrg.y + 8); + } while (!lastLine); + + _events->showCursor(); +} + void AmazonEngine::drawHelp() { - error("TODO: drawHelp"); + _events->hideCursor(); + if (_useItem == 0) { + _buffer2.copyBuffer(_screen); + if (_screen->_vesaMode) { + _screen->setPanel(2); + _screen->saveScreen(); + } + _screen->setPalette(); + _screen->fadeOut(); + _screen->clearBuffer(); + if (_moreHelp == 1) { + // Set cells + Common::Array cells; + cells.push_back(CellIdent(95, 95, 3)); + loadCells(cells); + } + } + + _files->loadScreen(95, 2); + if (_moreHelp == 1) { + ASurface *oldDest = _destIn; + _destIn = _screen; + int oldClip = _screen->_clipHeight; + _screen->_clipHeight = 200; + _screen->plotImage(_objectsTable[95], 0, Common::Point(76, 168)); + _destIn = oldDest; + _screen->_clipHeight = oldClip; + } + + if ((_useItem == 0) && (_screen->_vesaMode == 0)) + _screen->fadeIn(); + + HELPTITLE(); + drawHelpText("TODO: WHICH BUFFER?"); } void AmazonEngine::startChapter(int chapter) { diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h index c646f513b18a..0aea43575f47 100644 --- a/engines/access/amazon/amazon_game.h +++ b/engines/access/amazon/amazon_game.h @@ -83,6 +83,8 @@ class AmazonEngine : public AccessEngine { */ void setupGame(); + void HELPTITLE(); + void drawHelpText(const Common::String &msg); void doCredit(); void scrollTitle(); void loadEstablish(int estabIndex);