From b328b78653133f05107eadba31572874e4c35e95 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 26 Apr 2012 01:14:22 +0300 Subject: Add LPS counter to debug window (Logic per second). Normally must be always 100 LPS. --- src/client.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/client.cpp') 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; -- cgit v1.2.3-70-g09d2