aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-07-13 01:55:03 +0530
committerEugene Sandulenko2019-09-03 17:17:18 +0200
commit1f7e17921893d9eafd7524ad8aa8b2b63973af2c (patch)
tree7f85fc83029248abd03843ceeb9eceb1290d77bd
parent1874674364a4bf94a378e9009e10c9a8fa13525f (diff)
downloadscummvm-rg350-1f7e17921893d9eafd7524ad8aa8b2b63973af2c.tar.gz
scummvm-rg350-1f7e17921893d9eafd7524ad8aa8b2b63973af2c.tar.bz2
scummvm-rg350-1f7e17921893d9eafd7524ad8aa8b2b63973af2c.zip
HDB: Unstub drawSnow()
-rw-r--r--engines/hdb/gfx.cpp29
-rw-r--r--engines/hdb/gfx.h3
2 files changed, 23 insertions, 9 deletions
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp
index be96664a59..db7ae18985 100644
--- a/engines/hdb/gfx.cpp
+++ b/engines/hdb/gfx.cpp
@@ -130,14 +130,11 @@ bool Gfx::init() {
_showCursor = true;
// Load all 4 levels of star colors
- _starField[0] = getPicture("pic_star64");
- _starField[1] = getPicture("pic_star128");
- _starField[2] = getPicture("pic_star192");
- _starField[3] = getPicture("pic_star256");
-
- /*
- TODO: Load the snowflake
- */
+ _starField[0] = getPicture(PIC_STAR64);
+ _starField[1] = getPicture(PIC_STAR128);
+ _starField[2] = getPicture(PIC_STAR192);
+ _starField[3] = getPicture(PIC_STAR256);
+ _snowflake = getPicture(PIC_SNOWFLAKE);
_systemInit = true;
return true;
@@ -629,7 +626,21 @@ void Gfx::drawSky() {
}
void Gfx::drawSnow() {
- debug(9, "STUB: Gfx::drawSnow()");
+ int i;
+ if (_snowInfo.active == false)
+ return;
+
+ for (i = 0; i < MAX_SNOW; i++) {
+ _snowflake->drawMasked((int)_snowInfo.x[i], (int)_snowInfo.y[i]);
+ _snowInfo.x[i] += _snowXVList[_snowInfo.xvindex[i]++];
+ _snowInfo.y[i] += _snowInfo.yv[i];
+ if (_snowInfo.xvindex[i] == MAX_SNOW_XV)
+ _snowInfo.xvindex[i] = 0;
+ if (_snowInfo.x[i] < 0)
+ _snowInfo.x[i] = kScreenWidth - 1;
+ if (_snowInfo.y[i] > kScreenHeight - 1)
+ _snowInfo.y[i] = 0;
+ }
}
int Gfx::animateTile(int tileIndex) {
diff --git a/engines/hdb/gfx.h b/engines/hdb/gfx.h
index e384ac96f0..d0d9681200 100644
--- a/engines/hdb/gfx.h
+++ b/engines/hdb/gfx.h
@@ -208,6 +208,8 @@ private:
int xvindex[MAX_SNOW];
} _snowInfo;
+ int _snowXVList[13] = {0, -1, -1, -2, -2, -1, 0, 0, 0, -1, -2, -1, 0};
+
struct {
int x, y, speed;
uint16 color;
@@ -222,6 +224,7 @@ private:
int _tileSkyStarsLeft; // Left-scrolling stars, slow
int _tileSkyClouds; // Index of sky_stars tile
Picture *_starField[4];
+ Picture *_snowflake;
Picture *_skyClouds;
struct {