Fix gfximage struct

This commit is contained in:
fed 2023-03-10 16:52:18 +01:00
parent 19ae2fdf65
commit 362674812a
2 changed files with 63 additions and 31 deletions

View File

@ -60,8 +60,10 @@ namespace images
return false; return false;
} }
image->imageFormat = 0x1000003; image->mapType = game::MAPTYPE_2D;
image->resourceSize = -1; image->semantic = 2;
image->category = 3;
image->flags = 0;
D3D11_SUBRESOURCE_DATA data{}; D3D11_SUBRESOURCE_DATA data{};
data.SysMemPitch = raw_image->get_width() * 4; data.SysMemPitch = raw_image->get_width() * 4;
@ -69,7 +71,7 @@ namespace images
data.pSysMem = raw_image->get_buffer(); data.pSysMem = raw_image->get_buffer();
game::Image_Setup(image, raw_image->get_width(), raw_image->get_height(), image->depth, image->numElements, game::Image_Setup(image, raw_image->get_width(), raw_image->get_height(), image->depth, image->numElements,
image->imageFormat, DXGI_FORMAT_R8G8B8A8_UNORM, 0, image->name, &data); image->mapType, DXGI_FORMAT_R8G8B8A8_UNORM, 0, image->name, &data);
return true; return true;
} }

View File

@ -1429,55 +1429,85 @@ namespace game
char data[1]; char data[1];
}; };
union $3FA29451CE6F1FA138A5ABAB84BE9676
{
ID3D11Texture1D* linemap;
ID3D11Texture2D* map;
ID3D11Texture3D* volmap;
ID3D11Texture2D* cubemap;
GfxImageLoadDef* loadDef;
};
struct GfxTexture struct GfxTexture
{ {
$3FA29451CE6F1FA138A5ABAB84BE9676 ___u0; union
{
ID3D11Texture1D* linemap;
ID3D11Texture2D* map;
ID3D11Texture3D* volmap;
ID3D11Texture2D* cubemap;
GfxImageLoadDef* loadDef;
};
ID3D11ShaderResourceView* shaderView; ID3D11ShaderResourceView* shaderView;
ID3D11ShaderResourceView* shaderViewAlternate; ID3D11ShaderResourceView* shaderViewAlternate;
}; };
struct Picmip struct Picmip
{ {
char platform[2]; unsigned char platform[2];
}; };
struct CardMemory struct GfxImageStreamData
{ {
int platform[2]; unsigned short width;
unsigned short height;
union
{
unsigned char bytes[4];
unsigned int pixelSize;
};
}; };
enum MapType : std::uint8_t
{
MAPTYPE_NONE = 0x0,
MAPTYPE_INVALID1 = 0x1,
MAPTYPE_1D = 0x2,
MAPTYPE_2D = 0x3,
MAPTYPE_3D = 0x4,
MAPTYPE_CUBE = 0x5,
MAPTYPE_ARRAY = 0x6,
MAPTYPE_COUNT = 0x7,
};
#pragma warning(push)
#pragma warning(disable: 4201)
struct GfxImage struct GfxImage
{ {
GfxTexture textures; GfxTexture texture;
int flags; DXGI_FORMAT imageFormat;
int imageFormat; MapType mapType;
int resourceSize; unsigned char semantic;
char mapType; unsigned char category;
char semantic; unsigned char flags;
char category; union
char flags2; {
Picmip picmip; struct
char track; {
//CardMemory cardMemory; Picmip picmip;
char __pad0[2];
};
unsigned int resourceSize;
};
unsigned int dataLen1;
unsigned int dataLen2;
unsigned short width; unsigned short width;
unsigned short height; unsigned short height;
unsigned short depth; unsigned short depth;
unsigned short numElements; unsigned short numElements;
char pad3[4]; unsigned char levelCount;
void* pixelData; unsigned char streamed;
//GfxImageLoadDef *loadDef; char __pad1[2];
uint64_t streams[4]; unsigned char* pixelData;
GfxImageStreamData streams[4];
const char* name; const char* name;
}; };
#pragma warning(pop)
static_assert(offsetof(GfxImage, resourceSize) == 32);
static_assert(offsetof(GfxImage, dataLen1) == 36);
static_assert(offsetof(GfxImage, flags) == 31);
struct playerState_s struct playerState_s