ACCESS: MM - Start implementing MM dialog box, split cmdConverse in two (WIP)

This commit is contained in:
Strangerke 2015-01-12 00:04:38 +01:00
parent 8249de3d44
commit ec381ae364
6 changed files with 66 additions and 11 deletions

View File

@ -55,8 +55,6 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_currentMan = 0;
_currentManOld = -1;
_converseMode = 0;
_startAboutBox = 0;
_startTravelBox = 0;
_numAnimTimers = 0;
_startup = 0;
_currentCharFlag = false;
@ -99,7 +97,7 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
STARTTRAVELITEM = STARTTRAVELBOX = 0;
for (int i = 0; i < 16; i++)
ASK[i];
_startAboutItem = 0;
_startAboutItem = _startAboutBox = 0;
_vidEnd = false;
}

View File

@ -180,8 +180,6 @@ public:
int _playerDataCount;
int _currentManOld;
int _converseMode;
int _startAboutBox;
int _startTravelBox;
bool _currentCharFlag;
bool _boxSelect;
int _scale;
@ -210,11 +208,17 @@ public:
uint32 _newDate;
int _flags[256];
// Fields used by MM
// TODO: Refactor
int TRAVEL[60];
int STARTTRAVELITEM;
int STARTTRAVELBOX;
int ASK[16];
int _startAboutItem;
int _startAboutBox;
int BOXDATASTART;
int BOXSELECTY;
//
bool _vidEnd;
bool _clearSummaryFlag;

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) : Manager(vm) {
_type = type;
_bounds = Common::Rect(x, y, x + w, y + h);
_bubbleDisplStr = title;
@ -279,4 +279,9 @@ void BubbleBox::doBox(int item, int box) {
delete icons;
}
int BubbleBox::doBox_v1(int item, int box, int &type) {
warning("TODO: dobox_v1");
return -1;
}
} // End of namespace Access

View File

@ -82,6 +82,9 @@ public:
void drawBubble(int index);
void doBox(int item, int box);
int doBox_v1(int item, int box, int &type);
void getList() { warning("TODO: getList"); } // TODO: Check if implementation is useful
};
} // End of namespace Access

View File

@ -38,6 +38,9 @@ Scripts::Scripts(AccessEngine *vm) : Manager(vm) {
_charsOrg = Common::Point(0, 0);
_texsOrg = Common::Point(0, 0);
setOpcodes();
for (int i = 0; i < 60; i++)
TMPLPTR[i] = 0;
}
Scripts::~Scripts() {
@ -392,8 +395,8 @@ void Scripts::cmdNewRoom() {
cmdRetPos();
}
void Scripts::cmdConverse() {
_vm->_conversation = _data->readUint16LE();
void Scripts::converse1(int val) {
_vm->_conversation = val;
_vm->_room->clearRoom();
_vm->freeChar();
_vm->_char->loadChar(_vm->_conversation);
@ -409,6 +412,11 @@ void Scripts::cmdConverse() {
}
}
void Scripts::cmdConverse() {
int val = _data->readUint16LE();
converse1(val);
}
void Scripts::cmdCheckFrame() {
int id = _data->readUint16LE();
Animation *anim = _vm->_animation->findAnimation(id);
@ -475,8 +483,7 @@ void Scripts::cmdSetAbout() {
int idx = _data->readByte();
int val = _data->readByte();
_vm->ASK[idx] = val;
_vm->_startAboutBox = 0;
_vm->_startAboutItem = 0;
_vm->_startAboutBox = _vm->_startAboutItem = 0;
}
void Scripts::cmdSetTimer() {
@ -609,7 +616,41 @@ void Scripts::cmdRemoveLast() {
}
void Scripts::cmdDoTravel() {
error("TODO: DEMO - cmdDoTravel");
while (true) {
_vm->_travelBox->getList();
int type = 0;
int boxX = _vm->_travelBox->doBox_v1(_vm->STARTTRAVELITEM, _vm->STARTTRAVELBOX, type);
_vm->STARTTRAVELITEM = _vm->BOXDATASTART;
_vm->STARTTRAVELBOX = _vm->BOXSELECTY;
if (boxX == -1)
type = 2;
if (type != 2) {
int idx = TMPLPTR[boxX];
warning("TODO: if (_byte1EEB5[idx] != _byte26CB5) {");
// _vm->_bubbleBox->_bubbleTitle = "TRAVEL";
// _vm->_scripts->printString("YOU CAN'T GET THERE FROM HERE.");
// continue;
// }
if (_vm->_player->_roomNumber != idx) {
if (Martian::TRAVEL_POS[idx][0] == -1) {
_vm->_player->_roomNumber = idx;
_vm->_room->_conFlag = true;
_vm->_scripts->converse1(Martian::TRAVEL_POS[idx][1]);
return;
}
_vm->_player->_rawPlayer = Common::Point(Martian::TRAVEL_POS[idx][0], Martian::TRAVEL_POS[idx][1]);
cmdRetPos();
return;
}
}
if (_vm->_player->_roomNumber == -1)
continue;
return;
}
}
void Scripts::cmdCheckAbout() {

View File

@ -44,6 +44,8 @@ private:
void charLoop();
void printWatch();
void converse1(int val);
protected:
Common::SeekableReadStream *_data;
ScriptMethodPtr COMMAND_LIST[100];
@ -143,6 +145,8 @@ public:
int _choice;
int32 _choiceStart;
Common::Point _charsOrg, _texsOrg;
int TMPLPTR[60];
public:
Scripts(AccessEngine *vm);