#include <image.h>
Inheritance diagram for hoa_video::AnimatedImage:


Public Member Functions | |
| bool | AddFrame (const std::string &frame, uint32 frame_time) |
| Adds an animation frame using the filename of the image to add. | |
| bool | AddFrame (const StillImage &frame, uint32 frame_time) |
| Adds an animation frame by using an existing static image. | |
| AnimatedImage (const bool grayscale=false) | |
| void | Clear () |
| Removes the data and properties allocated to the animated image. | |
| void | DisableGrayScale () |
| Disables grayscale for the image. | |
| void | EnableGrayScale () |
| Enables grayscale for the image. | |
| void | ResetAnimation () |
| Resets the animation's frame, counter, and looping. | |
| void | Update () |
| Called every frame to update the animation's current frame. This will automatically synchronize the animation to VIDEO_ANIMATION_FRAME_PERIOD, i.e. 30 frames per second. If you want to update the frames yourself using some custom method, then use SetFrame(). | |
Class Member Get Functions | |
| uint32 | GetCurrentFrameIndex () const |
| Returns the index number of the current frame in the animation. | |
| StillImage * | GetFrame (uint32 index) const |
| Returns a pointer to the StillImage at a specified frame. | |
| float | GetHeight () const |
| Returns the height of the 1st frame of animation. | |
| uint32 | GetNumFrames () const |
| Returns the number of frames in this animation. | |
| float | GetPercentProgress () const |
| Returns the percentage of timing complete for the current frame being shown. | |
| uint32 | GetTimeProgress () const |
| Returns the number of milliseconds that the current frame has been shown for. | |
| float | GetWidth () const |
| Returns the width of the 1st frame of animation. | |
| bool | IsLoopsFinished () const |
| Returns true if the loops have finished, false otherwise. | |
Class Member Set Functions | |
| void | SetColor (const Color &color) |
| sets All frames to be of a certain color (all vertices are set to the same color) | |
| void | SetDimensions (const float width, const float height) |
| Sets all animation frames to be a certain width and height. | |
| void | SetFrameIndex (const uint32 index) |
| Sets the current frame index of the animation. | |
| void | SetHeight (const float height) |
| Sets all animation frames to be a certain height. | |
| void | SetLoopCounter (int32 loops) |
| Set the current number of loops that the animation has completed. | |
| void | SetLoopsFinished (bool loops) |
| Effectively stops the animation in its track if this member is set to true. | |
| void | SetNumberLoops (int32 loops) |
| Set the number of loops for the animation. A value less than zero indicates to loop forever. Zero indicates do not loop: just run the animation from beginning to end and stop. | |
| void | SetStatic (const bool is_static) |
| Sets the static member for all animation frame images. | |
| void | SetTimeProgress (uint32 time) |
| Sets the number of milliseconds that the current frame has been shown for. | |
| void | SetVertexColors (const Color &tl, const Color &tr, const Color &bl, const Color &br) |
| sets all frames to have the specified vertex colors | |
| void | SetWidth (const float width) |
| Sets all animation frames to be a certain width. | |
Private Attributes | |
| uint32 | _frame_counter |
| Counts how long each frame has been shown for. | |
| uint32 | _frame_index |
| The index of which animation frame to display. | |
| std::vector< private_video::AnimationFrame > | _frames |
| The vector of animation frames (both frame images and frame timing). | |
| int32 | _loop_counter |
| Counts the number of loops remaining for the animation. | |
| bool | _loops_finished |
| Set to true when the loop counter has expired. This member will remain eternally false if the looping is set to infinite mode. | |
| int32 | _number_loops |
| The number of times to loop the animation frames. A value less than zero indicates to loop forever, which is the default. | |
Friends | |
| class | GameVideo |
****************************************************************************
Animated images are really nothing more than a series of individual still images and timing information for each frame. This class assumes that all frame images are the same size, so you should not attempt to use this class if your frames are of different sizes. If you wish to use different sized frame images in an animation, you'll need to implement the code to do so yourself.
Definition at line 485 of file image.h.
| hoa_video::AnimatedImage::AnimatedImage | ( | const bool | grayscale = false |
) |
Definition at line 403 of file image.cpp.
References hoa_video::ImageDescriptor::_animated, hoa_video::ImageDescriptor::_grayscale, _loop_counter, _loops_finished, _number_loops, and Clear().
Here is the call graph for this function:

| bool hoa_video::AnimatedImage::AddFrame | ( | const std::string & | frame, | |
| uint32 | frame_time | |||
| ) |
Adds an animation frame using the filename of the image to add.
| frame | The filename of the frame image to add. | |
| frame_time | The number of milliseconds that this animation should last for |
Definition at line 481 of file image.cpp.
References hoa_video::ImageDescriptor::_color, _frames, hoa_video::ImageDescriptor::_height, hoa_video::ImageDescriptor::_is_static, hoa_video::ImageDescriptor::_width, hoa_video::private_video::AnimationFrame::frame_time, hoa_video::private_video::AnimationFrame::image, hoa_video::StillImage::SetDimensions(), hoa_video::StillImage::SetFilename(), hoa_video::StillImage::SetStatic(), and hoa_video::StillImage::SetVertexColors().
Here is the call graph for this function:

| bool hoa_video::AnimatedImage::AddFrame | ( | const StillImage & | frame, | |
| uint32 | frame_time | |||
| ) |
Adds an animation frame by using an existing static image.
| frame | The still image to use as the frame image. | |
| frame_time | The amount of millseconds to display the frame. |
Definition at line 498 of file image.cpp.
References hoa_video::StillImage::_elements, _frames, hoa_video::private_video::AnimationFrame::frame_time, and hoa_video::private_video::AnimationFrame::image.
Referenced by hoa_map::MapMode::_LoadTiles(), hoa_battle::BattleMode::BattleMode(), hoa_video::private_video::ParticleSystem::Create(), and hoa_global::GlobalCharacter::GlobalCharacter().
| void hoa_video::AnimatedImage::Clear | ( | ) | [virtual] |
Removes the data and properties allocated to the animated image.
Implements hoa_video::ImageDescriptor.
Definition at line 414 of file image.cpp.
References hoa_video::ImageDescriptor::_Clear(), _frame_counter, _frame_index, _frames, _loop_counter, _loops_finished, _number_loops, SetColor(), and hoa_video::Color::white.
Referenced by AnimatedImage().
Here is the call graph for this function:

| void hoa_video::AnimatedImage::DisableGrayScale | ( | ) |
Disables grayscale for the image.
Definition at line 439 of file image.cpp.
References _frames, hoa_video::StillImage::DisableGrayScale(), and GetFrame().
Here is the call graph for this function:

| void hoa_video::AnimatedImage::EnableGrayScale | ( | ) |
Enables grayscale for the image.
Definition at line 428 of file image.cpp.
References _frames, hoa_video::StillImage::EnableGrayScale(), and GetFrame().
Here is the call graph for this function:

| uint32 hoa_video::AnimatedImage::GetCurrentFrameIndex | ( | ) | const [inline] |
Returns the index number of the current frame in the animation.
Definition at line 620 of file image.h.
References _frame_index.
Referenced by hoa_video::private_video::ParticleSystem::Draw(), and hoa_video::GameVideo::DrawImage().
| StillImage* hoa_video::AnimatedImage::GetFrame | ( | uint32 | index | ) | const [inline] |
Returns a pointer to the StillImage at a specified frame.
| index | index of the frame you want |
Definition at line 631 of file image.h.
References _frames.
Referenced by DisableGrayScale(), hoa_video::private_video::ParticleSystem::Draw(), hoa_video::GameVideo::DrawImage(), EnableGrayScale(), SetColor(), SetDimensions(), SetHeight(), SetVertexColors(), and SetWidth().
| float hoa_video::AnimatedImage::GetHeight | ( | ) | const [inline, virtual] |
Returns the height of the 1st frame of animation.
Implements hoa_video::ImageDescriptor.
Definition at line 612 of file image.h.
References _frames.
| uint32 hoa_video::AnimatedImage::GetNumFrames | ( | ) | const [inline] |
| float hoa_video::AnimatedImage::GetPercentProgress | ( | ) | const [inline] |
Returns the percentage of timing complete for the current frame being shown.
Definition at line 641 of file image.h.
References _frame_counter, _frame_index, and _frames.
Referenced by hoa_video::private_video::ParticleSystem::Draw().
| uint32 hoa_video::AnimatedImage::GetTimeProgress | ( | ) | const [inline] |
Returns the number of milliseconds that the current frame has been shown for.
Definition at line 635 of file image.h.
References _frame_counter.
| float hoa_video::AnimatedImage::GetWidth | ( | ) | const [inline, virtual] |
Returns the width of the 1st frame of animation.
Implements hoa_video::ImageDescriptor.
Definition at line 607 of file image.h.
References _frames.
| bool hoa_video::AnimatedImage::IsLoopsFinished | ( | ) | const [inline] |
Returns true if the loops have finished, false otherwise.
Definition at line 645 of file image.h.
References _loops_finished.
| void hoa_video::AnimatedImage::ResetAnimation | ( | ) | [inline] |
Resets the animation's frame, counter, and looping.
Definition at line 507 of file image.h.
References _frame_counter, _frame_index, _loop_counter, and _loops_finished.
| void hoa_video::AnimatedImage::SetColor | ( | const Color & | color | ) | [virtual] |
sets All frames to be of a certain color (all vertices are set to the same color)
| color | Color of the 4 vertices |
Implements hoa_video::ImageDescriptor.
Definition at line 558 of file image.cpp.
References hoa_video::ImageDescriptor::_color, _frames, GetFrame(), and hoa_video::StillImage::SetColor().
Referenced by Clear().
Here is the call graph for this function:

| void hoa_video::AnimatedImage::SetDimensions | ( | const float | width, | |
| const float | height | |||
| ) | [virtual] |
Sets all animation frames to be a certain width and height.
| width | Width of the images | |
| height | Height of the images |
Implements hoa_video::ImageDescriptor.
Definition at line 544 of file image.cpp.
References _frames, hoa_video::ImageDescriptor::_height, hoa_video::ImageDescriptor::_width, GetFrame(), and hoa_video::StillImage::SetDimensions().
Referenced by hoa_map::MapMode::_LoadTiles().
Here is the call graph for this function:

| void hoa_video::AnimatedImage::SetFrameIndex | ( | const uint32 | index | ) | [inline] |
Sets the current frame index of the animation.
| index | The index of the frame to access |
Definition at line 573 of file image.h.
References _frame_counter, _frame_index, and _frames.
Referenced by hoa_global::GlobalCharacter::GlobalCharacter().
| void hoa_video::AnimatedImage::SetHeight | ( | const float | height | ) | [virtual] |
Sets all animation frames to be a certain height.
| height | Height of the images |
Implements hoa_video::ImageDescriptor.
Definition at line 531 of file image.cpp.
References _frames, hoa_video::ImageDescriptor::_height, GetFrame(), and hoa_video::StillImage::SetHeight().
Here is the call graph for this function:

| void hoa_video::AnimatedImage::SetLoopCounter | ( | int32 | loops | ) | [inline] |
Set the current number of loops that the animation has completed.
| loops | Current loop count |
Definition at line 593 of file image.h.
References _loop_counter.
| void hoa_video::AnimatedImage::SetLoopsFinished | ( | bool | loops | ) | [inline] |
Effectively stops the animation in its track if this member is set to true.
| loops | Flag for stoping the looping procecss |
Definition at line 599 of file image.h.
References _loops_finished.
| void hoa_video::AnimatedImage::SetNumberLoops | ( | int32 | loops | ) | [inline] |
Set the number of loops for the animation. A value less than zero indicates to loop forever. Zero indicates do not loop: just run the animation from beginning to end and stop.
| loops | Number of loops for the animation |
Definition at line 587 of file image.h.
References _number_loops.
| void hoa_video::AnimatedImage::SetStatic | ( | const bool | is_static | ) | [inline, virtual] |
Sets the static member for all animation frame images.
| is_static | Flag indicating wether the image will be static or not. |
Implements hoa_video::ImageDescriptor.
Definition at line 566 of file image.h.
References hoa_video::ImageDescriptor::_is_static.
| void hoa_video::AnimatedImage::SetTimeProgress | ( | uint32 | time | ) | [inline] |
Sets the number of milliseconds that the current frame has been shown for.
| time | Time of the frame counter |
Definition at line 579 of file image.h.
References _frame_counter.
| void hoa_video::AnimatedImage::SetVertexColors | ( | const Color & | tl, | |
| const Color & | tr, | |||
| const Color & | bl, | |||
| const Color & | br | |||
| ) | [virtual] |
sets all frames to have the specified vertex colors
| tl | The top left vertex color | |
| tr | The top right vertex color | |
| bl | The bottom left vertex color | |
| br | The bottom right vertex color |
Implements hoa_video::ImageDescriptor.
Definition at line 575 of file image.cpp.
References hoa_video::ImageDescriptor::_color, _frames, GetFrame(), and hoa_video::StillImage::SetVertexColors().
Here is the call graph for this function:

| void hoa_video::AnimatedImage::SetWidth | ( | const float | width | ) | [virtual] |
Sets all animation frames to be a certain width.
| width | Width of the images |
Implements hoa_video::ImageDescriptor.
Definition at line 518 of file image.cpp.
References _frames, hoa_video::ImageDescriptor::_width, GetFrame(), and hoa_video::StillImage::SetWidth().
Here is the call graph for this function:

| void hoa_video::AnimatedImage::Update | ( | ) |
Called every frame to update the animation's current frame. This will automatically synchronize the animation to VIDEO_ANIMATION_FRAME_PERIOD, i.e. 30 frames per second. If you want to update the frames yourself using some custom method, then use SetFrame().
Definition at line 450 of file image.cpp.
References _frame_counter, _frame_index, _frames, _loop_counter, _loops_finished, _number_loops, hoa_video::GameVideo::GetFrameChange(), and hoa_video::VideoManager.
Referenced by hoa_video::private_video::ParticleSystem::Update(), hoa_map::private_map::VirtualSprite::Update(), hoa_battle::private_battle::BattleCharacterActor::Update(), and hoa_battle::BattleMode::Update().
Here is the call graph for this function:

friend class GameVideo [friend] |
Counts how long each frame has been shown for.
Definition at line 654 of file image.h.
Referenced by Clear(), GetPercentProgress(), GetTimeProgress(), ResetAnimation(), SetFrameIndex(), SetTimeProgress(), and Update().
uint32 hoa_video::AnimatedImage::_frame_index [private] |
The index of which animation frame to display.
Definition at line 651 of file image.h.
Referenced by Clear(), GetCurrentFrameIndex(), GetPercentProgress(), ResetAnimation(), SetFrameIndex(), and Update().
std::vector<private_video::AnimationFrame> hoa_video::AnimatedImage::_frames [private] |
The vector of animation frames (both frame images and frame timing).
Definition at line 670 of file image.h.
Referenced by AddFrame(), Clear(), DisableGrayScale(), EnableGrayScale(), GetFrame(), GetHeight(), GetNumFrames(), GetPercentProgress(), GetWidth(), SetColor(), SetDimensions(), SetFrameIndex(), SetHeight(), SetVertexColors(), SetWidth(), and Update().
int32 hoa_video::AnimatedImage::_loop_counter [private] |
Counts the number of loops remaining for the animation.
Definition at line 662 of file image.h.
Referenced by AnimatedImage(), Clear(), ResetAnimation(), SetLoopCounter(), and Update().
bool hoa_video::AnimatedImage::_loops_finished [private] |
Set to true when the loop counter has expired. This member will remain eternally false if the looping is set to infinite mode.
Definition at line 667 of file image.h.
Referenced by AnimatedImage(), Clear(), IsLoopsFinished(), ResetAnimation(), SetLoopsFinished(), and Update().
int32 hoa_video::AnimatedImage::_number_loops [private] |
The number of times to loop the animation frames. A value less than zero indicates to loop forever, which is the default.
Definition at line 659 of file image.h.
Referenced by AnimatedImage(), Clear(), SetNumberLoops(), and Update().
1.5.1