-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSprite.hpp
32 lines (26 loc) · 886 Bytes
/
Sprite.hpp
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
#ifndef SPRITE_HPP
#define SPRITE_HPP
#include "Framework.hpp"
class CSprite
{
public:
CSprite ();
~CSprite ();
void Load (const string sFilename);
void Load (const string sFilename, int NumFrames,
int FrameWidth, int FrameHeight);
void SetPos (float fXPos, float fYPos);
void Render ();
void Render (float fFrameNumber);
SDL_Rect GetRect () {return m_Rect;}
private:
SDL_Renderer *m_pRenderer; // Zeiger auf den Renderer
SDL_Texture *m_pImage; // Das eigentliche Bild des Sprites
SDL_Rect m_Rect; // Rect des Sprites
SDL_Rect m_FrameRect; // Ausschnitt für Animationsphase
int m_NumFrames; // Anzahl der Animationsphasen
int m_FrameWidth; // Breite einer Animationsphase
int m_FrameHeight; // Höhe einer Animationsphase
int m_NumFramesX; // Wie viele Anim-Phasen in X-Richtung?
};
#endif