Added skeleton for client side render tick timing.

Fixed name lookup for ticks (will require an AT)
This commit is contained in:
ProfMobius committed 2013-12-23 04:34:09 +01:00
1 parent ab175caa8f
commit 0ae51bbfb8
10 files changed
+311 -20

No files matched your search

@@ -1,5 +1,15 @@
package mcp.mobius.opis.network;
import java.util.ArrayList;
import java.util.logging.Level;
import mcp.mobius.mobiuscore.profiler.ProfilerRegistrar;
import mcp.mobius.opis.modOpis;
import mcp.mobius.opis.client.OpisClientTickHandler;
import mcp.mobius.opis.data.client.TickHandlerClientManager;
import mcp.mobius.opis.data.client.TickHandlerClientProfiler;
import mcp.mobius.opis.data.holders.TickHandlerStats;
public class ClientCommandHandler {
private static ClientCommandHandler _instance;
@@ -12,6 +22,22 @@ public class ClientCommandHandler {
}
public void handle(byte cmd){
System.out.printf("Received client cmd with id %s\n", cmd);
if (cmd == ClientCommand.START_PROFILING){
modOpis.log.log(Level.INFO, "Started profiling");
modOpis.profilerRun = true;
OpisClientTickHandler.instance.profilerRunningTicks = 0;
TickHandlerClientManager.startStats.clear();
TickHandlerClientManager.endStats.clear();
ProfilerRegistrar.registerProfilerTick(new TickHandlerClientProfiler());
}
else if (cmd == ClientCommand.SHOW_RENDER_TICK){
modOpis.log.log(Level.INFO, "=== RENDER TICK ===");
ArrayList<TickHandlerStats> stats = TickHandlerClientManager.getCumulatedStats();
for (TickHandlerStats stat : stats){
System.out.printf("%s \n", stat);
}
}
}
}