diff engine/extensions/serializers/xmlobject.py @ 140:3fddb45c0304

edited the loaders, images are now loaded only once into memory
author thebastion@33b003aa-7bff-0310-803a-e67f0ece8222
date Sun, 28 Sep 2008 11:12:36 +0000
parents 9a1529f9625e
children 679ed3e15513
line wrap: on
line diff
--- a/engine/extensions/serializers/xmlobject.py	Sat Sep 27 23:33:17 2008 +0000
+++ b/engine/extensions/serializers/xmlobject.py	Sun Sep 28 11:12:36 2008 +0000
@@ -99,7 +99,7 @@
 			path.pop()
 			path.append(str(source))
 
-			id = self.image_pool.addResourceFromFile('/'.join(path))
+			id = self.image_pool.getIndex('/'.join(path))
 			object.get2dGfxVisual().addStaticImage(int( image.get('direction', 0) ), id)
 			img = self.image_pool.getImage(id)
 			img.setXShift(int( image.get('x_offset', 0) ))
@@ -126,7 +126,7 @@
 			path.pop()
 			path.append(str(source))
 
-			anim_id = self.anim_pool.addResourceFromFile('/'.join(path))
+			anim_id = self.anim_pool.getIndex('/'.join(path))
 			animation = self.anim_pool.getAnimation(anim_id)
 			action.get2dGfxVisual().addAnimation(int( anim.get('direction', 0) ), anim_id)
 			action.setDuration(animation.getDuration())