diff options
author | Strangerke | 2015-01-26 07:58:59 +0100 |
---|---|---|
committer | Strangerke | 2015-01-26 07:58:59 +0100 |
commit | e85788ffdce741c90ac8a6cfc9b1bee298c4c269 (patch) | |
tree | 2ca5c2dfa503b9850ee2099b4250e7d2bd953d30 /engines | |
parent | ed4a3565a1b2997360ca0eaec1473c9ea5581976 (diff) | |
download | scummvm-rg350-e85788ffdce741c90ac8a6cfc9b1bee298c4c269.tar.gz scummvm-rg350-e85788ffdce741c90ac8a6cfc9b1bee298c4c269.tar.bz2 scummvm-rg350-e85788ffdce741c90ac8a6cfc9b1bee298c4c269.zip |
ACCESS: MM - Some work on bubble_box
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/bubble_box.cpp | 28 | ||||
-rw-r--r-- | engines/access/bubble_box.h | 8 | ||||
-rw-r--r-- | engines/access/scripts.cpp | 39 |
3 files changed, 45 insertions, 30 deletions
diff --git a/engines/access/bubble_box.cpp b/engines/access/bubble_box.cpp index 0fb39c9195..3d1eacbda1 100644 --- a/engines/access/bubble_box.cpp +++ b/engines/access/bubble_box.cpp @@ -90,10 +90,7 @@ void BubbleBox::placeBubble1(const Common::String &msg) { Common::Rect r = _bubbles[0]; r.translate(-2, 0); _vm->_screen->saveBlock(r); - if (_vm->getGameID() == GType_MartianMemorandum) - printBubble_v1(msg); - else - printBubble_v2(msg); + printBubble(msg); } void BubbleBox::calcBubble(const Common::String &msg) { @@ -152,6 +149,13 @@ void BubbleBox::calcBubble(const Common::String &msg) { _vm->_screen->_printStart = printStart; } +void BubbleBox::printBubble(const Common::String &msg) { + if (_vm->getGameID() == GType_MartianMemorandum) + printBubble_v1(msg); + else + printBubble_v2(msg); +} + void BubbleBox::printBubble_v1(const Common::String &msg) { drawBubble(_bubbles.size() - 1); @@ -333,10 +337,8 @@ void BubbleBox::PRINTSTR(Common::String msg) { void BubbleBox::displayBoxData() { _vm->BOXDATAEND = false; _rowOff = 2; - _vm->_fonts._charSet._lo = 7; // 0xF7 - _vm->_fonts._charSet._hi = 15; - _vm->_fonts._charFor._lo = 15; // 0xFF - _vm->_fonts._charFor._hi = 15; + _vm->_fonts._charFor._lo = 0xF7; + _vm->_fonts._charFor._hi = 0xFF; if (_tempList[0].size() == 0) return; @@ -582,13 +584,9 @@ int BubbleBox::doBox_v1(int item, int box, int &btnSelected) { _rowOff = bp; retval_ = BOXPSTARTY = newY; - - // setcursorpos - _vm->_screen->_printOrg.y = _vm->_screen->_printStart.y = (newY << 3) + _rowOff; - _vm->_screen->_printOrg.x = _vm->_screen->_printStart.x = (newX << 3); - // + SETCURSORPOS(newX, newY); - _vm->_fonts._charFor._lo = -1; + _vm->_fonts._charFor._lo = 0xFF; _vm->_fonts._font1.drawString(_vm->_screen, _bubbleDisplStr, _vm->_screen->_printOrg); if (_type == TYPE_2) { @@ -727,7 +725,7 @@ int BubbleBox::doBox_v1(int item, int box, int &btnSelected) { if ((_vm->_events->_mousePos.y < tmpY) || (_vm->_events->_mousePos.y > tmpY + 8)) continue; - warning("TODO: sub175B5"); + warning("TODO: sub175B5 - List of files"); } } diff --git a/engines/access/bubble_box.h b/engines/access/bubble_box.h index 26cda6c2a5..d279ed19c6 100644 --- a/engines/access/bubble_box.h +++ b/engines/access/bubble_box.h @@ -50,6 +50,11 @@ private: void displayBoxData(); void drawSelectBox(); + /** + * Prints a text bubble and it's contents + */ + void printBubble_v1(const Common::String &msg); + void printBubble_v2(const Common::String &msg); public: BoxType _type; @@ -87,8 +92,7 @@ public: /** * Prints a text bubble and it's contents */ - void printBubble_v1(const Common::String &msg); - void printBubble_v2(const Common::String &msg); + void printBubble(const Common::String &msg); /* * Draws the background for a text bubble diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp index d15f293163..7d21c0efe6 100644 --- a/engines/access/scripts.cpp +++ b/engines/access/scripts.cpp @@ -813,19 +813,30 @@ void Scripts::cmdTexSpeak() { #define BTN_COUNT 6 void Scripts::cmdTexChoice() { - static const int BTN_RANGES[BTN_COUNT][2] = { - { 0, 76 }, { 77, 154 }, { 155, 232 }, { 233, 276 }, { 0, 0 }, - { 277, 319 } + // MM is defining 2 times the last range in the original. + static const int BTN_RANGES_v1[BTN_COUNT][2] = { + { 0, 60 }, { 64, 124 }, { 129, 192 }, { 194, 227 }, { 233, 292 }, { 297, 319 } }; + static const int BTN_RANGES_v2[BTN_COUNT][2] = { + { 0, 76 }, { 77, 154 }, { 155, 232 }, { 233, 276 }, { 0, 0 }, { 277, 319 } + }; + + _vm->_oldRects.clear(); _choiceStart = _data->pos() - 1; _vm->_fonts._charSet._lo = 1; _vm->_fonts._charSet._hi = 8; - _vm->_fonts._charFor._lo = 55; _vm->_fonts._charFor._hi = 255; + + if (_vm->getGameID() == GType_MartianMemorandum) { + _vm->_fonts._charFor._lo = 247; + _vm->_screen->_maxChars = 23; + } else { + _vm->_fonts._charFor._lo = 55; + _vm->_screen->_maxChars = 20; + } - _vm->_screen->_maxChars = 20; _vm->_screen->_printOrg = _texsOrg; _vm->_screen->_printStart = _texsOrg; @@ -838,11 +849,11 @@ void Scripts::cmdTexChoice() { tmpStr += (char)v; _vm->_bubbleBox->calcBubble(tmpStr); - _vm->_bubbleBox->printBubble_v2(tmpStr); + _vm->_bubbleBox->printBubble(tmpStr); Common::Array<Common::Rect> responseCoords; responseCoords.push_back(_vm->_bubbleBox->_bounds); - _vm->_screen->_printOrg.y = _vm->_bubbleBox->_bounds.bottom + 11; + _vm->_screen->_printOrg.y = _vm->_bubbleBox->_bounds.bottom + (_vm->getGameID() == GType_MartianMemorandum) ? 20 : 11; findNull(); @@ -853,9 +864,9 @@ void Scripts::cmdTexChoice() { if (tmpStr.size() != 0) { _vm->_bubbleBox->_bubbleDisplStr = Common::String("RESPONSE 2"); _vm->_bubbleBox->calcBubble(tmpStr); - _vm->_bubbleBox->printBubble_v2(tmpStr); + _vm->_bubbleBox->printBubble(tmpStr); responseCoords.push_back(_vm->_bubbleBox->_bounds); - _vm->_screen->_printOrg.y = _vm->_bubbleBox->_bounds.bottom + 11; + _vm->_screen->_printOrg.y = _vm->_bubbleBox->_bounds.bottom + (_vm->getGameID() == GType_MartianMemorandum) ? 20 : 11; } findNull(); @@ -868,9 +879,9 @@ void Scripts::cmdTexChoice() { if (tmpStr.size() != 0) { _vm->_bubbleBox->_bubbleDisplStr = Common::String("RESPONSE 3"); _vm->_bubbleBox->calcBubble(tmpStr); - _vm->_bubbleBox->printBubble_v2(tmpStr); + _vm->_bubbleBox->printBubble(tmpStr); responseCoords.push_back(_vm->_bubbleBox->_bounds); - _vm->_screen->_printOrg.y = _vm->_bubbleBox->_bounds.bottom + 11; + _vm->_screen->_printOrg.y = _vm->_bubbleBox->_bounds.bottom + (_vm->getGameID() == GType_MartianMemorandum) ? 20 : 11; } findNull(); @@ -885,11 +896,13 @@ void Scripts::cmdTexChoice() { _vm->_bubbleBox->_bubbleDisplStr = _vm->_bubbleBox->_bubbleTitle; if (_vm->_events->_leftButton) { - if (_vm->_events->_mouseRow >= 22) { + if (_vm->_events->_mouseRow >= (_vm->getGameID() == GType_MartianMemorandum) ? 23 : 22) { _vm->_events->debounceLeft(); int x = _vm->_events->_mousePos.x; for (int i = 0; i < BTN_COUNT; i++) { - if ((x >= BTN_RANGES[i][0]) && (x < BTN_RANGES[i][1])) { + if (((_vm->getGameID() == GType_MartianMemorandum) && (x >= BTN_RANGES_v1[i][0]) && (x < BTN_RANGES_v1[i][1])) + || ((_vm->getGameID() == GType_Amazon) && (x >= BTN_RANGES_v2[i][0]) && (x < BTN_RANGES_v2[i][1]))) { + choice = i; break; } |