mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-26 03:23:46 +08:00
cleanup and remove get_extension
This commit is contained in:
+16
-30
@@ -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/>.
|
||||
*/
|
||||
@@ -62,14 +62,14 @@ typedef struct _BITMAP_TYPE_INFO BITMAP_TYPE_INFO;
|
||||
* The idea comes from readbmp.c in Allegro by Shawn Hargreaves.
|
||||
*/
|
||||
struct _BITMAP_TYPE_INFO
|
||||
{
|
||||
{
|
||||
char ext[8];
|
||||
void* (*init) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal);
|
||||
int (*load) (MG_RWops* fp, void* init_info, MYBITMAP *my_bmp,
|
||||
CB_ONE_SCANLINE cb, void* context);
|
||||
void (*cleanup) (void* init_info);
|
||||
int (*save) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal);
|
||||
BOOL (*check) (MG_RWops* fp);
|
||||
void* (*init) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal);
|
||||
int (*load) (MG_RWops* fp, void* init_info, MYBITMAP *my_bmp,
|
||||
CB_ONE_SCANLINE cb, void* context);
|
||||
void (*cleanup) (void* init_info);
|
||||
int (*save) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal);
|
||||
BOOL (*check) (MG_RWops* fp);
|
||||
};
|
||||
|
||||
typedef struct _LOAD_MYBITMAP_INFO LOAD_MYBITMAP_INFO;
|
||||
@@ -140,20 +140,6 @@ BOOL __mg_check_png (MG_RWops* fp);
|
||||
|
||||
int bmp_ComputePitch (int bpp, Uint32 width, Uint32 *pitch, BOOL does_round);
|
||||
|
||||
static inline const char*
|
||||
get_extension (const char* filename)
|
||||
{
|
||||
const char* ext;
|
||||
|
||||
ext = strrchr (filename, '.');
|
||||
|
||||
if (ext)
|
||||
return ext + 1;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#define fp_getc(fp) MGUI_RWgetc(fp)
|
||||
#define fp_igetw(fp) MGUI_ReadLE16(fp)
|
||||
#define fp_igetl(fp) MGUI_ReadLE32(fp)
|
||||
|
||||
Reference in New Issue
Block a user