aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorNipun Garg2019-07-14 01:33:50 +0530
committerEugene Sandulenko2019-09-03 17:17:20 +0200
commit9dec31c4586e2733cbe9fe6eb9f49673adfbd38b (patch)
tree0ef2576170da75f088f44d3067181637367ef952 /engines/hdb
parentd07dcd210cf1ec04aa7b4f3c76ac2b9f1af57af4 (diff)
downloadscummvm-rg350-9dec31c4586e2733cbe9fe6eb9f49673adfbd38b.tar.gz
scummvm-rg350-9dec31c4586e2733cbe9fe6eb9f49673adfbd38b.tar.bz2
scummvm-rg350-9dec31c4586e2733cbe9fe6eb9f49673adfbd38b.zip
HDB: Unstub drawWaypoints()
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/ai-waypoint.cpp41
1 files changed, 39 insertions, 2 deletions
diff --git a/engines/hdb/ai-waypoint.cpp b/engines/hdb/ai-waypoint.cpp
index 9e16e1326a..4147354faa 100644
--- a/engines/hdb/ai-waypoint.cpp
+++ b/engines/hdb/ai-waypoint.cpp
@@ -523,14 +523,51 @@ Tile *AI::getStandFrameDir(AIEntity *e) {
return e->moverightGfx[0];
break;
case DIR_NONE:
- warning("AI-WAYPOINT: getStandFrameDir: DIR_NONE found");
break;
}
return e->standdownGfx[0];
}
void AI::drawWayPoints() {
- debug(9, "STUB: AI::drawWayPoints()");
+ int i;
+ int mapX, mapY;
+ static int anim = 0;
+ static uint32 delay = g_hdb->getTimeSlice();
+ static int alpha = 255;
+ static int aVel = -4;
+
+ g_hdb->_map->getMapXY(&mapX, &mapY);
+
+ for (i = 0; i < _numWaypoints; i++) {
+ int x = _waypoints[i].x * kTileWidth;
+ int y = _waypoints[i].y * kTileHeight;
+
+ if (x > mapX - 32 && (x < (mapX + kScreenWidth)) &&
+ y > mapY - 32 && (y < (mapY + kScreenHeight)))
+ _waypointGfx[anim]->drawMasked(x - mapX, y - mapY, alpha);
+ }
+
+ // vary the alpha blending
+ alpha = (alpha + aVel);
+ if (alpha < 64) {
+ alpha = 64;
+ aVel = -aVel;
+ }
+
+ if (alpha > 200) {
+ alpha = 200;
+ aVel = -aVel;
+ }
+
+ // don't animate every single game frame...
+ if (delay > g_hdb->getTimeSlice())
+ return;
+ delay = g_hdb->getTimeSlice() + 100;
+
+ // cycle the waypoint gfx animation
+ anim++;
+ if (anim == 4)
+ anim = 0;
}
} // End of Namespace