about summary refs log tree commit diff
path: root/src/engine/client/gfx.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2007-07-22 09:15:34 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2007-07-22 09:15:34 +0000
commit3b1871499c52a41c6fe1e017d6da858b7e70a396 (patch)
tree410cca70987d8789088e25c8a8b5b24eb46a8c06 /src/engine/client/gfx.cpp
parent1950995bb5137e084b5706275cce1d9d7398fc34 (diff)
downloadzcatch-3b1871499c52a41c6fe1e017d6da858b7e70a396.tar.gz
zcatch-3b1871499c52a41c6fe1e017d6da858b7e70a396.zip
laggometer, smaller gfx fixes
Diffstat (limited to 'src/engine/client/gfx.cpp')
-rw-r--r--src/engine/client/gfx.cpp33
1 files changed, 25 insertions, 8 deletions
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;
 }