everything must go (also a reference file :D)

main
ieee 802.11ac 1 year ago
parent ee0033fa1e
commit 75eb582c39

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -9,9 +9,47 @@ 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
struct DDS_PIXELFORMAT {
uint32_t dwSize;
uint32_t dwFlags;
uint32_t dwFourCC;
uint32_t dwRGBBitCount;
uint32_t dwRBitMask;
uint32_t dwGBitMask;
uint32_t dwBBitMask;
uint32_t dwABitMask;
};
typedef struct DDS_PIXELFORMAT DDS_PIXELFORMAT;
struct DDS_HEADER {
uint32_t magic; // always 'DDS '
uint32_t dwSize; // always 124
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 dwDepth; // irrelevant
uint32_t dwMipMapCount; // irrelevant
uint32_t dwReserved1[11]; // empty
DDS_PIXELFORMAT ddspf; // tmp_ddspf exists for a reason
uint32_t dwCaps; // always 0x1000 for us
uint32_t dwCaps2;
uint32_t dwCaps3;
uint32_t dwCaps4;
uint32_t dwReserved2;
};
typedef struct bmp_header bmp_hdr;
bmp_hdr header;
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, };
int main(int argc, char** argv) {
if (argc != 2) {
printf("usage: %s <filename>\n", argv[0]);
@ -45,7 +83,7 @@ int main(int argc, char** argv) {
printf("%u ", (c & 0b00000001 ? 1 : 0));
if (filearraylen % 8 == 0) printf("\n");
} else {
printf("\nlen: %i\n",filearraylen);
printf("len: %i\n",filearraylen);
break;
}
}

Loading…
Cancel
Save