Fixed font atlas, feature completed garbage collection, and fix math.
This commit is contained in:
@@ -1795,23 +1795,23 @@ namespace ehs
|
||||
return result;
|
||||
}
|
||||
|
||||
/// A 32-bit FNV-1a hash algorithm.
|
||||
/// @param [in] str The string to hash.
|
||||
/// @returns The resulting hash. Zero if string does not contain any characters.
|
||||
static UInt_32 Hash_32(const Str<T, N>& str)
|
||||
{
|
||||
/// A 32-bit FNV-1a hash algorithm.
|
||||
/// @param [in] str The string to hash.
|
||||
/// @returns The resulting hash. Zero if string does not contain any characters.
|
||||
static UInt_32 Hash_32(const Str<T, N>& str)
|
||||
{
|
||||
if (!str.Size())
|
||||
return 0;
|
||||
|
||||
const Byte* const bytes = str.ToBytes();
|
||||
const Byte* const bytes = str.ToBytes();
|
||||
|
||||
UInt_32 hash = 2166136261ul;
|
||||
UInt_32 hash = 2166136261ul;
|
||||
|
||||
for (N i = 0; i < str.Size(true); ++i)
|
||||
hash = (hash ^ bytes[i]) * 16777619;
|
||||
for (N i = 0; i < str.Size(true); ++i)
|
||||
hash = (hash ^ bytes[i]) * 16777619;
|
||||
|
||||
return hash;
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
/// A 32-bit FNV-1a hash algorithm.
|
||||
/// @returns The resulting hash. Zero if string does not contain any characters.
|
||||
@@ -1830,23 +1830,23 @@ namespace ehs
|
||||
return hash;
|
||||
}
|
||||
|
||||
/// A 64-bit FNV-1a hash algorithm.
|
||||
/// @param [in] str The string to hash.
|
||||
/// A 64-bit FNV-1a hash algorithm.
|
||||
/// @param [in] str The string to hash.
|
||||
/// @returns The resulting hash. Zero if string does not contain any characters.
|
||||
static UInt_64 Hash_64(const Str<T, N>& str)
|
||||
{
|
||||
static UInt_64 Hash_64(const Str<T, N>& str)
|
||||
{
|
||||
if (!str.Size())
|
||||
return 0;
|
||||
|
||||
const Byte* const bytes = str.ToBytes();
|
||||
const Byte* const bytes = str.ToBytes();
|
||||
|
||||
UInt_64 hash = 14695981039346656037ull;
|
||||
UInt_64 hash = 14695981039346656037ull;
|
||||
|
||||
for (N i = 0; i < str.Size(true); ++i)
|
||||
hash = (hash ^ bytes[i]) * 1099511628211;
|
||||
for (N i = 0; i < str.Size(true); ++i)
|
||||
hash = (hash ^ bytes[i]) * 1099511628211;
|
||||
|
||||
return hash;
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
/// A 64-bit FNV-1a hash algorithm.
|
||||
/// @returns The resulting hash. Zero if string does not contain any characters.
|
||||
|
Reference in New Issue
Block a user