1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Minor optimization of map startup time

This commit is contained in:
Ivan Savenko 2023-11-07 17:30:16 +02:00
parent 4e654a7e6e
commit ed66fc2fb3
4 changed files with 4 additions and 6 deletions

View File

@ -921,11 +921,9 @@ void CGameState::initMapObjects()
for(CGObjectInstance *obj : map->objects) for(CGObjectInstance *obj : map->objects)
{ {
if(obj) if(obj)
{
logGlobal->trace("Calling Init for object %d, %s, %s", obj->id.getNum(), obj->typeName, obj->subTypeName);
obj->initObj(getRandomGenerator()); obj->initObj(getRandomGenerator());
}
} }
logGlobal->debug("\tObject initialization done");
for(CGObjectInstance *obj : map->objects) for(CGObjectInstance *obj : map->objects)
{ {
if(!obj) if(!obj)

View File

@ -117,7 +117,7 @@ std::set<int3> CGObjectInstance::getBlockedPos() const
return ret; return ret;
} }
std::set<int3> CGObjectInstance::getBlockedOffsets() const const std::set<int3> & CGObjectInstance::getBlockedOffsets() const
{ {
return appearance->getBlockedOffsets(); return appearance->getBlockedOffsets();
} }

View File

@ -77,7 +77,7 @@ public:
bool coveringAt (const int3 & pos) const; //returns true if object covers with picture location (x, y) (h3m pos) bool coveringAt (const int3 & pos) const; //returns true if object covers with picture location (x, y) (h3m pos)
std::set<int3> getBlockedPos() const; //returns set of positions blocked by this object std::set<int3> getBlockedPos() const; //returns set of positions blocked by this object
std::set<int3> getBlockedOffsets() const; //returns set of relative positions blocked by this object const std::set<int3> & getBlockedOffsets() const; //returns set of relative positions blocked by this object
/// returns true if object is visitable /// returns true if object is visitable
bool isVisitable() const; bool isVisitable() const;

View File

@ -80,7 +80,7 @@ public:
bool isVisibleAt(si32 X, si32 Y) const; bool isVisibleAt(si32 X, si32 Y) const;
bool isBlockedAt(si32 X, si32 Y) const; bool isBlockedAt(si32 X, si32 Y) const;
inline std::set<int3> getBlockedOffsets() const inline const std::set<int3> & getBlockedOffsets() const
{ {
return blockedOffsets; return blockedOffsets;
}; };