MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / FileNameHash

Method FileNameHash

neo/idlib/Str.cpp:716–736  ·  view source on GitHub ↗

============ idStr::FileNameHash ============ */

Source from the content-addressed store, hash-verified

714============
715*/
716int idStr::FileNameHash( void ) const {
717 int i;
718 int hash;
719 char letter;
720
721 hash = 0;
722 i = 0;
723 while( data[i] != '\0' ) {
724 letter = idStr::ToLower( data[i] );
725 if ( letter == '.' ) {
726 break; // don't include extension
727 }
728 if ( letter =='\\' ) {
729 letter = '/';
730 }
731 hash += (int)(letter)*(i+119);
732 i++;
733 }
734 hash &= (FILE_HASH_SIZE-1);
735 return hash;
736}
737
738/*
739============

Callers 4

AllocImageMethod · 0.80
ImageFromFunctionMethod · 0.80
ImageFromFileMethod · 0.80
GetImageMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected