r3181 - in trunk/data: . gfx/menu/default gfx/menu/xaw qcsrc/common qcsrc/menu qcsrc/menu-div0test qcsrc/menu-div0test/nexuiz qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jan 19 04:08:51 EST 2008


Author: div0
Date: 2008-01-19 04:08:40 -0500 (Sat, 19 Jan 2008)
New Revision: 3181

Modified:
   trunk/data/gfx/menu/default/skinvalues.txt
   trunk/data/gfx/menu/xaw/skinvalues.txt
   trunk/data/nexuiz-credits.txt
   trunk/data/qcsrc/common/util.qc
   trunk/data/qcsrc/common/util.qh
   trunk/data/qcsrc/menu-div0test/classes.c
   trunk/data/qcsrc/menu-div0test/mbuiltin.qh
   trunk/data/qcsrc/menu-div0test/nexuiz/mainwindow.c
   trunk/data/qcsrc/menu-div0test/skin-customizables.inc
   trunk/data/qcsrc/menu/mbuiltin.qc
   trunk/data/qcsrc/server/cl_client.qc
   trunk/data/qcsrc/server/clientcommands.qc
   trunk/data/qcsrc/server/extensions.qh
   trunk/data/qcsrc/server/g_world.qc
   trunk/data/qcsrc/server/keyhunt.qc
   trunk/data/qcsrc/server/miscfunctions.qc
   trunk/data/qcsrc/server/runematch.qc
   trunk/data/qcsrc/server/t_jumppads.qc
Log:
database, stringbuffer and FTE_STRINGS for menu QC;
credits dialog


Modified: trunk/data/gfx/menu/default/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/default/skinvalues.txt	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/gfx/menu/default/skinvalues.txt	2008-01-19 09:08:40 UTC (rev 3181)
@@ -13,6 +13,7 @@
 COLOR_DIALOG_MAPINFO            '0.7 0.7 1'
 COLOR_DIALOG_USERBIND           '0.7 0.7 1'
 COLOR_DIALOG_SINGLEPLAYER       '1 1 0.7'
+COLOR_DIALOG_CREDITS            '0.7 0.7 1'
 
 // mouse
 //   uses "cursor" images
@@ -49,6 +50,14 @@
 COLOR_CHECKBOX_F                '1 1 1'
 COLOR_CHECKBOX_D                '1 1 1'
 
+// item: credits list
+COLOR_CREDITS_TITLE             '1 1 1'
+ALPHA_CREDITS_TITLE             1
+COLOR_CREDITS_FUNCTION          '1 1 1'
+ALPHA_CREDITS_FUNCTION          0.7
+COLOR_CREDITS_PERSON            '0.7 0.7 1'
+ALPHA_CREDITS_PERSON            0.7
+
 // item: crosshair button
 //   uses "crosshairbutton" images
 

Modified: trunk/data/gfx/menu/xaw/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/xaw/skinvalues.txt	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/gfx/menu/xaw/skinvalues.txt	2008-01-19 09:08:40 UTC (rev 3181)
@@ -13,6 +13,7 @@
 COLOR_DIALOG_TEAMSELECT         '1 1 1'
 COLOR_DIALOG_USERBIND           '1 1 1'
 COLOR_DIALOG_SINGLEPLAYER       '1 1 1'
+COLOR_DIALOG_CREDITS            '1 1 1'
 
 // mouse
 //   uses cursor.tga
@@ -52,6 +53,14 @@
 // item: crosshair button
 //   uses crosshairbutton.tga
 
+// item: credits list
+COLOR_CREDITS_TITLE             '1 1 1'
+ALPHA_CREDITS_TITLE             1
+COLOR_CREDITS_FUNCTION          '0 0 0'
+ALPHA_CREDITS_FUNCTION          1
+COLOR_CREDITS_PERSON            '0 0 0'
+ALPHA_CREDITS_PERSON            1
+
 // item: dialog
 //   uses border.tga
 //   uses closebutton.tga

Modified: trunk/data/nexuiz-credits.txt
===================================================================
--- trunk/data/nexuiz-credits.txt	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/nexuiz-credits.txt	2008-01-19 09:08:40 UTC (rev 3181)
@@ -1,172 +1,115 @@
-Team:
+**Team:
 
 
-
 Lee Vermeulen
-Project Founder and Co-Designer
+*Project Founder and Co-Designer
 
 Forest "LordHavoc" Hale
-Lead Programmer and Co-Designer
+*Lead Programmer and Co-Designer
 
 SavageX
-Project Maintainer
+*Project Maintainer
 
 
-In alphabetical order
-(nickname or surname)
 
+**In alphabetical order
+**(nickname or surname)
 
 
 Andreas "Black" Kirsch
-Programmer
+*Programmer
 
 Kurt Dereli
-Lead Artist
+*Lead Artist
 
-
 Yves "EviLair" Allaire 
-Artist
+*Artist
 
-
 Stephan "esteel" Stahl
-Programmer
+*Programmer
 
-
 Fabien "H. Reaper" Tschirhart 
-Level Designer
+*Level Designer
 
-
 "Innovati"
-Menu Artist
+*Menu Artist
 
-
 KadaverJack
-Programmer
+*Programmer
 
 MauveBib
-Bot Programmer
+*Bot Programmer
 
-
 Peter "Morphed" Pielak
-2d Artist, Menu Artist
+*2d Artist, Menu Artist
 
-
 Rick "Rat" Kelley
-Lead Animator, Skinner 
+*Lead Animator, Skinner 
 
 Rudolf "div0" Polzer
-Programmer
+*Programmer
 
 Paul "Strahlemann" Evers
-Co-Lead Level Designer
+*Co-Lead Level Designer
 
-
 Gottfried "Toddd" Hofmann
-Sound FX 
+*Sound FX 
 
-
 Marko "Urre" Permanto
-Bot Programmer
+*Bot Programmer
 
-
 Dan "Wazat" Hale
-Programmer
+*Programmer
 
-
 Garth "Zombie" Hendy
-Level Designer
+*Level Designer
 
 
 
+**Thanks:
 
-Thanks:
-
 Gerd "Elysis" Raudenbusch
-
 Qantourisc
-
 Tymo
-
 Spirit
-
 Attila "WW3" Houtkooper
-
 GreEn`mArine
-
 Dan "Digger" Korostelev
-
 Kristian "morfar" Johansson
-
 leileilol
-
 Jody Gallagher
-
 Donkey
-
 Vortex
-
 Juergen "LowDragon" Timm
-
 Sajt
-
 Supajoe
-
 lcatlnx
-
 Zenex
-
 Q1 Retexturing Project
-
 Tomaz
-
 Jitspoe
-
 "Parapraxis"
-
 NoelCower
-
 Brain Younds
-
 Spike
-
 Petithomme
-
 Tei
-
 Munyul
-
 Mathieu "Elric" Olivier
-
 SomeGuy
-
 Lee David Ash
-
 Shank
-
 FrikaC
-
 Dustin Geeraert
-
 Steve Vermeulen
-
 Edgenetwork
-
 Clinton "Kaziganthe" Freeman
-
 Jakob "tZork" Markstrom Grohn
-
 BigMac
-
 Mephisto
-
 michaelb
-
 dstrek
-
 Netzwerg
-
 Ulrich Galbraith
-
 Christian Ice
-
 Wolfgang "Blub\0" Bumiller

Modified: trunk/data/qcsrc/common/util.qc
===================================================================
--- trunk/data/qcsrc/common/util.qc	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/common/util.qc	2008-01-19 09:08:40 UTC (rev 3181)
@@ -234,35 +234,52 @@
 	return sc;
 }
 
-#if 0
-#define DB_BUCKETS 16384
-void db_save(float db, string filename)
+// Databases (hash tables)
+#define DB_BUCKETS 8192
+void db_save(float db, string pFilename)
 {
-	float fh, i;
-	fh = fopen(filename, FILE_WRITE);
+	float fh, i, n;
+	fh = fopen(pFilename, FILE_WRITE);
 	if(fh < 0)
-		error(strcat("Can't write DB to ", filename));
-	for(i = 0; i < DB_BUCKETS; ++i)
+		error(strcat("Can't write DB to ", pFilename));
+	n = buf_getsize(db);
+	fputs(fh, strcat(ftos(DB_BUCKETS), "\n"));
+	for(i = 0; i < n; ++i)
 		fputs(fh, strcat(bufstr_get(db, i), "\n"));
 	fclose(fh);
 }
 
-float db_load(string filename)
+float db_load(string pFilename)
 {
-	float db, fh, i;
+	float db, fh, i, j, n;
 	string l;
 	db = buf_create();
 	if(db < 0)
 		return -1;
-	fh = fopen(filename, FILE_READ);
+	fh = fopen(pFilename, FILE_READ);
 	if(fh < 0)
 		return db;
-	while((l = fgets(fh)))
+	if(stof(fgets(fh)) == DB_BUCKETS)
 	{
-		if(l != "")
-			bufstr_set(db, i, l);
-		++i;
+		i = 0;
+		while((l = fgets(fh)))
+		{
+			if(l != "")
+				bufstr_set(db, i, l);
+			++i;
+		}
 	}
+	else
+	{
+		// different count of buckets?
+		// need to reorganize the database then (SLOW)
+		while((l = fgets(fh)))
+		{
+			n = tokenizebyseparator(l, "\\");
+			for(j = 0; j < n; j += 2)
+				db_put(db, argv(j), argv(j+1));
+		}
+	}
 	fclose(fh);
 	return db;
 }
@@ -272,18 +289,18 @@
 	buf_del(db);
 }
 
-string db_get(float db, string key)
+string db_get(float db, string pKey)
 {
 	float h;
-	h = math_mod(hash(FALSE, key), DB_BUCKETS);
-	return infoget(bufstr_get(db, h), key);
+	h = mod(crc16(FALSE, pKey), DB_BUCKETS);
+	return infoget(bufstr_get(db, h), pKey);
 }
 
-void db_put(float db, string key, string value)
+void db_put(float db, string pKey, string pValue)
 {
 	float h;
-	h = math_mod(hash(FALSE, key), DB_BUCKETS);
-	bufstr_set(db, h, infoadd(bufstr_get(db, h), key, value));
+	h = mod(crc16(FALSE, pKey), DB_BUCKETS);
+	bufstr_set(db, h, infoadd(bufstr_get(db, h), pKey, pValue));
 }
 
 void db_test()
@@ -300,4 +317,36 @@
 	db_close(db);
 	print("CLOSED.\n");
 }
-#endif
+
+// Multiline text file buffers
+float buf_load(string pFilename)
+{
+	float buf, fh, i;
+	string l;
+	buf = buf_create();
+	if(buf < 0)
+		return -1;
+	fh = fopen(pFilename, FILE_READ);
+	if(fh < 0)
+		return buf;
+	i = 0;
+	while((l = fgets(fh)))
+	{
+		bufstr_set(buf, i, l);
+		++i;
+	}
+	fclose(fh);
+	return buf;
+}
+
+void buf_save(float buf, string pFilename)
+{
+	float fh, i, n;
+	fh = fopen(pFilename, FILE_WRITE);
+	if(fh < 0)
+		error(strcat("Can't write buf to ", pFilename));
+	n = buf_getsize(buf);
+	for(i = 0; i < n; ++i)
+		fputs(fh, strcat(bufstr_get(buf, i), "\n"));
+	fclose(fh);
+}

Modified: trunk/data/qcsrc/common/util.qh
===================================================================
--- trunk/data/qcsrc/common/util.qh	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/common/util.qh	2008-01-19 09:08:40 UTC (rev 3181)
@@ -35,3 +35,19 @@
 
 // unzone the string, and return it as tempstring. Safe to be called on string_null
 string fstrunzone(string s);
+
+// database (NOTE: keys are case sensitive)
+void db_save(float db, string filename);
+float db_load(string filename);
+void db_close(float db);
+string db_get(float db, string key);
+void db_put(float db, string key, string value);
+
+// stringbuffer loading/saving
+float buf_load(string filename);
+void buf_save(float buf, string filename);
+
+// modulo function
+#ifndef MENUQC
+float mod(float a, float b) { return a - (floor(a / b) * b); }   
+#endif

Modified: trunk/data/qcsrc/menu/mbuiltin.qc
===================================================================
--- trunk/data/qcsrc/menu/mbuiltin.qc	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/menu/mbuiltin.qc	2008-01-19 09:08:40 UTC (rev 3181)
@@ -249,6 +249,28 @@
 void gecko_resize( string name, float w, float h ) = #492;
 vector gecko_get_texture_extent( string name ) = #493;
 
+//DP_QC_STRINGBUFFERS
+//idea: ??
+//darkplaces implementation: LordHavoc
+//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
+float() buf_create = #440;
+void(float bufhandle) buf_del = #441;
+float(float bufhandle) buf_getsize = #442;
+void(float bufhandle_from, float bufhandle_to) buf_copy = #443;
+void(float bufhandle, float sortpower, float backward) buf_sort = #444;
+string(float bufhandle, string glue) buf_implode = #445;
+string(float bufhandle, float string_index) bufstr_get = #446;
+void(float bufhandle, float string_index, string str) bufstr_set = #447;
+float(float bufhandle, string str, float order) bufstr_add = #448;
+void(float bufhandle, float string_index) bufstr_free = #449;
+
+//DP_QC_CRC16
+//idea: div0
+//darkplaces implementation: div0
+//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
+//When caseinsensitive is set, the CRC is calculated of the lower cased string.
+float(float caseinsensitive, string s, ...) crc16 = #494;
+
 #ifdef FIXEDFOPEN
 float 	fopen( string filename, float mode ) =
 {

Modified: trunk/data/qcsrc/menu-div0test/classes.c
===================================================================
--- trunk/data/qcsrc/menu-div0test/classes.c	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/menu-div0test/classes.c	2008-01-19 09:08:40 UTC (rev 3181)
@@ -61,3 +61,5 @@
 #include "nexuiz/dialog_singleplayer.c"
 #include "nexuiz/campaign.c"
 #include "nexuiz/dialog_singleplayer_winner.c"
+#include "nexuiz/dialog_credits.c"
+#include "nexuiz/credits.c"

Modified: trunk/data/qcsrc/menu-div0test/mbuiltin.qh
===================================================================
--- trunk/data/qcsrc/menu-div0test/mbuiltin.qh	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/menu-div0test/mbuiltin.qh	2008-01-19 09:08:40 UTC (rev 3181)
@@ -102,12 +102,6 @@
 string	strcat(string s1, ...)  = #53;
 string	substring(string s, float start, float length)  = #54;
 
-float(string str, string sub, float startpos) strstrofs = #221;
-float(string s1, string s2, float len) strncmp = #228;
-float(string s1, string s2) strcasecmp = #229;
-float(string s1, string s2, float len) strncasecmp = #230;
-
-
 vector	stov(string s)  = #55;
 
 #ifdef PROFILESTRZONE
@@ -249,6 +243,44 @@
 void gecko_resize( string name, float w, float h ) = #492;
 vector gecko_get_texture_extent( string name ) = #493;
 
+//FTE_STRINGS
+//idea: many
+//darkplaces implementation: KrimZon
+//description:
+//various string manipulation functions
+float(string str, string sub, float startpos) strstrofs = #221;
+float(string str, float ofs) str2chr = #222;
+string(float c, ...) chr2str = #223;
+string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
+string(float chars, string s, ...) strpad = #225;
+string(string info, string key, string value, ...) infoadd = #226;
+string(string info, string key) infoget = #227;
+float(string s1, string s2, float len) strncmp = #228;
+float(string s1, string s2) strcasecmp = #229;
+float(string s1, string s2, float len) strncasecmp = #230;
+
+//DP_QC_STRINGBUFFERS
+//idea: ??
+//darkplaces implementation: LordHavoc
+//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
+float() buf_create = #440;
+void(float bufhandle) buf_del = #441;
+float(float bufhandle) buf_getsize = #442;
+void(float bufhandle_from, float bufhandle_to) buf_copy = #443;
+void(float bufhandle, float sortpower, float backward) buf_sort = #444;
+string(float bufhandle, string glue) buf_implode = #445;
+string(float bufhandle, float string_index) bufstr_get = #446;
+void(float bufhandle, float string_index, string str) bufstr_set = #447;
+float(float bufhandle, string str, float order) bufstr_add = #448;
+void(float bufhandle, float string_index) bufstr_free = #449;
+
+//DP_QC_CRC16
+//idea: div0
+//darkplaces implementation: div0
+//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
+//When caseinsensitive is set, the CRC is calculated of the lower cased string.
+float(float caseinsensitive, string s, ...) crc16 = #494;
+
 #ifdef FIXEDFOPEN
 float 	fopen( string filename, float mode ) =
 {

Modified: trunk/data/qcsrc/menu-div0test/nexuiz/mainwindow.c
===================================================================
--- trunk/data/qcsrc/menu-div0test/nexuiz/mainwindow.c	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/menu-div0test/nexuiz/mainwindow.c	2008-01-19 09:08:40 UTC (rev 3181)
@@ -73,6 +73,12 @@
 		n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 		n.setNexposee(n, i, '0.9 1.2 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
 		n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
+
+		i = spawnNexuizCreditsDialog();
+		i.configureDialog(i);
+		n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+		n.setNexposee(n, i, '0.5 1.2 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
+		n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
 	me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
 	me.moveItemAfter(me, n, NULL);
 

Modified: trunk/data/qcsrc/menu-div0test/skin-customizables.inc
===================================================================
--- trunk/data/qcsrc/menu-div0test/skin-customizables.inc	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/menu-div0test/skin-customizables.inc	2008-01-19 09:08:40 UTC (rev 3181)
@@ -45,6 +45,7 @@
 	SKINVECTOR(COLOR_DIALOG_MAPINFO, '0.7 0.7 1');
 	SKINVECTOR(COLOR_DIALOG_USERBIND, '0.7 0.7 1');
 	SKINVECTOR(COLOR_DIALOG_SINGLEPLAYER, '1 1 0.7');
+	SKINVECTOR(COLOR_DIALOG_CREDITS, '0.7 0.7 1');
 
 	// mouse
 	SKINSTRING(GFX_CURSOR, "cursor");
@@ -81,6 +82,14 @@
 	SKINVECTOR(COLOR_CHECKBOX_F, '1 1 1');
 	SKINVECTOR(COLOR_CHECKBOX_D, '1 1 1');
 
+	// item: credits list
+	SKINVECTOR(COLOR_CREDITS_TITLE, '1 1 1');
+	SKINFLOAT(ALPHA_CREDITS_TITLE, 1);
+	SKINVECTOR(COLOR_CREDITS_FUNCTION, '1 1 1');
+	SKINFLOAT(ALPHA_CREDITS_FUNCTION, 0.7);
+	SKINVECTOR(COLOR_CREDITS_PERSON, '0.7 0.7 1');
+	SKINFLOAT(ALPHA_CREDITS_PERSON, 0.7);
+
 	// item: crosshair button
 	SKINSTRING(GFX_CROSSHAIRBUTTON, "crosshairbutton");
 

Modified: trunk/data/qcsrc/server/cl_client.qc
===================================================================
--- trunk/data/qcsrc/server/cl_client.qc	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/server/cl_client.qc	2008-01-19 09:08:40 UTC (rev 3181)
@@ -404,7 +404,7 @@
 		return s;
 	if(s == 6)
 		return 6;
-	return math_mod(s, 3);
+	return mod(s, 3);
 }
 
 void FixPlayermodel()

Modified: trunk/data/qcsrc/server/clientcommands.qc
===================================================================
--- trunk/data/qcsrc/server/clientcommands.qc	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/server/clientcommands.qc	2008-01-19 09:08:40 UTC (rev 3181)
@@ -457,7 +457,7 @@
 		sprint(self, "^7Maps in list: ");
 		for(i = 0; i < n; ++i)
 		{
-			if(math_mod(i, 2))
+			if(mod(i, 2))
 				col = "^2";
 			else
 				col = "^3";

Modified: trunk/data/qcsrc/server/extensions.qh
===================================================================
--- trunk/data/qcsrc/server/extensions.qh	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/server/extensions.qh	2008-01-19 09:08:40 UTC (rev 3181)
@@ -1540,6 +1540,9 @@
 float(string s1, string s2, float len) strncasecmp = #230;
 
 //DP_QC_STRINGBUFFERS
+//idea: ??
+//darkplaces implementation: LordHavoc
+//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
 float() buf_create = #460;
 void(float bufhandle) buf_del = #461;
 float(float bufhandle) buf_getsize = #462;
@@ -1550,4 +1553,10 @@
 void(float bufhandle, float string_index, string str) bufstr_set = #467;
 float(float bufhandle, string str, float order) bufstr_add = #468;
 void(float bufhandle, float string_index) bufstr_free = #469;
-float(float caseinsensitive, string s, ...) hash = #487;
+
+//DP_QC_CRC16
+//idea: div0
+//darkplaces implementation: div0
+//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
+//When caseinsensitive is set, the CRC is calculated of the lower cased string.
+float(float caseinsensitive, string s, ...) crc16 = #494;

Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/server/g_world.qc	2008-01-19 09:08:40 UTC (rev 3181)
@@ -483,7 +483,7 @@
 		for(i = 1; i < Map_Count; ++i)
 		{
 			float mapindex;
-			mapindex = math_mod(i + Map_Current, Map_Count);
+			mapindex = mod(i + Map_Current, Map_Count);
 			if(Map_Check(mapindex, pass))
 				return mapindex;
 		}
@@ -507,7 +507,7 @@
 	for(i = 0; i <= imax; ++i)
 	{
 		float mapindex;
-		mapindex = math_mod(Map_Current + ceil(random() * (Map_Count - 1)), Map_Count); // any OTHER map
+		mapindex = mod(Map_Current + ceil(random() * (Map_Count - 1)), Map_Count); // any OTHER map
 		if(Map_Check(mapindex, 1))
 			return mapindex;
 	}
@@ -1984,7 +1984,7 @@
 			{
 				tmp = mapvote_maps[i];
 				tmp = strpad(mapvote_maxlen, tmp);
-				tmp = strcat(ftos(math_mod(i + 1, 10)), ": ", tmp);
+				tmp = strcat(ftos(mod(i + 1, 10)), ": ", tmp);
  				if(mapvote_detail)
  				{
  					tmp = strcat(tmp, " ^2(", ftos(mapvote_votes[i]), " vote");

Modified: trunk/data/qcsrc/server/keyhunt.qc
===================================================================
--- trunk/data/qcsrc/server/keyhunt.qc	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/server/keyhunt.qc	2008-01-19 09:08:40 UTC (rev 3181)
@@ -458,7 +458,7 @@
 	if(self.owner)
 	{
 #ifndef KH_PLAYER_USE_ATTACHMENT
-		makevectors('0 1 0' * (self.cnt + math_mod(time, 360) * KH_KEY_XYSPEED));
+		makevectors('0 1 0' * (self.cnt + mod(time, 360) * KH_KEY_XYSPEED));
 		setorigin(self, v_forward * KH_KEY_XYDIST + '0 0 1' * self.origin_z);
 #endif
 

Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/server/miscfunctions.qc	2008-01-19 09:08:40 UTC (rev 3181)
@@ -168,11 +168,6 @@
 	}
 }
 
-float math_mod(float a, float b)
-{
-	return a - (floor(a / b) * b);
-}
-
 void relocate_spawnpoint()
 {
 	// nudge off the floor

Modified: trunk/data/qcsrc/server/runematch.qc
===================================================================
--- trunk/data/qcsrc/server/runematch.qc	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/server/runematch.qc	2008-01-19 09:08:40 UTC (rev 3181)
@@ -171,7 +171,7 @@
 		rune = find(rune, classname, "rune");
 	}
 
-	ang_y = rnum*(360 / rcount) + math_mod(time, 360)*45;//180;
+	ang_y = rnum*(360 / rcount) + mod(time, 360)*45;//180;
 
 	makevectors(ang);
 

Modified: trunk/data/qcsrc/server/t_jumppads.qc
===================================================================
--- trunk/data/qcsrc/server/t_jumppads.qc	2008-01-19 07:56:55 UTC (rev 3180)
+++ trunk/data/qcsrc/server/t_jumppads.qc	2008-01-19 09:08:40 UTC (rev 3181)
@@ -137,7 +137,7 @@
 					found = TRUE;
 			if(!found)
 			{
-				other.(jumppadsused[math_mod(other.jumppadcount, NUM_JUMPPADSUSED)]) = self;
+				other.(jumppadsused[mod(other.jumppadcount, NUM_JUMPPADSUSED)]) = self;
 				other.jumppadcount = other.jumppadcount + 1;
 			}
 		}




More information about the nexuiz-commits mailing list