~ubuntu-branches/ubuntu/vivid/magicor/vivid

« back to all changes in this revision

Viewing changes to Magicor.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2010-01-02 13:18:28 UTC
  • mfrom: (2.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100102131828-o4p3gthk8m1dopv5
Tags: 1.1-1ubuntu1
* Merge with Debian testing. Remaining changes: 
  + debian/control: As Ubuntu's cdbs symlinks identical files, magicor needs
    a strict versioned Depends on magicor-data for the symlinked files to be
    in the same version.
* debian/magicor.install: Update to also work for Python 2.6. 
* debian/magicor.dirs: Unneeded as Makefile.debian creates them too.
* debian/Makefile.debian: Use /usr/share/python/python.mk to determine the
  correct Python library directory.
* debian/control: Update python dependency to >= 2.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from optparse import OptionParser
18
18
sys.path.append(".")
19
 
from magicor import GameEngine, getConfig
 
19
from magicor import GameEngine, getConfig, parse_printkeys
20
20
from magicor.states.intro import CopyrightNoticeState
21
21
 
22
22
parser = OptionParser(usage="%prog [options]")
33
33
    baseConf="~/.magicor/magicor.conf"
34
34
 
35
35
parser.add_option("-j", "--joystick",
36
 
                  action="store", type="int", dest="joystick", default=None,
 
36
                  action="store", type="int", dest="joystick",
 
37
                  default=None,
37
38
                  help="enable/disable joystick")
38
39
parser.add_option("-m", "--music",
39
 
                  action="store", type="int", dest="music", default=None,
 
40
                  action="store", type="int", dest="music",
 
41
                  default=None,
40
42
                  help="enable/disable music")
41
43
parser.add_option("-s", "--sound",
42
 
                  action="store", type="int",  dest="sound", default=None,
 
44
                  action="store", type="int",  dest="sound",
 
45
                  default=None,
43
46
                  help="enable/disable sound")
44
47
parser.add_option("-f", "--fullscreen",
45
 
                  action="store", type="int",  dest="fullscreen", default=None,
 
48
                  action="store", type="int",  dest="fullscreen",
 
49
                  default=None,
46
50
                  help="enable/disable fullscreen")
 
51
parser.add_option("-d","--dev", type="int", dest= "devmode",
 
52
                  default=None, help="enable dev keys")
 
53
parser.add_option("-k","--keysprintdbg",type="string", dest="printkeys",default="",help="keys to enable selective printing of debug info. Separator is ':'")
47
54
(options, args) = parser.parse_args()
48
55
 
49
56
paths = [ options.configPath, baseConf ]
54
61
    conf["data_path"]='data'
55
62
 
56
63
if options.joystick != None:
57
 
    conf["joystick"] = options.joystick
 
64
    conf["joystick"] = bool(options.joystick)
58
65
if options.music != None:
59
66
    conf["music"] = options.music
60
67
if options.sound != None:
61
68
    conf["sound"] = options.sound
62
69
if options.fullscreen != None:
63
 
    conf["fullscreen"] = options.fullscreen
 
70
    conf["fullscreen"] = bool(options.fullscreen)
 
71
if options.devmode != None:
 
72
    conf["devmode"] = bool(options.devmode)
 
73
parse_printkeys(options.printkeys)
64
74
gameEngine = GameEngine(conf)
65
75
gameEngine.start(CopyrightNoticeState(conf, None, gameEngine.screen))