From ff31f85fb6a01403c50e34d1226690074c06b7d2 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Sun, 12 Aug 2012 20:09:56 +0200 Subject: [PATCH] expose timing information in Animation --- src/graphics/Animation.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.39.2