X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FAnimation.cpp;h=bdd4b2905e75728c3d64523156203a714e4acff2;hb=0e7b9eca67383e45e04aa419cb783c92722f7801;hp=f55a9aa9fc6520b7c46e1532f8c83fccd9dece55;hpb=2255d436a0c2acc10b015827366a72b2ece86094;p=l2e.git diff --git a/src/graphics/Animation.cpp b/src/graphics/Animation.cpp index f55a9aa..bdd4b29 100644 --- a/src/graphics/Animation.cpp +++ b/src/graphics/Animation.cpp @@ -14,6 +14,11 @@ using loader::TypeDescription; namespace graphics { +Animation::Animation(loader::noinit_t) { + +} + + void Animation::CreateTypeDescription() { TypeDescription &td(TypeDescription::Create(TYPE_ID, "Animation")); td.SetDescription("Abstract base type for animations."); @@ -63,24 +68,24 @@ bool AnimationRunner::JustFinished() const { } -void AnimationRunner::Draw(SDL_Surface *dest, geometry::Vector position) const { +void AnimationRunner::Draw(SDL_Surface *dest, math::Vector position) const { GetSprite()->Draw(dest, position + animation->Offset(Frame()), animation->Col(Frame()) + ColOffset(), animation->Row(Frame()) + RowOffset()); } -void AnimationRunner::DrawTopRight(SDL_Surface *dest, geometry::Vector position) const { - geometry::Vector offset(-GetSprite()->Width(), 0); +void AnimationRunner::DrawTopRight(SDL_Surface *dest, math::Vector position) const { + math::Vector offset(-GetSprite()->Width(), 0); Draw(dest, position + offset); } -void AnimationRunner::DrawCenter(SDL_Surface *dest, geometry::Vector position) const { +void AnimationRunner::DrawCenter(SDL_Surface *dest, math::Vector position) const { Draw(dest, position - (GetSprite()->Size() / 2)); } -void AnimationRunner::DrawCenterBottom(SDL_Surface *dest, geometry::Vector position) const { - geometry::Vector offset(-GetSprite()->Width() / 2, -GetSprite()->Height()); +void AnimationRunner::DrawCenterBottom(SDL_Surface *dest, math::Vector position) const { + math::Vector offset(-GetSprite()->Width() / 2, -GetSprite()->Height()); Draw(dest, position + offset); }