diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-01-13 11:15:32 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-01-13 11:15:32 +0000 |
| commit | ea245b969d1864441b41d25c7631beccfb39d874 (patch) | |
| tree | 68fb62ef99cdd90f5dd4ec8edf11e7bb54b7f953 /src/engine/client | |
| parent | 906ece7894927983b8ac69e37dd3cb82cfe7aad1 (diff) | |
| download | zcatch-ea245b969d1864441b41d25c7631beccfb39d874.tar.gz zcatch-ea245b969d1864441b41d25c7631beccfb39d874.zip | |
new mapformat in place. continued the cleanup. some effects are gone, gonna be redone so no biggie. CTF isn't working now.
Diffstat (limited to 'src/engine/client')
| -rw-r--r-- | src/engine/client/ec_client.c | 67 | ||||
| -rw-r--r-- | src/engine/client/ec_gfx.c | 36 |
2 files changed, 87 insertions, 16 deletions
diff --git a/src/engine/client/ec_client.c b/src/engine/client/ec_client.c index bae8cb5c..6a3b4220 100644 --- a/src/engine/client/ec_client.c +++ b/src/engine/client/ec_client.c @@ -513,13 +513,15 @@ static void client_debug_render() } /* render graphs */ - gfx_mapscreen(0,0,400.0f,300.0f); - graph_render(&predict_graph, 300, 10, 90, 50); - graph_render(&predicted_time.graph, 300, 10+50+10, 90, 50); - - graph_render(&intra_graph, 300, 10+50+10+50+10, 90, 50); - graph_render(&input_late_graph, 300, 10+50+10+50+10+50+10, 90, 50); - + if(config.dbg_graphs) + { + gfx_mapscreen(0,0,400.0f,300.0f); + graph_render(&predict_graph, 300, 10, 90, 50); + graph_render(&predicted_time.graph, 300, 10+50+10, 90, 50); + + graph_render(&intra_graph, 300, 10+50+10+50+10, 90, 50); + graph_render(&input_late_graph, 300, 10+50+10+50+10+50+10, 90, 50); + } } void client_quit() @@ -808,7 +810,7 @@ static void client_process_packet(NETPACKET *packet) recived_snapshots++; if(current_recv_tick > 0) - snaploss += game_tick-current_recv_tick-1; + snaploss += game_tick-current_recv_tick-2; current_recv_tick = game_tick; /* we got two snapshots until we see us self as connected */ @@ -978,6 +980,9 @@ static void client_run() int64 reportinterval = time_freq()*1; int editor_active = 0; + static PERFORMACE_INFO rootscope = {"root", 0}; + perf_start(&rootscope); + local_start_time = time_get(); snapshot_part = 0; @@ -1014,14 +1019,27 @@ static void client_run() while (1) { + static PERFORMACE_INFO rootscope = {"root", 0}; int64 frame_start_time = time_get(); frames++; + perf_start(&rootscope); + /* update input */ - inp_update(); + { + static PERFORMACE_INFO scope = {"inp_update", 0}; + perf_start(&scope); + inp_update(); + perf_end(); + } /* update sound */ - snd_update(); + { + static PERFORMACE_INFO scope = {"snd_update", 0}; + perf_start(&scope); + snd_update(); + perf_end(); + } /* refocus */ if(!gfx_window_active()) @@ -1085,7 +1103,12 @@ static void client_run() } else { - client_update(); + { + static PERFORMACE_INFO scope = {"client_update", 0}; + perf_start(&scope); + client_update(); + perf_end(); + } if(config.dbg_stress) { @@ -1097,10 +1120,24 @@ static void client_run() } else { - client_render(); - gfx_swap(); + { + static PERFORMACE_INFO scope = {"client_render", 0}; + perf_start(&scope); + client_render(); + perf_end(); + } + + { + static PERFORMACE_INFO scope = {"gfx_swap", 0}; + perf_start(&scope); + gfx_swap(); + perf_end(); + } } } + + perf_end(); + /* check conditions */ if(client_state() == CLIENTSTATE_QUITING) @@ -1130,6 +1167,10 @@ static void client_run() frametime_high = 0; frames = 0; reporttime += reportinterval; + perf_next(); + + if(config.dbg_pref) + perf_dump(&rootscope); } /* update frametime */ diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c index 754d5d63..771c8515 100644 --- a/src/engine/client/ec_gfx.c +++ b/src/engine/client/ec_gfx.c @@ -529,6 +529,7 @@ static int record = 0; void gfx_swap() { + #if 0 if(record) { int w = screen_width; @@ -597,10 +598,39 @@ void gfx_swap() mem_free(pixel_data); do_screenshot = 0; } + #endif - glfwSwapBuffers(); - glFinish(); - glfwPollEvents(); + { + static PERFORMACE_INFO pscope = {"glfwSwapBuffers", 0}; + perf_start(&pscope); + glFinish(); + glfwSwapBuffers(); + perf_end(); + } + + if(0) + { + static PERFORMACE_INFO pscope = {"glFlush", 0}; + perf_start(&pscope); + glFlush(); + perf_end(); + } + + if(0) + { + static PERFORMACE_INFO pscope = {"glFinish", 0}; + perf_start(&pscope); + glFinish(); + perf_end(); + } + + if(0) + { + static PERFORMACE_INFO pscope = {"glfwPollEvents", 0}; + perf_start(&pscope); + glfwPollEvents(); + perf_end(); + } } int gfx_screenwidth() |