Added SDL_Coor options to ButtonToggle. Major changes coming.
This commit is contained in:
parent
93bbd34acc
commit
fd4ebca425
@ -1,13 +1,35 @@
|
||||
#include "ButtonToggle.h"
|
||||
|
||||
ButtonToggle::ButtonToggle(void) {
|
||||
|
||||
}
|
||||
|
||||
ButtonToggle::~ButtonToggle(void) {
|
||||
|
||||
}
|
||||
|
||||
void ButtonToggle::SetOverRGB(Uint8 r, Uint8 g, Uint8 b) {
|
||||
Button::SetOverRGB(r, g, b);
|
||||
}
|
||||
|
||||
void ButtonToggle::SetOverRGB(SDL_Color colour) {
|
||||
Button::SetOverRGB(colour);
|
||||
}
|
||||
|
||||
void ButtonToggle::SetOffRGB(Uint8 r, Uint8 g, Uint8 b) {
|
||||
ButtonToggle::SetOutRGB(r, g, b);
|
||||
}
|
||||
|
||||
void ButtonToggle::SetOnRGB(Uint8 r, Uint8 g, Uint8 b) {
|
||||
|
||||
void ButtonToggle::SetOffRGB(SDL_Color colour) {
|
||||
Button::SetOutRGB(colour);
|
||||
}
|
||||
|
||||
void ButtonToggle::SetOnRGB(Uint8 r, Uint8 g, Uint8 b) {
|
||||
m_onColour.r = r;
|
||||
m_onColour.g = g;
|
||||
m_onColour.b = b;
|
||||
}
|
||||
|
||||
void ButtonToggle::SetOnRGB(SDL_Color colour) {
|
||||
m_onColour = colour;
|
||||
}
|
||||
|
@ -11,8 +11,11 @@ public:
|
||||
~ButtonToggle(void);
|
||||
|
||||
void SetOverRGB(Uint8 r, Uint8 g, Uint8 b);
|
||||
void SetOverRGB(SDL_Color);
|
||||
void SetOffRGB(Uint8 r, Uint8 g, Uint8 b);
|
||||
void SetOffRGB(SDL_Color);
|
||||
void SetOnRGB(Uint8 r, Uint8 g, Uint8 b);
|
||||
void SetOnRGB(SDL_Color);
|
||||
|
||||
void SetTextRGB(Uint8 r, Uint8 g, Uint8 b);
|
||||
void SetOnText(string);
|
||||
|
@ -130,12 +130,15 @@ bool Character::CheckTileCollisions(void) {
|
||||
bool Character::CheckEntityCollisions(void) {
|
||||
for(int i = -1; i < 2; i++) {
|
||||
for(int j = -1; j < 2; j++) {
|
||||
if(map->GetEntitySolidity(tileX + i, tileY + j))
|
||||
if(map->GetEntitySolidity(tileX + i, tileY + j)) {
|
||||
printf("\nw - ", map->GetEntityWidth(tileX + i, tileY + j));
|
||||
printf("\nh - ", map->GetEntityHeight(tileX + i, tileY + j));
|
||||
if(CheckCollisionXY(x, y, w, h, map->GetEntityX(tileX + i, tileY + j),
|
||||
map->GetEntityY(tileX + i, tileY + j),
|
||||
map->GetEntityWidth(tileX + i, tileY + j),
|
||||
map->GetEntityHeight(tileX + i, tileY + j)))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "Collision.h"
|
||||
#include "Map.h"
|
||||
#include "Timer.h"
|
||||
#include "Debug.h"
|
||||
using namespace std;
|
||||
|
||||
class Map;
|
||||
@ -71,7 +72,7 @@ protected:
|
||||
|
||||
private:
|
||||
static const int ANIMATION_SPEED = 200;
|
||||
static const int ATTACKING_DISPLAY_LEN = 100;
|
||||
static const int ATTACKING_DISPLAY_LEN = 150;
|
||||
|
||||
SDL_Surface* m_texture;
|
||||
|
||||
|
@ -56,6 +56,9 @@ void Map::Load(const string filename) {
|
||||
m_entityTextures->GetTextureWidth(m_tile[m_mapRows][m_mapColumns].GetEntityID()),
|
||||
m_entityTextures->GetTextureHeight(m_tile[m_mapRows][m_mapColumns].GetEntityID()));
|
||||
|
||||
printf("\nw - ", m_entityTextures->GetTextureWidth(m_tile[m_mapRows][m_mapColumns].GetEntityID()));
|
||||
printf("\nh - ", m_entityTextures->GetTextureHeight(m_tile[m_mapRows][m_mapColumns].GetEntityID()));
|
||||
|
||||
// Set the entities x and y variables.
|
||||
m_tile[m_mapRows][m_mapColumns].SetEntityXY(
|
||||
m_tile[m_mapRows][m_mapColumns].GetTileX() - (m_tile[m_mapRows][m_mapColumns].GetEntityWidth() / 2 + TILE_WIDTH / 2),
|
||||
|
Loading…
Reference in New Issue
Block a user