Beispiel #1
0
def loadMapFile(path, engine, callback=None):
	""" load map file and get (an optional) callback if major stuff is done:
	- map creation
	- parsed imports
	- parsed layers 
	- parsed cameras
	the callback will send both a string and a float (which shows
	the overall process), callback(string, float)
		
	@return	map	: map object
	"""
	map_loader = XMLMapLoader(engine, callback)
	map = map_loader.loadResource(fife.ResourceLocation(path))
	logger.log(fife.LogManager.LEVEL_LOG, "--- Loading map took: " + str(map_loader.time_to_load) + " seconds.")
	return map
Beispiel #2
0
def loadImportFile(path, engine):
	object_loader = XMLObjectLoader(engine.getImagePool(), engine.getAnimationPool(), engine.getModel(), engine.getVFS())
	res = None
	try:
		res = object_loader.loadResource(fife.ResourceLocation(path))
		logger.log(fife.LogManager.LEVEL_LOG, 'imported object file ' + path)
	except WrongFileType:
		logger.log(fife.LogManager.LEVEL_LOG, 'ignored non-object file ' + path)
	except NameClash:
		logger.log(fife.LogManager.LEVEL_LOG, 'ignored already loaded file ' + path)
	
	return res