WTD
Материал из GTAModding.ru
Версия от 08:26, 13 июля 2009; Dageron (обсуждение | вклад)
WTD - Windows Texture Dictionary
Формат ПК-текстур GTA 4. Работа с ними поддерживается в OpenIV, SparkIV и G-Texture.
На Xbox360 текстуры имели формат XTD - XENON Texture Dictionary. Просмотр был реализован в ранних версиях OpenIV и SparkIV, но не поддерживается публичными вариантами.
Вывод структуры в 010 Editor
//--- 010 Editor v3.0.5 Binary Template // File: wtd.bt // Version: 0.1 beta // Author: Dageron // Site: www.GTAModding.ru //-------------------------------------- // Based on: //http://public.sannybuilder.com/GTA4/rsc_en.txt //http://gtaivtools.googlecode.com/ //-------------------------------------- //Simple function to get offset typedef int GetOffset <read=GetOffsetRead>; string GetOffsetRead(GetOffset f) { string s; SPrintf( s, "%i", f & 0x0fffffff); return s; } //-------------------------------------- struct GTA_Windows_Texture { LittleEndian(); struct pgDictionary { SetBackColor( cLtGreen ); int VTable; GetOffset BlockMapOffset; int ParentDictionary; int UsageCount; GetOffset HashTableOffset; short TextureCount; short TextureCount2; GetOffset TextureListOffset; short TextureCount3; short TextureCount4; SetBackColor( cLtGray ); struct { int zero; local int zero1 = 1; while (zero1=1) //Getting info to grcTexturePC offset { int zero2; if (zero2==0) break; zero1 = zero2; } } BlockMap; } header; FSeek(FTell()-8); SetBackColor(cLtYellow); struct { struct { uint VTable; GetOffset BlockMapOffset; uint Unknown1; uint Unknown2; uint Unknown3; GetOffset m_pszTextureName; //pointer to texture filename uint Unknown4; ushort m_wWidth; //texture width (edge length for cube texture) ushort m_wHeight; SetBackColor(cLtGreen); //texture height byte m_pixelFormat[4]; SetBackColor(cLtYellow); //texture pixel format byte m_nbLevels[4]; //number of levels in the texture float UnknownFloat1; float UnknownFloat2; float UnknownFloat3; float UnknownFloat4; float UnknownFloat5; float UnknownFloat6; GetOffset m_pPrev; //PrevTextureInfoOffset GetOffset m_pNext; //NextTextureInfoOffset GetOffset RawDataOffset; uint Unknown6; /* //Getting texture name - first variant - should work but can cause problems. local int currentpos = FTell(); FSeek(m_pszTextureName & 0x0fffffff); string Name; FSeek(currentpos); */ } grcTexturePC [header.TextureCount]; /* //Getting texture name - second variant - works, but texture names are not in right order. struct { string Name; } TextureName [ header.TextureCount ]; } TextureInfo; */ }dictionary;