aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorNipun Garg2019-06-28 03:45:07 +0530
committerEugene Sandulenko2019-09-03 17:17:03 +0200
commit8057837ba7de62a28444b8102a5df0c10bd00a8b (patch)
tree930ab0e2ab21c3aaed10fbb7155085f50fafbc84 /engines/hdb
parent9182fef47dd0ec2a12bbe125bb1b682d0aea3968 (diff)
downloadscummvm-rg350-8057837ba7de62a28444b8102a5df0c10bd00a8b.tar.gz
scummvm-rg350-8057837ba7de62a28444b8102a5df0c10bd00a8b.tar.bz2
scummvm-rg350-8057837ba7de62a28444b8102a5df0c10bd00a8b.zip
HDB: Add cycleFrames()
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/ai.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index a2f59e9bea..d8a831c10d 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -694,6 +694,16 @@ struct CineBlit {
#define onEvenTile(x, y) ( !(x & 31) && !(y & 31) )
#define hitPlayer(x, y) ( e->onScreen && g_hdb->_ai->checkPlayerCollision( x, y, 4 ) && !g_hdb->_ai->playerDead() )
+#define cycleFrames( e, max ) \
+ { \
+ if ( e->animDelay-- < 1 ) \
+ { \
+ e->animDelay = e->animCycle; \
+ e->animFrame++; \
+ if ( e->animFrame >= max ) \
+ e->animFrame = 0; \
+ } \
+ }
#define spawnBlocking(x, y, level) g_hdb->_ai->spawn(AI_NONE, DIR_NONE, x, y, NULL, NULL, NULL, DIR_NONE, level, 0, 0, 0)
class AI {