diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-29 11:44:03 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-29 11:44:03 +0000 |
| commit | 7a3874745ca370a799d95b5f86e85fcc8eadefbb (patch) | |
| tree | 16f1e28f2f499279496866a63cabf88e2f2ad6c4 /src/engine/client | |
| parent | 171d6b1c206c0488b59d157bc266319bf4ab482b (diff) | |
| download | zcatch-7a3874745ca370a799d95b5f86e85fcc8eadefbb.tar.gz zcatch-7a3874745ca370a799d95b5f86e85fcc8eadefbb.zip | |
fixed loads of graphical optimizations
Diffstat (limited to 'src/engine/client')
| -rw-r--r-- | src/engine/client/ec_client.c | 4 | ||||
| -rw-r--r-- | src/engine/client/ec_gfx.c | 50 |
2 files changed, 35 insertions, 19 deletions
diff --git a/src/engine/client/ec_client.c b/src/engine/client/ec_client.c index a8da7457..72b5536f 100644 --- a/src/engine/client/ec_client.c +++ b/src/engine/client/ec_client.c @@ -585,7 +585,9 @@ const char *client_error_string() static void client_render() { - gfx_clear(0.0f,0.0f,0.0f); + if(config.gfx_clear) + gfx_clear(1,1,0); + modc_render(); client_debug_render(); } diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c index 53fe1790..3efcdac7 100644 --- a/src/engine/client/ec_gfx.c +++ b/src/engine/client/ec_gfx.c @@ -88,7 +88,7 @@ static void flush() if(num_vertices == 0) return; - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glVertexPointer(3, GL_FLOAT, @@ -216,11 +216,14 @@ int gfx_init() glDisable(GL_DEPTH_TEST); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); -/* glAlphaFunc(GL_GREATER, 0); - glEnable(GL_ALPHA_TEST);*/ - - + + glAlphaFunc(GL_GREATER, 0); + glEnable(GL_ALPHA_TEST); + glDepthMask(0); + gfx_mask_op(MASK_NONE, 0); + /*glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);*/ + /* Set all z to -5.0f */ for (i = 0; i < vertex_buffer_size; i++) @@ -342,13 +345,21 @@ int gfx_unload_texture(int index) return 0; } +void gfx_blend_none() +{ + glDisable(GL_BLEND); +} + + void gfx_blend_normal() { + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } void gfx_blend_additive() { + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); } @@ -636,24 +647,27 @@ void gfx_swap() { static PERFORMACE_INFO pscope = {"glfwSwapBuffers", 0}; perf_start(&pscope); - glFinish(); glfwSwapBuffers(); perf_end(); } - - { - static PERFORMACE_INFO pscope = {"glFlush", 0}; - perf_start(&pscope); - glFlush(); - perf_end(); - } + /* + if(inp_key_pressed('P')) { - static PERFORMACE_INFO pscope = {"glFinish", 0}; - perf_start(&pscope); - glFinish(); - perf_end(); - } + { + static PERFORMACE_INFO pscope = {"glFlush", 0}; + perf_start(&pscope); + glFlush(); + perf_end(); + } + + { + static PERFORMACE_INFO pscope = {"glFinish", 0}; + perf_start(&pscope); + glFinish(); + perf_end(); + } + }*/ { static PERFORMACE_INFO pscope = {"glfwPollEvents", 0}; |