From: Daniel Karbach Date: Sun, 12 Aug 2012 18:09:56 +0000 (+0200) Subject: expose timing information in Animation X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=ff31f85fb6a01403c50e34d1226690074c06b7d2;p=l2e.git expose timing information in Animation --- diff --git a/src/graphics/Animation.h b/src/graphics/Animation.h index 03ead7f..524912d 100644 --- a/src/graphics/Animation.h +++ b/src/graphics/Animation.h @@ -43,6 +43,8 @@ public: return timer.Running() && (repeat || timer.Iteration() < NumFrames()); } + const app::Timer &GetTimer() { return timer; } + void SetColOffset(int offset) { colOffset = offset; } int ColOffset() const { return colOffset; } void SetRowOffset(int offset) { rowOffset = offset; } @@ -67,8 +69,9 @@ public: Draw(dest, position + offset); } -protected: int Frame() const { return Running() ? (timer.Iteration() % NumFrames()) : 0; } + +protected: virtual int Col() const = 0; virtual int Row() const = 0; virtual int NumFrames() const = 0;