fix: compiler warnings

This commit is contained in:
2021-09-02 10:48:14 +02:00
parent fe86bffc2e
commit 04d1e3c0bf
22 changed files with 74 additions and 79 deletions

View File

@@ -316,8 +316,7 @@ bool World::saveMap(const std::string& fileName) const{
DataBuffer buffer = mapHeaderCompressed << mapDataCompressed;
std::cout << "Total Size : " << buffer.GetSize() << std::endl;
buffer.WriteFile(fileName);
std::cout << "----- Map Saved ! -----\n";
return buffer.WriteFile(fileName);
}
void World::tick(std::uint64_t delta){
@@ -336,8 +335,6 @@ void World::moveMobs(std::uint64_t delta){
for(MobPtr mob : m_Mobs){
TilePtr tile = getTile(mob->getX(), mob->getY());
Direction tileDir;
if(tile != nullptr && tile->getType() == TileType::Walk){
WalkableTile* walkTile = dynamic_cast<WalkableTile*>(tile.get());
mob->setDirection(walkTile->direction);
@@ -368,22 +365,25 @@ void World::moveMobs(std::uint64_t delta){
}
}
const Color& World::getTileColor(TilePtr tile) const{
const Color* World::getTileColor(TilePtr tile) const{
switch(tile->getType()){
case TileType::Tower:{
TowerTile* towerTile = (TowerTile*) tile.get();
return m_TowerPlacePalette[towerTile->color_palette_ref];
return &m_TowerPlacePalette[towerTile->color_palette_ref];
}
case TileType::Walk:{
return m_WalkablePalette;
return &m_WalkablePalette;
}
case TileType::Decoration:{
DecorationTile* towerTile = (DecorationTile*) tile.get();
return m_DecorationPalette[towerTile->color_palette_ref];
return &m_DecorationPalette[towerTile->color_palette_ref];
break;
}
case TileType::None:{
return nullptr;
}
}
return m_DecorationPalette[0];
return nullptr;
}
Team& World::getRedTeam(){