def unpack(content_dir, out_dir): content_manager = FezContentManager(content_dir) out_dir = os.path.normpath(out_dir) for asset_name in content_manager.assets: print(asset_name) xnb = content_manager.xnb(asset_name, parse=False) out_file = os.path.join(out_dir, os.path.normpath(asset_name)) xnb.save(filename=out_file)
def unpack(content_dir, out_dir): content_manager = FezContentManager(content_dir) out_dir = os.path.normpath(out_dir) for asset_name in content_manager.assets: print(asset_name) try: xnb = content_manager.xnb(asset_name, parse=False) out_file = os.path.join(out_dir, os.path.normpath(asset_name)) xnb.save(filename=out_file) except ReaderError as ex: print("FAILED: '{}' {}: {}".format(asset_name, type(ex).__name__, ex), file=sys.stderr)
def main(): if len(sys.argv) == 3: # try and get config with 4x AA enabled, failing back to no AA platform = pyglet.window.get_platform() display = platform.get_default_display() screen = display.get_default_screen() template = pyglet.gl.Config(sample_buffers=1, samples=4) try: config = screen.get_best_config(template) except pyglet.window.NoSuchConfigException: template = pyglet.gl.Config() config = screen.get_best_config(template) # try and use FezContentManager if it works, failing back to directory reader try: content_manager = FezContentManager(sys.argv[1]) except ReaderError: content_manager = ContentManager(sys.argv[1]) AOWindow(content_manager=content_manager, asset_name=sys.argv[2], config=config) pyglet.app.run() else: print('show_ao.py Content|out objectao')
def unpack(content_dir, out_dir): content_manager = FezContentManager(content_dir) out_dir = os.path.normpath(out_dir) for asset_name in content_manager.assets: print(asset_name) content_manager.save(asset_name, out_dir)