r3404 - in trunk/data: . qcsrc/menu/nexuiz

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Feb 23 13:08:18 EST 2008


Author: div0
Date: 2008-02-23 13:08:18 -0500 (Sat, 23 Feb 2008)
New Revision: 3404

Modified:
   trunk/data/high.cfg
   trunk/data/low.cfg
   trunk/data/med.cfg
   trunk/data/normal.cfg
   trunk/data/omg.cfg
   trunk/data/qcsrc/menu/nexuiz/checkbox.c
   trunk/data/qcsrc/menu/nexuiz/dialog_settings_video.c
   trunk/data/ultimate.cfg
   trunk/data/ultra.cfg
Log:
vid_samples


Modified: trunk/data/high.cfg
===================================================================
--- trunk/data/high.cfg	2008-02-23 13:54:46 UTC (rev 3403)
+++ trunk/data/high.cfg	2008-02-23 18:08:18 UTC (rev 3404)
@@ -22,5 +22,6 @@
 r_water_resolutionmultiplier 0.5
 r_drawparticles_drawdistance 2000
 r_drawdecals_drawdistance 500
+vid_samples 1
 
 menu_sync

Modified: trunk/data/low.cfg
===================================================================
--- trunk/data/low.cfg	2008-02-23 13:54:46 UTC (rev 3403)
+++ trunk/data/low.cfg	2008-02-23 18:08:18 UTC (rev 3404)
@@ -22,5 +22,6 @@
 r_water_resolutionmultiplier 0.5
 r_drawparticles_drawdistance 500
 r_drawdecals_drawdistance 200
+vid_samples 1
 
 menu_sync

Modified: trunk/data/med.cfg
===================================================================
--- trunk/data/med.cfg	2008-02-23 13:54:46 UTC (rev 3403)
+++ trunk/data/med.cfg	2008-02-23 18:08:18 UTC (rev 3404)
@@ -22,5 +22,6 @@
 r_water_resolutionmultiplier 0.5
 r_drawparticles_drawdistance 1000
 r_drawdecals_drawdistance 300
+vid_samples 1
 
 menu_sync

Modified: trunk/data/normal.cfg
===================================================================
--- trunk/data/normal.cfg	2008-02-23 13:54:46 UTC (rev 3403)
+++ trunk/data/normal.cfg	2008-02-23 18:08:18 UTC (rev 3404)
@@ -22,5 +22,6 @@
 r_water_resolutionmultiplier 0.5
 r_drawparticles_drawdistance 1000
 r_drawdecals_drawdistance 300
+vid_samples 1
 
 menu_sync

Modified: trunk/data/omg.cfg
===================================================================
--- trunk/data/omg.cfg	2008-02-23 13:54:46 UTC (rev 3403)
+++ trunk/data/omg.cfg	2008-02-23 18:08:18 UTC (rev 3404)
@@ -21,5 +21,6 @@
 r_showsurfaces 1
 r_water 0
 r_water_resolutionmultiplier 0.5
+vid_samples 1
 
 menu_sync

Modified: trunk/data/qcsrc/menu/nexuiz/checkbox.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/checkbox.c	2008-02-23 13:54:46 UTC (rev 3403)
+++ trunk/data/qcsrc/menu/nexuiz/checkbox.c	2008-02-23 18:08:18 UTC (rev 3404)
@@ -1,14 +1,11 @@
 #ifdef INTERFACE
 CLASS(NexuizCheckBox) EXTENDS(CheckBox)
-	METHOD(NexuizCheckBox, configureNexuizCheckBox, void(entity, float, string, string))
+	METHOD(NexuizCheckBox, configureNexuizCheckBox, void(entity, float, float, string, string))
 	METHOD(NexuizCheckBox, setChecked, void(entity, float))
 	ATTRIB(NexuizCheckBox, fontSize, float, SKINFONTSIZE_NORMAL)
 	ATTRIB(NexuizCheckBox, image, string, SKINGFX_CHECKBOX)
-	ATTRIB(NexuizCheckBox, inverted, float, 0)
-	// can be: 0   (off =  0, on =  1)
-	//         1   (off =  1, on =  0)
-	//         1+a (off =  a, on = -a)
-	//        -1-a (off = -a, on =  a)
+	ATTRIB(NexuizCheckBox, yesValue, float, 1)
+	ATTRIB(NexuizCheckBox, noValue, float, 0)
 
 	ATTRIB(NexuizCheckBox, color, vector, SKINCOLOR_CHECKBOX_N)
 	ATTRIB(NexuizCheckBox, colorC, vector, SKINCOLOR_CHECKBOX_C)
@@ -23,19 +20,47 @@
 	ATTRIB(NexuizCheckBox, disabledAlpha, float, SKINALPHA_DISABLED)
 ENDCLASS(NexuizCheckBox)
 entity makeNexuizCheckBox(float, string, string);
+entity makeNexuizCheckBoxEx(float, float, string, string);
 #endif
 
 #ifdef IMPLEMENTATION
 entity makeNexuizCheckBox(float isInverted, string theCvar, string theText)
 {
+	float y, n;
+	if(isInverted > 1)
+	{
+		n = isInverted - 1;
+		y = -n;
+	}
+	else if(isInverted < -1)
+	{
+		n = isInverted + 1;
+		y = -n;
+	}
+	else if(isInverted == 1)
+	{
+		n = 1;
+		y = 0;
+	}
+	else
+	{
+		n = 0;
+		y = 1;
+	}
+	print("y = ", ftos(y), ", n = ", ftos(n), "\n");
+	return makeNexuizCheckBoxEx(y, n, theCvar, theText);
+}
+entity makeNexuizCheckBoxEx(float theYesValue, float theNoValue, string theCvar, string theText)
+{
 	entity me;
 	me = spawnNexuizCheckBox();
-	me.configureNexuizCheckBox(me, isInverted, theCvar, theText);
+	me.configureNexuizCheckBox(me, theYesValue, theNoValue, theCvar, theText);
 	return me;
 }
-void configureNexuizCheckBoxNexuizCheckBox(entity me, float isInverted, string theCvar, string theText)
+void configureNexuizCheckBoxNexuizCheckBox(entity me, float theYesValue, float theNoValue, string theCvar, string theText)
 {
-	me.inverted = isInverted;
+	me.yesValue = theYesValue;
+	me.noValue = theNoValue;
 	me.checked = 0;
 	if(theCvar)
 	{
@@ -54,34 +79,16 @@
 }
 void loadCvarsNexuizCheckBox(entity me)
 {
-	if(me.inverted == 0)
-		me.checked = cvar(me.cvarName);
-	else if(me.inverted == 1)
-		me.checked = !cvar(me.cvarName);
-	else if(me.inverted > 1)
-		me.checked = (cvar(me.cvarName) < 0);
-	else if(me.inverted < -1)
-		me.checked = (cvar(me.cvarName) > 0);
+	float m, d;
+	m = (me.yesValue + me.noValue) * 0.5;
+	d = (cvar(me.cvarName) - m) / (me.yesValue - m);
+	me.checked = (d > 0);
 }
 void saveCvarsNexuizCheckBox(entity me)
 {
-	if(me.inverted == 0)
-		cvar_set(me.cvarName, me.checked ? "1" : "0");
-	else if(me.inverted == 1)
-		cvar_set(me.cvarName, me.checked ? "0" : "1");
-	else if(me.inverted > 1)
-	{
-		if(me.checked)
-			cvar_set(me.cvarName, ftos(-(me.inverted - 1)));
-		else
-			cvar_set(me.cvarName, ftos(+(me.inverted - 1)));
-	}
-	else if(me.inverted < -1)
-	{
-		if(me.checked)
-			cvar_set(me.cvarName, ftos(-(me.inverted + 1)));
-		else
-			cvar_set(me.cvarName, ftos(+(me.inverted + 1)));
-	}
+	if(me.checked)
+		cvar_set(me.cvarName, ftos(me.yesValue));
+	else
+		cvar_set(me.cvarName, ftos(me.noValue));
 }
 #endif

Modified: trunk/data/qcsrc/menu/nexuiz/dialog_settings_video.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/dialog_settings_video.c	2008-02-23 13:54:46 UTC (rev 3403)
+++ trunk/data/qcsrc/menu/nexuiz/dialog_settings_video.c	2008-02-23 18:08:18 UTC (rev 3404)
@@ -42,8 +42,8 @@
 		me.TD(me, 1, 0.5, e = makeNexuizRadioButton(1, "gl_texturecompression", "0", "None"));
 		me.TD(me, 1, 0.5, e = makeNexuizRadioButton(1, "gl_texturecompression", "1", "Fast"));
 		me.TD(me, 1, 0.5, e = makeNexuizRadioButton(1, "gl_texturecompression", "2", "Good"));
-
 	me.TR(me);
+		me.TD(me, 1, 3, e = makeNexuizCheckBoxEx(4, 1, "vid_samples", "Use 4x multisampling"));
 
 	me.TR(me);
 		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Depth first:"));

Modified: trunk/data/ultimate.cfg
===================================================================
--- trunk/data/ultimate.cfg	2008-02-23 13:54:46 UTC (rev 3403)
+++ trunk/data/ultimate.cfg	2008-02-23 18:08:18 UTC (rev 3404)
@@ -22,5 +22,6 @@
 r_water_resolutionmultiplier 1
 r_drawparticles_drawdistance 2000
 r_drawdecals_drawdistance 500
+vid_samples 4
 
 menu_sync

Modified: trunk/data/ultra.cfg
===================================================================
--- trunk/data/ultra.cfg	2008-02-23 13:54:46 UTC (rev 3403)
+++ trunk/data/ultra.cfg	2008-02-23 18:08:18 UTC (rev 3404)
@@ -22,5 +22,6 @@
 r_water_resolutionmultiplier 0.5
 r_drawparticles_drawdistance 2000
 r_drawdecals_drawdistance 500
+vid_samples 4
 
 menu_sync




More information about the nexuiz-commits mailing list