libtcod / python-tcod

A high-performance Python port of libtcod. Includes the libtcodpy module for backwards compatibility with older projects.
BSD 2-Clause "Simplified" License
413 stars 36 forks source link

NameError: name 'framerate' is not defined whenever calling set_fps #30

Closed oakandsage closed 7 years ago

oakandsage commented 7 years ago

set_fps function parameter is named 'fps' but still references 'framerate', causing a NameError whenever it is called.

init line ~1275 should read _lib.TCOD_sys_set_fps(fps or 0) not _lib.TCOD_sys_set_fps(fps or 0)

HexDecimal commented 7 years ago

Thank you for raising this issue. I messed up and missed this completely.

I've fixed the NameError and added tests for tdl's fps functions. v4.0.1 has the fix and is being deployed right at this moment.

Here's a next trick that turns on VSync if you're interested. You can call this after tdl.init.

tcod.lib.SDL_GL_SetSwapInterval(1)