Просмотры
WTD
Материал из GTAModding.ru
(Перенаправлено с XTD)
| Версия объекта: | |||
|---|---|---|---|
| Расширение файла: | |||
| Содержащийся объект: |
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// Author: Dageron// Site: www.GTAModding.ru//--------------------------------------// Based on://http://public.sannybuilder.com/GTA4/rsc_en.txt//http://gtaivtools.googlecode.com///--------------------------------------//Simple function to get offsettypedef int GetOffset <read=GetOffsetRead>;
string GetOffsetRead(GetOffset f)
{string s;if (f == 0) s="0";
elseif (f >> 28 != 5) s="0"; //wrong offset
elseSPrintf( s, "%i", f & 0x0fffffff);
return s;
}//--------------------------------------struct GTA_Windows_Texture {
LittleEndian();
struct pgDictionary{SetBackColor( cLtGreen );
int VTable;
GetOffset BlockMapOffset;int ParentDictionary; // always 0 in file
int UsageCount; // always 1 in file
GetOffset HashTableOffset;short TextureCount;
short TextureCount2;
GetOffset TextureListOffset;short TextureCount3;
short TextureCount4;
FSeek(BlockMapOffset & 0x0fffffff);
SetBackColor( cLtGray );
struct{int zero;
` byte padding[524];
} BlockMap;
}Header;
struct{FSeek(Header.HashTableOffset & 0x0fffffff);
SetBackColor( cLtGreen );
local int i;
local int total = 16-(Header.TextureCount*4%16);
for(i = 0; i < Header.TextureCount; i++ )
{uint Hash;}SetBackColor( cLtGray ); byte padding1[total]; SetBackColor( cLtGreen );
}HashTable;
struct{FSeek(Header.TextureListOffset & 0x0fffffff);
SetBackColor( cLtGreen );
local int i;
local int total = 16-(Header.TextureCount*4%16);
for(i = 0; i < Header.TextureCount; i++ )
{GetOffset InfoOffsets;}SetBackColor( cLtGray ); byte padding1[total]; SetBackColor( cLtGreen );
}TextureListTable;
struct{local int i;
for(i = 0; i < Header.TextureCount; i++ )
{FSeek(TextureListTable.InfoOffsets[i]& 0x0fffffff);
SetBackColor(cLtYellow);
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
short m_BytesPerLine; //number of bytes per pixel line
byte m_TextureType; //texture type: 1 - cube texture, 2 - volume texture, other - regular texture
byte m_nbLevels; //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
int RawDataOffset;
uint Unknown6;}TextureInfo;
}for(i = 0; i < Header.TextureCount; i++ )
{FSeek(TextureInfo[i].m_pszTextureName& 0x0fffffff);
SetBackColor( cLtGreen );
struct {
string Name;SetBackColor(cLtYellow);
}TextureName;
}}grcTexturePC;
}dictionary;


