diff options
| author | Bryan Hoyle <starfoxprime@gmail.com> | 2011-08-16 01:44:37 (GMT) |
|---|---|---|
| committer | Bryan Hoyle <starfoxprime@gmail.com> | 2011-08-16 01:44:37 (GMT) |
| commit | aa56eca5c01359732f7331d2a572ce31d7ff3c23 (patch) | |
| tree | 5ca7e2e010bd80dd47708954de17f43553ecee94 /src | |
| parent | dcd3af94404b1d1bb296566a84177cc37e0b83d5 (diff) | |
| download | powder-aa56eca5c01359732f7331d2a572ce31d7ff3c23.zip powder-aa56eca5c01359732f7331d2a572ce31d7ff3c23.tar.gz | |
added lua command: tpt.setfpscap(int FPSCap)
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 3 | ||||
| -rw-r--r-- | src/luaconsole.c | 7 | ||||
| -rw-r--r-- | src/main.c | 3 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/graphics.c b/src/graphics.c index 033d219..14367ae 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1125,8 +1125,9 @@ int drawtextwrap(pixel *vid, int x, int y, int w, const char *s, int r, int g, i } } } -#endif + return rh; + #endif } //draws a rectange, (x,y) are the top left coords. diff --git a/src/luaconsole.c b/src/luaconsole.c index 78b633d..186764d 100644 --- a/src/luaconsole.c +++ b/src/luaconsole.c @@ -55,6 +55,7 @@ void luacon_open(){ {"heat", &luatpt_heat}, {"setfire", &luatpt_setfire}, {"setdebug", &luatpt_setdebug}, + {"setfpscap",&luatpt_setfpscap}, {NULL,NULL} }; @@ -1055,4 +1056,10 @@ int luatpt_setdebug(lua_State* l) debug_flags = debug; return 0; } +int luatpt_setfpscap(lua_State* l) +{ +int fpscap = luaL_optint(l, 1, 0); +limitFPS = fpscap; +return 0; +} #endif @@ -1598,6 +1598,7 @@ int main(int argc, char *argv[]) #else int main(int argc, char *argv[]) { + limitFPS = 60; pixel *part_vbuf; //Extra video buffer pixel *part_vbuf_store; #ifdef BETA @@ -1607,7 +1608,7 @@ int main(int argc, char *argv[]) char heattext[256] = ""; char coordtext[128] = ""; int currentTime = 0; - int FPS = 0, pastFPS = 0, elapsedTime = 0, limitFPS = 60; + int FPS = 0, pastFPS = 0, elapsedTime = 0; void *http_ver_check, *http_session_check = NULL; char *ver_data=NULL, *check_data=NULL, *tmp; //char console_error[255] = ""; |
