Add new method GetBitmapBPP as we need it for sprite math

This commit is contained in:
karri 2022-12-30 12:16:46 +02:00
parent ebd1381030
commit aed6591b19
1 changed files with 14 additions and 0 deletions

View File

@ -75,6 +75,9 @@ struct Bitmap {
unsigned Width;
unsigned Height;
/* Bits per pixels */
unsigned BPP;
/* Palette for indexed bitmap types, otherwise NULL */
Palette* Pal;
@ -179,6 +182,17 @@ INLINE unsigned GetBitmapColors (const Bitmap* B)
# define GetBitmapColors(B) ((B)->Pal? (B)->Pal->Count : (1U << 24))
#endif
#if defined(HAVE_INLINE)
INLINE unsigned GetBitmapBPP (const Bitmap* B)
/* Get the bits per pixel of the converted sprite
*/
{
return B->BPP;
}
#else
# define GetBitmapBPP(B) ((B)->BPP
#endif
/* End of bitmap.h */