Mercurial > fife-parpg
diff demos/rio_de_hola/scripts/world.py @ 422:9d94f4676d17
Moved the management of cameras into the Map class. The View class no longer exists since it now serves no purpose. The engine class itself holds the renderers and these get passed to each map that is loaded and then passed to each camera on each map. This change makes it possible for multiple maps to be loaded at the same time with the same camera id without a name clash. fixes[t:342]
author | vtchill@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 12 Feb 2010 06:34:50 +0000 |
parents | 70697641fca3 |
children | 4f2752d45458 |
line wrap: on
line diff
--- a/demos/rio_de_hola/scripts/world.py Thu Feb 11 04:18:42 2010 +0000 +++ b/demos/rio_de_hola/scripts/world.py Fri Feb 12 06:34:50 2010 +0000 @@ -75,7 +75,6 @@ self.engine = engine self.eventmanager = engine.getEventManager() self.model = engine.getModel() - self.view = self.engine.getView() self.filename = '' self.pump_ctr = 0 # for testing purposis self.ctrldown = False @@ -199,13 +198,13 @@ camera_prefix = camera_prefix.rpartition('/')[2] # Remove path camera_prefix += '_' - for cam in self.view.getCameras(): + for cam in self.map.getCameras(): camera_id = cam.getId().replace(camera_prefix, '') self.cameras[camera_id] = cam + cam.resetRenderers() self.cameras['main'].attach(self.hero.agent) - self.view.resetRenderers() # Floating text renderers currntly only support one font. # ... so we set that up. # You'll se that for our demo we use a image font, so we have to specify the font glyphs @@ -274,7 +273,6 @@ c.setEnabled(not c.isEnabled()) elif keystr == 'r': self.model.deleteMaps() - self.view.clearCameras() self.load(self.filename) elif keystr == 'o': self.target_rotation = (self.target_rotation + 90) % 360