projects
/
minwii.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Gestion explicite de KeyboardInterrupt pour être sûr de quitter le jeu sur un ^C.
[minwii.git]
/
src
/
minwii
/
start.py
diff --git
a/src/minwii/start.py
b/src/minwii/start.py
index
a9d9582
..
74ab5bf
100755
(executable)
--- a/
src/minwii/start.py
+++ b/
src/minwii/start.py
@@
-8,20
+8,18
@@
$URL$
"""
"""
+from optparse import OptionParser
+import pygame
+from app import MinWii
-def main(wiimoteSupport, fullscreen) :
- import pygame
- from app import MinWii
+def main(wiimoteSupport, fullscreen, audioDriver) :
pygame.init()
pygame.init()
- minwii = MinWii(wiimoteSupport=wiimoteSupport, fullscreen=fullscreen)
+ audioDriver = None if not audioDriver else audioDriver # cast de '' en None. fluidsynth le teste spécifiquement…
+ minwii = MinWii(wiimoteSupport=wiimoteSupport, fullscreen=fullscreen, audioDriver=audioDriver)
minwii.run()
pygame.quit()
if __name__ == "__main__" :
minwii.run()
pygame.quit()
if __name__ == "__main__" :
- from os.path import realpath, sep
- import sys
- from optparse import OptionParser
-
usage = "%prog [options]"
op = OptionParser(usage)
usage = "%prog [options]"
op = OptionParser(usage)
@@
-36,10
+34,11
@@
if __name__ == "__main__" :
, default=False
, help = u"activation du mode plein écran"
u" [%default]")
, default=False
, help = u"activation du mode plein écran"
u" [%default]")
+ op.add_option("--audio-driver", dest="audio_driver"
+ , action="store"
+ , default="coreaudio"
+ , help=u"driver audio pour le synthétiseur (fluidsynth) [%default]"
+ )
options, args = op.parse_args()
options, args = op.parse_args()
- minwiipath = realpath(__file__).split(sep)
- minwiipath = minwiipath[:-2]
- minwiipath = sep.join(minwiipath)
- sys.path.insert(1, minwiipath)
- main(options.wiimoteSupport, options.fullscreen)
+ main(options.wiimoteSupport, options.fullscreen, options.audio_driver)