diff options
author | Andrew Kurushin | 2005-03-18 17:11:37 +0000 |
---|---|---|
committer | Andrew Kurushin | 2005-03-18 17:11:37 +0000 |
commit | 3025db0d07c9bfa9f8cda8ff49847287230f166d (patch) | |
tree | bc9d21940950460dce0f3bfaf35c311fd3c30430 /saga/objectmap.cpp | |
parent | b4ed62e1ad7ed6f3d4d68b8e34a9263229d14dad (diff) | |
download | scummvm-rg350-3025db0d07c9bfa9f8cda8ff49847287230f166d.tar.gz scummvm-rg350-3025db0d07c9bfa9f8cda8ff49847287230f166d.tar.bz2 scummvm-rg350-3025db0d07c9bfa9f8cda8ff49847287230f166d.zip |
- changescene on fair for tents
- some memory deallocation fixup
todo: fix follower stuckiness in tents
svn-id: r17180
Diffstat (limited to 'saga/objectmap.cpp')
-rw-r--r-- | saga/objectmap.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/saga/objectmap.cpp b/saga/objectmap.cpp index 6b592fff67..4a037e98c0 100644 --- a/saga/objectmap.cpp +++ b/saga/objectmap.cpp @@ -34,6 +34,9 @@ #include "saga/interface.h" #include "saga/objectmap.h" #include "saga/stream.h" +#include "saga/actor.h" +#include "saga/scene.h" +#include "saga/isomap.h" namespace Saga { @@ -57,7 +60,7 @@ HitZone::HitZone(MemoryReadStreamEndian *readStream, int index): _index(index) { for (i = 0; i < _clickAreasCount; i++) { clickArea = &_clickAreas[i]; - clickArea->pointsCount = readStream->readUint16(); + clickArea->pointsCount = readStream->readUint16LE(); assert(clickArea->pointsCount); @@ -189,6 +192,7 @@ void ObjectMap::freeMem() { free(_hitZoneList); _hitZoneList = NULL; } + _hitZoneListCount = 0; } @@ -197,8 +201,17 @@ void ObjectMap::draw(SURFACE *ds, const Point& testPoint, int color, int color2) int i; int hitZoneIndex; char txtBuf[32]; + Point pickPoint; + Location pickLocation; + pickPoint = testPoint; + if (_vm->_scene->getFlags() & kSceneFlagISO) { + assert(_vm->_actor->_protagonist); + pickPoint.y -= _vm->_actor->_protagonist->location.z; + _vm->_isoMap->screenPointToTileCoords(pickPoint, pickLocation); + pickLocation.toScreenPointUV(pickPoint); + } - hitZoneIndex = hitTest(testPoint); + hitZoneIndex = hitTest(pickPoint); for (i = 0; i < _hitZoneListCount; i++) { _hitZoneList[i]->draw(ds, (hitZoneIndex == i) ? color2 : color); |