X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FAnimation.h;h=524912d5743029a1b2ca8cabbc586949267df373;hb=ff31f85fb6a01403c50e34d1226690074c06b7d2;hp=03ead7fc5fc3cb75cc293b8c8fd55c135eb7af2a;hpb=62db8dd0b428e68cf5626607297589c2bafe0d3e;p=l2e.git 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;