use standard pixel format for alpha_pixel_format

This commit is contained in:
Vincent Wei
2019-04-07 17:16:53 +08:00
parent 5a0fc2e74f
commit 736a532b1a
3 changed files with 29 additions and 37 deletions
+16 -25
View File
@@ -50,10 +50,6 @@
#ifndef GUI_EXSTUBS_H
#define GUI_EXSTUBS_H
/* external stubs for COMMLCD NEWGAL engine */
#ifdef _MGGAL_COMMLCD
/* The pixel format defined by depth */
#define COMMLCD_PSEUDO_RGB332 1
#define COMMLCD_TRUE_RGB555 2
@@ -78,25 +74,6 @@ struct commlcd_info {
Uint8* fb; // Frame buffer
};
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
int __commlcd_drv_init (void);
int __commlcd_drv_getinfo (struct commlcd_info *li,
int width, int height, int depth);
int __commlcd_drv_release (void);
int __commlcd_drv_setclut (int firstcolor, int ncolors, GAL_Color *colors);
int __commlcd_drv_update (const RECT* rc_dirty);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _MGGAL_COMMLCD */
#ifdef _MGIAL_COMM
#define COMM_MOUSEINPUT 0x01
#define COMM_KBINPUT 0x02
@@ -107,17 +84,31 @@ int __commlcd_drv_update (const RECT* rc_dirty);
extern "C" {
#endif /* __cplusplus */
/* external stubs for COMMLCD NEWGAL engine */
#ifdef _MGGAL_COMMLCD
int __commlcd_drv_init (void);
int __commlcd_drv_getinfo (struct commlcd_info *li,
int width, int height, int depth);
int __commlcd_drv_release (void);
int __commlcd_drv_setclut (int firstcolor, int ncolors, GAL_Color *colors);
int __commlcd_drv_update (const RECT* rc_dirty);
#endif /* _MGGAL_COMMLCD */
#ifdef _MGIAL_COMM
int __comminput_init (void);
int __comminput_ts_getdata (short *x, short *y, short *button);
int __comminput_kb_getdata (short *key, short *status);
int __comminput_wait_for_input (struct timeval *timeout);
void __comminput_deinit (void);
#endif /* _MGIAL_COMM */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _MGIAL_COMM */
#endif /* GUI_EXSTUBS_H */
+1
View File
@@ -240,6 +240,7 @@ GAL_PixelFormat *GAL_AllocFormat(int bpp,
}
return(format);
}
GAL_PixelFormat *GAL_ReallocFormat(GAL_Surface *surface, int bpp,
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
{
+12 -12
View File
@@ -75,22 +75,22 @@ static int make_alpha_pixel_format (PDC pdc)
if (pdc->alpha_pixel_format == NULL) {
switch (pdc->surface->format->BytesPerPixel) {
case 2:
Rmask = 0x0000F000;
Gmask = 0x00000F00;
Bmask = 0x000000F0;
Amask = 0x0000000F;
Amask = 0x0000F000;
Rmask = 0x00000F00;
Gmask = 0x000000F0;
Bmask = 0x0000000F;
break;
case 3:
Rmask = 0x00FC0000;
Gmask = 0x0003F000;
Bmask = 0x00000FC0;
Amask = 0x0000003F;
Amask = 0x00FC0000;
Rmask = 0x0003F000;
Gmask = 0x00000FC0;
Bmask = 0x0000003F;
break;
case 4:
Rmask = 0xFF000000;
Gmask = 0x00FF0000;
Bmask = 0x0000FF00;
Amask = 0x000000FF;
Amask = 0xFF000000;
Rmask = 0x00FF0000;
Gmask = 0x0000FF00;
Bmask = 0x000000FF;
break;
default:
return -1;