Image Asset: Difference between revisions
Aerosoul94 (talk | contribs) No edit summary |
No edit summary |
||
| (10 intermediate revisions by 2 users not shown) | |||
| Line 7: | Line 7: | ||
[[Category:MW3]] | [[Category:MW3]] | ||
[[Category:BO2]] | [[Category:BO2]] | ||
[[Category:BO3]] | |||
[[Category:Ghosts]] | [[Category:Ghosts]] | ||
[[Category:AW]] | |||
== Call of Duty 4 & World at War == | == Call of Duty 4 & World at War == | ||
<source lang="cpp"> | <source lang="cpp"> | ||
| Line 24: | Line 24: | ||
char levelCount; | char levelCount; | ||
char flags; | char flags; | ||
short dimensions[3]; | |||
_D3DFormat format; | _D3DFormat format; | ||
GfxTexture texture; | GfxTexture texture; | ||
| Line 39: | Line 39: | ||
#ifdef PS3 | #ifdef PS3 | ||
CellGcmTexture texture; // size = 0x18 | CellGcmTexture texture; // size = 0x18 | ||
#elif defined | #elif defined XBOX | ||
GfxTextureLoad texture; | GfxTextureLoad texture; | ||
#endif | #endif | ||
| Line 55: | Line 55: | ||
const char *name; | const char *name; | ||
}; | }; | ||
</source> | </source> | ||
NOTE: In the zone file, if the streaming is set as true, then data is loaded at the end of the zone file. | NOTE: In the zone file, if the streaming is set as true, then data is loaded at the end of the zone file. | ||
| Line 89: | Line 87: | ||
}; | }; | ||
</source> | </source> | ||
== Modern Warfare 2 & 3 & Ghosts == | == Modern Warfare 2 & 3 & Ghosts & Advanced Warfare == | ||
On Xbox 360 in the GfxTexture, the Common is either 0x03000000 or simply 3. A Common value of 0x03000000 implies that an endian swap (8IN32) needs to be performed on the entire GfxTexture. A value of 3 is the correct value. | |||
<source lang="cpp"> | <source lang="cpp"> | ||
struct CardMemory | |||
{ | |||
int platform[1]; | |||
}; | |||
union GfxTexture | union GfxTexture | ||
{ | { | ||
#ifdef _XBOX //size = 0x34 | |||
D3DBaseTexture basemap; | |||
D3DTexture map; | |||
D3DVolumeTexture volmap; | |||
D3DCubeTexture cubemap; | |||
#elif defined(PS3) //size = 0x18 | |||
CellGcmTexture texture; // size = 0x18 | |||
#endif | |||
}; | }; | ||
struct GfxImage | struct GfxImage | ||
{ | { | ||
GfxTexture texture; | |||
#ifdef _XBOX | |||
# | char unknown[4]; | ||
#endif | #endif | ||
char mapType; | |||
char semantic; | |||
char category; | |||
char flags; | |||
CardMemory cardMemory; | |||
unsigned __int16 width; | |||
unsigned __int16 height; | |||
unsigned __int16 depth; | |||
char mipmap; | char mipmap; | ||
bool streaming; | |||
char *pixels; | |||
char unknownData[0x20]; | |||
const char *name; | |||
}; | }; | ||
</source> | </source> | ||
NOTE: In the zone file, if streaming is set as true, then data will be found in [[:Modern Warfare PAK Files|PAK files]]. | NOTE: In the zone file, if streaming is set as true, then data will be found in [[:Modern Warfare PAK Files|PAK files]]. | ||
== Black Ops 2 == | == Black Ops 2 == | ||
<source lang="cpp"> | <source lang="cpp"> | ||
struct GfxImage | struct GfxImage | ||
{ | { | ||
#ifdef PS3 | |||
char unknown1[6]; | char unknown1[6]; | ||
CellGcmTexture texture; // modified, missing 10 bytes, size = 0xE | CellGcmTexture texture; // modified, missing 10 bytes, size = 0xE | ||
#elif defined (_XBOX) | |||
D3DBaseTexture basemap;//size = 0x34 | |||
#endif | #endif | ||
char mapType; | |||
char unknown3; | char unknown3; | ||
char unknown4; | char unknown4; | ||
char unknown5; | char unknown5; | ||
int size; | int size; | ||
unsigned __int16 width; | |||
unsigned __int16 height; | |||
unsigned __int16 depth; | |||
char | char levelCount; | ||
char streaming; | |||
unsigned int baseSize; | |||
char *pixels; | |||
char unknownData2[0x7C]; | |||
char streamedPartCount; | |||
const char *name; | |||
unsigned int hash; | |||
}; | }; | ||
</source> | |||
== Black Ops 3 == | |||
Black Ops 3 is the first game in the series so far to restructure the GfxImage asset. It appears that the major elements are still there, but are arranged in a more logical way. For instance name now appears at the beginning of the asset instead of the end. Note that this structure is from Xbox 360, and the other systems aren't reflected here yet. | |||
<source lang="cpp"> | |||
struct GfxImagePixels | |||
{ | |||
char * a;//Size = (flags >> 22) & 0xFFFFFF; | |||
} | |||
typedef char GfxStreamedPartInfo; | |||
struct GfxImage | |||
{ | |||
const char * name; | |||
D3DBaseTexture basemap; | |||
unsigned __int64 flags; //Not sure on the name. Size is clearly loaded from here for both pointers, and so is a flag. So not sure here. | |||
int unknown1[2]; //Most likely streaming, width, height and depth are all somewhere in here | |||
GfxImagePixels pixels; | |||
int unknown2[2]; | |||
GfxStreamedPartInfo * streamingPartInfo; //This will probably be important for reading images that are stored in pak files. Size = ((flags >> 19) << 5) & 0x60 //This should be right | |||
} | |||
</source> | </source> | ||
Latest revision as of 21:11, 2 November 2015
Call of Duty 4 & World at War
union GfxTexture
{
D3DBaseTexture *basemap;
D3DTexture *map;
D3DVolumeTexture *volmap; // if GfxImageLoadDef::flags & 8
D3DCubeTexture *cubemap; // if GfxImageLoadDef::flags & 4
};
struct GfxImageLoadDef
{
char levelCount;
char flags;
short dimensions[3];
_D3DFormat format;
GfxTexture texture;
};
struct GfxTextureLoad
{
GfxImageLoadDef *loadDef;
};
struct GfxImage
{
MapType mapType;
#ifdef PS3
CellGcmTexture texture; // size = 0x18
#elif defined XBOX
GfxTextureLoad texture;
#endif
CardMemory cardMemory;
int size;
unsigned short width;
unsigned short height;
unsigned short depth;
char category;
bool streaming;
char *data;
#ifdef XBOX360
char unknown[8];
#endif
const char *name;
};NOTE: In the zone file, if the streaming is set as true, then data is loaded at the end of the zone file.
Black Ops
union GfxTexture
{
char *data;
struct
{
char unknown[0x3C];
};
};
struct GfxImage
{
#ifdef PS3
CellGcmTexture texture; // size = 0x18
#endif
char unknown1;
char unknown2;
char unknown3;
char unknown4;
int size;
unsigned short height;
unsigned short width;
unsigned short depth;
char unknown[6];
GfxTexture textureDef;
const char *name;
int hash;
};Modern Warfare 2 & 3 & Ghosts & Advanced Warfare
On Xbox 360 in the GfxTexture, the Common is either 0x03000000 or simply 3. A Common value of 0x03000000 implies that an endian swap (8IN32) needs to be performed on the entire GfxTexture. A value of 3 is the correct value.
struct CardMemory
{
int platform[1];
};
union GfxTexture
{
#ifdef _XBOX //size = 0x34
D3DBaseTexture basemap;
D3DTexture map;
D3DVolumeTexture volmap;
D3DCubeTexture cubemap;
#elif defined(PS3) //size = 0x18
CellGcmTexture texture; // size = 0x18
#endif
};
struct GfxImage
{
GfxTexture texture;
#ifdef _XBOX
char unknown[4];
#endif
char mapType;
char semantic;
char category;
char flags;
CardMemory cardMemory;
unsigned __int16 width;
unsigned __int16 height;
unsigned __int16 depth;
char mipmap;
bool streaming;
char *pixels;
char unknownData[0x20];
const char *name;
};NOTE: In the zone file, if streaming is set as true, then data will be found in PAK files.
Black Ops 2
struct GfxImage
{
#ifdef PS3
char unknown1[6];
CellGcmTexture texture; // modified, missing 10 bytes, size = 0xE
#elif defined (_XBOX)
D3DBaseTexture basemap;//size = 0x34
#endif
char mapType;
char unknown3;
char unknown4;
char unknown5;
int size;
unsigned __int16 width;
unsigned __int16 height;
unsigned __int16 depth;
char levelCount;
char streaming;
unsigned int baseSize;
char *pixels;
char unknownData2[0x7C];
char streamedPartCount;
const char *name;
unsigned int hash;
};Black Ops 3
Black Ops 3 is the first game in the series so far to restructure the GfxImage asset. It appears that the major elements are still there, but are arranged in a more logical way. For instance name now appears at the beginning of the asset instead of the end. Note that this structure is from Xbox 360, and the other systems aren't reflected here yet.
struct GfxImagePixels
{
char * a;//Size = (flags >> 22) & 0xFFFFFF;
}
typedef char GfxStreamedPartInfo;
struct GfxImage
{
const char * name;
D3DBaseTexture basemap;
unsigned __int64 flags; //Not sure on the name. Size is clearly loaded from here for both pointers, and so is a flag. So not sure here.
int unknown1[2]; //Most likely streaming, width, height and depth are all somewhere in here
GfxImagePixels pixels;
int unknown2[2];
GfxStreamedPartInfo * streamingPartInfo; //This will probably be important for reading images that are stored in pak files. Size = ((flags >> 19) << 5) & 0x60 //This should be right
}