about summary refs log tree commit diff
path: root/src/engine
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-01-29 21:39:41 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-01-29 21:39:41 +0000
commit7bc733dc10f3d01985021b7b5d6ae140dd5af6f1 (patch)
treec9b0fcd8d128ec9abd40c10dfe4fcf245650a870 /src/engine
parent0dab7db963e2706182ea120c98f746f5e265c14c (diff)
downloadzcatch-7bc733dc10f3d01985021b7b5d6ae140dd5af6f1.tar.gz
zcatch-7bc733dc10f3d01985021b7b5d6ae140dd5af6f1.zip
large update. cleaned up some code. added new effects for almost everything
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/client/ec_gfx.c15
-rw-r--r--src/engine/e_system.h3
2 files changed, 15 insertions, 3 deletions
diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c
index 101b0279..1e4378d2 100644
--- a/src/engine/client/ec_gfx.c
+++ b/src/engine/client/ec_gfx.c
@@ -163,7 +163,7 @@ int gfx_init()
 	/* open window */	
 	if(config.gfx_fullscreen)
 	{
-		int result = glfwOpenWindow(screen_width, screen_height, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN);
+		int result = glfwOpenWindow(screen_width, screen_height, 8, 8, 8, 8, 24, 8, GLFW_FULLSCREEN);
 		if(result != GL_TRUE)
 		{
 			dbg_msg("game", "failed to create gl context");
@@ -172,19 +172,22 @@ int gfx_init()
 	}
 	else
 	{
-		int result = glfwOpenWindow(screen_width, screen_height, 0, 0, 0, 0, 24, 0, GLFW_WINDOW);
+		int result = glfwOpenWindow(screen_width, screen_height, 0, 0, 0, 8, 24, 8, GLFW_WINDOW);
 		if(result != GL_TRUE)
 		{
 			dbg_msg("game", "failed to create gl context");
 			return 0;
 		}
 	}
-
 	
 	glfwSetWindowSizeCallback(screen_resize);
 	
+	glGetIntegerv(GL_ALPHA_BITS, &i);
+	dbg_msg("gfx", "alphabits = %d", i);
 	glGetIntegerv(GL_DEPTH_BITS, &i);
 	dbg_msg("gfx", "depthbits = %d", i);
+	glGetIntegerv(GL_STENCIL_BITS, &i);
+	dbg_msg("gfx", "stencilbits = %d", i);
 	
 	glfwSetWindowTitle("Teewars");
 	
@@ -212,6 +215,10 @@ int gfx_init()
 	glDisable(GL_DEPTH_TEST);
 	glMatrixMode(GL_MODELVIEW);
 	glLoadIdentity();
+/*	glAlphaFunc(GL_GREATER, 0);
+	glEnable(GL_ALPHA_TEST);*/
+
+
 	gfx_mask_op(MASK_NONE, 0);
 	
 	/* Set all z to -5.0f */
@@ -325,6 +332,8 @@ void gfx_set_vsync(int val)
 
 int gfx_unload_texture(int index)
 {
+	if(index < 0)
+		return 0;
 	glDeleteTextures(1, &textures[index].tex);
 	textures[index].next = first_free_texture;
 	memory_usage -= textures[index].memsize;
diff --git a/src/engine/e_system.h b/src/engine/e_system.h
index 4802111f..72a4ff7b 100644
--- a/src/engine/e_system.h
+++ b/src/engine/e_system.h
@@ -524,6 +524,9 @@ void mem_debug_dump();
 int mem_allocated();
 
 void swap_endian(void *data, unsigned elem_size, unsigned num);
+
+/* #define cache_prefetch(addr) __builtin_prefetch(addr) */
+
 #ifdef __cplusplus
 }
 #endif