aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/ghostroom.cpp
diff options
context:
space:
mode:
authoruruk2014-02-08 15:41:29 +0100
committeruruk2014-02-08 15:41:39 +0100
commit410d548ac039eb0d071d6b6bd925414622ab3176 (patch)
tree03321d0f230fc8d0c24c1d3a0e13127994a296ed /engines/avalanche/ghostroom.cpp
parenta90c5369e181e66a4f24cadb0931f9bbfcfd1b48 (diff)
downloadscummvm-rg350-410d548ac039eb0d071d6b6bd925414622ab3176.tar.gz
scummvm-rg350-410d548ac039eb0d071d6b6bd925414622ab3176.tar.bz2
scummvm-rg350-410d548ac039eb0d071d6b6bd925414622ab3176.zip
AVALANCHE: Implement GhostRoom::doBat().
Diffstat (limited to 'engines/avalanche/ghostroom.cpp')
-rw-r--r--engines/avalanche/ghostroom.cpp40
1 files changed, 35 insertions, 5 deletions
diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp
index aee8b4f48d..98dd90974a 100644
--- a/engines/avalanche/ghostroom.cpp
+++ b/engines/avalanche/ghostroom.cpp
@@ -40,8 +40,6 @@ GhostRoom::GhostRoom(AvalancheEngine *vm) {
_glerkStage = 0;
_aarghCount = 0;
- _batX = _batY = 0;
- _batCount = 0;
_greldetX = _greldetY = 0;
_greldetCount = 0;
_redGreldet = false;
@@ -78,7 +76,39 @@ void GhostRoom::wait(uint16 howLong) {
}
void GhostRoom::doBat() {
- warning("STUB: doBat()");
+ static int16 batX = 277;
+ static int16 batY = 40;
+ static uint16 batCount = 0;
+
+ batCount++;
+
+ int8 dx, iy;
+ byte batImage;
+ if ((batCount % 2) == 1) {
+ if ((1 <= batCount) && (batCount <= 90)) {
+ dx = 2;
+ iy = 1;
+ batImage = 0;
+ } else if ((91 <= batCount) && (batCount <= 240)) {
+ dx = 1;
+ iy = 1;
+ batImage = 1;
+ } else if((241 <= batCount) && (batCount <= 260)) {
+ dx = 1;
+ iy = 4;
+ batImage = 2;
+ }
+
+ if ((batCount == 91) || (batCount == 241)) // When the bat changes, blank out the old one.
+ _vm->_graphics->drawFilledRectangle(Common::Rect(batX + _bat[batImage].w, batY, batX + _bat[batImage - 1].w, batY + _bat[batImage - 1].h), kColorBlack);
+
+ _vm->_graphics->drawFilledRectangle(Common::Rect(batX, batY, batX + _bat[batImage].w, batY + iy), kColorBlack);
+ _vm->_graphics->drawFilledRectangle(Common::Rect(batX + _bat[batImage].w - dx, batY, batX + _bat[batImage].w, batY + _bat[batImage].h), kColorBlack);
+
+ batX -= dx;
+ batY++;
+ _vm->_graphics->ghostDrawPicture(_bat[batImage], batX, batY);
+ }
}
void GhostRoom::bigGreenEyes(byte how) {
@@ -195,10 +225,10 @@ void GhostRoom::run() {
_glerkStage++;
}
- _vm->_graphics->refreshScreen();
-
doBat();
+ _vm->_graphics->refreshScreen();
+
wait(15);
}