HDB: Add _stars3D, _stars3DSlow + setup functions
This commit is contained in:
parent
703dbba648
commit
f90d06bee9
2 changed files with 37 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue