![]() |
Gorgon Game Engine
|
Public Types | |
using | AnimationType = basic_TextureAnimation< T_, basic_TextureAnimationProvider< T_, A_, F_ >, F_ > |
using | ConstIterator = typename std::vector< basic_AnimationFrame< T_ > >::const_iterator |
using | FrameType = F_ |
using | Iterator = typename std::vector< basic_AnimationFrame< T_ > >::iterator |
Public Member Functions | |
basic_TextureAnimationProvider ()=default | |
template<class C_ > | |
basic_TextureAnimationProvider (C_ &&other) | |
basic_TextureAnimationProvider (const basic_TextureAnimationProvider &)=delete | |
~basic_TextureAnimationProvider () | |
void | Add (const F_ &frame) |
void | Add (const Gorgon::Animation::Frame &frame) override |
void | Add (T_ &&image, unsigned duration=42) |
Adds the given image to the end of the animation. More... | |
void | Add (T_ &image, unsigned duration=42, bool own=false) |
Adds the given image to the end of the animation. More... | |
Iterator | begin () |
Returns an iterator to the beginning of the animation frames. More... | |
ConstIterator | begin () const |
Returns an iterator to the beginning of the animation frames. More... | |
void | Clear () override |
Removes all images from the animation. More... | |
virtual AnimationType & | CreateAnimation (bool create=true) const override |
Creates a new animation from this resource. More... | |
virtual AnimationType & | CreateAnimation (Gorgon::Animation::ControllerBase &controller) const override |
Creates a new animation from this resource. More... | |
basic_TextureAnimationProvider | Duplicate () const |
Iterator | end () |
Returns an iterator to the end of the animation frames. More... | |
ConstIterator | end () const |
Returns an iterator to the end of the animation frames. More... | |
const F_ & | FrameAt (int index) const override |
Returns the frame at specific point. More... | |
unsigned | FrameIndexAt (unsigned time) const |
Returns which frame is at the given time. More... | |
int | GetCount () const override |
Returns number of frames. More... | |
unsigned | GetDuration () const override |
Returns the duration of the animation. More... | |
unsigned | GetDuration (unsigned frame) const override |
Returns the duration of the given frame. More... | |
int | GetHeight () const |
Returns the size of the first image. More... | |
Geometry::Size | GetSize () const override |
Returns the size of the first image. More... | |
int | GetWidth () const |
Returns the size of the first image. More... | |
T_ & | ImageAt (unsigned time) const |
Returns the image that is to be shown at the given time. More... | |
void | Insert (const F_ &frm, int before) |
Inserts the given image before the given frame. More... | |
void | Insert (const Gorgon::Animation::Frame &frame, int before) override |
Inserts the given image before the given frame. More... | |
void | Insert (T_ &&img, int before, unsigned duration=42) |
Inserts the given image before the given frame. More... | |
void | Insert (T_ &image, int before, unsigned duration=42) |
Inserts the given image before the given frame. More... | |
void | MoveBefore (unsigned index, int before) override |
Moves a frame that has the index before the given position. More... | |
virtual auto | MoveOutProvider () -> decltype(*this) override |
template<class C_ > | |
basic_TextureAnimationProvider & | operator= (C_ &&other) |
basic_TextureAnimationProvider & | operator= (const basic_TextureAnimationProvider &)=delete |
T_ & | operator[] (int frame) const |
Returns the image at the given frame. More... | |
void | Own (T_ &image) |
Owns the given image so that it would be destroyed with this animation. More... | |
void | ReleaseAll () |
Releases ownership of all images in the animation without destroying them. More... | |
void | Remove (ConstIterator it) |
Removes an image from the animation. More... | |
void | Remove (unsigned frame) override |
Removes an image from the animation. More... | |
unsigned | StartOf (unsigned frame) const override |
Returns the starting time of the given frame. More... | |
Protected Attributes | |
Containers::Collection< T_ > | destroylist |
unsigned | duration |
std::vector< basic_AnimationFrame< T_ > > | frames |
using AnimationType = basic_TextureAnimation<T_, basic_TextureAnimationProvider<T_, A_, F_>, F_> |
using ConstIterator = typename std::vector<basic_AnimationFrame<T_> >::const_iterator |
using FrameType = F_ |
using Iterator = typename std::vector<basic_AnimationFrame<T_> >::iterator |
|
default |
|
delete |
basic_TextureAnimationProvider | ( | C_ && | other | ) |
void Add | ( | const F_ & | frame | ) |
|
override |
void Add | ( | T_ && | image, |
unsigned | duration = 42 |
||
) |
Adds the given image to the end of the animation.
This version owns the given image by moving it in the ownership list
References basic_TextureAnimationProvider< T_, A_, F_ >::destroylist, basic_TextureAnimationProvider< T_, A_, F_ >::duration, and basic_TextureAnimationProvider< T_, A_, F_ >::frames.
void Add | ( | T_ & | image, |
unsigned | duration = 42 , |
||
bool | own = false |
||
) |
Adds the given image to the end of the animation.
References basic_TextureAnimationProvider< T_, A_, F_ >::destroylist, basic_TextureAnimationProvider< T_, A_, F_ >::duration, and basic_TextureAnimationProvider< T_, A_, F_ >::frames.
Iterator begin | ( | ) |
Returns an iterator to the beginning of the animation frames.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
ConstIterator begin | ( | ) | const |
Returns an iterator to the beginning of the animation frames.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
override |
Removes all images from the animation.
References basic_TextureAnimationProvider< T_, A_, F_ >::duration, and basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
overridevirtual |
Creates a new animation from this resource.
|
overridevirtual |
Creates a new animation from this resource.
basic_TextureAnimationProvider Duplicate | ( | ) | const |
Iterator end | ( | ) |
Returns an iterator to the end of the animation frames.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
ConstIterator end | ( | ) | const |
Returns an iterator to the end of the animation frames.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
override |
Returns the frame at specific point.
References ASSERT, and basic_TextureAnimationProvider< T_, A_, F_ >::frames.
unsigned FrameIndexAt | ( | unsigned | time | ) | const |
Returns which frame is at the given time.
If the given time is larger than the animation duration, last frame is returned.
References ASSERT, and basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
override |
Returns number of frames.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
override |
Returns the duration of the animation.
References basic_TextureAnimationProvider< T_, A_, F_ >::duration.
|
override |
Returns the duration of the given frame.
References ASSERT, and basic_TextureAnimationProvider< T_, A_, F_ >::frames.
int GetHeight | ( | ) | const |
Returns the size of the first image.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
override |
Returns the size of the first image.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
int GetWidth | ( | ) | const |
Returns the size of the first image.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
T_& ImageAt | ( | unsigned | time | ) | const |
Returns the image that is to be shown at the given time.
If the given time is larger than the animation duration, animation is assumed to be looping.
References ASSERT, basic_TextureAnimationProvider< T_, A_, F_ >::duration, basic_TextureAnimationProvider< T_, A_, F_ >::FrameAt(), basic_TextureAnimationProvider< T_, A_, F_ >::frames, and basic_TextureAnimationProvider< T_, A_, F_ >::GetDuration().
void Insert | ( | const F_ & | frm, |
int | before | ||
) |
Inserts the given image before the given frame.
References basic_TextureAnimationProvider< T_, A_, F_ >::duration, and basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
override |
Inserts the given image before the given frame.
References basic_TextureAnimationProvider< T_, A_, F_ >::Insert().
void Insert | ( | T_ && | img, |
int | before, | ||
unsigned | duration = 42 |
||
) |
Inserts the given image before the given frame.
References basic_TextureAnimationProvider< T_, A_, F_ >::destroylist, basic_TextureAnimationProvider< T_, A_, F_ >::duration, and basic_TextureAnimationProvider< T_, A_, F_ >::frames.
void Insert | ( | T_ & | image, |
int | before, | ||
unsigned | duration = 42 |
||
) |
Inserts the given image before the given frame.
References basic_TextureAnimationProvider< T_, A_, F_ >::duration, and basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
override |
Moves a frame that has the index before the given position.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
overridevirtual |
Reimplemented in Animation.
basic_TextureAnimationProvider& operator= | ( | C_ && | other | ) |
|
delete |
T_& operator[] | ( | int | frame | ) | const |
Returns the image at the given frame.
References ASSERT, and basic_TextureAnimationProvider< T_, A_, F_ >::frames.
void Own | ( | T_ & | image | ) |
Owns the given image so that it would be destroyed with this animation.
References basic_TextureAnimationProvider< T_, A_, F_ >::destroylist.
void ReleaseAll | ( | ) |
Releases ownership of all images in the animation without destroying them.
References basic_TextureAnimationProvider< T_, A_, F_ >::destroylist.
void Remove | ( | ConstIterator | it | ) |
Removes an image from the animation.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
override |
Removes an image from the animation.
References ASSERT, basic_TextureAnimationProvider< T_, A_, F_ >::duration, basic_TextureAnimationProvider< T_, A_, F_ >::frames, and basic_TextureAnimationProvider< T_, A_, F_ >::GetDuration().
|
override |
Returns the starting time of the given frame.
References basic_TextureAnimationProvider< T_, A_, F_ >::frames.
|
protected |
|
protected |
|
protected |