Mercurial > fife-parpg
comparison engine/extensions/loaders.py @ 145:e7a431577c95
Cleaned the basic model up. Code is cleaner now and a bit faster.
Some code path were never tested in depth :-(
Added a 'time_to_load' attribute to XMLMapLoader, which records the seconds it took to load a map.
Down from 6s to 5.6s for reio de hola. Yay!
author | phoku@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 09 Oct 2008 08:23:13 +0000 |
parents | 5e85737281bc |
children | 54b3984e1afc |
comparison
equal
deleted
inserted
replaced
144:d2f1e81fbe2c | 145:e7a431577c95 |
---|---|
20 the overall process), callback(string, float) | 20 the overall process), callback(string, float) |
21 | 21 |
22 @return map : map object | 22 @return map : map object |
23 """ | 23 """ |
24 map_loader = XMLMapLoader(engine, callback) | 24 map_loader = XMLMapLoader(engine, callback) |
25 return map_loader.loadResource(fife.ResourceLocation(path)) | 25 map = map_loader.loadResource(fife.ResourceLocation(path)) |
26 #print "--- Loading map took: ", map_loader.time_to_load, " seconds." | |
27 return map | |
28 | |
26 | 29 |
27 def loadImportFile(path, engine): | 30 def loadImportFile(path, engine): |
28 object_loader = XMLObjectLoader(engine.getImagePool(), engine.getAnimationPool(), engine.getModel(), engine.getVFS()) | 31 object_loader = XMLObjectLoader(engine.getImagePool(), engine.getAnimationPool(), engine.getModel(), engine.getVFS()) |
29 res = None | 32 res = None |
30 try: | 33 try: |