vtex_idx - themeldingwars/Documentation GitHub Wiki

Virtual texture index

010 Editor Templates

Image Info Hashes

Each imageinfo entry contains three hashes, each pointing to a different texture file.

public static uint GenerateHash(int textureAssetId)
{
	string str = textureAssetId.ToString().PadLeft(8, '0');
	str = str.Substring(0, str.Length - 3) + "000" + "\\" + str;
	byte[] bytes = Encoding.ASCII.GetBytes(str);

	uint hash = 0;
	foreach (byte b in bytes)
	{
		hash = (hash << 7) | (hash >> (32 - 7));
		hash += b;
	}
	return hash;
}

// assault
uint h1 = GenerateHash(113473);
uint h2 = GenerateHash(113475);
uint h3 = GenerateHash(113476);