DDPIXELFORMAT * LookupPixelFormatById(int nId)
Find a pixel format of textures by its identifier.
void UnpackRgba5551ToRgba8(unsigned char *pDest, const unsigned short *pSrc, int nCount)
Unpack pixels of RGBA 5551 to RGBA 8888.
int CountTrailingZeroBits32(unsigned nMask)
Count the clear bits below the lowest set bit of a mask.
int CountBitWidth(unsigned nMask)
Count the bits up to and including the highest set bit of a mask.
int ConvertRGBAToPixelFormatWithColorKey(void *pDest, const void *pSrc, int nSize, int nPixelFormatId, unsigned *pColorKey)
Convert RGBA pixels, replacing alpha below 128 with the lowest green bit of the device format.
int ConvertRGBAToPixelFormat(void *pDest, const void *pSrc, int nSize, int nPixelFormatId)
Convert pixels of RGBA 8888 to a pixel format of the device.
unsigned ConvertN64Rgba5551ToRgba8(unsigned nColor)
Convert a host-loaded N64 RGBA 5551 word to four RGBA bytes.
int PopCount32(unsigned nMask)
Count the set bits of a mask.
HRESULT CALLBACK EnumTextureFormatsCallback_MatchPreset(DDSURFACEDESC *pDesc, void *pContext)
Store a texture format of the device in an entry of g_aTexturePixelFormats when it suits the entry be...
void * LoadRgba5551ImageFile(const char *pszPath, unsigned nAdlerExpected, int *pnWidth, int *pnHeight)
Load an image file of RGBA 5551 pixels and convert it to pixel format 0xb.