diff options
Diffstat (limited to 'src/libjin-lua/scripts/time')
-rw-r--r-- | src/libjin-lua/scripts/time/time.lua | 25 | ||||
-rw-r--r-- | src/libjin-lua/scripts/time/time.lua.h | 23 |
2 files changed, 48 insertions, 0 deletions
diff --git a/src/libjin-lua/scripts/time/time.lua b/src/libjin-lua/scripts/time/time.lua new file mode 100644 index 0000000..61c6ab1 --- /dev/null +++ b/src/libjin-lua/scripts/time/time.lua @@ -0,0 +1,25 @@ + +jin.time = jin.time or {} + +local f = 0 +local fps = 0 +local t = 0 + +jin.time.getFPS = function() + return fps +end + +local step = jin.time.step + +jin.time.step = function() + step() + -- Update fps + t = t + jin.time.getDelta() + if t > 1 then + t = t - 1 + fps = f + 1 + f = 0 + else + f = f + 1 + end +end diff --git a/src/libjin-lua/scripts/time/time.lua.h b/src/libjin-lua/scripts/time/time.lua.h new file mode 100644 index 0000000..e2003a3 --- /dev/null +++ b/src/libjin-lua/scripts/time/time.lua.h @@ -0,0 +1,23 @@ +/*Auto generated, don't modify by hand.*/ +static char time_lua[] = { +13,10,106,105,110,46,116,105,109,101,32,61,32,106,105,110,46,116,105,109, +101,32,111,114,32,123,125,13,10,13,10,108,111,99,97,108,32,102,32,61, +32,48,13,10,108,111,99,97,108,32,102,112,115,32,61,32,48,13,10,108, +111,99,97,108,32,116,32,61,32,48,13,10,13,10,106,105,110,46,116,105, +109,101,46,103,101,116,70,80,83,32,61,32,102,117,110,99,116,105,111,110, +40,41,32,13,10,32,32,32,32,114,101,116,117,114,110,32,102,112,115,13, +10,101,110,100,32,13,10,13,10,108,111,99,97,108,32,115,116,101,112,32, +61,32,106,105,110,46,116,105,109,101,46,115,116,101,112,13,10,13,10,106, +105,110,46,116,105,109,101,46,115,116,101,112,32,61,32,102,117,110,99,116, +105,111,110,40,41,32,13,10,32,32,32,32,115,116,101,112,40,41,32,13, +10,32,32,32,32,45,45,32,85,112,100,97,116,101,32,102,112,115,13,10, +32,32,32,32,116,32,61,32,116,32,43,32,106,105,110,46,116,105,109,101, +46,103,101,116,68,101,108,116,97,40,41,32,13,10,32,32,32,32,105,102, +32,116,32,62,32,49,32,116,104,101,110,32,13,10,32,32,32,32,32,32, +32,32,116,32,61,32,116,32,45,32,49,32,13,10,32,32,32,32,32,32, +32,32,102,112,115,32,61,32,102,32,43,32,49,13,10,32,32,32,32,32, +32,32,32,102,32,61,32,48,13,10,32,32,32,32,101,108,115,101,32,13, +10,32,32,32,32,32,32,32,32,102,32,61,32,102,32,43,32,49,13,10, +32,32,32,32,101,110,100,13,10,101,110,100,32,13,10 +}; + |