From 9e00e58e78d6c4c5696170e573d1ae7d51a74a61 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 7 Oct 2007 19:37:51 +0000 Subject: [PATCH] added fsaa and refresh rate options. tweaked scope a bit --- src/engine/client/gfx.c | 14 +++++++++++++- src/engine/config_variables.h | 2 ++ src/game/client/game_client.cpp | 13 +++++++------ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/engine/client/gfx.c b/src/engine/client/gfx.c index f30e5099c..c0c0d12af 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 8fbab7333..492d35fb6 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 f97c32ca0..a9ca9dd57 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,