From aed6591b19262c10d13517f7049fad25d03c2d27 Mon Sep 17 00:00:00 2001 From: karri Date: Fri, 30 Dec 2022 12:16:46 +0200 Subject: [PATCH] Add new method GetBitmapBPP as we need it for sprite math --- src/sp65/bitmap.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/sp65/bitmap.h b/src/sp65/bitmap.h index bf5e60559..e94ec71fd 100644 --- a/src/sp65/bitmap.h +++ b/src/sp65/bitmap.h @@ -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 */