[Scummvm-cvs-logs] scummvm master -> 410d548ac039eb0d071d6b6bd925414622ab3176
urukgit
urukgit at users.noreply.github.com
Sat Feb 8 15:42:16 CET 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
410d548ac0 AVALANCHE: Implement GhostRoom::doBat().
Commit: 410d548ac039eb0d071d6b6bd925414622ab3176
https://github.com/scummvm/scummvm/commit/410d548ac039eb0d071d6b6bd925414622ab3176
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-08T06:41:39-08:00
Commit Message:
AVALANCHE: Implement GhostRoom::doBat().
Changed paths:
engines/avalanche/ghostroom.cpp
engines/avalanche/ghostroom.h
diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp
index aee8b4f..98dd909 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);
}
diff --git a/engines/avalanche/ghostroom.h b/engines/avalanche/ghostroom.h
index 3779fa0..72ee828 100644
--- a/engines/avalanche/ghostroom.h
+++ b/engines/avalanche/ghostroom.h
@@ -69,8 +69,6 @@ private:
Graphics::Surface _greldet[6][2];
byte _glerkStage;
- int16 _batX, _batY;
- uint16 _batCount;
int8 _aarghCount;
int16 _greldetX, _greldetY;
byte _greldetCount;
More information about the Scummvm-git-logs
mailing list