def init(): hvars.pos = vec.Vec3() hvars.angles = vec.Vec3() hvars.left = vec.Vec3() hvars.up = vec.Vec3() hvars.forward = vec.Vec3() hvars.fov_x = math.radians(fov) dist = (hvars.WIDTH / 2.0) / math.tan(hvars.fov_x / 2.0) hvars.fov_y = 2.0 * math.atan((hvars.HEIGHT / 2.0) / dist) hvars.c_api.R_SetupProjection(ctypes.c_float(hvars.fov_x)) _calcViewVecs() hio.bind("mousemove", _mouseMove) hio.bindContinuous(".", _moveForward) hio.bindContinuous("u", _moveRight) hio.bindContinuous("e", _moveBack) hio.bindContinuous("o", _moveLeft) hio.bindContinuous("button3", _moveUp)
hvars.iwad = wad.Wad(sys.argv[1]) hio.init() r_main.init() r_cam.init() # load into the C rendered mapfile.load(sys.argv[2]) # console.write("test line 1\n") # console.write("test line 2\n") # console.write("two lines\npart of the 2nd\n") # hio.bind("backquote", console.toggle) hio.bind("escape", _quit) hio.bind("f", _showFPS) hio.bind("g", hio.toggleGrab) hio.bind("x", _debug) hio.bind("k", _debug2) hio.bind("c", hvars.c_api.ClearScreen) frame_start = hio.milliSeconds() while not hvars.do_quit: hvars.c_api.R_SetDebug(0) r_cam.beginFrame() hio.runInput() r_cam.update()