Glenn Maynard
508aaa2857
remove unused
2006-10-18 20:02:26 +00:00
Glenn Maynard
f7f21e2b8c
Replace PRNG with a standard MT.
...
RandomGen r; r(); now generates [0,2^31-1] on 32-bit platforms,
not [0,2^31-2]. No longer uses MAX_INT, so the default behavior
doesn't depend on the size of an int.
RandomInt no longer generates a float and truncates it. That
limited the values that could be returned to those that fit in
a 32-bit float.
Remove NR code. It's not free.
This code is not threadsafe. Locking access would kill performance.
The old code wasn't, either. I think most symptoms would be
innocuous enough to not worry about.
2006-10-18 02:28:06 +00:00
Glenn Maynard
08ca0d7721
hide RandomFloat(seed) interface
...
hide randseed
2006-10-18 01:46:15 +00:00
Glenn Maynard
82be487b07
iiiii
2006-10-17 22:24:16 +00:00
Glenn Maynard
dfaaa18a03
s[s.size()] is probably always going to work, but probably isn't actually valid
2006-10-17 21:41:55 +00:00
Glenn Maynard
27524421e1
don't use backslashes in redirs
2006-10-15 06:44:39 +00:00
Glenn Maynard
30fd6d77b4
maybe workaround g++ 3.3 weirdness
2006-10-07 08:56:12 +00:00
Glenn Maynard
d882f21348
make ToString and FromString templates
2006-10-07 06:21:39 +00:00
Glenn Maynard
e91a806b37
remove LuaFunctions.h
2006-09-29 09:54:50 +00:00
Glenn Maynard
0e6a779446
linux fixup
2006-09-18 23:17:28 +00:00
Glenn Maynard
6e3d48a3d9
Remove MAX_FMT_TRIES. I don't know why it was there.
2006-09-18 23:15:22 +00:00
Glenn Maynard
d8821cebab
strings passed to assign do not need to be null-terminated
2006-09-18 23:13:36 +00:00
Glenn Maynard
fc3506ac1e
move code into RageUtil
2006-09-18 23:08:43 +00:00
Glenn Maynard
d7e5ea675f
split windows-specific stuff out of RageUtil
2006-09-18 22:31:29 +00:00
Glenn Maynard
fba01c798c
split directx-specific stuff out of RageUtil
2006-09-18 22:20:54 +00:00
Glenn Maynard
8310c83f1a
RelBuf -> ReleaseBuffer
2006-09-18 21:46:40 +00:00
Glenn Maynard
8ad2856209
GetBuf -> GetBuffer
2006-09-18 21:46:39 +00:00
Glenn Maynard
76b7307c73
remove unused
2006-09-18 20:14:28 +00:00
Steve Checkoway
6ea2a41b00
Cleanup RageException::Throw(). Do not use ssprintf() inside of Throw() and do not pass it bare error messages. Use RageException::Throw( "%s", sError.c_str() ); instead. Be consistent with quoting file names "%s" and theme metrics as "%s : %s". Try to make them complete English sentences when possible.
2006-09-17 01:19:19 +00:00
Steve Checkoway
dc98ba4190
StringToFloat overload. Returns true if the entire string is a valid, finite float.
2006-09-02 23:26:07 +00:00
Steve Checkoway
df9d1f13b1
Allow calculation of a better estimator (still not quite unbiased) for the population standard deviation from a sample. The result will be slightly too low still, but not by very much.
2006-08-19 20:43:43 +00:00
Glenn Maynard
beef1efa87
partial ARRAYSIZE -> ARRAYLEN
2006-08-08 18:57:00 +00:00
Glenn Maynard
47e601cd4a
unrelated comment
2006-08-02 04:21:54 +00:00
Steve Checkoway
a07e194cf1
Revert. Fixes Linux build.
2006-07-18 05:51:37 +00:00
Jason Felds
366c3440d4
Fix VC8 macro redef warning. (more to come)
2006-07-18 03:56:37 +00:00
Steve Checkoway
d2429cb63b
Fix standard deviation calculation. This could probably be done using accumulate, multiplies, minus, bind2nd, distance, and compose2, but that's probably less clear.
...
Something like
float fMean = calc_mean( pStart, pEnd );
return sqrtf( accumulate(pStart, pEnd, 0.0f, compose2(multiplies<float>(), bind2nd(minus<float>(), fMean), bind2nd(minus<float>(), fMean))) / distance(pStart, pEnd) );
These are easily templated too, if necessary.
2006-07-08 07:49:42 +00:00
Steve Checkoway
d2d24ceb4b
Cleanup.
2006-06-26 11:36:10 +00:00
Chris Danford
cee1f2205c
hex <-> binary format string changes from Steve
2006-06-25 05:56:41 +00:00
Chris Danford
37db209bc9
hex <-> binary format string changes from Steve
2006-06-25 05:30:36 +00:00
Chris Danford
304d4c33ae
add HexToBinary, move to RageUtil
2006-06-25 04:21:58 +00:00
Chris Danford
b44ad7a4e0
preserve language name case in file name if LanguageInfo not available
2006-06-24 16:57:39 +00:00
Glenn Maynard
f0b7631e3a
use standard name "isfinite", not "finite"
2006-06-15 03:15:41 +00:00
Chris Danford
c7124728e0
move song finding to SongUtil
2006-06-13 03:51:18 +00:00
Chris Danford
8a0d3db8dc
isfinite -> finite
2006-06-12 22:34:52 +00:00
Steve Checkoway
4dbf1d44ae
Have FromString report failure when it read NaN or INF.
2006-06-12 07:58:54 +00:00
Steve Checkoway
a45880281a
Wrap strtof. Return 0 on nonfinite values.
2006-06-12 06:36:36 +00:00
Glenn Maynard
7e2fd6296a
fix conversion
2006-04-24 16:46:55 +00:00
Glenn Maynard
f0fd06f92c
add ConvertCodepageToWString, ConvertACPToUTF8
...
change ConvertWstringToACP -> ConvertWstringToCodepage
2006-04-04 23:38:09 +00:00
Chris Danford
865dcb072b
remove unnecessary CLAMP in RandomGen
2006-03-28 21:52:10 +00:00
Chris Danford
f9d50da5e1
cleanup for easier debugging
2006-03-28 19:15:44 +00:00
Glenn Maynard
514dd69f13
temp revert: this returns [0,n), not [0,n] (fixes crashes)
2006-03-28 12:47:54 +00:00
Chris Danford
6d865d4762
fix RandomGen off by 1. Was retruning.[0,max), not [0,max]. (Caused random courseEntries to never pick the last song in the list)
2006-03-27 21:55:34 +00:00
Glenn Maynard
6b24dd0309
cleanup
2006-03-26 06:09:12 +00:00
Steve Checkoway
5d9ab0982b
Fix warnings about possibly being used uninitialized.
2006-03-20 06:09:00 +00:00
Glenn Maynard
579d797374
don't assert on invalid text
2006-03-03 05:27:07 +00:00
Glenn Maynard
89d26b20ae
bind case changing
2006-03-03 02:08:46 +00:00
Glenn Maynard
f9f990f590
support UTF-8 through ISO-8859-1 in MakeUpper, MakeLower, Capitalize
2006-03-01 02:45:42 +00:00
Glenn Maynard
3d86168ebb
g_Uptab -> g_UpperCase
2006-03-01 01:04:02 +00:00
Glenn Maynard
d151beec27
g_Uptab values for ISO-8859-1
2006-03-01 00:26:07 +00:00
Glenn Maynard
26e8fbd0ae
detach uptab from char_traits_char_nocase
2006-03-01 00:24:25 +00:00