about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2007-10-07 19:37:51 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2007-10-07 19:37:51 +0000
commit9e00e58e78d6c4c5696170e573d1ae7d51a74a61 (patch)
treecc672f566b2ae8093df681e61834ae24487de499
parent982db98faec1ba28ff74fdd594ced77e4197cc02 (diff)
downloadzcatch-9e00e58e78d6c4c5696170e573d1ae7d51a74a61.tar.gz
zcatch-9e00e58e78d6c4c5696170e573d1ae7d51a74a61.zip
added fsaa and refresh rate options. tweaked scope a bit
-rw-r--r--src/engine/client/gfx.c14
-rw-r--r--src/engine/config_variables.h2
-rw-r--r--src/game/client/game_client.cpp13
3 files changed, 22 insertions, 7 deletions
diff --git a/src/engine/client/gfx.c b/src/engine/client/gfx.c
index f30e5099..c0c0d12a 100644
--- a/src/engine/client/gfx.c
+++ b/src/engine/client/gfx.c
@@ -134,10 +134,22 @@ int gfx_init()
 		screen_width = 320;
 		screen_height = 240;
 	}
+
+	/* set antialiasing	*/
+	if(config.gfx_fsaa_samples)
+		glfwOpenWindowHint(GLFW_FSAA_SAMPLES, config.gfx_fsaa_samples);
+	
+	/* set refresh rate */
+	if(config.gfx_refresh_rate)
+		glfwOpenWindowHint(GLFW_REFRESH_RATE, config.gfx_refresh_rate);
 	
+	/* no resizing allowed */
+	glfwOpenWindowHint(GLFW_WINDOW_NO_RESIZE, 1);
+		
+	/* open window */	
 	if(config.gfx_fullscreen)
 	{
-		int result = glfwOpenWindow(screen_width, screen_height, 8, 8, 8, 0, 0, 0, GLFW_FULLSCREEN);
+		int result = glfwOpenWindow(screen_width, screen_height, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN);
 		if(result != GL_TRUE)
 		{
 			dbg_msg("game", "failed to create gl context");
diff --git a/src/engine/config_variables.h b/src/engine/config_variables.h
index 8fbab733..492d35fb 100644
--- a/src/engine/config_variables.h
+++ b/src/engine/config_variables.h
@@ -29,6 +29,8 @@ MACRO_CONFIG_INT(gfx_display_all_modes, 0, 0, 1)
 MACRO_CONFIG_INT(gfx_texture_compression, 0, 0, 1)
 MACRO_CONFIG_INT(gfx_high_detail, 1, 0, 1)
 MACRO_CONFIG_INT(gfx_texture_quality, 1, 0, 1)
+MACRO_CONFIG_INT(gfx_fsaa_samples, 0, 0, 16)
+MACRO_CONFIG_INT(gfx_refresh_rate, 0, 0, 0)
 
 MACRO_CONFIG_INT(key_screenshot, 267, 32, 512)
 
diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp
index f97c32ca..a9ca9dd5 100644
--- a/src/game/client/game_client.cpp
+++ b/src/game/client/game_client.cpp
@@ -2012,7 +2012,7 @@ void render_game()
 		gfx_quads_begin();
 		gfx_setcolor(0.65f,0.78f,0.9f,1.0f);
 		
-		float fov = pi/4.0f;
+		float fov = pi/6.0f;
 		float fade = 0.7f;
 		
 		
@@ -2057,18 +2057,19 @@ void render_game()
 		gfx_quads_begin();
 		gfx_setcolor(0.5f,0.9f,0.5f,0.25f);
 		float r=0.5f, g=1.0f, b=0.5f;
+		float r2=r*0.25f, g2=g*0.25f, b2=b*0.25f;
 		
-		gfx_setcolor(r,g,b,0.1f);
+		gfx_setcolor(r,g,b,0.2f);
 		gfx_quads_draw_freeform(
 			cn.x,cn.y,
 			cn.x,cn.y,
 			cp0f.x,cp0f.y,
 			cp1f.x,cp1f.y);
 
-		gfx_setcolorvertex(0, r, g, b, 0.1f);
-		gfx_setcolorvertex(1, 0, 0, 0, 0.9f);
-		gfx_setcolorvertex(2, r, g, b, 0.1f);
-		gfx_setcolorvertex(3, 0, 0, 0, 0.9f);
+		gfx_setcolorvertex(0, r, g, b, 0.2f);
+		gfx_setcolorvertex(1, r2, g2, b2, 0.9f);
+		gfx_setcolorvertex(2, r, g, b, 0.2f);
+		gfx_setcolorvertex(3, r2, g2, b2, 0.9f);
 		gfx_quads_draw_freeform(
 			cn.x,cn.y,
 			p0n.x,p0n.y,