X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=source%2Frice_gles%2Fsrc%2Fliblinux%2FBMGUtils.h;fp=source%2Frice_gles%2Fsrc%2Fliblinux%2FBMGUtils.h;h=7578508d202eda3ad4d68b225ee7495e31eb557b;hb=d07c171fa694cae985ad7045f9ce2b2f1a5699b4;hp=0000000000000000000000000000000000000000;hpb=ca22e7b76883b946060a6b40bb8709c1981e1cf6;p=mupen64plus-pandora.git diff --git a/source/rice_gles/src/liblinux/BMGUtils.h b/source/rice_gles/src/liblinux/BMGUtils.h new file mode 100644 index 0000000..7578508 --- /dev/null +++ b/source/rice_gles/src/liblinux/BMGUtils.h @@ -0,0 +1,56 @@ +#ifndef _BMG_UTILS_H_ +#define _BMG_UTILS_H_ +/* + some handy utilities used in several units + + Copyright 2001 + M. Scott Heiman + All Rights Reserved +*/ + +#include "BMGImage.h" +#include "../osal_preproc.h" + +/* the following 3 functions are used to access the background color +// and the background image */ +void InitBackground(void); + +unsigned char *GetBackgroundColor(void); + +struct BMGImageStruct *GetBackgroundImage(void); + +/* creates a 24 bpp image from a 16 bpp image */ +BMGError Convert16to24( struct BMGImageStruct *img ); + +/* converts an array of 1-bit scanlines to 8-bit scanlines */ +void Convert1to8( struct BMGImageStruct img, + unsigned char *out ); + +/* converts an array of 4-bit scanlines to 8-bit scanlines */ +void Convert4to8( struct BMGImageStruct img, + unsigned char *out ); + +unsigned char AlphaComp( unsigned char fg, + unsigned char alpha, + unsigned char bg ); + +unsigned char InverseAlphaComp( unsigned char fg, + unsigned char alpha, + unsigned char bg ); + +BITMAPINFO InternalCreateBMI( unsigned int dwWidth, /* width */ + unsigned int dwHeight, /* height */ + unsigned short wBitCount, /* bit count */ + int compression ); /* compression type */ + +void SetLastBMGError( BMGError err ); + +/* the following 4 functions are for dealing with file formats + that store data in big endian format */ +short SwapShort( short in ); +unsigned short SwapUShort( unsigned short in ); +int SwapLong( int in ); +unsigned int SwapULong( unsigned int in ); + +#endif +