aboutsummaryrefslogtreecommitdiff
path: root/engines/access/bubble_box.cpp
diff options
context:
space:
mode:
authorStrangerke2015-01-15 00:40:43 +0100
committerStrangerke2015-01-15 00:40:43 +0100
commitf1aa191f8c3acd0bfa259c4239bc6aadc9c9b0b0 (patch)
tree916cd496232686907f016fe7f7f921066549c4f5 /engines/access/bubble_box.cpp
parent3a57f208165c849bd8f68eacd1eaad818af5f75e (diff)
downloadscummvm-rg350-f1aa191f8c3acd0bfa259c4239bc6aadc9c9b0b0.tar.gz
scummvm-rg350-f1aa191f8c3acd0bfa259c4239bc6aadc9c9b0b0.tar.bz2
scummvm-rg350-f1aa191f8c3acd0bfa259c4239bc6aadc9c9b0b0.zip
ACCESS: MM - Implement getList
Diffstat (limited to 'engines/access/bubble_box.cpp')
-rw-r--r--engines/access/bubble_box.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/engines/access/bubble_box.cpp b/engines/access/bubble_box.cpp
index 19b9c1fd55..30d33a7fde 100644
--- a/engines/access/bubble_box.cpp
+++ b/engines/access/bubble_box.cpp
@@ -26,7 +26,7 @@
namespace Access {
-BubbleBox::BubbleBox(AccessEngine *vm, Access::BoxType type, int x, int y, int w, int h, int val1, int val2, int val3, int val4, Common::String title, byte *tmpList) : Manager(vm) {
+BubbleBox::BubbleBox(AccessEngine *vm, Access::BoxType type, int x, int y, int w, int h, int val1, int val2, int val3, int val4, Common::String title) : Manager(vm) {
_type = type;
_bounds = Common::Rect(x, y, x + w, y + h);
_bubbleDisplStr = title;
@@ -40,7 +40,8 @@ BubbleBox::BubbleBox(AccessEngine *vm, Access::BoxType type, int x, int y, int w
BOXENDX = BOXENDY = 0;
BOXPSTARTX = BOXPSTARTY = 0;
// Unused in AGoE
- _tempListPtr = tmpList;
+ for (int i = 0; i < 60; i++)
+ _tempListPtr[i] = "";
}
void BubbleBox::load(Common::SeekableReadStream *stream) {
@@ -294,14 +295,14 @@ void BubbleBox::displayBoxData() {
_vm->_fonts._charFor._lo = 15; // 0xFF
_vm->_fonts._charFor._hi = 15;
- if (!_tempListPtr)
+ if (_tempListPtr[0].size() == 0)
return;
int idx = 0;
if ((_type == TYPE_1) || (_type == TYPE_3)) {
_vm->BCNT = 0;
- if (_tempListPtr[idx] == -1) {
+ if (_tempListPtr[idx].size() == 0) {
_vm->BOXDATAEND = 1;
return;
}
@@ -322,7 +323,7 @@ void BubbleBox::displayBoxData() {
++BOXPSTARTY;
for (int i = 0; i < _vm->BOXDATASTART; i++, idx++) {
- while (_tempListPtr[idx] != 0)
+ while (_tempListPtr[idx].size() != 0)
++idx;
}
@@ -332,7 +333,7 @@ void BubbleBox::displayBoxData() {
++idx;
++BOXPSTARTY;
++_vm->BCNT;
- if (_tempListPtr[idx] == nullptr) {
+ if (_tempListPtr[idx].size() == 0) {
BOXPSTARTY = oldPStartY;
_vm->_events->showCursor();
_vm->BOXDATAEND = 1;
@@ -565,4 +566,17 @@ int BubbleBox::doBox_v1(int item, int box, int &type) {
warning("TODO: more dobox_v1");
return -1;
}
+
+void BubbleBox::getList(const char *data[], int *flags) {
+ int srcIdx = 0;
+ int destIdx = 0;
+ while (data[srcIdx]) {
+ if (flags[srcIdx]) {
+ _tempListPtr[destIdx] = Common::String(data[srcIdx]);
+ ++destIdx;
+ }
+ srcIdx++;
+ }
+ _tempListPtr[destIdx] = "";
+}
} // End of namespace Access