comparison src/parpg/application.py @ 182:59c9ce2b8351

PARPG now works with, and needs Fife 0.3.3.
author KarstenBock@gmx.net
date Tue, 11 Oct 2011 14:47:37 +0200
parents 0443ab9533ce
children 9d9c4ccc081e
comparison
equal deleted inserted replaced
181:54c4277ed905 182:59c9ce2b8351
16 import os 16 import os
17 import sys 17 import sys
18 18
19 from fife import fife 19 from fife import fife
20 from fife.extensions import pychan 20 from fife.extensions import pychan
21 from fife.extensions.serializers.xmlanimation import XMLAnimationLoader
22 from fife.extensions.basicapplication import ApplicationBase 21 from fife.extensions.basicapplication import ApplicationBase
23 22
24 from parpg import console, vfs 23 from parpg import console, vfs
25 from parpg.font import PARPGFont 24 from parpg.font import PARPGFont
26 from parpg.gamemodel import GameModel 25 from parpg.gamemodel import GameModel
119 self.loadSettings() 118 self.loadSettings()
120 self.engine.init() 119 self.engine.init()
121 # KLUDGE M. George Hansen 2011-06-04: See parpg/vfs.py. 120 # KLUDGE M. George Hansen 2011-06-04: See parpg/vfs.py.
122 vfs.VFS = self.engine.getVFS() 121 vfs.VFS = self.engine.getVFS()
123 vfs.VFS.addNewSource(setting.parpg.DataPath) 122 vfs.VFS.addNewSource(setting.parpg.DataPath)
124 self._animationloader = XMLAnimationLoader(self.engine.getImagePool(),
125 self.engine.getVFS())
126 self.engine.getAnimationPool().addResourceLoader(self._animationloader)
127 123
128 pychan.init(self.engine, debug = True) 124 pychan.init(self.engine, debug = True)
129 pychan.setupModalExecution(self.mainLoop,self.breakFromMainLoop) 125 pychan.setupModalExecution(self.mainLoop,self.breakFromMainLoop)
130 126
131 self.quitRequested = False 127 self.quitRequested = False
178 self._setting.fife.Font) 174 self._setting.fife.Font)
179 ) 175 )
180 engineSetting.setDefaultFontSize(self._setting.fife.DefaultFontSize) 176 engineSetting.setDefaultFontSize(self._setting.fife.DefaultFontSize)
181 engineSetting.setBitsPerPixel(self._setting.fife.BitsPerPixel) 177 engineSetting.setBitsPerPixel(self._setting.fife.BitsPerPixel)
182 engineSetting.setInitialVolume(self._setting.fife.InitialVolume) 178 engineSetting.setInitialVolume(self._setting.fife.InitialVolume)
183 engineSetting.setSDLRemoveFakeAlpha(self._setting.fife.SDLRemoveFakeAlpha) 179 engineSetting.setSDLRemoveFakeAlpha(
180 self._setting.fife.SDLRemoveFakeAlpha
181 )
184 engineSetting.setScreenWidth(self._setting.fife.ScreenWidth) 182 engineSetting.setScreenWidth(self._setting.fife.ScreenWidth)
185 engineSetting.setScreenHeight(self._setting.fife.ScreenHeight) 183 engineSetting.setScreenHeight(self._setting.fife.ScreenHeight)
186 engineSetting.setRenderBackend(self._setting.fife.RenderBackend) 184 engineSetting.setRenderBackend(self._setting.fife.RenderBackend)
187 engineSetting.setFullScreen(self._setting.fife.FullScreen) 185 engineSetting.setFullScreen(self._setting.fife.FullScreen)
188 engineSetting.setVideoDriver(self._setting.fife.VideoDriver) 186 engineSetting.setVideoDriver(self._setting.fife.VideoDriver)
205 """ 203 """
206 pass 204 pass
207 205
208 def _pump(self): 206 def _pump(self):
209 """Main game loop. 207 """Main game loop.
210 There are in fact 2 main loops, this one and the one in GameSceneView. 208 There are 2 main loops, this one and the one in GameSceneView.
211 @return: None""" 209 @return: None"""
212 if self.listener.quit: 210 if self.listener.quit:
213 self.breakRequested = True #pylint: disable-msg=C0103 211 self.breakRequested = True #pylint: disable-msg=C0103
214 else: 212 else:
215 self.manager._pump() 213 self.manager._pump()