Example #1
0
 def log_conf(self):
     self.log('version: ' + eng.logic.version)
     self.log('operative system: ' + system() + ' ' + release() + ' ' +
              version())
     self.log('architecture: ' + str(architecture()))
     self.log('machine: ' + machine())
     self.log('platform: ' + platform())
     self.log('processor: ' + processor())
     try:
         self.log('cores: ' + str(cpu_count()))
     except NotImplementedError:  # on Windows
         self.log('cores: not implemented')
     self.log('panda version: ' + PandaSystem.get_version_string() + ' ' +
              PandaSystem.get_git_commit())
     self.log('bullet version: ' + str(get_bullet_version()))
     self.log('appdata: ' + str(Filename.get_user_appdata_directory()))
Example #2
0
 def __init__(self):
     default_opt = {
         'settings': {
             'lang': 'en',
             'volume': 1,
             'fullscreen': 0,
             'resolution': '1280 720',
             'antialiasing': 0,
             'cars_number': 7,
             'keys': {
                 'forward': 'arrow_up',
                 'rear': 'arrow_down',
                 'left': 'arrow_left',
                 'right': 'arrow_right',
                 'fire': 'space',
                 'respawn': 'r',
                 'pause': 'p'},
             'joystick': 0,
             'last_version': '0.7.0-x',
             'player_name': '',
             'shaders': 1,
             'xmpp':
                 {'usr': '', 'pwd': ''}},
         'development': {
             'multithreaded_render': 0,
             'ai': 0,
             'fps': 0,
             'car': '',
             'track': '',
             'shaders_dev': 0,
             'gamma': 2.2,
             'show_waypoints': 0,
             'show_exit': 1,
             'menu_joypad': 1,
             'win_orig': '',
             'profiling': 0,
             'pyprof_percall': 0,
             'verbose': '',
             'verbose_log': 0,
             'race_start_time': 3.5,
             'countdown_seconds': 3,
             'xmpp_debug': 0,
             'xmpp_server': '*****@*****.**',
             'server': ''}}
     opt_path = ''
     if platform == 'win32' and not exists('main.py'):
         # it is the deployed version for windows
         opt_path = join(str(Filename.get_user_appdata_directory()), 'Yorg')
     self.options = DctFile(
         join(opt_path, 'options.yml') if opt_path else 'options.yml',
         default_opt)
     opt_dev = self.options['development']
     win_orig = opt_dev['win_orig']
     parser = argparse.ArgumentParser()
     parser.add_argument('--win_orig')
     parser.add_argument('--user')
     parser.add_argument('--pwd')
     parser.add_argument('--car')
     parser.add_argument('--server')
     args = parser.parse_args()
     if args.win_orig: win_orig = args.win_orig
     if args.car: opt_dev['car'] = args.car
     if args.server: opt_dev['server'] = args.server
     gui_cfg = GuiCfg(
         win_title='Yorg', win_orig=win_orig,
         win_size=self.options['settings']['resolution'],
         fullscreen=self.options['settings']['fullscreen'],
         antialiasing=self.options['settings']['antialiasing'],
         fps=opt_dev['fps'], shaders=self.options['settings']['shaders'],
         volume=self.options['settings']['volume'])
     profiling_cfg = ProfilingCfg(
         profiling=opt_dev['profiling'],
         pyprof_percall=opt_dev['pyprof_percall'])
     lang_cfg = LangCfg(lang=self.options['settings']['lang'],
                        lang_domain='yorg',
                        languages=['English', 'Italiano', 'Deutsch',
                                   u'G\u00E0idhlig', 'Spanish', 'Galician'])
     cursor_cfg = CursorCfg(
         cursor_path='assets/images/gui/cursor.txo',
         cursor_scale=((256/352.0) * .08, 1, .08),
         cursor_hotspot=(.1, .06))
     dev_cfg = DevCfg(
         mt_render=opt_dev['multithreaded_render'],
         shaders_dev=opt_dev['shaders_dev'], gamma=opt_dev['gamma'],
         menu_joypad=opt_dev['menu_joypad'], verbose=opt_dev['verbose'],
         verbose_log=opt_dev['verbose_log'],
         xmpp_server=opt_dev['xmpp_server'])
     conf = Cfg(gui_cfg, profiling_cfg, lang_cfg, cursor_cfg, dev_cfg)
     init_lst = [
         [('fsm', YorgFsm, [self])],
         [('logic', YorgLogic, [self])],
         [('audio', YorgAudio, [self])],
         [('event', YorgEvent, [self])]]
     menu_args = MenuArgs(
         'assets/fonts/Hanken-Book.ttf', (.75, .75, .25, 1),
         (.75, .75, .75, 1), (.75, .25, .25, 1), .1, (-4.6, 4.6, -.32, .88),
         (0, 0, 0, .2), 'assets/images/gui/menu_background.txo',
         'assets/sfx/menu_over.wav', 'assets/sfx/menu_clicked.ogg',
         'assets/images/icons/%s.txo')
     cars_names = ['themis', 'kronos', 'diones', 'iapeto', 'phoibe', 'rea',
                   'iperion', 'teia']
     damage_info = DamageInfo('assets/models/cars/%s/cardamage1',
                              'assets/models/cars/%s/cardamage2')
     Game.__init__(self, init_lst, conf)
     wheel_gfx_names = ['wheelfront', 'wheelrear', 'wheel']
     wheel_gfx_names = [
         self.eng.curr_path + 'assets/models/cars/%s/' + wname
         for wname in wheel_gfx_names]
     wheel_gfx_names = WheelGfxNames(*wheel_gfx_names)
     social_sites = [
         ('facebook', 'http://www.facebook.com/Ya2Tech'),
         ('twitter', 'http://twitter.com/ya2tech'),
         ('google_plus', 'https://plus.google.com/118211180567488443153'),
         ('youtube',
          'http://www.youtube.com/user/ya2games?sub_confirmation=1'),
         ('pinterest', 'http://www.pinterest.com/ya2tech'),
         ('tumblr', 'http://ya2tech.tumblr.com'),
         ('feed', 'http://www.ya2.it/pages/feed-following.html')]
     self.gameprops = GameProps(
         menu_args, cars_names, self.drivers(),
         ['toronto', 'rome', 'sheffield', 'orlando', 'nagano', 'dubai'],
         lambda: [_('Toronto'), _('Rome'), _('Sheffield'), _('Orlando'),
                  _('Nagano'), _('Dubai')],
         'assets/images/tracks/%s.txo',
         self.options['settings']['player_name'],
         DriverPaths('assets/images/drivers/driver%s.txo',
                     'assets/images/drivers/driver%s_sel.txo'),
         'assets/images/cars/%s_sel.txo',
         'assets/images/cars/%s.txo',
         self.eng.curr_path + 'assets/models/cars/%s/phys.yml',
         'assets/models/cars/%s/car',
         damage_info, wheel_gfx_names, opt_dev['xmpp_debug'],
         social_sites)
Example #3
0
 def __init__(self):
     default_opt = {
         'settings': {
             'lang': 'en',
             'volume': 1,
             'fullscreen': 0,
             'resolution': '1280 720',
             'antialiasing': 0,
             'cars_number': 8,
             'keys': {
                 'forward1': 'raw-arrow_up',
                 'rear1': 'raw-arrow_down',
                 'left1': 'raw-arrow_left',
                 'right1': 'raw-arrow_right',
                 'fire1': 'raw-rcontrol',
                 'respawn1': 'raw-rshift',
                 'forward2': 'raw-w',
                 'rear2': 'raw-s',
                 'left2': 'raw-a',
                 'right2': 'raw-d',
                 'fire2': 'raw-x',
                 'respawn2': 'raw-c',
                 'forward3': 'raw-i',
                 'rear3': 'raw-k',
                 'left3': 'raw-j',
                 'right3': 'raw-l',
                 'fire3': 'raw-n',
                 'respawn3': 'raw-m',
                 'forward4': 'raw-t',
                 'rear4': 'raw-g',
                 'left4': 'raw-f',
                 'right4': 'raw-h',
                 'fire4': 'raw-v',
                 'respawn4': 'raw-b',
                 'pause': 'raw-p'
             },
             'joystick': {
                 'forward1': 'btn_a',
                 'rear1': 'btn_b',
                 'fire1': 'btn_c',
                 'respawn1': 'btn_d',
                 'forward2': 'btn_a',
                 'rear2': 'btn_b',
                 'fire2': 'btn_c',
                 'respawn2': 'btn_d',
                 'forward3': 'btn_a',
                 'rear3': 'btn_b',
                 'fire3': 'btn_c',
                 'respawn3': 'btn_d',
                 'forward4': 'btn_a',
                 'rear4': 'btn_b',
                 'fire4': 'btn_c',
                 'respawn4': 'btn_d'
             },
             'last_version': '0.7.0-x',
             'player_names': [],
             'stored_player_names': [],
             'shaders': 1,
             'camera': 'top',
             'login': {
                 'usr': '',
                 'pwd': ''
             }
         },
         'development': {
             'multithreaded_render': 1,
             'ai': 0,
             'ai_debug': 0,
             'fps': 0,
             'cars': '',
             'track': '',
             'start_wp': '',
             'shaders_dev': 0,
             'gamma': 2.2,
             'show_waypoints': 0,
             'show_exit': 1,
             'menu_joypad': 1,
             'win_orig': '',
             'port': 9099,
             'profiling': 0,
             'pyprof_percall': 0,
             'verbose': '',
             'verbose_log': 0,
             'race_start_time': 3.5,
             'countdown_seconds': 3,
             'xmpp_debug': 0,
             'xmpp_server': '*****@*****.**',
             'server': 'ya2tech.it:9099',
             'mp_srv_usr': '',
             'fixed_fps': 0,
             'srgb': 0,
             'opengl_3_2': 0
         }
     }
     opt_path = ''
     if platform in ['win32', 'linux'] and not exists('main.py'):
         # it is the deployed version for windows
         opt_path = str(Filename.get_user_appdata_directory()) + '/Yorg'
     parser = argparse.ArgumentParser()
     parser.add_argument('--win_orig')
     parser.add_argument('--user')
     parser.add_argument('--pwd')
     parser.add_argument('--cars')
     parser.add_argument('--server')
     parser.add_argument('--optfile')
     args = parser.parse_args(EngineLogic.cmd_line())
     optfile = args.optfile if args.optfile else 'options.yml'
     old_def = deepcopy(default_opt)
     self.options = DctFile(
         LibP3d.fixpath(opt_path + '/' + optfile) if opt_path else optfile,
         default_opt)
     if self.options['development']['server'] == '':
         self.options['development']['server'] = old_def['development'][
             'server']
     opt_dev = self.options['development']
     win_orig = opt_dev['win_orig']
     if args.win_orig: win_orig = args.win_orig
     if args.cars: opt_dev['cars'] = args.cars
     if args.server: opt_dev['server'] = args.server
     gui_cfg = GuiCfg(win_title='Yorg',
                      win_orig=win_orig,
                      win_size=self.options['settings']['resolution'],
                      fullscreen=self.options['settings']['fullscreen'],
                      antialiasing=self.options['settings']['antialiasing'],
                      fps=opt_dev['fps'],
                      shaders=self.options['settings']['shaders'],
                      volume=self.options['settings']['volume'],
                      fixed_fps=self.options['development']['fixed_fps'])
     profiling_cfg = ProfilingCfg(profiling=opt_dev['profiling'],
                                  pyprof_percall=opt_dev['pyprof_percall'])
     lang_cfg = LangCfg(lang=self.options['settings']['lang'],
                        lang_domain='yorg',
                        languages=[('English', 'en'), ('Deutsch', 'de'),
                                   (u'Espa\u00F1ol', 'es'),
                                   (u'Fran\u00E7ais', 'fr'),
                                   (u'G\u00E0idhlig', 'gd'),
                                   ('Galego', 'gl'), ('Italiano', 'it')])
     cursor_cfg = CursorCfg(cursor_path='assets/images/gui/cursor.txo',
                            cursor_scale=((256 / 352.0) * .08, 1, .08),
                            cursor_hotspot=(.1, .06))
     dev_cfg = DevCfg(mt_render=opt_dev['multithreaded_render'],
                      shaders_dev=opt_dev['shaders_dev'],
                      gamma=opt_dev['gamma'],
                      menu_joypad=opt_dev['menu_joypad'],
                      verbose=opt_dev['verbose'],
                      verbose_log=opt_dev['verbose_log'],
                      xmpp_server=opt_dev['xmpp_server'],
                      start_wp=opt_dev['start_wp'],
                      port=opt_dev['port'],
                      server=opt_dev['server'],
                      srgb=opt_dev['srgb'],
                      opengl_3_2=opt_dev['opengl_3_2'])
     conf = Cfg(gui_cfg, profiling_cfg, lang_cfg, cursor_cfg, dev_cfg)
     init_lst = [[('fsm', YorgFsm, [self])], [('logic', YorgLogic, [self])],
                 [('audio', YorgAudio, [self])],
                 [('event', YorgEvent, [self])]]
     keys = self.options['settings']['keys']
     nav1 = NavInfoPerPlayer(keys['left1'], keys['right1'],
                             keys['forward1'], keys['rear1'], keys['fire1'])
     nav2 = NavInfoPerPlayer(keys['left2'], keys['right2'],
                             keys['forward2'], keys['rear2'], keys['fire2'])
     nav3 = NavInfoPerPlayer(keys['left3'], keys['right3'],
                             keys['forward3'], keys['rear3'], keys['fire3'])
     nav4 = NavInfoPerPlayer(keys['left4'], keys['right4'],
                             keys['forward4'], keys['rear4'], keys['fire4'])
     nav = NavInfo([nav1, nav2, nav3, nav4])
     menu_props = MenuProps(
         'assets/fonts/Hanken-Book.ttf', (.75, .75, .25, 1),
         (.75, .75, .75, 1), (.75, .25, .25, 1), .1, (-4.6, 4.6, -.32, .88),
         (0, 0, 0, .2), 'assets/images/gui/menu_background.txo',
         'assets/sfx/menu_over.wav', 'assets/sfx/menu_clicked.ogg',
         'assets/images/icons/%s.txo', nav)
     damage_info = DamageInfo('assets/cars/%s/models/cardamage1',
                              'assets/cars/%s/models/cardamage2')
     Game.__init__(self, init_lst, conf, YorgClient)
     cars_names = self.__compute_cars()
     wheel_gfx_names = ['wheelfront', 'wheelrear', 'wheel']
     wheel_gfx_names = [
         self.eng.curr_path + 'assets/cars/%s/models/' + wname
         for wname in wheel_gfx_names
     ]
     wheel_gfx_names = WheelGfxNames(*wheel_gfx_names)
     social_sites = [
         ('facebook', 'https://www.facebook.com/Ya2Tech'),
         ('twitter', 'https://twitter.com/ya2tech'),
         ('google_plus', 'https://plus.google.com/118211180567488443153'),
         ('youtube',
          'https://www.youtube.com/user/ya2games?sub_confirmation=1'),
         ('pinterest', 'https://www.pinterest.com/ya2tech'),
         ('tumblr', 'https://ya2tech.tumblr.com'),
         ('feed', 'https://www.ya2.it/pages/feed-following.html')
     ]
     tracks = self.__compute_tracks()
     tracks_tr = self.__compute_tracks_tr()
     self.gameprops = GameProps(
         menu_props, cars_names, self.drivers(), tracks, tracks_tr,
         'assets/tracks/%s/images/menu.txo',
         self.options['settings']['player_names'],
         self.options['settings']['stored_player_names'],
         DriverPaths('assets/images/drivers/driver%s.txo',
                     'assets/images/drivers/driver%s_sel.txo'),
         'assets/cars/%s/images/car_sel.txo',
         'assets/cars/%s/images/car.txo',
         self.eng.curr_path + 'assets/cars/%s/phys.yml',
         'assets/cars/%s/models/car', damage_info, wheel_gfx_names,
         opt_dev['xmpp_debug'], social_sites)
     self.log_conf(self.options.dct)
     self.eng.lib.set_icon('assets/images/icon/yorg.ico')
Example #4
0
# log ########################################################################
from os.path import exists, join
from panda3d.core import MultiplexStream, Notify, Filename
from yorg.yorg import Yorg
import sys
import direct.particles.ParticleManagerGlobal  # for deploy-ng

if sys.platform != 'darwin' and not exists('main.py'):
    # (on osx it shows an error window on exit)
    # is it the deployed version?
    log_path = ''
    if sys.platform == 'win32' and not exists('main.py'):
        log_path = join(str(Filename.get_user_appdata_directory()), 'Yorg')
        if not exists(log_path):
            Filename.mkdir(Filename(log_path))
    sys.stdout = open(
        join(log_path, 'yorg_output.txt') if log_path else 'yorg_output.txt',
        'w')
    sys.stderr = open(
        join(log_path, 'yorg_error.txt') if log_path else 'yorg_error.txt',
        'w')
    nout = MultiplexStream()
    Notify.ptr().setOstreamPtr(nout, 0)
    nout.addFile(
        join(log_path, 'yorg_log.txt') if log_path else 'yorg_log.txt')

# main #######################################################################
if __name__ == '__main__' or exists('main.pyo'):
    Yorg()
Example #5
0
File: yorg.py Project: cflavio/yorg
 def __init__(self):
     default_opt = {
         'settings': {
             'lang': 'en',
             'volume': 1,
             'fullscreen': 0,
             'resolution': '1280 720',
             'antialiasing': 0,
             'cars_number': 8,
             'keys': {
                 'forward1': 'raw-arrow_up',
                 'rear1': 'raw-arrow_down',
                 'left1': 'raw-arrow_left',
                 'right1': 'raw-arrow_right',
                 'fire1': 'raw-rcontrol',
                 'respawn1': 'raw-rshift',
                 'forward2': 'raw-w',
                 'rear2': 'raw-s',
                 'left2': 'raw-a',
                 'right2': 'raw-d',
                 'fire2': 'raw-x',
                 'respawn2': 'raw-c',
                 'forward3': 'raw-i',
                 'rear3': 'raw-k',
                 'left3': 'raw-j',
                 'right3': 'raw-l',
                 'fire3': 'raw-n',
                 'respawn3': 'raw-m',
                 'forward4': 'raw-t',
                 'rear4': 'raw-g',
                 'left4': 'raw-f',
                 'right4': 'raw-h',
                 'fire4': 'raw-v',
                 'respawn4': 'raw-b',
                 'pause': 'raw-p'},
             'joystick1': 0,
             'joystick2': 0,
             'joystick3': 0,
             'joystick4': 0,
             'last_version': '0.7.0-x',
             'player_name': '',
             'shaders': 1,
             'camera': 'top',
             'login':
                 {'usr': '', 'pwd': ''}},
         'development': {
             'multithreaded_render': 1,
             'ai': 0,
             'ai_debug': 0,
             'fps': 0,
             'cars': '',
             'track': '',
             'start_wp': '',
             'shaders_dev': 0,
             'gamma': 2.2,
             'show_waypoints': 0,
             'show_exit': 1,
             'menu_joypad': 1,
             'win_orig': '',
             'port': 9099,
             'profiling': 0,
             'pyprof_percall': 0,
             'verbose': '',
             'verbose_log': 0,
             'race_start_time': 3.5,
             'countdown_seconds': 3,
             'xmpp_debug': 0,
             'xmpp_server': '*****@*****.**',
             'server': 'ya2tech.it:9099',
             'mp_srv_usr': '',
             'fixed_fps': 0}}
     opt_path = ''
     if platform in ['win32', 'linux'] and not exists('main.py'):
         # it is the deployed version for windows
         opt_path = str(Filename.get_user_appdata_directory()) + '/Yorg'
     parser = argparse.ArgumentParser()
     parser.add_argument('--win_orig')
     parser.add_argument('--user')
     parser.add_argument('--pwd')
     parser.add_argument('--cars')
     parser.add_argument('--server')
     parser.add_argument('--optfile')
     args = parser.parse_args(EngineLogic.cmd_line())
     optfile = args.optfile if args.optfile else 'options.yml'
     old_def = deepcopy(default_opt)
     self.options = DctFile(
         LibP3d.fixpath(opt_path + '/' + optfile) if opt_path else optfile,
         default_opt)
     if self.options['development']['server'] == '':
         self.options['development']['server'] = old_def['development']['server']
     opt_dev = self.options['development']
     win_orig = opt_dev['win_orig']
     if args.win_orig: win_orig = args.win_orig
     if args.cars: opt_dev['cars'] = args.cars
     if args.server: opt_dev['server'] = args.server
     gui_cfg = GuiCfg(
         win_title='Yorg', win_orig=win_orig,
         win_size=self.options['settings']['resolution'],
         fullscreen=self.options['settings']['fullscreen'],
         antialiasing=self.options['settings']['antialiasing'],
         fps=opt_dev['fps'], shaders=self.options['settings']['shaders'],
         volume=self.options['settings']['volume'],
         fixed_fps=self.options['development']['fixed_fps'])
     profiling_cfg = ProfilingCfg(
         profiling=opt_dev['profiling'],
         pyprof_percall=opt_dev['pyprof_percall'])
     lang_cfg = LangCfg(lang=self.options['settings']['lang'],
                        lang_domain='yorg',
                        languages=[('English', 'en'), ('Deutsch', 'de'),
                                   (u'Espa\u00F1ol', 'es'),
                                   (u'Fran\u00E7ais', 'fr'),
                                   (u'G\u00E0idhlig', 'gd'),
                                   ('Galego', 'gl'), ('Italiano', 'it')])
     cursor_cfg = CursorCfg(
         cursor_path='assets/images/gui/cursor.txo',
         cursor_scale=((256/352.0) * .08, 1, .08),
         cursor_hotspot=(.1, .06))
     dev_cfg = DevCfg(
         mt_render=opt_dev['multithreaded_render'],
         shaders_dev=opt_dev['shaders_dev'], gamma=opt_dev['gamma'],
         menu_joypad=opt_dev['menu_joypad'], verbose=opt_dev['verbose'],
         verbose_log=opt_dev['verbose_log'],
         xmpp_server=opt_dev['xmpp_server'],
         start_wp=opt_dev['start_wp'], port=opt_dev['port'],
         server=opt_dev['server'])
     conf = Cfg(gui_cfg, profiling_cfg, lang_cfg, cursor_cfg, dev_cfg)
     init_lst = [
         [('fsm', YorgFsm, [self])],
         [('logic', YorgLogic, [self])],
         [('audio', YorgAudio, [self])],
         [('event', YorgEvent, [self])]]
     keys = self.options['settings']['keys']
     nav1 = NavInfoPerPlayer(keys['left1'], keys['right1'], keys['forward1'],
                             keys['rear1'], keys['fire1'])
     nav2 = NavInfoPerPlayer(keys['left2'], keys['right2'], keys['forward2'],
                             keys['rear2'], keys['fire2'])
     nav3 = NavInfoPerPlayer(keys['left3'], keys['right3'], keys['forward3'],
                             keys['rear3'], keys['fire3'])
     nav4 = NavInfoPerPlayer(keys['left4'], keys['right4'], keys['forward4'],
                             keys['rear4'], keys['fire4'])
     nav = NavInfo([nav1, nav2, nav3, nav4])
     menu_props = MenuProps(
         'assets/fonts/Hanken-Book.ttf', (.75, .75, .25, 1),
         (.75, .75, .75, 1), (.75, .25, .25, 1), .1, (-4.6, 4.6, -.32, .88),
         (0, 0, 0, .2), 'assets/images/gui/menu_background.txo',
         'assets/sfx/menu_over.wav', 'assets/sfx/menu_clicked.ogg',
         'assets/images/icons/%s.txo', nav)
     cars_names = ['themis', 'kronos', 'diones', 'iapeto', 'phoibe', 'rea',
                   'iperion', 'teia']
     damage_info = DamageInfo('assets/models/cars/%s/cardamage1',
                              'assets/models/cars/%s/cardamage2')
     Game.__init__(self, init_lst, conf, YorgClient)
     wheel_gfx_names = ['wheelfront', 'wheelrear', 'wheel']
     wheel_gfx_names = [
         self.eng.curr_path + 'assets/models/cars/%s/' + wname
         for wname in wheel_gfx_names]
     wheel_gfx_names = WheelGfxNames(*wheel_gfx_names)
     social_sites = [
         ('facebook', 'https://www.facebook.com/Ya2Tech'),
         ('twitter', 'https://twitter.com/ya2tech'),
         ('google_plus', 'https://plus.google.com/118211180567488443153'),
         ('youtube',
          'https://www.youtube.com/user/ya2games?sub_confirmation=1'),
         ('pinterest', 'https://www.pinterest.com/ya2tech'),
         ('tumblr', 'https://ya2tech.tumblr.com'),
         ('feed', 'https://www.ya2.it/pages/feed-following.html')]
     self.gameprops = GameProps(
         menu_props, cars_names, self.drivers(),
         ['moon', 'toronto', 'rome', 'sheffield', 'orlando', 'nagano',
          'dubai'],
         lambda: [_('Sinus Aestuum'), _('Toronto'), _('Rome'), _('Sheffield'),
                  _('Orlando'), _('Nagano'), _('Dubai')],
         'assets/images/tracks/%s.txo',
         self.options['settings']['player_name'],
         DriverPaths('assets/images/drivers/driver%s.txo',
                     'assets/images/drivers/driver%s_sel.txo'),
         'assets/images/cars/%s_sel.txo',
         'assets/images/cars/%s.txo',
         self.eng.curr_path + 'assets/models/cars/%s/phys.yml',
         'assets/models/cars/%s/car',
         damage_info, wheel_gfx_names, opt_dev['xmpp_debug'],
         social_sites)
     self.log_conf(self.options.dct)
     self.eng.lib.set_icon('assets/images/icon/yorg.ico')
Example #6
0
 def __init__(self):
     default_opt = {
         'settings': {
             'lang': 'en',
             'volume': 1,
             'fullscreen': 0,
             'resolution': '1280 720',
             'aa': 0,
             'keys': {
                 'forward': 'arrow_up',
                 'rear': 'arrow_down',
                 'left': 'arrow_left',
                 'right': 'arrow_right',
                 'button': 'x',
                 'respawn': 'r'
             },
             'joystick': 0,
             'player_name': '',
             'shaders': 1
         },
         'development': {
             'multithreaded_render': 0,
             'ai': 0,
             'fps': 0,
             'car': '',
             'track': '',
             'shaders_dev': 0,
             'gamma': 2.2,
             'show_waypoints': 0,
             'show_exit': 1,
             'menu_joypad': 1,
             'multiplayer': 0,
             'season': 0,
             'win_orig': '',
             'profiling': 0,
             'python_profiling': 0,
             'python_profiling_percall': 0
         }
     }
     opt_path = ''
     if platform == 'win32' and not exists('main.py'):
         opt_path = join(str(Filename.get_user_appdata_directory()), 'Yorg')
     self.options = DctFile(
         join(opt_path, 'options.yml') if opt_path else 'options.yml',
         default_opt)
     conf = Cfg(
         win_title='Yorg',
         win_orig=self.options['development']['win_orig'],
         win_size=self.options['settings']['resolution'],
         fullscreen=self.options['settings']['fullscreen'],
         antialiasing=self.options['settings']['aa'],
         fps=self.options['development']['fps'],
         mt_render=self.options['development']['multithreaded_render'],
         shaders_dev=self.options['development']['shaders_dev'],
         gamma=self.options['development']['gamma'],
         menu_joypad=self.options['development']['menu_joypad'],
         lang=self.options['settings']['lang'],
         lang_domain='yorg',
         cursor_path='assets/images/gui/cursor.png',
         cursor_scale=((256 / 352.0) * .08, 1, .08),
         cursor_hotspot=(.1, .06),
         volume=self.options['settings']['volume'],
         profiling=self.options['development']['profiling'],
         python_profiling=self.options['development']['python_profiling'],
         python_profiling_percall=self.options['development']
         ['python_profiling_percall'])
     init_lst = [[('fsm', YorgFsm, [self])], [('logic', YorgLogic, [self])],
                 [('audio', YorgAudio, [self])],
                 [('event', YorgEvent, [self])]]
     Game.__init__(self, init_lst, conf)