diff options
author | Nipun Garg | 2019-06-21 03:21:36 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:52 +0200 |
commit | f9c21da88bbf265e38ef54d22d86f3d24fd48062 (patch) | |
tree | a64e9e8cc7892b3c9c65c90b3d04c818aa118ba6 | |
parent | 5c2cfac2094a6161bb94c06b57efc0ae72a9eb7e (diff) | |
download | scummvm-rg350-f9c21da88bbf265e38ef54d22d86f3d24fd48062.tar.gz scummvm-rg350-f9c21da88bbf265e38ef54d22d86f3d24fd48062.tar.bz2 scummvm-rg350-f9c21da88bbf265e38ef54d22d86f3d24fd48062.zip |
HDB: Add getStandFrameDir()
-rw-r--r-- | engines/hdb/ai-waypoint.cpp | 33 | ||||
-rw-r--r-- | engines/hdb/ai.h | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/engines/hdb/ai-waypoint.cpp b/engines/hdb/ai-waypoint.cpp index ec31bd19c8..88a0c44d13 100644 --- a/engines/hdb/ai-waypoint.cpp +++ b/engines/hdb/ai-waypoint.cpp @@ -29,4 +29,37 @@ void AI::clearWaypoints() { _numWaypoints = 0; } +void *AI::getStandFrameDir(AIEntity *e) { + switch (e->dir) { + case DIR_DOWN: + if (e->standdownFrames) + return e->standdownGfx[0]; + else if (e->movedownFrames) + return e->movedownGfx[0]; + break; + case DIR_UP: + if (e->standupFrames) + return e->standupGfx[0]; + else if (e->moveupFrames) + return e->moveupGfx[0]; + break; + case DIR_LEFT: + if (e->standleftFrames) + return e->standleftGfx[0]; + else if (e->moveleftFrames) + return e->moveleftGfx[0]; + break; + case DIR_RIGHT: + if (e->standrightFrames) + return e->standrightGfx[0]; + else if (e->moverightFrames) + return e->moverightGfx[0]; + break; + case DIR_NONE: + warning("AI-WAYPOINT: getStandFrameDir: DIR_NONE found"); + break; + } + return e->standdownGfx[0]; +} + } // End of Namespace diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 8e6a7ab8d7..e3d846f1cc 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -633,6 +633,7 @@ public: // Waypoint & Movement Functions void lookAtXY(int x, int y); void clearWaypoints(); + void *getStandFrameDir(AIEntity *e); // Inventory Functions bool addToInventory(AIEntity *e); |