aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-11-12 23:12:44 +0100
committerPaul Gilbert2014-12-12 22:31:52 -0500
commit37431dcedfddbac02b450affa9346d6c2581e673 (patch)
tree3010b86a61569bd4d72667e9ad32874c4515175e
parentba8f4941b5ed387999ec1f30c90e237b048e9d76 (diff)
downloadscummvm-rg350-37431dcedfddbac02b450affa9346d6c2581e673.tar.gz
scummvm-rg350-37431dcedfddbac02b450affa9346d6c2581e673.tar.bz2
scummvm-rg350-37431dcedfddbac02b450affa9346d6c2581e673.zip
ACCESS: Implement guardSee and setGuardFrame
-rw-r--r--engines/access/amazon/amazon_scripts.cpp48
-rw-r--r--engines/access/amazon/amazon_scripts.h2
2 files changed, 48 insertions, 2 deletions
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp
index e2fea04960..faf2ede386 100644
--- a/engines/access/amazon/amazon_scripts.cpp
+++ b/engines/access/amazon/amazon_scripts.cpp
@@ -683,12 +683,56 @@ void AmazonScripts::mWhile(int param1) {
}
}
+void AmazonScripts::CHKVLINE() {
+ warning("TODO: CHKVLINE()");
+}
+
+void AmazonScripts::CHKHLINE() {
+ warning("TODO: CHKHLINE()");
+}
+
void AmazonScripts::guardSee() {
- warning("TODO: guardSee()");
+ int tmpY = (_vm->_screen->_scrollRow << 4) + _vm->_screen->_scrollY;
+ _game->_flags[140] = 0;
+ if (tmpY > _game->_guard._position.y)
+ return;
+
+ tmpY += _vm->_screen->_vWindowLinesTall;
+ tmpY -= 11;
+
+ if (tmpY < _game->_guard._position.y)
+ return;
+
+ _game->_guardFind = 1;
+ _game->_flags[140] = 1;
+
+ for (uint16 idx = 0; idx < _vm->_room->_plotter._walls.size(); idx++) {
+ _vm->_screen->_orgX1 = _vm->_room->_plotter._walls[idx].left;
+ _vm->_screen->_orgY1 = _vm->_room->_plotter._walls[idx].top;
+ _vm->_screen->_orgX2 = _vm->_room->_plotter._walls[idx].right;
+ _vm->_screen->_orgY2 = _vm->_room->_plotter._walls[idx].bottom;
+ if (_vm->_screen->_orgX1 == _vm->_screen->_orgX2) {
+ CHKVLINE();
+ if (_game->_guardFind == 0)
+ return;
+ } else if (_vm->_screen->_orgY1 == _vm->_screen->_orgY2) {
+ CHKHLINE();
+ if (_game->_guardFind == 0)
+ return;
+ }
+ }
}
void AmazonScripts::setGuardFrame() {
- warning("TODO: setGuardFrame()");
+ ImageEntry ie;
+ ie._flags = 8;
+ if (_game->_guardLocation == 4)
+ ie._flags |= 2;
+ ie._spritesPtr = _vm->_objectsTable[37];
+ ie._frameNumber = _game->_guard._guardCel;
+ ie._position = _game->_guard._position;
+ ie._offsetY = 10;
+ _vm->_images.addToList(ie);
}
void AmazonScripts::guard() {
diff --git a/engines/access/amazon/amazon_scripts.h b/engines/access/amazon/amazon_scripts.h
index 9d741158a8..9d5e4d8db1 100644
--- a/engines/access/amazon/amazon_scripts.h
+++ b/engines/access/amazon/amazon_scripts.h
@@ -72,6 +72,8 @@ protected:
void mWhileJWalk();
void mWhileDoOpen();
void mWhile(int param1);
+ void CHKVLINE();
+ void CHKHLINE();
void guardSee();
void setGuardFrame();
void guard();