WBK: Added info on string hashing algorithm

This commit is contained in:
NicknineTheEagle 2022-02-19 21:45:40 +03:00
parent 3515644d73
commit 218374c8d6

View File

@ -1,5 +1,6 @@
#include "meta.h" #include "meta.h"
#include "../coding/coding.h" #include "../coding/coding.h"
//#include <ctype.h>
/* .WBK - seen in some Treyarch games [Spider-Man 2, Ultimate Spider-Man, Call of Duty 2: Big Red One] */ /* .WBK - seen in some Treyarch games [Spider-Man 2, Ultimate Spider-Man, Call of Duty 2: Big Red One] */
VGMSTREAM* init_vgmstream_wbk(STREAMFILE* sf) { VGMSTREAM* init_vgmstream_wbk(STREAMFILE* sf) {
@ -154,6 +155,19 @@ fail:
return NULL; return NULL;
} }
/* Ultimate Spider-Man string hashing algorithm, for reference */
#if 0
static uint32_t wbk_hasher(const char* input) {
uint32_t hash = 0;
for (const char* ch = input; *ch; ch++) {
hash += hash*32 + tolower(*ch);
}
return hash;
}
#endif
/* .WBK - evolution of the above Treyarch bank format [Call of Duty 3] */ /* .WBK - evolution of the above Treyarch bank format [Call of Duty 3] */
VGMSTREAM* init_vgmstream_wbk_nslb(STREAMFILE* sf) { VGMSTREAM* init_vgmstream_wbk_nslb(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL; VGMSTREAM* vgmstream = NULL;