aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Boutonné2011-01-29 14:10:47 +0000
committerArnaud Boutonné2011-01-29 14:10:47 +0000
commit946bdcd3898deeebf24f85d2a4377b244729e74d (patch)
treeae6509aac546cf94a3f7d6089b81e4efdf60c0fc
parent1da472a2db3b5ec721c1d363e0e974c58a9cf50b (diff)
downloadscummvm-rg350-946bdcd3898deeebf24f85d2a4377b244729e74d.tar.gz
scummvm-rg350-946bdcd3898deeebf24f85d2a4377b244729e74d.tar.bz2
scummvm-rg350-946bdcd3898deeebf24f85d2a4377b244729e74d.zip
HUGO: Display all (clipped) object zones in God Mode
svn-id: r55614
-rw-r--r--engines/hugo/display.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 613371327f..79c6da15e5 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -39,6 +39,7 @@
#include "hugo/display.h"
#include "hugo/inventory.h"
#include "hugo/util.h"
+#include "hugo/object.h"
namespace Hugo {
Screen::Screen(HugoEngine *vm) : _vm(vm), _mainPalette(0), _curPalette(0) {
@@ -494,19 +495,19 @@ void Screen::drawRectangle(bool filledFl, int16 x1, int16 y1, int16 x2, int16 y2
assert(y1 <= y2);
if (filledFl) {
- for (int i = y1; i < y2; i++) {
- for (int j = x1; j < x2; j++) {
+ for (int i = y1; i <= CLIP<int16>(y2, 0, 200); i++) {
+ for (int j = x1; j <= CLIP<int16>(x2, 0, 320); j++) {
_backBuffer[320 * i + j] = color;
_frontBuffer[320 * i + j] = color;
_backBufferBackup[320 * i + j] = color;
}
}
} else {
- for (int i = y1; i < y2; i++) {
+ for (int i = y1; i <= CLIP<int16>(y2, 0, 200); i++) {
_frontBuffer[320 * i + x1] = color;
_frontBuffer[320 * i + x2] = color;
}
- for (int i = x1; i < x2; i++) {
+ for (int i = x1; i < CLIP<int16>(x2, 0, 320); i++) {
_frontBuffer[320 * y1 + i] = color;
_frontBuffer[320 * y2 + i] = color;
}
@@ -614,7 +615,10 @@ bool Screen::isOverlaping(rect_t *rectA, rect_t *rectB) {
}
/**
-* Display exit hotspots in God Mode
+* Display exit hotspots in God Mode ('PPG')
+* Light Red = Exit hotspots
+* Light Green = Visible objects
+* White = Fixed objects, parts of background
*/
void Screen::drawHotspots() {
if (!_vm->getGameStatus().godModeFl)
@@ -625,6 +629,17 @@ void Screen::drawHotspots() {
if (hotspot->screenIndex == _vm->_hero->screenIndex)
drawRectangle(false, hotspot->x1, hotspot->y1, hotspot->x2, hotspot->y2, _TLIGHTRED);
}
+
+ for (int i = 0; i < _vm->_object->_numObj; i++) {
+ object_t *obj = &_vm->_object->_objects[i]; // Get pointer to object
+ if (obj->screenIndex == *_vm->_screen_p) {
+ if ((obj->currImagePtr != 0) && (obj->cycling != kCycleInvisible))
+ drawRectangle(false, obj->x + obj->currImagePtr->x1, obj->y + obj->currImagePtr->y1,
+ obj->x + obj->currImagePtr->x2, obj->y + obj->currImagePtr->y2, _TLIGHTGREEN);
+ else if ((obj->currImagePtr == 0) && (obj->vxPath != 0) && !obj->carriedFl)
+ drawRectangle(false, obj->oldx, obj->oldy, obj->oldx + obj->vxPath, obj->oldy + obj->vyPath, _TBRIGHTWHITE);
+ }
+ }
g_system->copyRectToScreen(_frontBuffer, 320, 0, 0, 320, 200);
}