diff options
author | Strangerke | 2011-09-06 23:14:49 +0200 |
---|---|---|
committer | Strangerke | 2011-09-06 23:14:49 +0200 |
commit | 52f669c93c9497a03e3e32467a4614263e1c6382 (patch) | |
tree | 954e4f4ac80c205c93479ebd923b87efba6af300 /engines | |
parent | 39d09d5865d9a01bfdbde02b047806f801a5d5c8 (diff) | |
download | scummvm-rg350-52f669c93c9497a03e3e32467a4614263e1c6382.tar.gz scummvm-rg350-52f669c93c9497a03e3e32467a4614263e1c6382.tar.bz2 scummvm-rg350-52f669c93c9497a03e3e32467a4614263e1c6382.zip |
CGE: Replace Hxy by Common::Point
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge/cge.cpp | 4 | ||||
-rw-r--r-- | engines/cge/cge.h | 8 | ||||
-rw-r--r-- | engines/cge/cge_main.cpp | 12 | ||||
-rw-r--r-- | engines/cge/snail.cpp | 4 |
4 files changed, 12 insertions, 16 deletions
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp index 66262e5e4a..7a181a58be 100644 --- a/engines/cge/cge.cpp +++ b/engines/cge/cge.cpp @@ -57,8 +57,8 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription) void CGEEngine::initCaveValues() { for (int i = 0; i < kCaveMax; i++) { - _heroXY[i]._x = 0; - _heroXY[i]._y = 0; + _heroXY[i].x = 0; + _heroXY[i].y = 0; } for (int i = 0; i < kCaveMax + 1; i++) { diff --git a/engines/cge/cge.h b/engines/cge/cge.h index 95985103f4..66811a9a10 100644 --- a/engines/cge/cge.h +++ b/engines/cge/cge.h @@ -28,6 +28,7 @@ #include "common/savefile.h" #include "common/serializer.h" #include "common/str.h" +#include "common/rect.h" #include "engines/engine.h" #include "gui/debugger.h" #include "graphics/surface.h" @@ -89,11 +90,6 @@ struct Bar { uint8 _vert; }; -struct Hxy { - int _x; - int _y; -}; - class CGEEngine : public Engine { private: uint32 _lastFrame, _lastTick; @@ -139,7 +135,7 @@ public: Sprite *_sprK2; Sprite *_sprK3; - Hxy _heroXY[kCaveMax]; + Common::Point _heroXY[kCaveMax]; Bar _barriers[kCaveMax]; Common::RandomSource _randomSource; diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index b168c039e6..a915a08689 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -167,8 +167,8 @@ void CGEEngine::syncHeader(Common::Serializer &s) { } for (i = 0; i < kCaveMax; i++) { - s.syncAsSint16LE(_heroXY[i]._x); - s.syncAsUint16LE(_heroXY[i]._y); + s.syncAsSint16LE(_heroXY[i].x); + s.syncAsUint16LE(_heroXY[i].y); } for (i = 0; i < 1 + kCaveMax; i++) { s.syncAsByte(_barriers[i]._horz); @@ -483,8 +483,8 @@ void CGEEngine::loadHeroXY() { cf.read((byte *)&x, 2); cf.read((byte *)&y, 2); - _heroXY[i]._x = (int16)FROM_LE_16(x); - _heroXY[i]._y = (int16)FROM_LE_16(y); + _heroXY[i].x = (int16)FROM_LE_16(x); + _heroXY[i].y = (int16)FROM_LE_16(y); } } } @@ -641,7 +641,7 @@ void CGEEngine::caveUp() { _fx->preload(BakRef); if (_hero) { - _hero->gotoxy(_heroXY[_now - 1]._x, _heroXY[_now - 1]._y); + _hero->gotoxy(_heroXY[_now - 1].x, _heroXY[_now - 1].y); // following 2 lines trims Hero's Z position! _hero->tick(); _hero->_time = 1; @@ -1361,7 +1361,7 @@ void CGEEngine::runGame() { if (_hero) { expandSprite(_hero); - _hero->gotoxy(_heroXY[_now - 1]._x, _heroXY[_now - 1]._y); + _hero->gotoxy(_heroXY[_now - 1].x, _heroXY[_now - 1].y); if (VFile::exist("00SHADOW.SPR")) { loadSprite("00SHADOW", -1, 0, _hero->_x + 14, _hero->_y + 51); delete _shadow; diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp index ccdcac3578..0e0606706b 100644 --- a/engines/cge/snail.cpp +++ b/engines/cge/snail.cpp @@ -653,13 +653,13 @@ void CGEEngine::snUncover(Sprite *spr, Sprite *xspr) { void CGEEngine::snSetX0(int cav, int x0) { debugC(1, kCGEDebugEngine, "CGEEngine::snSetX0(%d, %d)", cav, x0); - _heroXY[cav - 1]._x = x0; + _heroXY[cav - 1].x = x0; } void CGEEngine::snSetY0(int cav, int y0) { debugC(1, kCGEDebugEngine, "CGEEngine::snSetY0(%d, %d)", cav, y0); - _heroXY[cav - 1]._y = y0; + _heroXY[cav - 1].y = y0; } void CGEEngine::snSetXY(Sprite *spr, uint16 xy) { |