[Remove] Killed my new/delete overloads in Character.h to stop KonoM from bitching at me.
This commit is contained in:
parent
1b2ea15604
commit
50a948152d
@ -21,108 +21,108 @@ class LevelGen;
|
|||||||
class Character {
|
class Character {
|
||||||
public:
|
public:
|
||||||
Character(LevelGen* mapArg);
|
Character(LevelGen* mapArg);
|
||||||
~Character(void);
|
~Character(void);
|
||||||
|
|
||||||
void LoadSprites(string filename, int wArg, int hArg);
|
void LoadSprites(string filename, int wArg, int hArg);
|
||||||
|
|
||||||
float GetX(void) { return x; }
|
|
||||||
float GetY(void) { return y; }
|
|
||||||
float GetWidth(void) { return w; }
|
|
||||||
float GetHeight(void) { return h; }
|
|
||||||
|
|
||||||
void SetXY(float xArg, float yArg) { x = xArg, y = yArg; }
|
|
||||||
void SetXVelocity(float arg) { xVel = arg; }
|
|
||||||
void SetYVelocity(float arg) { yVel = arg; }
|
|
||||||
|
|
||||||
void SetHealth(int health) { _health = health; }
|
float GetX(void) { return x; }
|
||||||
int GetHealth(void) { return _health; }
|
float GetY(void) { return y; }
|
||||||
|
float GetWidth(void) { return w; }
|
||||||
int GetDirectionFacing(void) { return directionFacing; }
|
float GetHeight(void) { return h; }
|
||||||
void SetDirectionFacing(int dir) { directionFacing = dir; }
|
|
||||||
|
|
||||||
void AddSpeachBubble(string text);
|
void SetXY(float xArg, float yArg) { x = xArg, y = yArg; }
|
||||||
|
void SetXVelocity(float arg) { xVel = arg; }
|
||||||
|
void SetYVelocity(float arg) { yVel = arg; }
|
||||||
|
|
||||||
void Render(void);
|
void SetHealth(int health) { _health = health; }
|
||||||
void Update(void);
|
int GetHealth(void) { return _health; }
|
||||||
|
|
||||||
void OnAttack(void);
|
int GetDirectionFacing(void) { return directionFacing; }
|
||||||
|
void SetDirectionFacing(int dir) { directionFacing = dir; }
|
||||||
|
|
||||||
inline void* operator new(size_t size) {
|
void AddSpeachBubble(string text);
|
||||||
return gMemManager.Allocate(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void operator delete(void* object) {
|
void Render(void);
|
||||||
gMemManager.Free(object);
|
void Update(void);
|
||||||
}
|
|
||||||
|
|
||||||
inline void* operator new [](size_t size) {
|
void OnAttack(void);
|
||||||
return gMemManager.Allocate(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void operator delete [](void* object) {
|
// inline void* operator new(size_t size) {
|
||||||
gMemManager.Free(object);
|
// return gMemManager.Allocate(size);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
// inline void operator delete(void* object) {
|
||||||
|
// gMemManager.Free(object);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// inline void* operator new [](size_t size) {
|
||||||
|
// return gMemManager.Allocate(size);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// inline void operator delete [](void* object) {
|
||||||
|
// gMemManager.Free(object);
|
||||||
|
// }
|
||||||
|
|
||||||
|
static const int FACING_UP = 0;
|
||||||
|
static const int FACING_RIGHT = 1;
|
||||||
|
static const int FACING_DOWN = 2;
|
||||||
|
static const int FACING_LEFT = 3;
|
||||||
|
|
||||||
static const int FACING_UP = 0;
|
|
||||||
static const int FACING_RIGHT = 1;
|
|
||||||
static const int FACING_DOWN = 2;
|
|
||||||
static const int FACING_LEFT = 3;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Move(void);
|
void Move(void);
|
||||||
|
|
||||||
bool CheckTileCollisions(void);
|
bool CheckTileCollisions(void);
|
||||||
bool CheckEntityCollisions(void);
|
bool CheckEntityCollisions(void);
|
||||||
bool CheckCharacterCollisions(void);
|
bool CheckCharacterCollisions(void);
|
||||||
|
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
float w;
|
float w;
|
||||||
float h;
|
float h;
|
||||||
|
|
||||||
float xVel;
|
float xVel;
|
||||||
float yVel;
|
float yVel;
|
||||||
|
|
||||||
int tileX;
|
int tileX;
|
||||||
int tileY;
|
int tileY;
|
||||||
|
|
||||||
Timer attackTimer;
|
Timer attackTimer;
|
||||||
bool attacking;
|
bool attacking;
|
||||||
|
|
||||||
|
int _health;
|
||||||
|
|
||||||
int _health;
|
|
||||||
|
|
||||||
LevelGen* map;
|
LevelGen* map;
|
||||||
|
|
||||||
static const float CHARACTER_SPEED;
|
|
||||||
|
|
||||||
int directionFacing;
|
|
||||||
|
|
||||||
static const int ANIM_LEFT_FOOT = 0;
|
|
||||||
static const int ANIM_NO_FOOT = 1;
|
|
||||||
static const int ANIM_RIGHT_FOOT = 2;
|
|
||||||
static const int ANIM_ATTACK = 3;
|
|
||||||
|
|
||||||
Bar _healthBar;
|
static const float CHARACTER_SPEED;
|
||||||
Timer _healthBarDuration;
|
|
||||||
bool _showHealthBar;
|
int directionFacing;
|
||||||
|
|
||||||
|
static const int ANIM_LEFT_FOOT = 0;
|
||||||
|
static const int ANIM_NO_FOOT = 1;
|
||||||
|
static const int ANIM_RIGHT_FOOT = 2;
|
||||||
|
static const int ANIM_ATTACK = 3;
|
||||||
|
|
||||||
|
Bar _healthBar;
|
||||||
|
Timer _healthBarDuration;
|
||||||
|
bool _showHealthBar;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int ANIMATION_SPEED = 200;
|
static const int ANIMATION_SPEED = 200;
|
||||||
static const int ATTACKING_DISPLAY_LEN = 150;
|
static const int ATTACKING_DISPLAY_LEN = 150;
|
||||||
|
|
||||||
static const int SPEACH_BUBBLE_DISPLAY_LENGTH = 6000;
|
static const int SPEACH_BUBBLE_DISPLAY_LENGTH = 6000;
|
||||||
|
|
||||||
SDL_Surface* _texture;
|
|
||||||
|
|
||||||
// [direction][action]
|
|
||||||
SDL_Rect _sprites[4][4];
|
|
||||||
|
|
||||||
Timer _animationTimer;
|
|
||||||
int _animationStage;
|
|
||||||
bool _leftFoot;
|
|
||||||
|
|
||||||
list<string> _speachBubble;
|
SDL_Surface* _texture;
|
||||||
list<string>::iterator _speachBubbleIter;
|
|
||||||
Timer _speachBubbleTimer;
|
// [direction][action]
|
||||||
Text _speachBubbleText;
|
SDL_Rect _sprites[4][4];
|
||||||
|
|
||||||
|
Timer _animationTimer;
|
||||||
|
int _animationStage;
|
||||||
|
bool _leftFoot;
|
||||||
|
|
||||||
|
list<string> _speachBubble;
|
||||||
|
list<string>::iterator _speachBubbleIter;
|
||||||
|
Timer _speachBubbleTimer;
|
||||||
|
Text _speachBubbleText;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user