def session_console(): libtcodpy.console_set_custom_font(FONT_FILE) console = libtcodpy.console_init_root(WIDTH, HEIGHT, TITLE, FULLSCREEN, RENDERER) assert libtcodpy.console_get_width(console) == WIDTH assert libtcodpy.console_get_height(console) == HEIGHT assert libtcodpy.console_is_fullscreen() == FULLSCREEN libtcodpy.console_set_window_title(TITLE) assert not libtcodpy.console_is_window_closed() libtcodpy.sys_get_current_resolution() libtcodpy.sys_get_char_size() libtcodpy.sys_set_renderer(RENDERER) libtcodpy.sys_get_renderer() yield console libtcodpy.console_delete(console)
def test_sys_custom_render(console): if libtcodpy.sys_get_renderer() != libtcodpy.RENDERER_SDL: pytest.xfail(reason='Only supports SDL') escape = [] def sdl_callback(sdl_surface): escape.append(True) libtcodpy.console_set_dirty(0, 0, 0, 0) libtcodpy.sys_register_SDL_renderer(sdl_callback) libtcodpy.console_flush() assert escape, 'proof that sdl_callback was called'
logging.warning('[Cython] ImportError with module: %s' % e) logging.warning( '[Cython] Certain functions can run faster if compiled with Cython.' ) logging.warning( '[Cython] Run \'python compile_cython_modules.py build_ext --inplace\'' ) logging.info(WINDOW_TITLE) gfx.log(WINDOW_TITLE) if os.path.exists('git-version.txt'): with open('git-version.txt', 'r') as ver: logging.info('Build %s' % ver.readline().strip()) logging.debug('Renderer: %s' % tcod.sys_get_renderer()) tiles.create_all_tiles() language.load_strings() missions.load_all_missions() alife.rawparse.create_function_map() locks.create_lock('camera_free', locked=True) gfx.init_libtcod() threads.init() #smp.init() SETTINGS['draw z-levels below'] = True SETTINGS['draw z-levels above'] = True life.initiate_life('human')
sys.exit(1) except ImportError, e: CYTHON_ENABLED = False logging.warning("[Cython] ImportError with module: %s" % e) logging.warning("[Cython] Certain functions can run faster if compiled with Cython.") logging.warning("[Cython] Run 'python compile_cython_modules.py build_ext --inplace'") logging.info(WINDOW_TITLE) gfx.log(WINDOW_TITLE) if os.path.exists("git-version.txt"): with open("git-version.txt", "r") as ver: logging.info("Build %s" % ver.readline().strip()) logging.debug("Renderer: %s" % tcod.sys_get_renderer()) tiles.create_all_tiles() language.load_strings() alife.rawparse.create_function_map() gfx.init_libtcod() # smp.init() SETTINGS["draw z-levels below"] = True SETTINGS["draw z-levels above"] = True life.initiate_life("human") life.initiate_life("dog") life.initiate_life("night_terror")
sys.exit(1) except ImportError, e: CYTHON_ENABLED = False logging.warning('[Cython] ImportError with module: %s' % e) logging.warning('[Cython] Certain functions can run faster if compiled with Cython.') logging.warning('[Cython] Run \'python compile_cython_modules.py build_ext --inplace\'') logging.info(WINDOW_TITLE) gfx.log(WINDOW_TITLE) if os.path.exists('git-version.txt'): with open('git-version.txt', 'r') as ver: logging.info('Build %s' % ver.readline().strip()) logging.debug('Renderer: %s' % tcod.sys_get_renderer()) tiles.create_all_tiles() language.load_strings() missions.load_all_missions() alife.rawparse.create_function_map() locks.create_lock('camera_free', locked=True) gfx.init_libtcod() threads.init() #smp.init() SETTINGS['draw z-levels below'] = True SETTINGS['draw z-levels above'] = True life.initiate_life('human')