#include <stdio.h>
#include <stdlib.h>
-
-#ifdef _WIN32
-// cough, cough
-typedef __int32 int32_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int32 uint32_t;
-typedef __int16 int16_t;
-#endif
-
#include <math.h>
#include "gensurf.h"
fprintf( stderr,"%s:%d: Error file '%s' is malformed.\n",__FILE__,__LINE__,gbmp.name ); \
fclose( fp ); \
return NULL; \
-} while ( 0 )
+} while ( 0 );
int32_t bmWidth;
int32_t bmHeight;
rc = fread( &m1, 1, 1, fp );
m_bytesRead++;
if ( rc == -1 ) {
- fclose( fp );
- return NULL;
+ INVALID_FORMAT;
}
rc = fread( &m2, 1, 1, fp );
if ( bmBitsPixel != 8 ) {
g_FuncTable.m_pfnMessageBox( g_pWnd, "This is not an 8-bit image. GenSurf can't use it.",
- "Bitmap", MB_ICONEXCLAMATION, NULL );
- INVALID_FORMAT;
+ "Bitmap", eMB_OK, eMB_ICONWARNING );
+ fclose( fp );
+ return NULL;
}
if ( colors == 0 ) {
OpenBitmapFile();
if ( !gbmp.colors ) {
- g_print( "failed to load file gbmp %s\n",gbmp.name );
char Text[256];
sprintf( Text, "Error opening %s", gbmp.name );
- g_FuncTable.m_pfnMessageBox( g_pWnd, Text, "Bitmap", MB_ICONEXCLAMATION, NULL );
+ g_FuncTable.m_pfnMessageBox( g_pWnd, Text, "Bitmap", eMB_OK, eMB_ICONWARNING );
strcpy( gbmp.name, "" );
}