From 0e370a41625d3bcbbf8b3d770323003765c11824 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Sun, 18 Mar 2007 17:17:21 +0000 Subject: converted DoorData and Zone to Common::Point svn-id: r26215 --- engines/parallaction/animation.cpp | 4 ++-- engines/parallaction/location.cpp | 12 ++++++------ engines/parallaction/parallaction.cpp | 19 +++++++++---------- engines/parallaction/parallaction.h | 2 +- engines/parallaction/saveload.cpp | 4 ++-- engines/parallaction/walk.cpp | 4 ++-- engines/parallaction/zone.cpp | 8 ++++---- engines/parallaction/zone.h | 4 ++-- 8 files changed, 28 insertions(+), 29 deletions(-) (limited to 'engines/parallaction') diff --git a/engines/parallaction/animation.cpp b/engines/parallaction/animation.cpp index 8a47591f8e..e6b7523649 100644 --- a/engines/parallaction/animation.cpp +++ b/engines/parallaction/animation.cpp @@ -138,8 +138,8 @@ Animation *Parallaction::parseAnimation(Script& script, Node *list, char *name) vD0->_z = atoi(_tokens[3]); } if (!scumm_stricmp(_tokens[0], "moveto")) { - vD0->_zone._moveTo._x = atoi(_tokens[1]); - vD0->_zone._moveTo._y = atoi(_tokens[2]); + vD0->_zone._moveTo.x = atoi(_tokens[1]); + vD0->_zone._moveTo.y = atoi(_tokens[2]); } fillBuffers(script, true); diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp index b03c41b23e..24e1ab6093 100644 --- a/engines/parallaction/location.cpp +++ b/engines/parallaction/location.cpp @@ -388,14 +388,14 @@ void Parallaction::changeLocation(char *location) { _vm->_char._ani._zone._oldTop = -1000; _vm->_char._ani.field_50 = 0; - if (_location._startPosition._x != -1000) { - _vm->_char._ani._zone._left = _location._startPosition._x; - _vm->_char._ani._zone._top = _location._startPosition._y; + if (_location._startPosition.x != -1000) { + _vm->_char._ani._zone._left = _location._startPosition.x; + _vm->_char._ani._zone._top = _location._startPosition.y; _vm->_char._ani._frame = _location._startFrame; - _location._startPosition._y = -1000; - _location._startPosition._x = -1000; + _location._startPosition.y = -1000; + _location._startPosition.x = -1000; - debugC(2, kDebugLocation, "changeLocation: initial position set to x: %i, y: %i, f: %i", _location._startPosition._x, _location._startPosition._y, _location._startFrame); + debugC(2, kDebugLocation, "changeLocation: initial position set to x: %i, y: %i, f: %i", _location._startPosition.x, _location._startPosition.y, _location._startFrame); } byte palette[PALETTE_SIZE]; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 0f72f490d3..325ee132e2 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -201,8 +201,8 @@ int Parallaction::init() { memset(_locationNames, 0, 120*32); _numLocations = 0; - _location._startPosition._x = -1000; - _location._startPosition._x = -1000; + _location._startPosition.x = -1000; + _location._startPosition.y = -1000; _location._startFrame = 0; _location._walkNodes._prev = NULL; _location._walkNodes._next = NULL; @@ -260,12 +260,12 @@ void Parallaction::initGame() { strcpy(_saveData1, _location._name); parseLocation(_location._name); - if (_location._startPosition._x != -1000) { - _vm->_char._ani._zone._left = _location._startPosition._x; - _vm->_char._ani._zone._top = _location._startPosition._y; + if (_location._startPosition.x != -1000) { + _vm->_char._ani._zone._left = _location._startPosition.x; + _vm->_char._ani._zone._top = _location._startPosition.y; _vm->_char._ani._frame = _location._startFrame; - _location._startPosition._y = -1000; - _location._startPosition._x = -1000; + _location._startPosition.y = -1000; + _location._startPosition.x = -1000; } return; @@ -614,9 +614,8 @@ Parallaction::InputData *Parallaction::translateInput() { // else it will move to the mouse position _input._event = kEvWalk; _actionAfterWalk = true; - if (z->_moveTo._y != 0) { - _input._mousePos.x = z->_moveTo._x; - _input._mousePos.y = z->_moveTo._y; + if (z->_moveTo.y != 0) { + _input._mousePos = z->_moveTo; } } diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 5fea511a35..5efa287eea 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -222,7 +222,7 @@ class MidiPlayer; struct Location { - Point _startPosition; + Common::Point _startPosition; uint16 _startFrame; Node _walkNodes; char _name[100]; diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 0a2f92985d..1d3f3169ad 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -68,10 +68,10 @@ void Parallaction::doLoadGame(uint16 slot) { strcat(_vm->_location._name, "."); f->readLine(s, 15); - _location._startPosition._x = atoi(s); + _location._startPosition.x = atoi(s); f->readLine(s, 15); - _location._startPosition._y = atoi(s); + _location._startPosition.y = atoi(s); f->readLine(s, 15); _score = atoi(s); diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index 996d87eb20..d8fb254d36 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -419,8 +419,8 @@ uint16 checkDoor() { if (z != NULL) { if ((z->_flags & kFlagsClosed) == 0) { - _vm->_location._startPosition._x = z->u.door->_startPos._x; - _vm->_location._startPosition._y = z->u.door->_startPos._y; + _vm->_location._startPosition.x = z->u.door->_startPos.x; + _vm->_location._startPosition.y = z->u.door->_startPos.y; _vm->_location._startFrame = z->u.door->_startFrame; strcpy( _vm->_location._name, z->u.door->_location ); diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp index 47a4556c4b..7f8ed55544 100644 --- a/engines/parallaction/zone.cpp +++ b/engines/parallaction/zone.cpp @@ -83,8 +83,8 @@ void Parallaction::parseZone(Script &script, Node *list, char *name) { z->_bottom = atoi(_tokens[4]); } if (!scumm_stricmp(_tokens[0], "moveto")) { - z->_moveTo._x = atoi(_tokens[1]); - z->_moveTo._y = atoi(_tokens[2]); + z->_moveTo.x = atoi(_tokens[1]); + z->_moveTo.y = atoi(_tokens[2]); } if (!scumm_stricmp(_tokens[0], "type")) { if (_tokens[2][0] != '\0') { @@ -299,8 +299,8 @@ void Parallaction::parseZoneTypeBlock(Script &script, Zone *z) { } if (!scumm_stricmp(_tokens[0], "startpos")) { - u->door->_startPos._x = atoi(_tokens[1]); - u->door->_startPos._y = atoi(_tokens[2]); + u->door->_startPos.x = atoi(_tokens[1]); + u->door->_startPos.y = atoi(_tokens[2]); u->door->_startFrame = atoi(_tokens[3]); } break; diff --git a/engines/parallaction/zone.h b/engines/parallaction/zone.h index 3c6b9162aa..b2b109e1f8 100644 --- a/engines/parallaction/zone.h +++ b/engines/parallaction/zone.h @@ -97,7 +97,7 @@ struct DoorData { // size = 28 char* _location; Cnv _cnv; byte* _background; - Point _startPos; + Common::Point _startPos; uint16 _startFrame; }; struct HearData { // size = 20 @@ -139,7 +139,7 @@ struct Zone : public Node { uint16 field_2E; // unused TypeData u; Command *_commands; - Point _moveTo; + Common::Point _moveTo; void getRect(Common::Rect& r) const { r.left = _left; -- cgit v1.2.3