r7979 - trunk/darkplaces

divverent at icculus.org divverent at icculus.org
Fri Jan 18 20:46:58 EST 2008


Author: divverent
Date: 2008-01-18 20:46:58 -0500 (Fri, 18 Jan 2008)
New Revision: 7979

Modified:
   trunk/darkplaces/prvm_cmds.c
   trunk/darkplaces/prvm_cmds.h
   trunk/darkplaces/svvm_cmds.c
Log is attached.
Fix bug in stringbuffers with bufstr_set not updating num_strings; add a new builtin for QC called float hash(float caseinsensitive, string str) that returns the CRC of the string (possibly after lowercasing). Using this, a persistent database can be implemented quite efficiently (for a 1MB database file, it takes about 0.1 seconds to load and 0.3 seconds to save, which is quite acceptable). From QC, I use a string buffer of 16384 strings, indexed by hash of the key, containing an info string at each index to solve the collision issue. Possibly add hash() to the stringbuffer DP extension, or make a new extension for it?


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 20080119.014658.diff
URL: <http://icculus.org/pipermail/twilight-commits/attachments/20080118/6d89387c/attachment.diff>


More information about the twilight-commits mailing list