ACCESS: MM - Implement displayBoxData

This commit is contained in:
Strangerke 2015-01-14 23:44:24 +01:00
parent 93e8b47e13
commit 3a57f20816
4 changed files with 72 additions and 12 deletions

View File

@ -106,6 +106,7 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
NUMBLINES = 0;
_word234F3 = _word234F7 = _word234F5 = _word234F9 = 0;
_word234FB = _word234FF = _word234FD = _word23501 = 0;
TEMPLIST = nullptr;
_vidEnd = false;
}
@ -162,12 +163,12 @@ void AccessEngine::initialize() {
// Create sub-objects of the engine
_animation = new AnimationManager(this);
_bubbleBox = new BubbleBox(this, TYPE_2, 64, 32, 130, 122, 0, 0, 0, 0, "");
_bubbleBox = new BubbleBox(this, TYPE_2, 64, 32, 130, 122, 0, 0, 0, 0, "", nullptr);
if (getGameID() == GType_MartianMemorandum) {
_helpBox = new BubbleBox(this, TYPE_1, 64, 24, 146, 122, 1, 32, 2, 76, "HELP");
_travelBox = new BubbleBox(this, TYPE_1, 64, 32, 194, 122, 1, 24, 2, 74, "TRAVEL");
_invBox = new BubbleBox(this, TYPE_1, 64, 32, 146, 122, 1, 32, 2, 76, "INVENTORY");
_aboutBox = new BubbleBox(this, TYPE_1, 64, 32, 194, 122, 1, 32, 2, 76, "ASK ABOUT");
_helpBox = new BubbleBox(this, TYPE_1, 64, 24, 146, 122, 1, 32, 2, 76, "HELP", TEMPLIST);
_travelBox = new BubbleBox(this, TYPE_1, 64, 32, 194, 122, 1, 24, 2, 74, "TRAVEL", TEMPLIST);
_invBox = new BubbleBox(this, TYPE_1, 64, 32, 146, 122, 1, 32, 2, 76, "INVENTORY", TEMPLIST);
_aboutBox = new BubbleBox(this, TYPE_1, 64, 32, 194, 122, 1, 32, 2, 76, "ASK ABOUT", TEMPLIST);
} else {
_helpBox = nullptr;
_travelBox = nullptr;

View File

@ -225,6 +225,7 @@ public:
int BCNT;
int _word234F3, _word234F7, _word234F5, _word234F9;
int _word234FB, _word234FF, _word234FD, _word23501;
byte *TEMPLIST;
//
bool _vidEnd;

View File

@ -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) : 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, byte *tmpList) : Manager(vm) {
_type = type;
_bounds = Common::Rect(x, y, x + w, y + h);
_bubbleDisplStr = title;
@ -37,8 +37,10 @@ BubbleBox::BubbleBox(AccessEngine *vm, Access::BoxType type, int x, int y, int w
_btnId3 = _btnX3 = 0; // Unused in MM and Amazon?
BOXSTARTX = BOXSTARTY = 0;
BICONSTARTX = BICONSTARTY = 0;
BOXENDY = 0;
BOXENDX = BOXENDY = 0;
BOXPSTARTX = BOXPSTARTY = 0;
// Unused in AGoE
_tempListPtr = tmpList;
}
void BubbleBox::load(Common::SeekableReadStream *stream) {
@ -285,7 +287,64 @@ void BubbleBox::doBox(int item, int box) {
}
void BubbleBox::displayBoxData() {
warning("TODO displayBoxData");
_vm->BOXDATAEND = 0;
_rowOff = 2;
_vm->_fonts._charSet._lo = 7; // 0xF7
_vm->_fonts._charSet._hi = 15;
_vm->_fonts._charFor._lo = 15; // 0xFF
_vm->_fonts._charFor._hi = 15;
if (!_tempListPtr)
return;
int idx = 0;
if ((_type == TYPE_1) || (_type == TYPE_3)) {
_vm->BCNT = 0;
if (_tempListPtr[idx] == -1) {
_vm->BOXDATAEND = 1;
return;
}
_vm->_events->hideCursor();
_vm->_screen->_orgX1 = BOXSTARTX;
_vm->_screen->_orgX2 = BOXENDX;
_vm->_screen->_orgY1 = BOXSTARTY;
_vm->_screen->_orgY2 = BOXENDY;
_vm->_screen->_lColor = 0xFA;
_vm->_screen->drawRect();
_vm->_events->showCursor();
}
_vm->_events->hideCursor();
int oldPStartY = BOXPSTARTY;
++BOXPSTARTY;
for (int i = 0; i < _vm->BOXDATASTART; i++, idx++) {
while (_tempListPtr[idx] != 0)
++idx;
}
while (true) {
warning("TODO: SETCURSOR");
warning("TODO: PRINTSTR");
++idx;
++BOXPSTARTY;
++_vm->BCNT;
if (_tempListPtr[idx] == nullptr) {
BOXPSTARTY = oldPStartY;
_vm->_events->showCursor();
_vm->BOXDATAEND = 1;
return;
}
if (_vm->BCNT == _vm->NUMBLINES) {
BOXPSTARTY = oldPStartY;
_vm->_events->showCursor();
return;
}
}
}
void BubbleBox::drawSelectBox() {
@ -503,9 +562,7 @@ int BubbleBox::doBox_v1(int item, int box, int &type) {
drawSelectBox();
}
warning("TODO: more dobox_v1");
return -1;
}
} // End of namespace Access

View File

@ -44,7 +44,7 @@ private:
int _charCol, _rowOff;
Common::Point _fileStart;
int BOXSTARTX, BOXSTARTY;
int BOXENDY;
int BOXENDX, BOXENDY;
int BICONSTARTX, BICONSTARTY;
int BOXPSTARTX, BOXPSTARTY;
@ -57,6 +57,7 @@ public:
Common::StringArray _nameIndex;
Common::String _bubbleTitle;
Common::String _bubbleDisplStr;
byte *_tempListPtr;
int _btnId1;
int _btnX1;
int _btnId2;
@ -66,7 +67,7 @@ public:
Common::Array<Common::Rect> _bubbles;
public:
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);
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);
void load(Common::SeekableReadStream *stream);