Fix to gImage BMP handling where the system pixel size is less than a byte
This commit is contained in:
parent
127a7cd2a2
commit
0586fd276d
@ -4,6 +4,8 @@
|
||||
|
||||
*** After Release 2.9 ***
|
||||
CHANGE: Added type gImage to replace V2.x gdispImage
|
||||
FIX: Fixed GWIN console widget scroll
|
||||
FIX: A warning and adjusted is made if GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE is less than 40 bytes.
|
||||
|
||||
|
||||
*** Release 2.9 ***
|
||||
|
@ -11,6 +11,16 @@
|
||||
|
||||
#include "gdisp_image_support.h"
|
||||
|
||||
#if GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE * (COLOR_TYPE_BITS/8) < 40
|
||||
#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
|
||||
#warning "GDISP: GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE must be at least 40 bytes. It has been adjusted for you."
|
||||
#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
|
||||
COMPILER_WARNING("GDISP: GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE must be at least 40 bytes. It has been adjusted for you.")
|
||||
#endif
|
||||
#undef GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE
|
||||
#define GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE ((40 + (COLOR_TYPE_BITS/8) - 1) / (COLOR_TYPE_BITS/8))
|
||||
#endif
|
||||
|
||||
typedef struct gdispImagePrivate_BMP {
|
||||
gU8 bmpflags;
|
||||
#define BMP_V2 0x01 // Version 2 (old) header format
|
||||
|
@ -389,8 +389,8 @@
|
||||
#define GDISP_NEED_IMAGE_BMP_32 GFXON
|
||||
#endif
|
||||
/**
|
||||
* @brief The BMP blit buffer size.
|
||||
* @details Defaults to 32
|
||||
* @brief The BMP blit buffer size in pixels.
|
||||
* @details Defaults to 32 pixels
|
||||
* @note Bigger is faster but requires more RAM.
|
||||
* @note This must be greater than 40 bytes and 32 pixels as we read our headers into this space as well.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user