converted DoorData and Zone to Common::Point
svn-id: r26215
This commit is contained in:
parent
919985e4df
commit
0e370a4162
8 changed files with 28 additions and 29 deletions
|
@ -138,8 +138,8 @@ Animation *Parallaction::parseAnimation(Script& script, Node *list, char *name)
|
||||||
vD0->_z = atoi(_tokens[3]);
|
vD0->_z = atoi(_tokens[3]);
|
||||||
}
|
}
|
||||||
if (!scumm_stricmp(_tokens[0], "moveto")) {
|
if (!scumm_stricmp(_tokens[0], "moveto")) {
|
||||||
vD0->_zone._moveTo._x = atoi(_tokens[1]);
|
vD0->_zone._moveTo.x = atoi(_tokens[1]);
|
||||||
vD0->_zone._moveTo._y = atoi(_tokens[2]);
|
vD0->_zone._moveTo.y = atoi(_tokens[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
fillBuffers(script, true);
|
fillBuffers(script, true);
|
||||||
|
|
|
@ -388,14 +388,14 @@ void Parallaction::changeLocation(char *location) {
|
||||||
_vm->_char._ani._zone._oldTop = -1000;
|
_vm->_char._ani._zone._oldTop = -1000;
|
||||||
|
|
||||||
_vm->_char._ani.field_50 = 0;
|
_vm->_char._ani.field_50 = 0;
|
||||||
if (_location._startPosition._x != -1000) {
|
if (_location._startPosition.x != -1000) {
|
||||||
_vm->_char._ani._zone._left = _location._startPosition._x;
|
_vm->_char._ani._zone._left = _location._startPosition.x;
|
||||||
_vm->_char._ani._zone._top = _location._startPosition._y;
|
_vm->_char._ani._zone._top = _location._startPosition.y;
|
||||||
_vm->_char._ani._frame = _location._startFrame;
|
_vm->_char._ani._frame = _location._startFrame;
|
||||||
_location._startPosition._y = -1000;
|
_location._startPosition.y = -1000;
|
||||||
_location._startPosition._x = -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];
|
byte palette[PALETTE_SIZE];
|
||||||
|
|
|
@ -201,8 +201,8 @@ int Parallaction::init() {
|
||||||
memset(_locationNames, 0, 120*32);
|
memset(_locationNames, 0, 120*32);
|
||||||
_numLocations = 0;
|
_numLocations = 0;
|
||||||
|
|
||||||
_location._startPosition._x = -1000;
|
_location._startPosition.x = -1000;
|
||||||
_location._startPosition._x = -1000;
|
_location._startPosition.y = -1000;
|
||||||
_location._startFrame = 0;
|
_location._startFrame = 0;
|
||||||
_location._walkNodes._prev = NULL;
|
_location._walkNodes._prev = NULL;
|
||||||
_location._walkNodes._next = NULL;
|
_location._walkNodes._next = NULL;
|
||||||
|
@ -260,12 +260,12 @@ void Parallaction::initGame() {
|
||||||
strcpy(_saveData1, _location._name);
|
strcpy(_saveData1, _location._name);
|
||||||
parseLocation(_location._name);
|
parseLocation(_location._name);
|
||||||
|
|
||||||
if (_location._startPosition._x != -1000) {
|
if (_location._startPosition.x != -1000) {
|
||||||
_vm->_char._ani._zone._left = _location._startPosition._x;
|
_vm->_char._ani._zone._left = _location._startPosition.x;
|
||||||
_vm->_char._ani._zone._top = _location._startPosition._y;
|
_vm->_char._ani._zone._top = _location._startPosition.y;
|
||||||
_vm->_char._ani._frame = _location._startFrame;
|
_vm->_char._ani._frame = _location._startFrame;
|
||||||
_location._startPosition._y = -1000;
|
_location._startPosition.y = -1000;
|
||||||
_location._startPosition._x = -1000;
|
_location._startPosition.x = -1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -614,9 +614,8 @@ Parallaction::InputData *Parallaction::translateInput() {
|
||||||
// else it will move to the mouse position
|
// else it will move to the mouse position
|
||||||
_input._event = kEvWalk;
|
_input._event = kEvWalk;
|
||||||
_actionAfterWalk = true;
|
_actionAfterWalk = true;
|
||||||
if (z->_moveTo._y != 0) {
|
if (z->_moveTo.y != 0) {
|
||||||
_input._mousePos.x = z->_moveTo._x;
|
_input._mousePos = z->_moveTo;
|
||||||
_input._mousePos.y = z->_moveTo._y;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ class MidiPlayer;
|
||||||
|
|
||||||
struct Location {
|
struct Location {
|
||||||
|
|
||||||
Point _startPosition;
|
Common::Point _startPosition;
|
||||||
uint16 _startFrame;
|
uint16 _startFrame;
|
||||||
Node _walkNodes;
|
Node _walkNodes;
|
||||||
char _name[100];
|
char _name[100];
|
||||||
|
|
|
@ -68,10 +68,10 @@ void Parallaction::doLoadGame(uint16 slot) {
|
||||||
strcat(_vm->_location._name, ".");
|
strcat(_vm->_location._name, ".");
|
||||||
|
|
||||||
f->readLine(s, 15);
|
f->readLine(s, 15);
|
||||||
_location._startPosition._x = atoi(s);
|
_location._startPosition.x = atoi(s);
|
||||||
|
|
||||||
f->readLine(s, 15);
|
f->readLine(s, 15);
|
||||||
_location._startPosition._y = atoi(s);
|
_location._startPosition.y = atoi(s);
|
||||||
|
|
||||||
f->readLine(s, 15);
|
f->readLine(s, 15);
|
||||||
_score = atoi(s);
|
_score = atoi(s);
|
||||||
|
|
|
@ -419,8 +419,8 @@ uint16 checkDoor() {
|
||||||
if (z != NULL) {
|
if (z != NULL) {
|
||||||
|
|
||||||
if ((z->_flags & kFlagsClosed) == 0) {
|
if ((z->_flags & kFlagsClosed) == 0) {
|
||||||
_vm->_location._startPosition._x = z->u.door->_startPos._x;
|
_vm->_location._startPosition.x = z->u.door->_startPos.x;
|
||||||
_vm->_location._startPosition._y = z->u.door->_startPos._y;
|
_vm->_location._startPosition.y = z->u.door->_startPos.y;
|
||||||
_vm->_location._startFrame = z->u.door->_startFrame;
|
_vm->_location._startFrame = z->u.door->_startFrame;
|
||||||
strcpy( _vm->_location._name, z->u.door->_location );
|
strcpy( _vm->_location._name, z->u.door->_location );
|
||||||
|
|
||||||
|
|
|
@ -83,8 +83,8 @@ void Parallaction::parseZone(Script &script, Node *list, char *name) {
|
||||||
z->_bottom = atoi(_tokens[4]);
|
z->_bottom = atoi(_tokens[4]);
|
||||||
}
|
}
|
||||||
if (!scumm_stricmp(_tokens[0], "moveto")) {
|
if (!scumm_stricmp(_tokens[0], "moveto")) {
|
||||||
z->_moveTo._x = atoi(_tokens[1]);
|
z->_moveTo.x = atoi(_tokens[1]);
|
||||||
z->_moveTo._y = atoi(_tokens[2]);
|
z->_moveTo.y = atoi(_tokens[2]);
|
||||||
}
|
}
|
||||||
if (!scumm_stricmp(_tokens[0], "type")) {
|
if (!scumm_stricmp(_tokens[0], "type")) {
|
||||||
if (_tokens[2][0] != '\0') {
|
if (_tokens[2][0] != '\0') {
|
||||||
|
@ -299,8 +299,8 @@ void Parallaction::parseZoneTypeBlock(Script &script, Zone *z) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!scumm_stricmp(_tokens[0], "startpos")) {
|
if (!scumm_stricmp(_tokens[0], "startpos")) {
|
||||||
u->door->_startPos._x = atoi(_tokens[1]);
|
u->door->_startPos.x = atoi(_tokens[1]);
|
||||||
u->door->_startPos._y = atoi(_tokens[2]);
|
u->door->_startPos.y = atoi(_tokens[2]);
|
||||||
u->door->_startFrame = atoi(_tokens[3]);
|
u->door->_startFrame = atoi(_tokens[3]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -97,7 +97,7 @@ struct DoorData { // size = 28
|
||||||
char* _location;
|
char* _location;
|
||||||
Cnv _cnv;
|
Cnv _cnv;
|
||||||
byte* _background;
|
byte* _background;
|
||||||
Point _startPos;
|
Common::Point _startPos;
|
||||||
uint16 _startFrame;
|
uint16 _startFrame;
|
||||||
};
|
};
|
||||||
struct HearData { // size = 20
|
struct HearData { // size = 20
|
||||||
|
@ -139,7 +139,7 @@ struct Zone : public Node {
|
||||||
uint16 field_2E; // unused
|
uint16 field_2E; // unused
|
||||||
TypeData u;
|
TypeData u;
|
||||||
Command *_commands;
|
Command *_commands;
|
||||||
Point _moveTo;
|
Common::Point _moveTo;
|
||||||
|
|
||||||
void getRect(Common::Rect& r) const {
|
void getRect(Common::Rect& r) const {
|
||||||
r.left = _left;
|
r.left = _left;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue