Mercurial > fife-parpg
comparison engine/extensions/savers.py @ 106:1fa74d3229d5
Omission of a camera viewport in xml map files now indicates that the camera should use the full window.
author | jwt@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 25 Jul 2008 00:59:08 +0000 |
parents | 4a0efb7baf70 |
children | 9a1529f9625e |
comparison
equal
deleted
inserted
replaced
105:2241b0d5379e | 106:1fa74d3229d5 |
---|---|
207 (None, 'tilt'): 'tile', | 207 (None, 'tilt'): 'tile', |
208 (None, 'rotation'): 'rotation', | 208 (None, 'rotation'): 'rotation', |
209 (None, 'ref_layer_id'): 'ref_layer_id', | 209 (None, 'ref_layer_id'): 'ref_layer_id', |
210 (None, 'ref_cell_width'): 'ref_cell_width', | 210 (None, 'ref_cell_width'): 'ref_cell_width', |
211 (None, 'ref_cell_height'): 'ref_cell_height', | 211 (None, 'ref_cell_height'): 'ref_cell_height', |
212 (None, 'viewport'): 'viewport', | |
213 } | 212 } |
214 | 213 |
215 attr_vals = { | 214 attr_vals = { |
216 (None, 'id'): cam.getId(), | 215 (None, 'id'): cam.getId(), |
217 (None, 'zoom'): str( cam.getZoom()), | 216 (None, 'zoom'): str( cam.getZoom()), |
218 (None, 'tilt'): str( cam.getTilt()), | 217 (None, 'tilt'): str( cam.getTilt()), |
219 (None, 'rotation'): str( cam.getRotation()), | 218 (None, 'rotation'): str( cam.getRotation()), |
220 (None, 'ref_layer_id'): cam.getLocation().getLayer().getId(), | 219 (None, 'ref_layer_id'): cam.getLocation().getLayer().getId(), |
221 (None, 'ref_cell_width'): str( celldimensions.x ), | 220 (None, 'ref_cell_width'): str( celldimensions.x ), |
222 (None, 'ref_cell_height'): str( celldimensions.y ), | 221 (None, 'ref_cell_height'): str( celldimensions.y ), |
223 (None, 'viewport'): '%d,%d,%d,%d' % (viewport.x, viewport.y, viewport.w, viewport.h), | |
224 } | 222 } |
223 | |
224 # add a viewport entry if the cam isn't full sized | |
225 if not (viewport == self.engine.getRenderBackend().getArea()): | |
226 attr_names[(None,'viewport')] = 'viewport' | |
227 attr_vals[(None,'viewport')] = '%d,%d,%d,%d' % (viewport.x, viewport.y, viewport.w, viewport.h) | |
225 | 228 |
226 attrs = AttributesNSImpl( attr_vals, attr_names ) | 229 attrs = AttributesNSImpl( attr_vals, attr_names ) |
227 self.startElement( 'camera', attrs ); | 230 self.startElement( 'camera', attrs ); |
228 self.endElement( 'camera' ); | 231 self.endElement( 'camera' ); |
229 | 232 |