mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Minor optimization of map startup time
This commit is contained in:
		| @@ -921,11 +921,9 @@ void CGameState::initMapObjects() | ||||
| 	for(CGObjectInstance *obj : map->objects) | ||||
| 	{ | ||||
| 		if(obj) | ||||
| 		{ | ||||
| 			logGlobal->trace("Calling Init for object %d, %s, %s", obj->id.getNum(), obj->typeName, obj->subTypeName); | ||||
| 			obj->initObj(getRandomGenerator()); | ||||
| 		} | ||||
| 	} | ||||
| 	logGlobal->debug("\tObject initialization done"); | ||||
| 	for(CGObjectInstance *obj : map->objects) | ||||
| 	{ | ||||
| 		if(!obj) | ||||
|   | ||||
| @@ -117,7 +117,7 @@ std::set<int3> CGObjectInstance::getBlockedPos() const | ||||
| 	return ret; | ||||
| } | ||||
|  | ||||
| std::set<int3> CGObjectInstance::getBlockedOffsets() const | ||||
| const std::set<int3> & CGObjectInstance::getBlockedOffsets() const | ||||
| { | ||||
| 	return appearance->getBlockedOffsets(); | ||||
| } | ||||
|   | ||||
| @@ -77,7 +77,7 @@ public: | ||||
| 	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> 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 | ||||
| 	bool isVisitable() const; | ||||
|   | ||||
| @@ -80,7 +80,7 @@ public: | ||||
| 	bool isVisibleAt(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; | ||||
| 	}; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user