This commit is contained in:
Vincent Wei
2020-01-21 18:31:42 +08:00
parent 9874a9385f
commit 0e0319a737

View File

@@ -11,35 +11,35 @@
//
//////////////////////////////////////////////////////////////////////////////
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Or,
*
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
*/
@@ -232,7 +232,7 @@ GAL_PixelFormat *GAL_AllocFormat(int bpp,
break;
}
/* Calculate some standard bitmasks, if necessary
/* Calculate some standard bitmasks, if necessary
* Note: This could conflict with an alpha mask, if given.
*/
if ( (bpp > 8) && !format->Rmask && !format->Gmask && !format->Bmask ) {
@@ -252,6 +252,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)
{
@@ -338,7 +339,7 @@ Uint8 GAL_FindDitheredColor (int bpp, Uint8 r, Uint8 g, Uint8 b)
return r | g | b;
}
/*
/*
* Calculate the pad-aligned scanline width of a surface
*/
Uint32 GAL_CalculatePitch(GAL_Surface *surface)
@@ -372,7 +373,7 @@ Uint8 GAL_FindColor(GAL_Palette *pal, Uint8 r, Uint8 g, Uint8 b)
int rd, gd, bd;
int i;
Uint8 pixel=0;
smallest = ~0;
for ( i=0; i<pal->ncolors; ++i ) {
rd = pal->colors[i].r - r;
@@ -531,6 +532,7 @@ static Uint8 *Map1to1(GAL_Palette *src, GAL_Palette *dst, int *identical)
}
return(map);
}
/* Map from Palette to BitField */
static Uint8 *Map1toN(GAL_Palette *src, GAL_PixelFormat *dst)
{
@@ -555,6 +557,7 @@ static Uint8 *Map1toN(GAL_Palette *src, GAL_PixelFormat *dst)
}
return(map);
}
/* Map from BitField to Dithered-Palette to Palette */
static Uint8 *MapNto1(GAL_PixelFormat *src, GAL_Palette *dst, int *identical)
{
@@ -592,6 +595,7 @@ GAL_BlitMap *GAL_AllocBlitMap(void)
/* It's ready to go */
return(map);
}
void GAL_InvalidateMap(GAL_BlitMap *map)
{
if ( ! map ) {
@@ -604,6 +608,7 @@ void GAL_InvalidateMap(GAL_BlitMap *map)
map->table = NULL;
}
}
int GAL_MapSurface (GAL_Surface *src, GAL_Surface *dst)
{
GAL_PixelFormat *srcfmt;
@@ -669,8 +674,8 @@ int GAL_MapSurface (GAL_Surface *src, GAL_Surface *dst)
/* BitField --> BitField */
if (
#ifdef _MGGAL_S3C6410
(((src->flags & GAL_HWSURFACE) == GAL_HWSURFACE) && ((dst->flags & GAL_HWSURFACE) == GAL_HWSURFACE))
||
(((src->flags & GAL_HWSURFACE) == GAL_HWSURFACE) &&
((dst->flags & GAL_HWSURFACE) == GAL_HWSURFACE)) ||
#endif
FORMAT_EQUAL(srcfmt, dstfmt)
) {
@@ -687,6 +692,7 @@ int GAL_MapSurface (GAL_Surface *src, GAL_Surface *dst)
/* Choose your blitters wisely */
return(GAL_CalculateBlit(src));
}
void GAL_FreeBlitMap(GAL_BlitMap *map)
{
if ( map ) {