aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2015-01-19 00:11:05 +0100
committerStrangerke2015-01-19 00:11:05 +0100
commit6ba81a974936d25846cd4e273393c39f206ad2f7 (patch)
tree2578e793c213a48816ee81cbbf03c190ac07b1ea /engines
parentb1477438bbc440e6bc240adc19029e7d2817da33 (diff)
downloadscummvm-rg350-6ba81a974936d25846cd4e273393c39f206ad2f7.tar.gz
scummvm-rg350-6ba81a974936d25846cd4e273393c39f206ad2f7.tar.bz2
scummvm-rg350-6ba81a974936d25846cd4e273393c39f206ad2f7.zip
ACCESS: MM - Implement printBubble_v1
Diffstat (limited to 'engines')
-rw-r--r--engines/access/bubble_box.cpp41
-rw-r--r--engines/access/bubble_box.h3
-rw-r--r--engines/access/inventory.cpp1
-rw-r--r--engines/access/scripts.cpp23
-rw-r--r--engines/access/scripts.h3
5 files changed, 57 insertions, 14 deletions
diff --git a/engines/access/bubble_box.cpp b/engines/access/bubble_box.cpp
index 97bdbedc06..da3ae66713 100644
--- a/engines/access/bubble_box.cpp
+++ b/engines/access/bubble_box.cpp
@@ -74,7 +74,7 @@ void BubbleBox::clearBubbles() {
}
void BubbleBox::placeBubble(const Common::String &msg) {
- _vm->_screen->_maxChars = 27;
+ _vm->_screen->_maxChars = (_vm->getGameID() == GType_MartianMemorandum) ? 30 : 27;
placeBubble1(msg);
}
@@ -82,15 +82,18 @@ void BubbleBox::placeBubble1(const Common::String &msg) {
_bubbles.clear();
_vm->_fonts._charSet._lo = 1;
_vm->_fonts._charSet._hi = 8;
- _vm->_fonts._charFor._lo = 29;
- _vm->_fonts._charFor._hi = 32;
+ _vm->_fonts._charFor._lo = (_vm->getGameID() == GType_MartianMemorandum) ? 247 : 29;
+ _vm->_fonts._charFor._hi = (_vm->getGameID() == GType_MartianMemorandum) ? 255 : 32;
calcBubble(msg);
Common::Rect r = _bubbles[0];
r.translate(-2, 0);
_vm->_screen->saveBlock(r);
- printBubble(msg);
+ if (_vm->getGameID() == GType_MartianMemorandum)
+ printBubble_v1(msg);
+ else
+ printBubble_v2(msg);
}
void BubbleBox::calcBubble(const Common::String &msg) {
@@ -149,7 +152,29 @@ void BubbleBox::calcBubble(const Common::String &msg) {
_vm->_screen->_printStart = printStart;
}
-void BubbleBox::printBubble(const Common::String &msg) {
+void BubbleBox::printBubble_v1(const Common::String &msg) {
+ drawBubble(_bubbles.size() - 1);
+
+ // Loop through drawing the lines
+ Common::String s = msg;
+ Common::String line;
+ int width = 0;
+ bool lastLine;
+ do {
+ // Get next line
+ Font &font2 = _vm->_fonts._font2;
+ lastLine = font2.getLine(s, _vm->_screen->_maxChars * 6, line, width);
+ // Draw the text
+ font2.drawString(_vm->_screen, line, _vm->_screen->_printOrg);
+
+ // Move print position
+ _vm->_screen->_printOrg.y += 6;
+ _vm->_screen->_printOrg.x = _vm->_screen->_printStart.x;
+ } while (!lastLine);
+
+}
+
+void BubbleBox::printBubble_v2(const Common::String &msg) {
drawBubble(_bubbles.size() - 1);
// Loop through drawing the lines
@@ -183,7 +208,11 @@ void BubbleBox::printBubble(const Common::String &msg) {
void BubbleBox::drawBubble(int index) {
_bounds = _bubbles[index];
- doBox(0, 0);
+ if (_vm->getGameID() == GType_MartianMemorandum) {
+ int btnSelected = 0;
+ doBox_v1(0, 0, btnSelected);
+ } else
+ doBox(0, 0);
}
void BubbleBox::doBox(int item, int box) {
diff --git a/engines/access/bubble_box.h b/engines/access/bubble_box.h
index 065e0ef82a..26cda6c2a5 100644
--- a/engines/access/bubble_box.h
+++ b/engines/access/bubble_box.h
@@ -87,7 +87,8 @@ public:
/**
* Prints a text bubble and it's contents
*/
- void printBubble(const Common::String &msg);
+ void printBubble_v1(const Common::String &msg);
+ void printBubble_v2(const Common::String &msg);
/*
* Draws the background for a text bubble
diff --git a/engines/access/inventory.cpp b/engines/access/inventory.cpp
index 781650b614..1d78839606 100644
--- a/engines/access/inventory.cpp
+++ b/engines/access/inventory.cpp
@@ -230,7 +230,6 @@ int InventoryManager::displayInv() {
else
_vm->_useItem = -1;
-
free(inv);
return 0;
}
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp
index e823f611b6..4e19659f75 100644
--- a/engines/access/scripts.cpp
+++ b/engines/access/scripts.cpp
@@ -54,7 +54,7 @@ void Scripts::setOpcodes() {
COMMAND_LIST[6] = &Scripts::cmdJumpUse;
COMMAND_LIST[7] = &Scripts::cmdJumpTalk;
COMMAND_LIST[8] = &Scripts::cmdNull;
- COMMAND_LIST[9] = &Scripts::cmdPrint;
+ COMMAND_LIST[9] = &Scripts::cmdPrint_v1;
COMMAND_LIST[10] = &Scripts::cmdRetPos;
COMMAND_LIST[11] = &Scripts::cmdAnim;
COMMAND_LIST[12] = &Scripts::cmdSetFlag;
@@ -121,6 +121,7 @@ void Scripts::setOpcodes() {
}
void Scripts::setOpcodes_v2() {
+ COMMAND_LIST[9] = &Scripts::cmdPrint_v2;
COMMAND_LIST[15] = &Scripts::cmdSetInventory;
COMMAND_LIST[28] = &Scripts::cmdDispInv_v2;
COMMAND_LIST[29] = &Scripts::cmdSetTimer;
@@ -257,12 +258,24 @@ void Scripts::cmdNull() {
#define PRINT_TIMER 25
-void Scripts::cmdPrint() {
+void Scripts::cmdPrint_v2() {
// Get a text line for display
Common::String msg = readString();
printString(msg);
}
+void Scripts::cmdPrint_v1() {
+ _vm->_screen->_printOrg = Common::Point(20, 42);
+ _vm->_screen->_printStart = Common::Point(20, 32);
+ Common::String msg = readString();
+ _vm->_bubbleBox->placeBubble(msg);
+ _vm->_events->waitKeyMouse();
+ _vm->_events->hideCursor();
+ _vm->_screen->restoreBlock();
+ _vm->_events->showCursor();
+ findNull();
+}
+
void Scripts::printString(const Common::String &msg) {
_vm->_screen->_printOrg = Common::Point(20, 42);
_vm->_screen->_printStart = Common::Point(20, 42);
@@ -751,7 +764,7 @@ void Scripts::cmdTexChoice() {
tmpStr += (char)v;
_vm->_bubbleBox->calcBubble(tmpStr);
- _vm->_bubbleBox->printBubble(tmpStr);
+ _vm->_bubbleBox->printBubble_v2(tmpStr);
Common::Array<Common::Rect> responseCoords;
responseCoords.push_back(_vm->_bubbleBox->_bounds);
@@ -766,7 +779,7 @@ void Scripts::cmdTexChoice() {
if (tmpStr.size() != 0) {
_vm->_bubbleBox->_bubbleDisplStr = Common::String("RESPONSE 2");
_vm->_bubbleBox->calcBubble(tmpStr);
- _vm->_bubbleBox->printBubble(tmpStr);
+ _vm->_bubbleBox->printBubble_v2(tmpStr);
responseCoords.push_back(_vm->_bubbleBox->_bounds);
_vm->_screen->_printOrg.y = _vm->_bubbleBox->_bounds.bottom + 11;
}
@@ -781,7 +794,7 @@ void Scripts::cmdTexChoice() {
if (tmpStr.size() != 0) {
_vm->_bubbleBox->_bubbleDisplStr = Common::String("RESPONSE 3");
_vm->_bubbleBox->calcBubble(tmpStr);
- _vm->_bubbleBox->printBubble(tmpStr);
+ _vm->_bubbleBox->printBubble_v2(tmpStr);
responseCoords.push_back(_vm->_bubbleBox->_bounds);
_vm->_screen->_printOrg.y = _vm->_bubbleBox->_bounds.bottom + 11;
}
diff --git a/engines/access/scripts.h b/engines/access/scripts.h
index a9f8becda2..905137d944 100644
--- a/engines/access/scripts.h
+++ b/engines/access/scripts.h
@@ -66,7 +66,8 @@ protected:
void cmdJumpUse();
void cmdJumpTalk();
void cmdNull();
- void cmdPrint();
+ void cmdPrint_v1();
+ void cmdPrint_v2();
void cmdAnim();
void cmdSetFlag();
void cmdCheckFlag();