From 3b1871499c52a41c6fe1e017d6da858b7e70a396 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 22 Jul 2007 09:15:34 +0000 Subject: laggometer, smaller gfx fixes --- src/engine/client/gfx.cpp | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'src/engine/client/gfx.cpp') diff --git a/src/engine/client/gfx.cpp b/src/engine/client/gfx.cpp index 8248d3a5..e7ec3b37 100644 --- a/src/engine/client/gfx.cpp +++ b/src/engine/client/gfx.cpp @@ -185,6 +185,8 @@ void gfx_blend_additive() glBlendFunc(GL_SRC_ALPHA, GL_ONE); } +int DEBUGTEST_MAPIMAGE = 0; + int gfx_load_texture_raw(int w, int h, int format, const void *data) { // grab texture @@ -195,14 +197,29 @@ int gfx_load_texture_raw(int w, int h, int format, const void *data) // set data and return // TODO: should be RGBA, not BGRA dbg_msg("gfx", "%d = %dx%d", tex, w, h); - if(format == IMG_RGB) - textures[tex].tex.data2d(w, h, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, data); - else if(format == IMG_RGBA) - textures[tex].tex.data2d(w, h, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, data); - else if(format == IMG_BGR) - textures[tex].tex.data2d(w, h, GL_RGB, GL_BGR, GL_UNSIGNED_BYTE, data); - else if(format == IMG_BGRA) - textures[tex].tex.data2d(w, h, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE, data); + if(DEBUGTEST_MAPIMAGE) + { + if(format == IMG_RGB) + textures[tex].tex.data2d_nomip(w, h, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, data); + else if(format == IMG_RGBA) + textures[tex].tex.data2d_nomip(w, h, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, data); + else if(format == IMG_BGR) + textures[tex].tex.data2d_nomip(w, h, GL_RGB, GL_BGR, GL_UNSIGNED_BYTE, data); + else if(format == IMG_BGRA) + textures[tex].tex.data2d_nomip(w, h, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE, data); + } + else + { + if(format == IMG_RGB) + textures[tex].tex.data2d(w, h, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, data); + else if(format == IMG_RGBA) + textures[tex].tex.data2d(w, h, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, data); + else if(format == IMG_BGR) + textures[tex].tex.data2d(w, h, GL_RGB, GL_BGR, GL_UNSIGNED_BYTE, data); + else if(format == IMG_BGRA) + textures[tex].tex.data2d(w, h, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE, data); + } + return tex; } -- cgit 1.4.1