diff options
author | Gregory Montoir | 2004-01-08 14:10:32 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-01-08 14:10:32 +0000 |
commit | 85f8b442f212e4eb1b044cc7ed23747a4ca4e76b (patch) | |
tree | fc67ec16e20bbe5d3b02f4d7553ca75e743b6b14 /queen/cutaway.cpp | |
parent | ea154852b7f4fd6b3d6d068c18b02b988948110c (diff) | |
download | scummvm-rg350-85f8b442f212e4eb1b044cc7ed23747a4ca4e76b.tar.gz scummvm-rg350-85f8b442f212e4eb1b044cc7ed23747a4ca4e76b.tar.bz2 scummvm-rg350-85f8b442f212e4eb1b044cc7ed23747a4ca4e76b.zip |
- new Grid class to handle all zones / areas stuff
- adapted Logic/Walk code to use it
svn-id: r12250
Diffstat (limited to 'queen/cutaway.cpp')
-rw-r--r-- | queen/cutaway.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index 939baa2130..661380441e 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -22,9 +22,10 @@ #include "stdafx.h" #include "queen/cutaway.h" -#include "queen/credits.h" +#include "queen/bankman.h" #include "queen/display.h" #include "queen/graphics.h" +#include "queen/grid.h" #include "queen/input.h" #include "queen/logic.h" #include "queen/queen.h" @@ -337,7 +338,7 @@ void Cutaway::changeRooms(CutawayObject &object) { if (_finalRoom != object.room) { int firstObjectInRoom = _vm->logic()->roomData(object.room) + 1; - int lastObjectInRoom = _vm->logic()->roomData(object.room) + _vm->logic()->objMax(object.room); + int lastObjectInRoom = _vm->logic()->roomData(object.room) + _vm->grid()->objMax(object.room); for (int i = firstObjectInRoom; i <= lastObjectInRoom; i++) { ObjectData *objectData = _vm->logic()->objectData(i); @@ -1137,7 +1138,7 @@ void Cutaway::stop() { pbs->x = x; pbs->y = y; if (inRange(object->image, -4, -3)) - pbs->scale = _vm->logic()->findScale(x, y); + pbs->scale = _vm->grid()->findScale(x, y); } if (frame) { @@ -1185,7 +1186,7 @@ void Cutaway::stop() { joeBob->x = joeX; joeBob->y = joeY; - _vm->logic()->joeScale(_vm->logic()->findScale(joeX, joeY)); + _vm->logic()->joeScale(_vm->grid()->findScale(joeX, joeY)); _vm->logic()->joeFace(); } } @@ -1238,11 +1239,11 @@ void Cutaway::updateGameState() { // Turn area on or off if (areaSubIndex > 0) { - Area *area = _vm->logic()->area(areaIndex, areaSubIndex); + Area *area = _vm->grid()->area(areaIndex, areaSubIndex); area->mapNeighbours = ABS(area->mapNeighbours); } else { - Area *area = _vm->logic()->area(areaIndex, ABS(areaSubIndex)); + Area *area = _vm->grid()->area(areaIndex, ABS(areaSubIndex)); area->mapNeighbours = -ABS(area->mapNeighbours); } } @@ -1416,9 +1417,9 @@ int Cutaway::scale(CutawayObject &object) { y = bob->y; } - int zone = _vm->logic()->zoneInArea(0, x, y); + int zone = _vm->grid()->findAreaForPos(GS_ROOM, x, y); if (zone > 0) { - Area *area = _vm->logic()->area(_vm->logic()->currentRoom(), zone); + Area *area = _vm->grid()->area(_vm->logic()->currentRoom(), zone); scaling = area->calcScale(y); } } |