Skip to content

Commit

Permalink
mac errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ironbell committed Mar 7, 2016
1 parent 262e524 commit 4428f79
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions include/Enums/GameObjectState.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// this enum is used for animations and used by all game objects
enum class GameObjectState {
VOID,
Idle, // used by nearly every game object
Idle_up, // used by map main character
Idle_down, // used by map main character
Expand Down
2 changes: 1 addition & 1 deletion include/GameObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class GameObject {
virtual void setDebugBoundingBox(const sf::Color &debugColor);

protected:
GameObjectState m_state;
GameObjectState m_state = GameObjectState::VOID;

Screen* m_screen = nullptr;
sf::RectangleShape m_debugBox;
Expand Down
6 changes: 1 addition & 5 deletions src/TileMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ bool TileMap::load(const WorldData& data, const std::vector<std::vector<int> >&
m_layers.push_back(layer);
}

for (int i = 0; i < m_layers.size(); i++) {
for (auto& tile : m_animatedTiles.at(i)) {
tile->setState(GameObjectState::Idle);
}
}
return true;
}

Expand Down Expand Up @@ -99,6 +94,7 @@ void TileMap::readAnimatedTile(int tileNumber, int layerNr, int i, int j, const
animatedTile->playCurrentAnimation(true);
animatedTile->setPosition(position);
animatedTile->setState(GameObjectState::Idle);
animatedTile->setCurrentAnimation(animatedTile->getAnimation(GameObjectState::Idle), false);

m_animatedTiles[layerNr].push_back(animatedTile);

Expand Down

0 comments on commit 4428f79

Please sign in to comment.