289 lines
12 KiB
Diff
289 lines
12 KiB
Diff
diff --git a/src/liblinux/BMGDLL.h b/src/liblinux/BMGDLL.h
|
|
index 0a777fa..2348f11 100644
|
|
--- a/src/liblinux/BMGDLL.h
|
|
+++ b/src/liblinux/BMGDLL.h
|
|
@@ -54,11 +54,11 @@ extern "C" {
|
|
/* returns a BITMAPINFO structure with the given height, width,
|
|
bit count, and compression scheme. This structure DOES NOT contain any
|
|
palette information (bmiColors = NULL) */
|
|
-extern
|
|
-BITMAPINFO CreateBMI( unsigned int dwWidth, /* width in pixels */
|
|
- unsigned int dwHeight, /* height in pixels */
|
|
- unsigned short wBitCount, /* 1, 4, 8, 16, 24, & 32 */
|
|
- int compression ); /* biCompression value */
|
|
+// extern
|
|
+// BITMAPINFO CreateBMI( unsigned int dwWidth, /* width in pixels */
|
|
+// unsigned int dwHeight, /* height in pixels */
|
|
+// unsigned short wBitCount, /* 1, 4, 8, 16, 24, & 32 */
|
|
+// int compression ); /* biCompression value */
|
|
|
|
/* returns an array of RGBA or BGRA values for all supported graphics file
|
|
formats. The RGBA pixel format is supported by all versions of OpenGL.
|
|
@@ -81,20 +81,20 @@ BMGError SaveUnpackedArray( const char *filename,
|
|
unsigned char *bits,
|
|
int bgra );
|
|
|
|
-/* saves the contents of an HBITMAP to a file. The extension of the file name
|
|
-// determines the file type. returns 1 if successfull, 0 otherwise */
|
|
-extern
|
|
-BMGError SaveBitmapToFile( HBITMAP hBitmap, /* bitmap to be saved */
|
|
- const char *filename, /* name of output file */
|
|
- void *parameters );
|
|
-
|
|
-/* Creates an HBITMAP to an image file. The extension of the file name
|
|
-// determines the file type. returns an HBITMAP if successfull, NULL
|
|
-// otherwise */
|
|
-extern
|
|
-HBITMAP CreateBitmapFromFile( const char *filename,
|
|
- void *parameters,
|
|
- int blend );
|
|
+// /* saves the contents of an HBITMAP to a file. The extension of the file name
|
|
+// // determines the file type. returns 1 if successfull, 0 otherwise */
|
|
+// extern
|
|
+// BMGError SaveBitmapToFile( HBITMAP hBitmap, /* bitmap to be saved */
|
|
+// const char *filename, /* name of output file */
|
|
+// void *parameters );
|
|
+
|
|
+// /* Creates an HBITMAP to an image file. The extension of the file name
|
|
+// // determines the file type. returns an HBITMAP if successfull, NULL
|
|
+// // otherwise */
|
|
+// extern
|
|
+// HBITMAP CreateBitmapFromFile( const char *filename,
|
|
+// void *parameters,
|
|
+// int blend );
|
|
|
|
/* extracts a BMGImageStruct from any one of the supported image files */
|
|
extern
|
|
diff --git a/src/liblinux/BMGImage.h b/src/liblinux/BMGImage.h
|
|
index 0776a5d..b88ab62 100644
|
|
--- a/src/liblinux/BMGImage.h
|
|
+++ b/src/liblinux/BMGImage.h
|
|
@@ -116,16 +116,16 @@ BMGError ConvertToGrayScale( struct BMGImageStruct *img );
|
|
extern
|
|
BMGError ConvertToPseudoGrayScale( struct BMGImageStruct *img );
|
|
|
|
-/* stores the contents of a bitmap into a BMGImageStruct */
|
|
-extern
|
|
-BMGError GetDataFromBitmap( HBITMAP hBitmap,
|
|
- struct BMGImageStruct *img,
|
|
- int remove_alpha );
|
|
+// /* stores the contents of a bitmap into a BMGImageStruct */
|
|
+// extern
|
|
+// BMGError GetDataFromBitmap( HBITMAP hBitmap,
|
|
+// struct BMGImageStruct *img,
|
|
+// int remove_alpha );
|
|
|
|
-/* creates an HBITMAP from a BMGImageStruct */
|
|
-extern
|
|
-HBITMAP CreateBitmapFromData( struct BMGImageStruct img,
|
|
- int alpha_blend );
|
|
+// /* creates an HBITMAP from a BMGImageStruct */
|
|
+// extern
|
|
+// HBITMAP CreateBitmapFromData( struct BMGImageStruct img,
|
|
+// int alpha_blend );
|
|
|
|
/* sets the background color for alpha blending
|
|
color points to an array of 4 unsigned chars
|
|
@@ -133,10 +133,10 @@ HBITMAP CreateBitmapFromData( struct BMGImageStruct img,
|
|
extern
|
|
void SetBMGBackgroundColor( unsigned char *color );
|
|
|
|
-/* defines the background bitmap that is used for alpha blending & transparent
|
|
- pixels */
|
|
-extern
|
|
-BMGError SetBMGBackgroundBitmap( HBITMAP hBitmap );
|
|
+// /* defines the background bitmap that is used for alpha blending & transparent
|
|
+// pixels */
|
|
+// extern
|
|
+// BMGError SetBMGBackgroundBitmap( HBITMAP hBitmap );
|
|
|
|
/* defines the background image that is used for alpha blending & transparent
|
|
pixels */
|
|
diff --git a/src/liblinux/BMGLibPNG.h b/src/liblinux/BMGLibPNG.h
|
|
index b74382a..0fd3a22 100644
|
|
--- a/src/liblinux/BMGLibPNG.h
|
|
+++ b/src/liblinux/BMGLibPNG.h
|
|
@@ -39,19 +39,19 @@
|
|
extern "C" {
|
|
#endif
|
|
|
|
-//#pragma message ("Exporting BMGLibPNG functions")
|
|
-/* saves the contents of an HBITMAP to a file. The extension of the file name
|
|
-// determines the file type. returns 1 if successfull, 0 otherwise */
|
|
-extern
|
|
-BMGError SaveBitmapToPNGFile( HBITMAP hBitmap, /* bitmap to be saved */
|
|
- const char *filename); /* name of output file */
|
|
+// //#pragma message ("Exporting BMGLibPNG functions")
|
|
+// /* saves the contents of an HBITMAP to a file. The extension of the file name
|
|
+// // determines the file type. returns 1 if successfull, 0 otherwise */
|
|
+// extern
|
|
+// BMGError SaveBitmapToPNGFile( HBITMAP hBitmap, /* bitmap to be saved */
|
|
+// const char *filename); /* name of output file */
|
|
|
|
/* Creates an HBITMAP to an image file. The extension of the file name
|
|
// determines the file type. returns an HBITMAP if successfull, NULL
|
|
// otherwise */
|
|
-extern
|
|
-HBITMAP CreateBitmapFromPNGFile( const char *filename,
|
|
- int blend );
|
|
+// extern
|
|
+// HBITMAP CreateBitmapFromPNGFile( const char *filename,
|
|
+// int blend );
|
|
|
|
#if defined(__cplusplus)
|
|
}
|
|
diff --git a/src/liblinux/BMGUtils.c b/src/liblinux/BMGUtils.c
|
|
index 6379642..a51b6f7 100644
|
|
--- a/src/liblinux/BMGUtils.c
|
|
+++ b/src/liblinux/BMGUtils.c
|
|
@@ -294,50 +294,50 @@ unsigned char InverseAlphaComp( unsigned char fg, unsigned char alpha,
|
|
// Creates a BITMAPINFOHEADER for the given width, height, bit count, and
|
|
// compression. Compression must = BI_RGB, BI_BITFIELDS, BI_RLE4, or BI_RLE8.
|
|
*/
|
|
-BITMAPINFO InternalCreateBMI( unsigned int dwWidth, /* width */
|
|
- unsigned int dwHeight, /* height */
|
|
- unsigned short wBitCount, /* bit count */
|
|
- int compression ) /* compression type */
|
|
-{
|
|
- BITMAPINFO bi; /* bitmap header */
|
|
- unsigned int dwBytesPerLine; /* Number of bytes per scanline */
|
|
-
|
|
- /* clear the bitmapinfo structure */
|
|
- memset(&bi, 0, sizeof(BITMAPINFO));
|
|
-
|
|
- /* Make sure bits per pixel is valid */
|
|
- if (wBitCount <= 1)
|
|
- wBitCount = 1;
|
|
- else if (wBitCount <= 4)
|
|
- wBitCount = 4;
|
|
- else if (wBitCount <= 8)
|
|
- wBitCount = 8;
|
|
- else if (wBitCount <= 16)
|
|
- wBitCount = 16;
|
|
- else if (wBitCount <= 24)
|
|
- wBitCount = 24;
|
|
- else if (wBitCount <= 32)
|
|
- wBitCount = 32;
|
|
- else
|
|
- wBitCount = 8; /* set default value to 8 if parameter is bogus */
|
|
-
|
|
- dwBytesPerLine = (((wBitCount * dwWidth) + 31) / 32 * 4);
|
|
-
|
|
- /* initialize BITMAPINFO */
|
|
- bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
|
- bi.bmiHeader.biWidth = dwWidth;
|
|
- bi.bmiHeader.biHeight = dwHeight;
|
|
- bi.bmiHeader.biPlanes = 1; /* must be 1 */
|
|
- bi.bmiHeader.biBitCount = wBitCount;
|
|
- bi.bmiHeader.biCompression = compression;
|
|
- bi.bmiHeader.biSizeImage = dwBytesPerLine*dwHeight;
|
|
- bi.bmiHeader.biXPelsPerMeter = 0;
|
|
- bi.bmiHeader.biYPelsPerMeter = 0;
|
|
- bi.bmiHeader.biClrUsed = wBitCount <= 8 ? 1U << wBitCount : 0;
|
|
- bi.bmiHeader.biClrImportant = bi.bmiHeader.biClrUsed;
|
|
-
|
|
- return bi;
|
|
-}
|
|
+// BITMAPINFO InternalCreateBMI( unsigned int dwWidth, /* width */
|
|
+// unsigned int dwHeight, /* height */
|
|
+// unsigned short wBitCount, /* bit count */
|
|
+// int compression ) /* compression type */
|
|
+// {
|
|
+// BITMAPINFO bi; /* bitmap header */
|
|
+// unsigned int dwBytesPerLine; /* Number of bytes per scanline */
|
|
+
|
|
+// /* clear the bitmapinfo structure */
|
|
+// memset(&bi, 0, sizeof(BITMAPINFO));
|
|
+
|
|
+// /* Make sure bits per pixel is valid */
|
|
+// if (wBitCount <= 1)
|
|
+// wBitCount = 1;
|
|
+// else if (wBitCount <= 4)
|
|
+// wBitCount = 4;
|
|
+// else if (wBitCount <= 8)
|
|
+// wBitCount = 8;
|
|
+// else if (wBitCount <= 16)
|
|
+// wBitCount = 16;
|
|
+// else if (wBitCount <= 24)
|
|
+// wBitCount = 24;
|
|
+// else if (wBitCount <= 32)
|
|
+// wBitCount = 32;
|
|
+// else
|
|
+// wBitCount = 8; /* set default value to 8 if parameter is bogus */
|
|
+
|
|
+// dwBytesPerLine = (((wBitCount * dwWidth) + 31) / 32 * 4);
|
|
+
|
|
+// /* initialize BITMAPINFO */
|
|
+// bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
|
+// bi.bmiHeader.biWidth = dwWidth;
|
|
+// bi.bmiHeader.biHeight = dwHeight;
|
|
+// bi.bmiHeader.biPlanes = 1; /* must be 1 */
|
|
+// bi.bmiHeader.biBitCount = wBitCount;
|
|
+// bi.bmiHeader.biCompression = compression;
|
|
+// bi.bmiHeader.biSizeImage = dwBytesPerLine*dwHeight;
|
|
+// bi.bmiHeader.biXPelsPerMeter = 0;
|
|
+// bi.bmiHeader.biYPelsPerMeter = 0;
|
|
+// bi.bmiHeader.biClrUsed = wBitCount <= 8 ? 1U << wBitCount : 0;
|
|
+// bi.bmiHeader.biClrImportant = bi.bmiHeader.biClrUsed;
|
|
+
|
|
+// return bi;
|
|
+// }
|
|
|
|
short SwapShort( short in )
|
|
{
|
|
diff --git a/src/liblinux/BMGUtils.h b/src/liblinux/BMGUtils.h
|
|
index a4779d8..986fc86 100644
|
|
--- a/src/liblinux/BMGUtils.h
|
|
+++ b/src/liblinux/BMGUtils.h
|
|
@@ -38,10 +38,10 @@ 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 */
|
|
+// BITMAPINFO InternalCreateBMI( unsigned int dwWidth, /* width */
|
|
+// unsigned int dwHeight, /* height */
|
|
+// unsigned short wBitCount, /* bit count */
|
|
+// int compression ); /* compression type */
|
|
|
|
void SetLastBMGError( BMGError err );
|
|
|
|
diff --git a/src/osal_preproc.h b/src/osal_preproc.h
|
|
index 9cf1336..ebc2661 100644
|
|
--- a/src/osal_preproc.h
|
|
+++ b/src/osal_preproc.h
|
|
@@ -29,6 +29,7 @@
|
|
#include <windows.h>
|
|
#if defined(__MINGW32__)
|
|
#define ALIGN(BYTES,DATA) DATA __attribute__((aligned(BYTES)));
|
|
+ typedef void* HBITMAP;
|
|
#else
|
|
#define ALIGN(BYTES,DATA) __declspec(align(BYTES)) DATA;
|
|
#define strncasecmp _strnicmp
|
|
@@ -39,7 +40,6 @@
|
|
#define ALIGN(BYTES,DATA) DATA __attribute__((aligned(BYTES)));
|
|
|
|
typedef unsigned int BOOL;
|
|
-typedef void* HBITMAP;
|
|
|
|
typedef struct
|
|
{
|
|
@@ -74,11 +74,11 @@ typedef struct tagBITMAPINFOHEADER
|
|
unsigned int biClrImportant;
|
|
} __attribute__ ((packed)) BITMAPINFOHEADER;
|
|
|
|
-typedef struct tagBITMAPINFO
|
|
-{
|
|
- BITMAPINFOHEADER bmiHeader;
|
|
- unsigned int unused;
|
|
-} BITMAPINFO;
|
|
+// typedef struct tagBITMAPINFO
|
|
+// {
|
|
+// BITMAPINFOHEADER bmiHeader;
|
|
+// unsigned int unused;
|
|
+// } BITMAPINFO;
|
|
|
|
typedef struct tagBITMAPFILEHEADER
|
|
{
|