diff options
Diffstat (limited to 'src/components/animatable.cpp')
| -rw-r--r-- | src/components/animatable.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
| diff --git a/src/components/animatable.cpp b/src/components/animatable.cpp deleted file mode 100644 index fcd277c..0000000 --- a/src/components/animatable.cpp +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | #include "animatable.h" | ||
| 2 | |||
| 3 | AnimatableComponent::AnimatableComponent(const char* filename, int frame_width, int frame_height, int frames_across) | ||
| 4 | : texture(filename), frame_width(frame_width), frame_height(frame_height), frames_across(frames_across) | ||
| 5 | { | ||
| 6 | |||
| 7 | } | ||
| 8 | |||
| 9 | int AnimatableComponent::getFrame() const | ||
| 10 | { | ||
| 11 | return frame; | ||
| 12 | } | ||
| 13 | |||
| 14 | void AnimatableComponent::setFrame(int frame) | ||
| 15 | { | ||
| 16 | this->frame = frame; | ||
| 17 | } | ||
| 18 | |||
| 19 | const Texture& AnimatableComponent::getTexture() const | ||
| 20 | { | ||
| 21 | return texture; | ||
| 22 | } | ||
| 23 | |||
| 24 | Rectangle AnimatableComponent::getFrameRect() const | ||
| 25 | { | ||
| 26 | return {frame_width * (frame % frames_across), frame_height * (frame / frames_across), frame_width, frame_height}; | ||
| 27 | } | ||
