Separate object layers, asign layers to proper slots
This commit is contained in:
20
engine/breeze/utils/string.h
Normal file
20
engine/breeze/utils/string.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef BREEZE_STRING_H
|
||||
#define BREEZE_STRING_H
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
typedef u32 BzStringHashFunc(const char *str);
|
||||
|
||||
// djb2 hash algorithm
|
||||
// From: https://stackoverflow.com/questions/7666509/hash-function-for-string
|
||||
// http://www.cse.yorku.ca/~oz/hash.html
|
||||
static u32 bzStringDefaultHash(const char *str) {
|
||||
u32 hash = 5381;
|
||||
int c;
|
||||
while ((c = (int) *str++)) {
|
||||
hash = ((hash << 5) + hash) + c; /* hash + 33 + c */
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
#endif //BREEZE_STRING_H
|
||||
Reference in New Issue
Block a user