mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Cleanup
This commit is contained in:
parent
d4496c81f9
commit
301ac2457a
@ -1021,6 +1021,7 @@ void CServerHandler::threadRunServer()
|
||||
void CServerHandler::onServerFinished()
|
||||
{
|
||||
threadRunLocalServer.reset();
|
||||
if (CSH)
|
||||
CSH->campaignServerRestartLock.setn(false);
|
||||
}
|
||||
|
||||
|
@ -134,8 +134,10 @@ std::shared_ptr<IImage> MapTileStorage::find(size_t fileIndex, size_t rotationIn
|
||||
MapRendererTerrain::MapRendererTerrain()
|
||||
: storage(VLC->terrainTypeHandler->objects.size())
|
||||
{
|
||||
logGlobal->debug("Loading map terrains");
|
||||
for(const auto & terrain : VLC->terrainTypeHandler->objects)
|
||||
storage.load(terrain->getIndex(), terrain->tilesFilename, EImageBlitMode::OPAQUE);
|
||||
logGlobal->debug("Done loading map terrains");
|
||||
}
|
||||
|
||||
void MapRendererTerrain::renderTile(IMapRendererContext & context, Canvas & target, const int3 & coordinates)
|
||||
@ -173,8 +175,10 @@ uint8_t MapRendererTerrain::checksum(IMapRendererContext & context, const int3 &
|
||||
MapRendererRiver::MapRendererRiver()
|
||||
: storage(VLC->riverTypeHandler->objects.size())
|
||||
{
|
||||
logGlobal->debug("Loading map rivers");
|
||||
for(const auto & river : VLC->riverTypeHandler->objects)
|
||||
storage.load(river->getIndex(), river->tilesFilename, EImageBlitMode::COLORKEY);
|
||||
logGlobal->debug("Done loading map rivers");
|
||||
}
|
||||
|
||||
void MapRendererRiver::renderTile(IMapRendererContext & context, Canvas & target, const int3 & coordinates)
|
||||
@ -208,8 +212,10 @@ uint8_t MapRendererRiver::checksum(IMapRendererContext & context, const int3 & c
|
||||
MapRendererRoad::MapRendererRoad()
|
||||
: storage(VLC->roadTypeHandler->objects.size())
|
||||
{
|
||||
logGlobal->debug("Loading map roads");
|
||||
for(const auto & road : VLC->roadTypeHandler->objects)
|
||||
storage.load(road->getIndex(), road->tilesFilename, EImageBlitMode::COLORKEY);
|
||||
logGlobal->debug("Done loading map roads");
|
||||
}
|
||||
|
||||
void MapRendererRoad::renderTile(IMapRendererContext & context, Canvas & target, const int3 & coordinates)
|
||||
|
@ -34,8 +34,10 @@ MapRendererContextState::MapRendererContextState()
|
||||
|
||||
objects.resize(boost::extents[mapSize.z][mapSize.x][mapSize.y]);
|
||||
|
||||
logGlobal->debug("Loading map objects");
|
||||
for(const auto & obj : CGI->mh->getMap()->objects)
|
||||
addObject(obj);
|
||||
logGlobal->debug("Done loading map objects");
|
||||
}
|
||||
|
||||
void MapRendererContextState::addObject(const CGObjectInstance * obj)
|
||||
|
@ -726,12 +726,6 @@ CGameInfoCallback::CGameInfoCallback(CGameState * GS):
|
||||
{
|
||||
}
|
||||
|
||||
//std::shared_ptr<const boost::multi_array<ui8, 3>> CPlayerSpecificInfoCallback::getVisibilityMap() const
|
||||
//{
|
||||
// //boost::shared_lock<boost::shared_mutex> lock(*gs->mx);
|
||||
// return gs->getPlayerTeam(*getPlayerID())->fogOfWarMap;
|
||||
//}
|
||||
|
||||
int CPlayerSpecificInfoCallback::howManyTowns() const
|
||||
{
|
||||
//boost::shared_lock<boost::shared_mutex> lock(*gs->mx);
|
||||
|
@ -247,8 +247,6 @@ public:
|
||||
|
||||
virtual int getResourceAmount(GameResID type) const;
|
||||
virtual TResources getResourceAmount() const;
|
||||
//virtual std::shared_ptr<const boost::multi_array<ui8, 3>> getVisibilityMap() const; //returns visibility map
|
||||
//virtual const PlayerSettings * getPlayerSettings(PlayerColor color) const;
|
||||
};
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
@ -317,8 +317,7 @@ CTownHandler::CTownHandler():
|
||||
|
||||
CTownHandler::~CTownHandler()
|
||||
{
|
||||
delete randomTown;
|
||||
delete randomFaction;
|
||||
delete randomFaction; // will also delete randomTown
|
||||
}
|
||||
|
||||
JsonNode readBuilding(CLegacyConfigParser & parser)
|
||||
|
@ -35,14 +35,10 @@ CGObjectInstance::CGObjectInstance():
|
||||
tempOwner(PlayerColor::UNFLAGGABLE),
|
||||
blockVisit(false)
|
||||
{
|
||||
logGlobal->debug("Created object at %d", ptrdiff_t(this));
|
||||
}
|
||||
|
||||
//must be instantiated in .cpp file for access to complete types of all member fields
|
||||
CGObjectInstance::~CGObjectInstance()
|
||||
{
|
||||
logGlobal->debug("Deleted object %d at %d", id.getNum(), ptrdiff_t(this));
|
||||
}
|
||||
CGObjectInstance::~CGObjectInstance() = default;
|
||||
|
||||
MapObjectID CGObjectInstance::getObjGroupIndex() const
|
||||
{
|
||||
|
@ -23,9 +23,4 @@ BinaryDeserializer::BinaryDeserializer(IBinaryReader * r): CLoaderBase(r)
|
||||
registerTypes(*this);
|
||||
}
|
||||
|
||||
BinaryDeserializer::~BinaryDeserializer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
@ -145,7 +145,6 @@ public:
|
||||
bool saving;
|
||||
|
||||
BinaryDeserializer(IBinaryReader * r);
|
||||
~BinaryDeserializer();
|
||||
|
||||
template<class T>
|
||||
BinaryDeserializer & operator&(T & t)
|
||||
@ -291,7 +290,7 @@ public:
|
||||
{
|
||||
typedef typename std::remove_pointer<T>::type npT;
|
||||
typedef typename std::remove_const<npT>::type ncpT;
|
||||
data = ClassObjectCreator<ncpT>::invoke();// !!!
|
||||
data = ClassObjectCreator<ncpT>::invoke();
|
||||
ptrAllocated(data, pid);
|
||||
load(*data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user