aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Mettifogo2009-03-23 20:41:54 +0000
committerNicola Mettifogo2009-03-23 20:41:54 +0000
commit2223627c7541651efd49f0718bbfe71a1625cee3 (patch)
treee0ef02054a967b3ea4b733d75b30e32e2e517963
parent7f641cc6becc7481460d77c3e3b78a2eeb5788b0 (diff)
downloadscummvm-rg350-2223627c7541651efd49f0718bbfe71a1625cee3.tar.gz
scummvm-rg350-2223627c7541651efd49f0718bbfe71a1625cee3.tar.bz2
scummvm-rg350-2223627c7541651efd49f0718bbfe71a1625cee3.zip
Merged GetData, HearData, SpeakData, PathData, ExamineData, MergeData into TypeData struct. This simplifies life a bit especially in the parsers.
svn-id: r39645
-rw-r--r--engines/parallaction/dialogue.cpp8
-rw-r--r--engines/parallaction/exec_br.cpp2
-rw-r--r--engines/parallaction/input.cpp6
-rw-r--r--engines/parallaction/objects.cpp41
-rw-r--r--engines/parallaction/objects.h139
-rw-r--r--engines/parallaction/parallaction.cpp42
-rw-r--r--engines/parallaction/parser_br.cpp47
-rw-r--r--engines/parallaction/parser_ns.cpp76
-rw-r--r--engines/parallaction/walk.cpp22
9 files changed, 129 insertions, 254 deletions
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index e41f7f3272..e3c505f7d4 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -176,9 +176,9 @@ DialogueManager::DialogueManager(Parallaction *vm, ZonePtr z) : _vm(vm), _z(z) {
} else
error("unsupported game in DialogueManager");
- _dialogue = _z->u.speak->_dialogue;
- isNpc = scumm_stricmp(_z->u.speak->_name, "yourself") && _z->u.speak->_name[0] != '\0';
- _questioner = isNpc ? _vm->_disk->loadTalk(_z->u.speak->_name) : _vm->_char._talk;
+ _dialogue = _z->u._speakDialogue;
+ isNpc = !_z->u._filename.empty() && _z->u._filename.compareToIgnoreCase("yourself");
+ _questioner = isNpc ? _vm->_disk->loadTalk(_z->u._filename.c_str()) : _vm->_char._talk;
_answerer = _vm->_char._talk;
_askPassword = false;
@@ -432,7 +432,7 @@ void DialogueManager::run() {
}
void Parallaction::enterDialogueMode(ZonePtr z) {
- debugC(1, kDebugDialogue, "Parallaction::enterDialogueMode(%s)", z->u.speak->_name);
+ debugC(1, kDebugDialogue, "Parallaction::enterDialogueMode(%s)", z->u._filename.c_str());
_dialogueMan = _vm->createDialogueManager(z);
_input->_inputMode = Input::kInputModeDialogue;
}
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index b0421f497a..a6980e5749 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -203,7 +203,7 @@ DECLARE_COMMAND_OPCODE(add) {
DECLARE_COMMAND_OPCODE(leave) {
ZonePtr z = ctxt._cmd->u._zone;
- _vm->dropItem(z->u.get->_icon);
+ _vm->dropItem(z->u._getIcon);
_vm->showZone(z, true);
}
diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp
index 3fbd65d196..92f3f026d1 100644
--- a/engines/parallaction/input.cpp
+++ b/engines/parallaction/input.cpp
@@ -375,9 +375,9 @@ void Input::exitInventoryMode() {
ZonePtr z = _vm->hitZone(kZoneMerge, _activeItem._index, _vm->getInventoryItemIndex(pos));
if (z) {
- _vm->dropItem(z->u.merge->_obj1);
- _vm->dropItem(z->u.merge->_obj2);
- _vm->addInventoryItem(z->u.merge->_obj3);
+ _vm->dropItem(z->u._mergeObj1);
+ _vm->dropItem(z->u._mergeObj2);
+ _vm->addInventoryItem(z->u._mergeObj3);
_vm->_cmdExec->run(z->_commands);
}
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index daffe4393d..c852d58881 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -191,47 +191,6 @@ Zone::Zone() {
Zone::~Zone() {
// printf("~Zone(%s)\n", _name);
- switch (ACTIONTYPE(this)) {
- case kZoneExamine:
- free(u.examine->_filename);
- u.examine->_description.clear();
- delete u.examine->_cnv;
- delete u.examine;
- break;
-
- case kZoneDoor:
- free(u.door->_location);
- u.door->gfxobj->release();
- delete u.door;
- break;
-
- case kZoneSpeak:
- delete u.speak->_dialogue;
- delete u.speak;
- break;
-
- case kZoneGet:
- u.get->gfxobj->release();
- delete u.get;
- break;
-
- case kZoneHear:
- delete u.hear;
- break;
-
- case kZoneMerge:
- delete u.merge;
- break;
-
- case kZonePath:
- delete u.path;
- break;
-
- default:
- break;
- }
-
-
free(_linkedName);
}
diff --git a/engines/parallaction/objects.h b/engines/parallaction/objects.h
index 89ed1350bd..b97c168327 100644
--- a/engines/parallaction/objects.h
+++ b/engines/parallaction/objects.h
@@ -193,102 +193,63 @@ struct Dialogue {
~Dialogue();
};
-struct GetData {
- uint32 _icon;
- GfxObj *gfxobj;
+#define MAX_WALKPOINT_LISTS 20
- GetData() {
- _icon = 0;
- gfxobj = NULL;
- }
-};
-struct SpeakData {
- char _name[32];
- Dialogue *_dialogue;
+struct TypeData {
+ // common
+ GfxObj *_gfxobj; // get, examine, door
+ Common::String _filename; // speak, examine, hear
- SpeakData() {
- _name[0] = '\0';
- _dialogue = NULL;
- }
-};
-struct ExamineData {
- GfxObj *_cnv;
- Common::String _description;
- char* _filename;
-
- ExamineData() {
- _filename = NULL;
- _cnv = NULL;
- }
-};
-struct DoorData {
- char* _location;
- GfxObj *gfxobj;
- Common::Point _startPos;
- uint16 _startFrame;
- // BRA specific
- Common::Point _startPos2;
- uint16 _startFrame2;
-
- DoorData() {
- _location = NULL;
- _startFrame = 0;
- _startPos.x = -1000;
- _startPos.y = -1000;
- _startFrame2 = 0;
- _startPos2.x = -1000;
- _startPos2.y = -1000;
- gfxobj = NULL;
- }
-};
-struct HearData { // size = 20
- char _name[20];
- int _channel;
- int _freq;
-
- HearData() {
- _channel = -1;
- _freq = -1;
- _name[0] = '\0';
- }
-};
-struct MergeData { // size = 12
- uint32 _obj1;
- uint32 _obj2;
- uint32 _obj3;
+ // get
+ uint32 _getIcon;
- MergeData() {
- _obj1 = _obj2 = _obj3 = 0;
- }
-};
-#define MAX_WALKPOINT_LISTS 20
-struct PathData {
- int _numLists;
- PointList _lists[MAX_WALKPOINT_LISTS];
+ // speak
+ Dialogue *_speakDialogue;
- PathData() {
- _numLists = 0;
- }
-};
+ // examine
+ Common::String _examineText;
-struct TypeData {
- GetData *get;
- SpeakData *speak;
- ExamineData *examine;
- DoorData *door;
- HearData *hear;
- MergeData *merge;
- // BRA specific field
- PathData *path;
+ // door
+ Common::String _doorLocation;
+ Common::Point _doorStartPos;
+ uint16 _doorStartFrame;
+ Common::Point _doorStartPos2_br;
+ uint16 _doorStartFrame2_br;
+
+ // hear
+ int _hearChannel;
+ int _hearFreq;
+
+ // merge
+ uint32 _mergeObj1;
+ uint32 _mergeObj2;
+ uint32 _mergeObj3;
+
+ // path
+ int _pathNumLists;
+ PointList _pathLists[MAX_WALKPOINT_LISTS];
TypeData() {
- get = NULL;
- speak = NULL;
- examine = NULL;
- door = NULL;
- hear = NULL;
- merge = NULL;
- path = NULL;
+ _gfxobj = 0;
+ _getIcon = 0;
+ _speakDialogue = 0;
+ _doorStartFrame = 0;
+ _doorStartPos.x = -1000;
+ _doorStartPos.y = -1000;
+ _doorStartFrame2_br = 0;
+ _doorStartPos2_br.x = -1000;
+ _doorStartPos2_br.y = -1000;
+ _hearChannel = -1;
+ _hearFreq = -1;
+ _mergeObj1 = 0;
+ _mergeObj2 = 0;
+ _mergeObj3 = 0;
+ _pathNumLists = 0;
+ }
+
+ ~TypeData() {
+ _gfxobj->release();
+ delete _speakDialogue;
}
};
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 7b6f3b464e..ac7a2cada9 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -467,10 +467,10 @@ void Parallaction::drawZone(ZonePtr zone) {
GfxObj *obj = 0;
if (ACTIONTYPE(zone) == kZoneGet) {
- obj = zone->u.get->gfxobj;
+ obj = zone->u._gfxobj;
} else
if (ACTIONTYPE(zone) == kZoneDoor) {
- obj = zone->u.door->gfxobj;
+ obj = zone->u._gfxobj;
}
if (!obj) {
@@ -520,7 +520,7 @@ void Parallaction::showZone(ZonePtr z, bool visible) {
}
if (ACTIONTYPE(z) == kZoneGet) {
- _gfx->showGfxObj(z->u.get->gfxobj, visible);
+ _gfx->showGfxObj(z->u._gfxobj, visible);
}
}
@@ -536,32 +536,32 @@ void Parallaction::enterCommentMode(ZonePtr z) {
_commentZone = z;
- ExamineData *data = _commentZone->u.examine;
+ TypeData *data = &_commentZone->u;
- if (data->_description.empty()) {
+ if (data->_examineText.empty()) {
return;
}
// TODO: move this balloons stuff into DialogueManager and BalloonManager
if (getGameType() == GType_Nippon) {
- if (data->_filename) {
- if (data->_cnv == 0) {
- data->_cnv = _disk->loadStatic(data->_filename);
+ if (!data->_filename.empty()) {
+ if (data->_gfxobj == 0) {
+ data->_gfxobj = _disk->loadStatic(data->_filename.c_str());
}
_gfx->setHalfbriteMode(true);
- _balloonMan->setSingleBalloon(data->_description.c_str(), 0, 90, 0, BalloonManager::kNormalColor);
+ _balloonMan->setSingleBalloon(data->_examineText.c_str(), 0, 90, 0, BalloonManager::kNormalColor);
Common::Rect r;
- data->_cnv->getRect(0, r);
- _gfx->setItem(data->_cnv, 140, (_screenHeight - r.height())/2);
+ data->_gfxobj->getRect(0, r);
+ _gfx->setItem(data->_gfxobj, 140, (_screenHeight - r.height())/2);
_gfx->setItem(_char._head, 100, 152);
} else {
- _balloonMan->setSingleBalloon(data->_description.c_str(), 140, 10, 0, BalloonManager::kNormalColor);
+ _balloonMan->setSingleBalloon(data->_examineText.c_str(), 140, 10, 0, BalloonManager::kNormalColor);
_gfx->setItem(_char._talk, 190, 80);
}
} else
if (getGameType() == GType_BRA) {
- _balloonMan->setSingleBalloon(data->_description.c_str(), 0, 0, 1, BalloonManager::kNormalColor);
+ _balloonMan->setSingleBalloon(data->_examineText.c_str(), 0, 0, 1, BalloonManager::kNormalColor);
_gfx->setItem(_char._talk, 10, 80);
}
@@ -611,10 +611,10 @@ void Parallaction::runZone(ZonePtr z) {
break;
case kZoneHear:
- _soundMan->execute(SC_SETSFXCHANNEL, z->u.hear->_channel);
+ _soundMan->execute(SC_SETSFXCHANNEL, z->u._hearChannel);
_soundMan->execute(SC_SETSFXLOOPING, (int)((z->_flags & kFlagsLooping) == kFlagsLooping));
_soundMan->execute(SC_SETSFXVOLUME, 60);
- _soundMan->execute(SC_PLAYSFX, z->u.hear->_name);
+ _soundMan->execute(SC_PLAYSFX, z->u._filename.c_str());
break;
case kZoneSpeak:
@@ -635,10 +635,10 @@ void Parallaction::runZone(ZonePtr z) {
void Parallaction::updateDoor(ZonePtr z, bool close) {
z->_flags = close ? (z->_flags |= kFlagsClosed) : (z->_flags &= ~kFlagsClosed);
- if (z->u.door->gfxobj) {
+ if (z->u._gfxobj) {
uint frame = (close ? 0 : 1);
-// z->u.door->gfxobj->setFrame(frame);
- z->u.door->gfxobj->frame = frame;
+// z->u._gfxobj->setFrame(frame);
+ z->u._gfxobj->frame = frame;
}
return;
@@ -655,7 +655,7 @@ bool Parallaction::pickupItem(ZonePtr z) {
return false;
}
- int slot = addInventoryItem(z->u.get->_icon);
+ int slot = addInventoryItem(z->u._getIcon);
if (slot != -1) {
showZone(z, false);
}
@@ -673,8 +673,8 @@ bool Parallaction::checkSpecialZoneBox(ZonePtr z, uint32 type, uint x, uint y) {
// WORKAROUND: this huge condition is needed because we made TypeData a collection of structs
// instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine,
// but we need to check it separately here. The same workaround is applied in freeZones.
- if (((ACTIONTYPE(z) == kZoneMerge) && (((x == z->u.merge->_obj1) && (y == z->u.merge->_obj2)) || ((x == z->u.merge->_obj2) && (y == z->u.merge->_obj1)))) ||
- ((ACTIONTYPE(z) == kZoneGet) && ((x == z->u.get->_icon) || (y == z->u.get->_icon)))) {
+ if (((ACTIONTYPE(z) == kZoneMerge) && (((x == z->u._mergeObj1) && (y == z->u._mergeObj2)) || ((x == z->u._mergeObj2) && (y == z->u._mergeObj1)))) ||
+ ((ACTIONTYPE(z) == kZoneGet) && ((x == z->u._getIcon) || (y == z->u._getIcon)))) {
// WORKAROUND for bug 2070751: special zones are only used in NS, to allow the
// the EXAMINE/USE action to be applied on some particular item in the inventory.
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index 5f238215dc..718bb9ccdb 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -754,27 +754,21 @@ DECLARE_ZONE_PARSER(type) {
}
void LocationParser_br::parsePathData(ZonePtr z) {
-
- PathData *data = new PathData;
-
+ TypeData *data = &z->u;
do {
if (!scumm_stricmp("zone", _tokens[0])) {
int id = atoi(_tokens[1]);
- parsePointList(data->_lists[id]);
- data->_numLists++;
+ parsePointList(data->_pathLists[id]);
+ data->_pathNumLists++;
}
_script->readLineToken(true);
} while (scumm_stricmp("endzone", _tokens[0]));
-
- z->u.path = data;
}
void LocationParser_br::parseGetData(ZonePtr z) {
-
- GetData *data = new GetData;
-
+ TypeData *data = &z->u;
do {
if (!scumm_stricmp(_tokens[0], "file")) {
@@ -784,31 +778,27 @@ void LocationParser_br::parseGetData(ZonePtr z) {
obj->x = z->getX();
obj->y = z->getY();
obj->_prog = _zoneProg;
- data->gfxobj = obj;
+ data->_gfxobj = obj;
}
if (!scumm_stricmp(_tokens[0], "mask")) {
- ctxt.info->loadGfxObjMask(_tokens[1], data->gfxobj);
+ ctxt.info->loadGfxObjMask(_tokens[1], data->_gfxobj);
}
if (!scumm_stricmp(_tokens[0], "path")) {
- ctxt.info->loadGfxObjPath(_tokens[1], data->gfxobj);
+ ctxt.info->loadGfxObjPath(_tokens[1], data->_gfxobj);
}
if (!scumm_stricmp(_tokens[0], "icon")) {
- data->_icon = 4 + _vm->_objectsNames->lookup(_tokens[1]);
+ data->_getIcon = 4 + _vm->_objectsNames->lookup(_tokens[1]);
}
_script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone"));
-
- z->u.get = data;
}
void LocationParser_br::parseDoorData(ZonePtr z) {
-
- DoorData *data = new DoorData;
-
+ TypeData *data = &z->u;
do {
if (!scumm_stricmp(_tokens[0], "slidetext")) {
@@ -817,7 +807,7 @@ void LocationParser_br::parseDoorData(ZonePtr z) {
}
if (!scumm_stricmp(_tokens[0], "location")) {
- data->_location = strdup(_tokens[1]);
+ data->_doorLocation = strdup(_tokens[1]);
}
if (!scumm_stricmp(_tokens[0], "file")) {
@@ -831,26 +821,23 @@ void LocationParser_br::parseDoorData(ZonePtr z) {
obj->y = z->getY();
_vm->_gfx->showGfxObj(obj, true);
- data->gfxobj = obj;
+ data->_gfxobj = obj;
}
if (!scumm_stricmp(_tokens[0], "startpos")) {
- data->_startPos.x = atoi(_tokens[1]);
- data->_startPos.y = atoi(_tokens[2]);
- data->_startFrame = atoi(_tokens[3]);
+ data->_doorStartPos.x = atoi(_tokens[1]);
+ data->_doorStartPos.y = atoi(_tokens[2]);
+ data->_doorStartFrame = atoi(_tokens[3]);
}
if (!scumm_stricmp(_tokens[0], "startpos2")) {
- data->_startPos2.x = atoi(_tokens[1]);
- data->_startPos2.y = atoi(_tokens[2]);
- data->_startFrame2 = atoi(_tokens[3]);
+ data->_doorStartPos2_br.x = atoi(_tokens[1]);
+ data->_doorStartPos2_br.y = atoi(_tokens[2]);
+ data->_doorStartFrame2_br = atoi(_tokens[3]);
}
_script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone") && scumm_stricmp(_tokens[0], "endanimation"));
-
- z->u.door = data;
-
}
void LocationParser_br::parseZoneTypeBlock(ZonePtr z) {
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index 37aa9949c3..02e23393f8 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -1385,9 +1385,7 @@ void LocationParser_ns::parseZone(ZoneList &list, char *name) {
void LocationParser_ns::parseGetData(ZonePtr z) {
-
- GetData *data = new GetData;
-
+ TypeData *data = &z->u;
do {
if (!scumm_stricmp(_tokens[0], "file")) {
@@ -1401,46 +1399,35 @@ void LocationParser_ns::parseGetData(ZonePtr z) {
obj->_prog = _zoneProg;
_vm->_gfx->showGfxObj(obj, visible);
- data->gfxobj = obj;
+ data->_gfxobj = obj;
}
if (!scumm_stricmp(_tokens[0], "icon")) {
- data->_icon = 4 + _vm->_objectsNames->lookup(_tokens[1]);
+ data->_getIcon = 4 + _vm->_objectsNames->lookup(_tokens[1]);
}
_script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone") && scumm_stricmp(_tokens[0], "endanimation"));
-
- z->u.get = data;
-
}
void LocationParser_ns::parseExamineData(ZonePtr z) {
-
- ExamineData *data = new ExamineData;
-
+ TypeData *data = &z->u;
do {
if (!scumm_stricmp(_tokens[0], "file")) {
data->_filename = strdup(_tokens[1]);
}
if (!scumm_stricmp(_tokens[0], "desc")) {
- data->_description = parseComment();
+ data->_examineText = parseComment();
}
-
_script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone") && scumm_stricmp(_tokens[0], "endanimation"));
-
- z->u.examine = data;
-
}
void LocationParser_ns::parseDoorData(ZonePtr z) {
-
- DoorData *data = new DoorData;
-
+ TypeData *data = &z->u;
do {
if (!scumm_stricmp(_tokens[0], "slidetext")) {
@@ -1449,7 +1436,7 @@ void LocationParser_ns::parseDoorData(ZonePtr z) {
}
if (!scumm_stricmp(_tokens[0], "location")) {
- data->_location = strdup(_tokens[1]);
+ data->_doorLocation = strdup(_tokens[1]);
}
if (!scumm_stricmp(_tokens[0], "file")) {
@@ -1463,85 +1450,66 @@ void LocationParser_ns::parseDoorData(ZonePtr z) {
obj->y = z->getY();
_vm->_gfx->showGfxObj(obj, true);
- data->gfxobj = obj;
+ data->_gfxobj = obj;
}
if (!scumm_stricmp(_tokens[0], "startpos")) {
- data->_startPos.x = atoi(_tokens[1]);
- data->_startPos.y = atoi(_tokens[2]);
- data->_startFrame = atoi(_tokens[3]);
+ data->_doorStartPos.x = atoi(_tokens[1]);
+ data->_doorStartPos.y = atoi(_tokens[2]);
+ data->_doorStartFrame = atoi(_tokens[3]);
}
_script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone") && scumm_stricmp(_tokens[0], "endanimation"));
-
- z->u.door = data;
-
}
void LocationParser_ns::parseMergeData(ZonePtr z) {
-
- MergeData *data = new MergeData;
-
+ TypeData *data = &z->u;
do {
if (!scumm_stricmp(_tokens[0], "obj1")) {
- data->_obj1 = 4 + _vm->_objectsNames->lookup(_tokens[1]);
+ data->_mergeObj1 = 4 + _vm->_objectsNames->lookup(_tokens[1]);
}
if (!scumm_stricmp(_tokens[0], "obj2")) {
- data->_obj2 = 4 + _vm->_objectsNames->lookup(_tokens[1]);
+ data->_mergeObj2 = 4 + _vm->_objectsNames->lookup(_tokens[1]);
}
if (!scumm_stricmp(_tokens[0], "newobj")) {
- data->_obj3 = 4 + _vm->_objectsNames->lookup(_tokens[1]);
+ data->_mergeObj3 = 4 + _vm->_objectsNames->lookup(_tokens[1]);
}
_script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone") && scumm_stricmp(_tokens[0], "endanimation"));
-
- z->u.merge = data;
-
}
void LocationParser_ns::parseHearData(ZonePtr z) {
-
- HearData *data = new HearData;
-
+ TypeData *data = &z->u;
do {
if (!scumm_stricmp(_tokens[0], "sound")) {
- strcpy(data->_name, _tokens[1]);
- data->_channel = atoi(_tokens[2]);
+ data->_filename = _tokens[1];
+ data->_hearChannel = atoi(_tokens[2]);
}
if (!scumm_stricmp(_tokens[0], "freq")) {
- data->_freq = atoi(_tokens[1]);
+ data->_hearFreq = atoi(_tokens[1]);
}
-
_script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone") && scumm_stricmp(_tokens[0], "endanimation"));
-
- z->u.hear = data;
-
}
void LocationParser_ns::parseSpeakData(ZonePtr z) {
-
- SpeakData *data = new SpeakData;
-
+ TypeData *data = &z->u;
do {
if (!scumm_stricmp(_tokens[0], "file")) {
- strcpy(data->_name, _tokens[1]);
+ data->_filename = _tokens[1];
}
if (!scumm_stricmp(_tokens[0], "Dialogue")) {
- data->_dialogue = parseDialogue();
+ data->_speakDialogue = parseDialogue();
}
_script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone") && scumm_stricmp(_tokens[0], "endanimation"));
-
- z->u.speak = data;
-
}
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp
index f9fd6254e1..485f85490b 100644
--- a/engines/parallaction/walk.cpp
+++ b/engines/parallaction/walk.cpp
@@ -287,9 +287,9 @@ void PathWalker_NS::checkDoor(const Common::Point &foot) {
ZonePtr z = _vm->hitZone(kZoneDoor, foot.x, foot.y);
if (z) {
if ((z->_flags & kFlagsClosed) == 0) {
- _vm->_location._startPosition = z->u.door->_startPos;
- _vm->_location._startFrame = z->u.door->_startFrame;
- _vm->scheduleLocationSwitch(z->u.door->_location);
+ _vm->_location._startPosition = z->u._doorStartPos;
+ _vm->_location._startFrame = z->u._doorStartFrame;
+ _vm->scheduleLocationSwitch(z->u._doorLocation.c_str());
_vm->_zoneTrap.reset();
} else {
_vm->_cmdExec->run(z->_commands, z);
@@ -478,14 +478,14 @@ void PathWalker_BR::buildPath(State &s, uint16 x, uint16 y) {
// build complex path
int id = atoi(z0->_name);
- if (z1->u.path->_lists[id].empty()) {
+ if (z1->u._pathLists[id].empty()) {
s._walkPath.clear();
debugC(3, kDebugWalk, "buildPath: no path");
return;
}
- PointList::iterator b = z1->u.path->_lists[id].begin();
- PointList::iterator e = z1->u.path->_lists[id].end();
+ PointList::iterator b = z1->u._pathLists[id].begin();
+ PointList::iterator e = z1->u._pathLists[id].end();
for ( ; b != e; ++b) {
s._walkPath.push_front(*b);
}
@@ -502,21 +502,21 @@ void PathWalker_BR::finalizeWalk(State &s) {
ZonePtr z = _vm->hitZone(kZoneDoor, foot.x, foot.y);
if (z && ((z->_flags & kFlagsClosed) == 0)) {
- _vm->_location._startPosition = z->u.door->_startPos; // foot pos
- _vm->_location._startFrame = z->u.door->_startFrame;
+ _vm->_location._startPosition = z->u._doorStartPos; // foot pos
+ _vm->_location._startFrame = z->u._doorStartFrame;
// TODO: implement working follower. Must find out a location in which the code is
// used and which is stable enough.
if (_follower._active) {
- _vm->_location._followerStartPosition = z->u.door->_startPos2; // foot pos
- _vm->_location._followerStartFrame = z->u.door->_startFrame2;
+ _vm->_location._followerStartPosition = z->u._doorStartPos2_br; // foot pos
+ _vm->_location._followerStartFrame = z->u._doorStartFrame2_br;
} else {
_vm->_location._followerStartPosition.x = -1000;
_vm->_location._followerStartPosition.y = -1000;
_vm->_location._followerStartFrame = 0;
}
- _vm->scheduleLocationSwitch(z->u.door->_location);
+ _vm->scheduleLocationSwitch(z->u._doorLocation.c_str());
_vm->_cmdExec->run(z->_commands, z);
}