X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/blobdiff_plain/40af98705c25adcf25ff58b08dc495f0f4322f88..dcb9290b9379098e8946d3ef98e4d7998c434105:/src/minwii/start.py?ds=sidebyside diff --git a/src/minwii/start.py b/src/minwii/start.py index 849338f..74ab5bf 100755 --- 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) : - import pygame - from app import MinWii +def main(wiimoteSupport, fullscreen, audioDriver) : pygame.init() - minwii = MinWii(wiimoteSupport=wiimoteSupport) + 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() + pygame.quit() if __name__ == "__main__" : - from os.path import realpath, sep - import sys - from optparse import OptionParser - usage = "%prog [options]" op = OptionParser(usage) @@ -31,11 +29,16 @@ if __name__ == "__main__" : , help = u"désactivation du support des wiimotes" u" [%default]") + op.add_option("--fullscreen", dest="fullscreen" + , action="store_true" + , 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() - wiimoteSupport = options.wiimoteSupport - minwiipath = realpath(__file__).split(sep) - minwiipath = minwiipath[:-2] - minwiipath = sep.join(minwiipath) - sys.path.insert(1, minwiipath) - main(wiimoteSupport) \ No newline at end of file + main(options.wiimoteSupport, options.fullscreen, options.audio_driver)