aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNipun Garg2019-06-08 02:25:11 +0530
committerEugene Sandulenko2019-09-03 17:16:45 +0200
commitf90d06bee94ee5b3b42a9fd2873a03c77d961ca5 (patch)
treecab8f6efe28befbe6d336e564cbb843cc0cbb5e3 /engines
parent703dbba6480af5bbd9f6012ad749b6d84b482e4b (diff)
downloadscummvm-rg350-f90d06bee94ee5b3b42a9fd2873a03c77d961ca5.tar.gz
scummvm-rg350-f90d06bee94ee5b3b42a9fd2873a03c77d961ca5.tar.bz2
scummvm-rg350-f90d06bee94ee5b3b42a9fd2873a03c77d961ca5.zip
HDB: Add _stars3D, _stars3DSlow + setup functions
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/draw-manager.cpp23
-rw-r--r--engines/hdb/draw-manager.h16
2 files changed, 37 insertions, 2 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp
index eebb7c81d7..b39155ecc0 100644
--- a/engines/hdb/draw-manager.cpp
+++ b/engines/hdb/draw-manager.cpp
@@ -144,10 +144,10 @@ void DrawMan::setSky(int skyIndex) {
// Setup current sky
if (tileIndex == _tileSkyStars) {
- warning("STUB: DRAWMAN::setSky: Setup3DStars");
+ setup3DStars();
return;
} else if (skyIndex == _tileSkyStarsLeft) {
- warning("STUB: DRAWMAN::setSky: Setup3DStarsLeft");
+ setup3DStarsLeft();
return;
} else if (skyIndex == _tileSkyStars) {
warning("STUB: DRAWMAN::setSky: getPicture( CLOUDY_SKIES )");
@@ -155,6 +155,25 @@ void DrawMan::setSky(int skyIndex) {
}
}
+void DrawMan::setup3DStars() {
+ for (int i = 0; i < kNum3DStars; i++) {
+ _stars3D[i].x = g_hdb->_rnd->getRandomNumber(kScreenWidth) % kScreenWidth;
+ _stars3D[i].y = g_hdb->_rnd->getRandomNumber(kScreenHeight) % kScreenHeight;
+ _stars3D[i].speed = (g_hdb->_rnd->getRandomNumber(256) % 256);
+ _stars3D[i].speed >>= 1;
+ _stars3D[i].color = _stars3D[i].speed / 64;
+ }
+}
+
+void DrawMan::setup3DStarsLeft() {
+ for (int i = 0; i < kNum3DStars; i++) {
+ _stars3DSlow[i].x = g_hdb->_rnd->getRandomNumber(kScreenWidth) % kScreenWidth;
+ _stars3DSlow[i].y = g_hdb->_rnd->getRandomNumber(kScreenHeight) % kScreenHeight;
+ _stars3DSlow[i].speed = ((double) (1 + (g_hdb->_rnd->getRandomNumber(5) % 5))) / 6.0;
+ _stars3DSlow[i].color = (int) (_stars3DSlow[i].speed * 4.00);
+ }
+}
+
Picture::~Picture() {
_surface.free();
}
diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h
index 9db9629d1d..da419eb9db 100644
--- a/engines/hdb/draw-manager.h
+++ b/engines/hdb/draw-manager.h
@@ -57,12 +57,28 @@ public:
Picture *getPicture(const char *name);
int isSky(int skyIndex);
void setSky(int skyIndex);
+ void setup3DStars();
+ void setup3DStarsLeft();
+ // Add draw functions for the above two
+ //void draw3DStars();
+ //void draw3DStarsLeft();
private:
int _numTiles;
TileLookup *_tLookupArray;
uint16 _skyTiles[kMaxSkies];
int _currentSky; // 0 if no Sky, 1+ for which Sky to use
+
+ struct {
+ int x, y, speed;
+ uint16 color;
+ } _stars3D[kNum3DStars];
+
+ struct {
+ double x, y, speed;
+ uint16 color;
+ } _stars3DSlow[kNum3DStars];
+
int _tileSkyStars; // Index of sky_stars tile
int _tileSkyStarsLeft; // Left-scrolling stars, slow
int _tileSkyClouds; // Index of sky_stars tile