void SceneManager::LoadLevel(Ogre::String levelfile, bool load_dynamic)
	{
		Msg msg;
		msg.typeID = GlobalMessageIDs::LOADLEVEL_BEGIN;
		MessageSystem::Instance().MulticastMessage(msg, true);

		ClearGameObjects();

		LoadSave::LoadSystem *ls = LoadSave::LoadSave::Instance().LoadFile(levelfile);

		std::shared_ptr<DataMap> levelparams = ls->LoadTypedObject<DataMap>();
		SetParameters(levelparams.get());

		std::vector<GameObjectPtr> objects;
		ls->LoadAtom("vector<GameObjectPtr>", &objects);	//objects call RegisterObject

		ls->CloseFile();
		delete ls;

		CreateNavigationMesh();

		msg.typeID = GlobalMessageIDs::LOADLEVEL_END;
		MessageSystem::Instance().MulticastMessage(msg, true);
	}
	void SceneManager::Reset()
	{
		AIManager::Instance().GetNavigationMesh()->Reset();
		ClearGameObjects();
		SetToOutdoor();
	}
Ejemplo n.º 3
0
Vehicle::Vehicle(uint64 guid) : Creature(guid)
{
	sLog.outDebug("Vehicle Constructed");
	ClearGameObjects();
	ClearPassengers();
}