-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCAnimation.h
More file actions
executable file
·55 lines (49 loc) · 1.11 KB
/
CAnimation.h
File metadata and controls
executable file
·55 lines (49 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include <SDL2/SDL.h>
#include "CTexture.h"
#include "CMotion.h"
class CAnimation
{
private:
int CurrentFrame;
int FrameInc;
int FrameRate; //Milliseconds
long OldTime;
CRectangle mBounds;
protected:
CMotion *mMover;
int mFloor;
public:
int MaxFrames[10];
int MaxRows;
bool Oscillate;
CTexture *mTexture;
int X, Y;
int W, H;
int Velocity;
int Row;
bool Enabled;
bool Repeat;
bool mState;
public:
CAnimation();
virtual void OnAnimate();
void Enable(bool enable);
void SetFrameRate(int Rate);
void SetCurrentFrame(int Frame);
int GetCurrentFrame();
void Render(SDL_Renderer *renderer);
void SetTexture(CTexture *tex, int rows, int frames);
void SetCurrentRow(int row);
void SetMover(CMotion *mover);
void MoveOffScreen();
virtual void Move();
virtual void SetMoverState(bool state);
virtual void SetPosition(int x, int y);
virtual void SetVelocity(int v);
virtual void SetState(bool s);
virtual void Reset();
void SetBounds(CRectangle bounds);
void SetBounds(int x, int y, int w, int h);
virtual void Transition() {}
};