diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-01 14:36:36 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-01 14:36:36 +0000 |
| commit | 0747c2dff9289db6204b82501d03447f3ec6cc99 (patch) | |
| tree | ecca83ee860dfa5293f4dba9233820579a4bf4ac /src/game/client/gc_hooks.cpp | |
| parent | 622dbc6f3e5a5f398af8c6ef98d057a200c813a0 (diff) | |
| download | zcatch-0747c2dff9289db6204b82501d03447f3ec6cc99.tar.gz zcatch-0747c2dff9289db6204b82501d03447f3ec6cc99.zip | |
fixed remote console. some gui tweaks aswell.
Diffstat (limited to 'src/game/client/gc_hooks.cpp')
| -rw-r--r-- | src/game/client/gc_hooks.cpp | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/src/game/client/gc_hooks.cpp b/src/game/client/gc_hooks.cpp index 9292d08c..d8863be7 100644 --- a/src/game/client/gc_hooks.cpp +++ b/src/game/client/gc_hooks.cpp @@ -31,9 +31,25 @@ extern "C" void modc_console_init() client_console_init(); } +static void load_sounds_thread(void *) +{ + // load sounds + for(int s = 0; s < data->num_sounds; s++) + { + //render_loading(current/total); + for(int i = 0; i < data->sounds[s].num_sounds; i++) + { + int id = snd_load_wv(data->sounds[s].sounds[i].filename); + data->sounds[s].sounds[i].id = id; + } + } +} + extern "C" void modc_init() { static FONT_SET default_font; + + int64 start = time_get(); int before = gfx_memory_usage(); font_set_load(&default_font, "data/fonts/default_font%d.tfnt", "data/fonts/default_font%d.png", "data/fonts/default_font%d_b.png", 14, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 36); @@ -56,9 +72,9 @@ extern "C" void modc_init() // TODO: should be removed snd_set_listener_pos(0.0f, 0.0f); - float total = data->num_sounds+data->num_images; + float total = data->num_images; float current = 0; - + // load textures for(int i = 0; i < data->num_images; i++) { @@ -66,8 +82,14 @@ extern "C" void modc_init() data->images[i].id = gfx_load_texture(data->images[i].filename, IMG_AUTO); current++; } + + skin_init(); + //load_sounds_thread(0); + thread_create(load_sounds_thread, 0); + // load sounds + /* for(int s = 0; s < data->num_sounds; s++) { render_loading(current/total); @@ -83,9 +105,11 @@ extern "C" void modc_init() } current++; - } - - skin_init(); + }*/ + + + int64 end = time_get(); + dbg_msg("", "%f.2ms", ((end-start)*1000)/(float)time_freq()); } extern "C" void modc_entergame() @@ -324,6 +348,11 @@ extern "C" void modc_render() console_render(); } +extern "C" void modc_rcon_line(const char *line) +{ + console_rcon_print(line); +} + extern "C" int modc_snap_input(int *data) { picked_up_weapon = -1; |