mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-06 11:34:15 -04:00
* adding animdata loader * utility methods, more tests, export record struct - added methods for fps and frame duration calculation to the AnimationDataRecord - exported AnimationDataRecord - split the various structs into their own files - added getter methods for retrieving records by name - added tests for the new utility methods
19 lines
290 B
Go
19 lines
290 B
Go
package d2animdata
|
|
|
|
import "strings"
|
|
|
|
type hashTable [numBlocks]byte
|
|
|
|
func hashName(name string) byte {
|
|
hashBytes := []byte(strings.ToUpper(name))
|
|
|
|
var hash uint32
|
|
for hashByteIdx := range hashBytes {
|
|
hash += uint32(hashBytes[hashByteIdx])
|
|
}
|
|
|
|
hash %= numBlocks
|
|
|
|
return byte(hash)
|
|
}
|