|
|
|
@ -9,7 +9,7 @@ struct bmp_header {
|
|
|
|
|
uint16_t width;
|
|
|
|
|
uint16_t height;
|
|
|
|
|
uint16_t bypl; // bytes per line
|
|
|
|
|
}; // officially it's 16 bytes wide but shush this doesn't need to write into a bmp_ps2
|
|
|
|
|
}; // officially it's 16 bytes wide but hush this doesn't need to write into a bmp_ps2
|
|
|
|
|
|
|
|
|
|
struct DDS_PIXELFORMAT {
|
|
|
|
|
uint32_t dwSize;
|
|
|
|
@ -30,7 +30,7 @@ struct DDS_HEADER {
|
|
|
|
|
uint32_t dwFlags; // we're not doing mipmaps or multiple textures per file so 0x1007 is fine
|
|
|
|
|
uint32_t dwHeight;
|
|
|
|
|
uint32_t dwWidth;
|
|
|
|
|
uint32_t dwPitchOrLinearSize; // why is it ( width * bits-per-pixel + 7 ) / 8 wtf ms
|
|
|
|
|
uint32_t dwPitchOrLinearSize; // why is it ( width * bits-per-pixel + 7 ) / 8 wtf directx devs
|
|
|
|
|
uint32_t dwDepth; // irrelevant
|
|
|
|
|
uint32_t dwMipMapCount; // irrelevant
|
|
|
|
|
uint32_t dwReserved1[11]; // empty
|
|
|
|
@ -42,13 +42,13 @@ struct DDS_HEADER {
|
|
|
|
|
uint32_t dwReserved2;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
DDS_PIXELFORMAT tmp_ddspf = {32, 0x41, 0, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000};
|
|
|
|
|
const DDS_PIXELFORMAT tmp_ddspf = {32, 0x41, 0, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000};
|
|
|
|
|
|
|
|
|
|
typedef struct DDS_HEADER DDS_HEADER;
|
|
|
|
|
typedef struct bmp_header bmp_header;
|
|
|
|
|
|
|
|
|
|
bmp_header header;
|
|
|
|
|
DDS_HEADER ddsHeader = {'DDS ', 124, 0x100F, 0, 0, 0, };
|
|
|
|
|
bmp_header bitmapHeader;
|
|
|
|
|
DDS_HEADER ddsHeader = {'DDS ', 124, 0x100F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, tmp_ddspf, 0x1000};
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
|
if (argc != 2) {
|
|
|
|
|