diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-26 01:14:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-26 01:14:22 +0300 |
commit | b328b78653133f05107eadba31572874e4c35e95 (patch) | |
tree | f426ca2b61fecab7dd115f2b12083e94502ae989 /src/client.cpp | |
parent | a57ee0d8a7c729ea2887c71b5262dd0a6cb56a71 (diff) | |
download | plus-b328b78653133f05107eadba31572874e4c35e95.tar.gz plus-b328b78653133f05107eadba31572874e4c35e95.tar.bz2 plus-b328b78653133f05107eadba31572874e4c35e95.tar.xz plus-b328b78653133f05107eadba31572874e4c35e95.zip |
Add LPS counter to debug window (Logic per second).
Normally must be always 100 LPS.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index 56d7c2d25..b51d8cdac 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -164,7 +164,9 @@ void ErrorListener::action(const gcn::ActionEvent &) volatile int tick_time; /**< Tick counter */ volatile int fps = 0; /**< Frames counted in the last second */ +volatile int lps = 0; /**< Logic processed per second */ volatile int frame_count = 0; /**< Counts the frames during one second */ +volatile int logic_count = 0; /**< Counts the logic during one second */ volatile int cur_time; volatile bool runCounters; bool isSafeMode = false; @@ -197,7 +199,9 @@ Uint32 nextTick(Uint32 interval, void *param A_UNUSED) Uint32 nextSecond(Uint32 interval, void *param A_UNUSED) { fps = frame_count; + lps = logic_count; frame_count = 0; + logic_count = 0; return interval; } @@ -926,6 +930,7 @@ int Client::gameExec() ++lastTickTime; k ++; } + logic_count += k; // This is done because at some point tick_time will wrap. lastTickTime = tick_time; |