aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2013-12-27 20:42:05 +1100
committerPaul Gilbert2013-12-27 20:42:05 +1100
commit8ed1171ca07e5857c1ab4862052bc7451f8728e7 (patch)
treeb4b04a1978fdc00f179b19ea59d776523be34b24
parent16cbccf09ac3f98e5dddfa866e35c5cd319f8f5d (diff)
downloadscummvm-rg350-8ed1171ca07e5857c1ab4862052bc7451f8728e7.tar.gz
scummvm-rg350-8ed1171ca07e5857c1ab4862052bc7451f8728e7.tar.bz2
scummvm-rg350-8ed1171ca07e5857c1ab4862052bc7451f8728e7.zip
VOYEUR: Convert doInterface to use new rects resource type
-rw-r--r--engines/voyeur/files_threads.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index 26e4b5987b..8d0ad00c34 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -1409,7 +1409,8 @@ int ThreadResource::doInterface() {
_vm->_eventsManager.setMousePos(Common::Point(_currentMouseX, _currentMouseY));
_vm->initIFace();
- byte *dataP = _vm->_bVoy->memberAddr(_vm->_playStamp1);
+ Common::Array<Common::Rect> &hotspots = _vm->_bVoy->boltEntry(
+ _vm->_playStamp1)._rectResource->_entries;
_vm->_playStamp2 = 151 - _vm->getRandomNumber(5);
_vm->_voy._vocSecondsOffset = _vm->getRandomNumber(29);
@@ -1447,11 +1448,8 @@ int ThreadResource::doInterface() {
pt = _vm->_eventsManager.getMousePos() + Common::Point(120, 75);
regionIndex = -1;
- for (int idx = 0; idx < READ_LE_UINT16(dataP); ++idx) {
- if (READ_LE_UINT16(dataP + (idx * 8 + 2)) <= pt.x &&
- READ_LE_UINT16(dataP + (idx * 8 + 6)) >= pt.x &&
- READ_LE_UINT16(dataP + (idx * 8 + 4)) <= pt.y &&
- READ_LE_UINT16(dataP + (idx * 8 + 8)) >= pt.y) {
+ for (int idx = 0; idx < (int)hotspots.size(); ++idx) {
+ if (hotspots[idx].contains(pt)) {
// Rect check done
for (int arrIndex = 0; arrIndex < 3; ++arrIndex) {
if (_vm->_voy._arr3[arrIndex][idx] <= _vm->_voy._RTVNum &&
@@ -1542,7 +1540,7 @@ int ThreadResource::doInterface() {
_vm->_eventsManager.setMousePos(Common::Point(_currentMouseX, _currentMouseY));
_vm->initIFace();
- dataP = _vm->_bVoy->memberAddr(_vm->_playStamp1 + 1);
+ hotspots = _vm->_bVoy->boltEntry(_vm->_playStamp1 + 1)._rectResource->_entries;
_vm->_eventsManager.getMouseInfo();
_vm->_eventsManager.setMousePos(Common::Point(_currentMouseX, _currentMouseY));