1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Gcc compile & warning fixes

This commit is contained in:
Ivan Savenko
2014-06-22 17:26:08 +03:00
parent 3ac306f501
commit c605e2d10c
3 changed files with 18 additions and 8 deletions

View File

@@ -10,10 +10,10 @@
#include "StdInc.h" #include "StdInc.h"
#include "CGTownInstance.h" #include "CGTownInstance.h"
#include "CObjectClassesHandler.h"
#include "../NetPacks.h" #include "../NetPacks.h"
#include "../CGeneralTextHandler.h" #include "../CGeneralTextHandler.h"
#include "../mapObjects/CObjectClassesHandler.h"
using namespace boost::assign; using namespace boost::assign;

View File

@@ -237,7 +237,7 @@ void CMapGenerator::createConnections()
int3 guardPos(-1,-1,-1); int3 guardPos(-1,-1,-1);
auto otherZoneTiles = zoneB->getTileInfo(); auto otherZoneTiles = zoneB->getTileInfo();
auto otherZoneCenter = zoneB->getPos(); //auto otherZoneCenter = zoneB->getPos();
for (auto tile : tiles) for (auto tile : tiles)
{ {

View File

@@ -20,6 +20,8 @@
#include "../CSpellHandler.h" //for choosing random spells #include "../CSpellHandler.h" //for choosing random spells
#include "../mapObjects/CObjectClassesHandler.h" #include "../mapObjects/CObjectClassesHandler.h"
#include "../mapObjects/CGPandoraBox.h"
#include "../mapObjects/CRewardableObject.h"
class CMap; class CMap;
class CMapEditManager; class CMapEditManager;
@@ -122,9 +124,16 @@ void CTileInfo::setTerrainType(ETerrainType value)
terrain = value; terrain = value;
} }
CRmgTemplateZone::CRmgTemplateZone() : id(0), type(ETemplateZoneType::PLAYER_START), size(1), CRmgTemplateZone::CRmgTemplateZone() :
terrainType (ETerrainType::GRASS), townType(0), townsAreSameType(false), matchTerrainToTown(true), totalDensity(0), id(0),
zoneMonsterStrength(EMonsterStrength::ZONE_NORMAL) type(ETemplateZoneType::PLAYER_START),
size(1),
townsAreSameType(false),
matchTerrainToTown(true),
townType(0),
terrainType (ETerrainType::GRASS),
zoneMonsterStrength(EMonsterStrength::ZONE_NORMAL),
totalDensity(0)
{ {
townTypes = getDefaultTownTypes(); townTypes = getDefaultTownTypes();
terrainTypes = getDefaultTerrainTypes(); terrainTypes = getDefaultTerrainTypes();
@@ -370,7 +379,7 @@ void CRmgTemplateZone::fractalize(CMapGenerator* gen)
{ {
if (gen->isFree(tile)) if (gen->isFree(tile))
clearedTiles.push_back(tile); clearedTiles.push_back(tile);
else if (gen->isPossible(tile)); else if (gen->isPossible(tile))
possibleTiles.insert(tile); possibleTiles.insert(tile);
} }
if (clearedTiles.empty()) //this should come from zone connections if (clearedTiles.empty()) //this should come from zone connections
@@ -1032,8 +1041,8 @@ bool CRmgTemplateZone::findPlaceForObject(CMapGenerator* gen, CGObjectInstance*
//si32 min_dist = sqrt(tileinfo.size()/density); //si32 min_dist = sqrt(tileinfo.size()/density);
int best_distance = 0; int best_distance = 0;
bool result = false; bool result = false;
si32 w = gen->map->width; //si32 w = gen->map->width;
si32 h = gen->map->height; //si32 h = gen->map->height;
//logGlobal->infoStream() << boost::format("Min dist for density %f is %d") % density % min_dist; //logGlobal->infoStream() << boost::format("Min dist for density %f is %d") % density % min_dist;
@@ -1265,6 +1274,7 @@ ObjectInfo CRmgTemplateZone::getRandomObject (CMapGenerator* gen, ui32 value)
if (r <= t.first) if (r <= t.first)
return t.second; return t.second;
} }
//FIXME: control reaches end of non-void function. Missing return?
} }
void CRmgTemplateZone::addAllPossibleObjects (CMapGenerator* gen) void CRmgTemplateZone::addAllPossibleObjects (CMapGenerator* gen)