QD3D: RGBA32 edge padding extension

This commit is contained in:
Iliyas Jorio 2023-01-21 14:22:14 +01:00
parent 80349be4c0
commit ad9cc177d2
3 changed files with 15 additions and 1 deletions

View File

@ -510,6 +510,7 @@ TQ3Pixmap* Q3MetaFileParser::ParsePixmap(uint32_t chunkType, uint32_t chunkSize)
case kQ3PixelTypeARGB16: printf(" ARGB16"); break;
case kQ3PixelTypeRGB16_565: printf(" RGB16_565"); break;
case kQ3PixelTypeRGB24: printf(" RGB24"); break;
case kQ3PixelTypeRGBA32: printf(" RGBA32"); break;
default: printf(" UnknownPixelType"); break;
}
#endif

View File

@ -123,6 +123,16 @@ void Q3Pixmap_ApplyEdgePadding(TQ3Pixmap* pm)
pm->byteOrder==kQ3EndianNative? 0xFF000000: 0x000000FF);
break;
case kQ3PixelTypeRGBA32:
Assert(pm->rowBytes >= pm->width * 4, "EdgePadding RGBA32: incorrect rowBytes");
_EdgePadding<uint32_t>(
(uint32_t *) pm->image,
pm->width,
pm->height,
pm->rowBytes,
pm->byteOrder==kQ3EndianNative? 0x000000FF: 0xFF000000);
break;
case kQ3PixelTypeRGB16:
case kQ3PixelTypeRGB16_565:
case kQ3PixelTypeRGB24:

View File

@ -91,6 +91,9 @@ typedef enum
/// 8 bits for red, green, and blue. No alpha byte.
kQ3PixelTypeRGB24 = 5,
/// 8 bits for red, green, and blue, and alpha (Pomme extension, not in real 3DMF files)
kQ3PixelTypeRGBA32 = 6,
kQ3PixelTypeUnknown = 200,
kQ3PixelTypeSize32 = 0xFFFFFFFF
} TQ3PixelType;