diff options
author | Nipun Garg | 2019-07-05 03:03:00 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:11 +0200 |
commit | ad8f85759576ca81993f9f143feaf5df8c2e714e (patch) | |
tree | 31af4a3959815e2ffa18cf950947b97526ceb5e1 /engines | |
parent | 0751cedb08e9c357bfa6f696fa749ebc303b7cfa (diff) | |
download | scummvm-rg350-ad8f85759576ca81993f9f143feaf5df8c2e714e.tar.gz scummvm-rg350-ad8f85759576ca81993f9f143feaf5df8c2e714e.tar.bz2 scummvm-rg350-ad8f85759576ca81993f9f143feaf5df8c2e714e.zip |
HDB: Move Bots gfx into _gfx
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/ai-bots.cpp | 32 | ||||
-rw-r--r-- | engines/hdb/ai-init.cpp | 109 | ||||
-rw-r--r-- | engines/hdb/ai.h | 21 | ||||
-rw-r--r-- | engines/hdb/gfx.h | 23 |
4 files changed, 95 insertions, 90 deletions
diff --git a/engines/hdb/ai-bots.cpp b/engines/hdb/ai-bots.cpp index 689c7af68f..7836bbf74e 100644 --- a/engines/hdb/ai-bots.cpp +++ b/engines/hdb/ai-bots.cpp @@ -1290,16 +1290,16 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) { case DIR_UP: if (e->tileY == e->value1 && e->int2) { // going down or right? for (i = e->value1 + 1; i < e->value2; i++) - onScreen += gfxLaserbeamUD[frame]->drawMasked(e->x - mx, i * kTileHeight - my); - onScreen += gfxLaserbeamUDTop[frame]->drawMasked(e->x - mx, i * kTileHeight - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamUD[frame]->drawMasked(e->x - mx, i * kTileHeight - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamUDTop[frame]->drawMasked(e->x - mx, i * kTileHeight - my); if (onScreen) { g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true); warning("STUB: Set Laser onScreen to true"); } } else { for (i = e->value1 + 1; i < e->value2; i++) - onScreen += gfxLaserbeamLR[frame]->drawMasked(i * kTileWidth - mx, e->y - my); - onScreen += gfxLaserbeamLRLeft[frame]->drawMasked(i * kTileWidth - mx, e->y - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamLR[frame]->drawMasked(i * kTileWidth - mx, e->y - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamLRLeft[frame]->drawMasked(i * kTileWidth - mx, e->y - my); if (onScreen) { g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true); warning("STUB: Set Laser onScreen to true"); @@ -1309,16 +1309,16 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) { case DIR_DOWN: if (e->tileY == e->value1 && e->int2) { // going down or left? for (i = e->value1 + 1; i < e->value2; i++) - onScreen += gfxLaserbeamUD[frame]->drawMasked(e->x - mx, i * kTileHeight - my); - onScreen += gfxLaserbeamUDTop[frame]->drawMasked(e->x - mx, i * kTileHeight - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamUD[frame]->drawMasked(e->x - mx, i * kTileHeight - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamUDTop[frame]->drawMasked(e->x - mx, i * kTileHeight - my); if (onScreen) { g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true); warning("STUB: Set Laser onscreen to true"); } } else { for (i = e->value1 - 1; i > e->value2; i--) - onScreen += gfxLaserbeamLR[frame]->drawMasked(i * kTileWidth - mx, e->y - my); - onScreen += gfxLaserbeamLRRight[frame]->drawMasked(i * kTileWidth - mx, e->y - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamLR[frame]->drawMasked(i * kTileWidth - mx, e->y - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamLRRight[frame]->drawMasked(i * kTileWidth - mx, e->y - my); if (onScreen) { g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true); warning("STUB: Set Laser onscreen to true"); @@ -1328,16 +1328,16 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) { case DIR_LEFT: if (e->tileY == e->value1 && e->int2) { // going up or left? for (i = e->value1 - 1; i > e->value2; i--) - onScreen += gfxLaserbeamUD[frame]->drawMasked(e->x - mx, i * kTileHeight - my); - onScreen += gfxLaserbeamUDBottom[frame]->drawMasked(e->x - mx, i * kTileHeight - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamUD[frame]->drawMasked(e->x - mx, i * kTileHeight - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamUDBottom[frame]->drawMasked(e->x - mx, i * kTileHeight - my); if (onScreen) { g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true); warning("STUB: Set Laser onscreen to true"); } } else { for (i = e->value1 - 1; i > e->value2; i--) - onScreen += gfxLaserbeamLR[frame]->drawMasked(i * kTileWidth - mx, e->y - my); - onScreen += gfxLaserbeamLRRight[frame]->drawMasked(i * kTileWidth - mx, e->y - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamLR[frame]->drawMasked(i * kTileWidth - mx, e->y - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamLRRight[frame]->drawMasked(i * kTileWidth - mx, e->y - my); if (onScreen) { g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true); warning("STUB: Set Laser onscreen to true"); @@ -1347,16 +1347,16 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) { case DIR_RIGHT: if (e->tileY == e->value1 && e->int2) { // going up or right? for (i = e->value1 - 1; i > e->value2; i--) - onScreen += gfxLaserbeamUD[frame]->drawMasked(e->x - mx, i * kTileHeight - my); - onScreen += gfxLaserbeamUDBottom[frame]->drawMasked(e->x - mx, i * kTileHeight - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamUD[frame]->drawMasked(e->x - mx, i * kTileHeight - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamUDBottom[frame]->drawMasked(e->x - mx, i * kTileHeight - my); if (onScreen) { g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true); warning("STUB: Set Laser onscreen to true"); } } else { for (i = e->value1 + 1; i < e->value2; i++) - onScreen += gfxLaserbeamLR[frame]->drawMasked(i * kTileWidth - mx, e->y - my); - onScreen += gfxLaserbeamLRLeft[frame]->drawMasked(i * kTileWidth - mx, e->y - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamLR[frame]->drawMasked(i * kTileWidth - mx, e->y - my); + onScreen += g_hdb->_gfx->_gfxLaserbeamLRLeft[frame]->drawMasked(i * kTileWidth - mx, e->y - my); if (onScreen) { g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true); warning("STUB: Set Laser onscreen to true"); diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp index d6e2b3fb78..29b5ec1377 100644 --- a/engines/hdb/ai-init.cpp +++ b/engines/hdb/ai-init.cpp @@ -773,17 +773,19 @@ bool AI::init() { _kcHolderBlackOn = g_hdb->_gfx->getTileIndex("t32_kcholder_black_on"); // icepuff snowball - icepSnowballGfxDown = icepSnowballGfxLeft = icepSnowballGfxRight = NULL; + g_hdb->_gfx->_icepSnowballGfxDown = g_hdb->_gfx->_icepSnowballGfxLeft = + g_hdb->_gfx->_icepSnowballGfxRight = NULL; // Frogglick - tileFroglickMiddleUD = tileFroglickMiddleLR = NULL; - tileFroglickWiggleLeft[0] = tileFroglickWiggleRight[0] = NULL; + g_hdb->_gfx->_tileFroglickMiddleUD = g_hdb->_gfx->_tileFroglickMiddleLR = NULL; + g_hdb->_gfx->_tileFroglickWiggleLeft[0] = g_hdb->_gfx->_tileFroglickWiggleRight[0] = NULL; // Dragon - gfxDragonAsleep = NULL; + g_hdb->_gfx->_gfxDragonAsleep = NULL; // laser beam - gfxLaserbeamUD[0] = gfxLaserbeamUD[1] = gfxLaserbeamLR[0] = gfxLaserbeamLR[1] = NULL; + g_hdb->_gfx->_gfxLaserbeamUD[0] = g_hdb->_gfx->_gfxLaserbeamUD[1] = + g_hdb->_gfx->_gfxLaserbeamLR[0] = g_hdb->_gfx->_gfxLaserbeamLR[1] = NULL; _dummyPlayer.type = AI_GUY; _dummyLaser.type = AI_LASERBEAM; @@ -848,76 +850,77 @@ void AI::restartSystem() { memset(_clubRightGfx, NULL, kMaxAnimFrames * sizeof(Tile *)); int i; - if (icepSnowballGfxDown) { - icepSnowballGfxDown->free(); - icepSnowballGfxDown = NULL; + if (g_hdb->_gfx->_icepSnowballGfxDown) { + g_hdb->_gfx->_icepSnowballGfxDown->free(); + g_hdb->_gfx->_icepSnowballGfxDown = NULL; } - if (icepSnowballGfxLeft) { - icepSnowballGfxLeft->free(); - icepSnowballGfxLeft = NULL; + if (g_hdb->_gfx->_icepSnowballGfxLeft) { + g_hdb->_gfx->_icepSnowballGfxLeft->free(); + g_hdb->_gfx->_icepSnowballGfxLeft = NULL; } - if (icepSnowballGfxRight) { - icepSnowballGfxRight->free(); - icepSnowballGfxRight = NULL; + if (g_hdb->_gfx->_icepSnowballGfxRight) { + g_hdb->_gfx->_icepSnowballGfxRight->free(); + g_hdb->_gfx->_icepSnowballGfxRight = NULL; } - if (tileFroglickMiddleUD) { - tileFroglickMiddleUD->free(); - tileFroglickMiddleUD = NULL; + if (g_hdb->_gfx->_tileFroglickMiddleUD) { + g_hdb->_gfx->_tileFroglickMiddleUD->free(); + g_hdb->_gfx->_tileFroglickMiddleUD = NULL; } - if (tileFroglickWiggleUD[0]) { + if (g_hdb->_gfx->_tileFroglickWiggleUD[0]) { for (i = 0; i < 3; i++) { - tileFroglickWiggleUD[i]->free(); - tileFroglickWiggleUD[i] = NULL; + g_hdb->_gfx->_tileFroglickWiggleUD[i]->free(); + g_hdb->_gfx->_tileFroglickWiggleUD[i] = NULL; } } - if (tileFroglickMiddleLR) { - tileFroglickMiddleLR->free(); - tileFroglickMiddleLR = NULL; + if (g_hdb->_gfx->_tileFroglickMiddleLR) { + g_hdb->_gfx->_tileFroglickMiddleLR->free(); + g_hdb->_gfx->_tileFroglickMiddleLR = NULL; } - if (tileFroglickWiggleLeft[0]) { + if (g_hdb->_gfx->_tileFroglickWiggleLeft[0]) { for (i = 0; i < 3; i++) { - tileFroglickWiggleLeft[i]->free(); - tileFroglickWiggleLeft[i] = NULL; + g_hdb->_gfx->_tileFroglickWiggleLeft[i]->free(); + g_hdb->_gfx->_tileFroglickWiggleLeft[i] = NULL; } } - if (tileFroglickWiggleRight[0]) { + if (g_hdb->_gfx->_tileFroglickWiggleRight[0]) { for (i = 0; i < 3; i++) { - tileFroglickWiggleRight[i]->free(); - tileFroglickWiggleRight[i] = NULL; + g_hdb->_gfx->_tileFroglickWiggleRight[i]->free(); + g_hdb->_gfx->_tileFroglickWiggleRight[i] = NULL; } } // dragon! see ya! - if (gfxDragonAsleep) { - gfxDragonAsleep->free(); - gfxDragonAsleep = NULL; - gfxDragonFlap[0]->free(); - gfxDragonFlap[1]->free(); - gfxDragonFlap[0] = gfxDragonFlap[1] = NULL; - gfxDragonBreathe[0]->free(); - gfxDragonBreathe[1]->free(); - gfxDragonBreathe[2]->free(); - gfxDragonBreathe[0] = gfxDragonBreathe[1] = gfxDragonBreathe[2] = NULL; + if (g_hdb->_gfx->_gfxDragonAsleep) { + g_hdb->_gfx->_gfxDragonAsleep->free(); + g_hdb->_gfx->_gfxDragonAsleep = NULL; + g_hdb->_gfx->_gfxDragonFlap[0]->free(); + g_hdb->_gfx->_gfxDragonFlap[1]->free(); + g_hdb->_gfx->_gfxDragonFlap[0] = g_hdb->_gfx->_gfxDragonFlap[1] = NULL; + g_hdb->_gfx->_gfxDragonBreathe[0]->free(); + g_hdb->_gfx->_gfxDragonBreathe[1]->free(); + g_hdb->_gfx->_gfxDragonBreathe[2]->free(); + g_hdb->_gfx->_gfxDragonBreathe[0] = g_hdb->_gfx->_gfxDragonBreathe[1] = + g_hdb->_gfx->_gfxDragonBreathe[2] = NULL; } // laser beams - if (gfxLaserbeamUD[0]) { + if (g_hdb->_gfx->_gfxLaserbeamUD[0]) { for (i = 0; i < 4; i++) { - gfxLaserbeamUD[i]->free(); - gfxLaserbeamUDTop[i]->free(); - gfxLaserbeamUDBottom[i]->free(); - gfxLaserbeamLR[i]->free(); - gfxLaserbeamLRLeft[i]->free(); - gfxLaserbeamLRRight[i]->free(); - - gfxLaserbeamUD[i] = NULL; - gfxLaserbeamUDTop[i] = NULL; - gfxLaserbeamUDBottom[i] = NULL; - gfxLaserbeamLR[i] = NULL; - gfxLaserbeamLRLeft[i] = NULL; - gfxLaserbeamLRRight[i] = NULL; + g_hdb->_gfx->_gfxLaserbeamUD[i]->free(); + g_hdb->_gfx->_gfxLaserbeamUDTop[i]->free(); + g_hdb->_gfx->_gfxLaserbeamUDBottom[i]->free(); + g_hdb->_gfx->_gfxLaserbeamLR[i]->free(); + g_hdb->_gfx->_gfxLaserbeamLRLeft[i]->free(); + g_hdb->_gfx->_gfxLaserbeamLRRight[i]->free(); + + g_hdb->_gfx->_gfxLaserbeamUD[i] = NULL; + g_hdb->_gfx->_gfxLaserbeamUDTop[i] = NULL; + g_hdb->_gfx->_gfxLaserbeamUDBottom[i] = NULL; + g_hdb->_gfx->_gfxLaserbeamLR[i] = NULL; + g_hdb->_gfx->_gfxLaserbeamLRLeft[i] = NULL; + g_hdb->_gfx->_gfxLaserbeamLRRight[i] = NULL; } } diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 05a5a2d903..38501803f9 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -774,27 +774,6 @@ struct CineBlit { } #define spawnBlocking(x, y, level) g_hdb->_ai->spawn(AI_NONE, DIR_NONE, x, y, NULL, NULL, NULL, DIR_NONE, level, 0, 0, 0) -extern Picture *icepSnowballGfxDown; // ICEPUFF's snowball moving down -extern Picture *icepSnowballGfxLeft; // ICEPUFF's snowball moving left -extern Picture *icepSnowballGfxRight; // ICEPUFF's snowball moving right - -extern Tile *tileFroglickMiddleUD; -extern Tile *tileFroglickWiggleUD[3]; -extern Tile *tileFroglickMiddleLR; -extern Tile *tileFroglickWiggleLeft[3]; -extern Tile *tileFroglickWiggleRight[3]; - -extern Picture *gfxDragonAsleep; -extern Picture *gfxDragonFlap[2]; -extern Picture *gfxDragonBreathe[3]; - -extern Tile *gfxLaserbeamUD[4]; -extern Tile *gfxLaserbeamUDTop[4]; -extern Tile *gfxLaserbeamUDBottom[4]; -extern Tile *gfxLaserbeamLR[4]; -extern Tile *gfxLaserbeamLRLeft[4]; -extern Tile *gfxLaserbeamLRRight[4]; - class AI { public: AI(); diff --git a/engines/hdb/gfx.h b/engines/hdb/gfx.h index 83af1e49da..dbd3786f28 100644 --- a/engines/hdb/gfx.h +++ b/engines/hdb/gfx.h @@ -148,6 +148,29 @@ public: void setCursor(int x, int y); void getCursor(int *x, int *y); + // Some Gfx + + Picture *_icepSnowballGfxDown; // ICEPUFF's snowball moving down + Picture *_icepSnowballGfxLeft; // ICEPUFF's snowball moving left + Picture *_icepSnowballGfxRight; // ICEPUFF's snowball moving right + + Tile *_tileFroglickMiddleUD; + Tile *_tileFroglickWiggleUD[3]; + Tile *_tileFroglickMiddleLR; + Tile *_tileFroglickWiggleLeft[3]; + Tile *_tileFroglickWiggleRight[3]; + + Picture *_gfxDragonAsleep; + Picture *_gfxDragonFlap[2]; + Picture *_gfxDragonBreathe[3]; + + Tile *_gfxLaserbeamUD[4]; + Tile *_gfxLaserbeamUDTop[4]; + Tile *_gfxLaserbeamUDBottom[4]; + Tile *_gfxLaserbeamLR[4]; + Tile *_gfxLaserbeamLRLeft[4]; + Tile *_gfxLaserbeamLRRight[4]; + private: int _numTiles; TileLookup *_tLookupArray; |