comparison engine/extensions/serializers/xmlobject.py @ 156:376b8afc9a18

Fixed a horrendous misconeception in the pool. The map was sorted by pointer comparison. Needs a bit cleanup, though.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Sun, 12 Oct 2008 20:30:09 +0000
parents 679ed3e15513
children 17edb4b98e3e
comparison
equal deleted inserted replaced
155:29309cd5e240 156:376b8afc9a18
97 # paths are relative to this resource's path 97 # paths are relative to this resource's path
98 path = self.filename.split('/') 98 path = self.filename.split('/')
99 path.pop() 99 path.pop()
100 path.append(str(source)) 100 path.append(str(source))
101 101
102 id = self.image_pool.addResourceFromFile('/'.join(path)) 102 image_location = fife.ImageLocation('/'.join(path))
103 image_location .setXShift(int( image.get('x_offset', 0) ))
104 image_location .setYShift(int( image.get('y_offset', 0) ))
105 id = self.image_pool.addResourceFromLocation(image_location)
103 object.get2dGfxVisual().addStaticImage(int( image.get('direction', 0) ), id) 106 object.get2dGfxVisual().addStaticImage(int( image.get('direction', 0) ), id)
104 img = self.image_pool.getImage(id) 107 #img = self.image_pool.getImage(id)
105 img.setXShift(int( image.get('x_offset', 0) ))
106 img.setYShift(int( image.get('y_offset', 0) ))
107 108
108 def parse_actions(self, objelt, object): 109 def parse_actions(self, objelt, object):
109 for action in objelt.findall('action'): 110 for action in objelt.findall('action'):
110 id = action.get('id') 111 id = action.get('id')
111 if not id: 112 if not id: