IMG_bmp.c
author Sam Lantinga <slouken@libsdl.org>
Sun, 14 May 2006 20:57:19 +0000
changeset 151 d2452c2421bd
parent 121 1bf9c0c87374
child 154 201cc5c1b373
permissions -rw-r--r--
Maurizio Monge - Sun May 14 13:57:32 PDT 2006
* Fixed loading BMP palettes at unusual offsets
slouken@0
     1
/*
slouken@53
     2
    SDL_image:  An example image loading library for use with SDL
slouken@121
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@0
     4
slouken@0
     5
    This library is free software; you can redistribute it and/or
slouken@121
     6
    modify it under the terms of the GNU Lesser General Public
slouken@0
     7
    License as published by the Free Software Foundation; either
slouken@121
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@0
     9
slouken@0
    10
    This library is distributed in the hope that it will be useful,
slouken@0
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@121
    13
    Lesser General Public License for more details.
slouken@0
    14
slouken@121
    15
    You should have received a copy of the GNU Lesser General Public
slouken@121
    16
    License along with this library; if not, write to the Free Software
slouken@121
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@0
    18
slouken@0
    19
    Sam Lantinga
slouken@53
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@0
    22
slouken@0
    23
/* This is a BMP image file loading framework */
slouken@0
    24
slouken@0
    25
#include <stdio.h>
slouken@0
    26
#include <string.h>
slouken@0
    27
slouken@0
    28
#include "SDL_image.h"
slouken@0
    29
slouken@0
    30
#ifdef LOAD_BMP
slouken@0
    31
slouken@0
    32
/* See if an image is contained in a data source */
slouken@0
    33
int IMG_isBMP(SDL_RWops *src)
slouken@0
    34
{
slouken@117
    35
	int start;
slouken@0
    36
	int is_BMP;
slouken@0
    37
	char magic[2];
slouken@0
    38
slouken@117
    39
	start = SDL_RWtell(src);
slouken@0
    40
	is_BMP = 0;
slouken@117
    41
	if ( SDL_RWread(src, magic, sizeof(magic), 1) ) {
slouken@0
    42
		if ( strncmp(magic, "BM", 2) == 0 ) {
slouken@0
    43
			is_BMP = 1;
slouken@0
    44
		}
slouken@0
    45
	}
slouken@117
    46
	SDL_RWseek(src, start, SEEK_SET);
slouken@0
    47
	return(is_BMP);
slouken@0
    48
}
slouken@0
    49
slouken@101
    50
#include "SDL_error.h"
slouken@101
    51
#include "SDL_video.h"
slouken@101
    52
#include "SDL_endian.h"
slouken@101
    53
slouken@101
    54
/* Compression encodings for BMP files */
slouken@101
    55
#ifndef BI_RGB
slouken@101
    56
#define BI_RGB		0
slouken@101
    57
#define BI_RLE8		1
slouken@101
    58
#define BI_RLE4		2
slouken@101
    59
#define BI_BITFIELDS	3
slouken@101
    60
#endif
slouken@101
    61
slouken@101
    62
static int readRlePixels(SDL_Surface * surface, SDL_RWops * src, int isRle8)
slouken@101
    63
{
slouken@101
    64
	/*
slouken@101
    65
	| Sets the surface pixels from src.  A bmp image is upside down.
slouken@101
    66
	*/
slouken@101
    67
	int pitch = surface->pitch;
slouken@101
    68
	int height = surface->h;
slouken@101
    69
	Uint8 * bits = (Uint8 *)surface->pixels + ((height-1) * pitch);
slouken@101
    70
	int ofs = 0;
slouken@101
    71
	Uint8 ch;
slouken@101
    72
	Uint8 needsPad;
slouken@101
    73
slouken@101
    74
	for (;;) {
slouken@101
    75
		if ( !SDL_RWread(src, &ch, 1, 1) ) return 1;
slouken@101
    76
		/*
slouken@101
    77
		| encoded mode starts with a run length, and then a byte
slouken@101
    78
		| with two colour indexes to alternate between for the run
slouken@101
    79
		*/
slouken@101
    80
		if ( ch ) {
slouken@101
    81
			Uint8 pixel;
slouken@101
    82
			if ( !SDL_RWread(src, &pixel, 1, 1) ) return 1;
slouken@101
    83
			if ( isRle8 ) {                 /* 256-color bitmap, compressed */
slouken@101
    84
				do {
slouken@101
    85
					bits[ofs++] = pixel;
slouken@101
    86
				} while (--ch);
slouken@101
    87
			}else {                         /* 16-color bitmap, compressed */
slouken@101
    88
				Uint8 pixel0 = pixel >> 4;
slouken@101
    89
				Uint8 pixel1 = pixel & 0x0F;
slouken@101
    90
				for (;;) {
slouken@101
    91
					bits[ofs++] = pixel0;     /* even count, high nibble */
slouken@101
    92
					if (!--ch) break;
slouken@101
    93
					bits[ofs++] = pixel1;     /* odd count, low nibble */
slouken@101
    94
					if (!--ch) break;
slouken@101
    95
				}
slouken@101
    96
			}
slouken@101
    97
		} else {
slouken@101
    98
			/*
slouken@101
    99
			| A leading zero is an escape; it may signal the end of the bitmap,
slouken@101
   100
			| a cursor move, or some absolute data.
slouken@101
   101
			| zero tag may be absolute mode or an escape
slouken@101
   102
			*/
slouken@101
   103
			if ( !SDL_RWread(src, &ch, 1, 1) ) return 1;
slouken@101
   104
			switch (ch) {
slouken@101
   105
			case 0:                         /* end of line */
slouken@101
   106
				ofs = 0;
slouken@101
   107
				bits -= pitch;               /* go to previous */
slouken@101
   108
				break;
slouken@101
   109
			case 1:                         /* end of bitmap */
slouken@101
   110
				return 0;                    /* success! */
slouken@101
   111
			case 2:                         /* delta */
slouken@101
   112
				if ( !SDL_RWread(src, &ch, 1, 1) ) return 1;
slouken@101
   113
				ofs += ch;
slouken@101
   114
				if ( !SDL_RWread(src, &ch, 1, 1) ) return 1;
slouken@101
   115
				bits -= (ch * pitch);
slouken@101
   116
				break;
slouken@101
   117
			default:                        /* no compression */
slouken@101
   118
				if (isRle8) {
slouken@101
   119
					needsPad = ( ch & 1 );
slouken@101
   120
					do {
slouken@101
   121
						if ( !SDL_RWread(src, bits + ofs++, 1, 1) ) return 1;
slouken@101
   122
					} while (--ch);
slouken@101
   123
				} else {
slouken@101
   124
					needsPad = ( ((ch+1)>>1) & 1 ); /* (ch+1)>>1: bytes size */
slouken@101
   125
					for (;;) {
slouken@101
   126
						Uint8 pixel;
slouken@101
   127
						if ( !SDL_RWread(src, &pixel, 1, 1) ) return 1;
slouken@101
   128
						bits[ofs++] = pixel >> 4;
slouken@101
   129
						if (!--ch) break;
slouken@101
   130
						bits[ofs++] = pixel & 0x0F;
slouken@101
   131
						if (!--ch) break;
slouken@101
   132
					}
slouken@101
   133
				}
slouken@101
   134
				/* pad at even boundary */
slouken@101
   135
				if ( needsPad && !SDL_RWread(src, &ch, 1, 1) ) return 1;
slouken@101
   136
				break;
slouken@101
   137
			}
slouken@101
   138
		}
slouken@101
   139
	}
slouken@101
   140
}
slouken@101
   141
slouken@101
   142
static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)
slouken@101
   143
{
slouken@101
   144
	int was_error;
slouken@101
   145
	long fp_offset;
slouken@101
   146
	int bmpPitch;
slouken@101
   147
	int i, pad;
slouken@101
   148
	SDL_Surface *surface;
slouken@101
   149
	Uint32 Rmask;
slouken@101
   150
	Uint32 Gmask;
slouken@101
   151
	Uint32 Bmask;
slouken@106
   152
	Uint32 Amask;
slouken@101
   153
	SDL_Palette *palette;
slouken@101
   154
	Uint8 *bits;
slouken@101
   155
	int ExpandBMP;
slouken@101
   156
slouken@101
   157
	/* The Win32 BMP file header (14 bytes) */
slouken@101
   158
	char   magic[2];
slouken@101
   159
	Uint32 bfSize;
slouken@101
   160
	Uint16 bfReserved1;
slouken@101
   161
	Uint16 bfReserved2;
slouken@101
   162
	Uint32 bfOffBits;
slouken@101
   163
slouken@101
   164
	/* The Win32 BITMAPINFOHEADER struct (40 bytes) */
slouken@101
   165
	Uint32 biSize;
slouken@101
   166
	Sint32 biWidth;
slouken@101
   167
	Sint32 biHeight;
slouken@101
   168
	Uint16 biPlanes;
slouken@101
   169
	Uint16 biBitCount;
slouken@101
   170
	Uint32 biCompression;
slouken@101
   171
	Uint32 biSizeImage;
slouken@101
   172
	Sint32 biXPelsPerMeter;
slouken@101
   173
	Sint32 biYPelsPerMeter;
slouken@101
   174
	Uint32 biClrUsed;
slouken@101
   175
	Uint32 biClrImportant;
slouken@101
   176
slouken@101
   177
	/* Make sure we are passed a valid data source */
slouken@101
   178
	surface = NULL;
slouken@101
   179
	was_error = 0;
slouken@101
   180
	if ( src == NULL ) {
slouken@101
   181
		was_error = 1;
slouken@101
   182
		goto done;
slouken@101
   183
	}
slouken@101
   184
slouken@101
   185
	/* Read in the BMP file header */
slouken@101
   186
	fp_offset = SDL_RWtell(src);
slouken@101
   187
	SDL_ClearError();
slouken@101
   188
	if ( SDL_RWread(src, magic, 1, 2) != 2 ) {
slouken@101
   189
		SDL_Error(SDL_EFREAD);
slouken@101
   190
		was_error = 1;
slouken@101
   191
		goto done;
slouken@101
   192
	}
slouken@101
   193
	if ( strncmp(magic, "BM", 2) != 0 ) {
slouken@101
   194
		SDL_SetError("File is not a Windows BMP file");
slouken@101
   195
		was_error = 1;
slouken@101
   196
		goto done;
slouken@101
   197
	}
slouken@101
   198
	bfSize		= SDL_ReadLE32(src);
slouken@101
   199
	bfReserved1	= SDL_ReadLE16(src);
slouken@101
   200
	bfReserved2	= SDL_ReadLE16(src);
slouken@101
   201
	bfOffBits	= SDL_ReadLE32(src);
slouken@101
   202
slouken@101
   203
	/* Read the Win32 BITMAPINFOHEADER */
slouken@101
   204
	biSize		= SDL_ReadLE32(src);
slouken@101
   205
	if ( biSize == 12 ) {
slouken@101
   206
		biWidth		= (Uint32)SDL_ReadLE16(src);
slouken@101
   207
		biHeight	= (Uint32)SDL_ReadLE16(src);
slouken@101
   208
		biPlanes	= SDL_ReadLE16(src);
slouken@101
   209
		biBitCount	= SDL_ReadLE16(src);
slouken@101
   210
		biCompression	= BI_RGB;
slouken@101
   211
		biSizeImage	= 0;
slouken@101
   212
		biXPelsPerMeter	= 0;
slouken@101
   213
		biYPelsPerMeter	= 0;
slouken@101
   214
		biClrUsed	= 0;
slouken@101
   215
		biClrImportant	= 0;
slouken@101
   216
	} else {
slouken@101
   217
		biWidth		= SDL_ReadLE32(src);
slouken@101
   218
		biHeight	= SDL_ReadLE32(src);
slouken@101
   219
		biPlanes	= SDL_ReadLE16(src);
slouken@101
   220
		biBitCount	= SDL_ReadLE16(src);
slouken@101
   221
		biCompression	= SDL_ReadLE32(src);
slouken@101
   222
		biSizeImage	= SDL_ReadLE32(src);
slouken@101
   223
		biXPelsPerMeter	= SDL_ReadLE32(src);
slouken@101
   224
		biYPelsPerMeter	= SDL_ReadLE32(src);
slouken@101
   225
		biClrUsed	= SDL_ReadLE32(src);
slouken@101
   226
		biClrImportant	= SDL_ReadLE32(src);
slouken@101
   227
	}
slouken@101
   228
slouken@101
   229
	/* Check for read error */
slouken@101
   230
	if ( strcmp(SDL_GetError(), "") != 0 ) {
slouken@101
   231
		was_error = 1;
slouken@101
   232
		goto done;
slouken@101
   233
	}
slouken@101
   234
slouken@101
   235
	/* Expand 1 and 4 bit bitmaps to 8 bits per pixel */
slouken@101
   236
	switch (biBitCount) {
slouken@101
   237
		case 1:
slouken@101
   238
		case 4:
slouken@101
   239
			ExpandBMP = biBitCount;
slouken@101
   240
			biBitCount = 8;
slouken@101
   241
			break;
slouken@101
   242
		default:
slouken@101
   243
			ExpandBMP = 0;
slouken@101
   244
			break;
slouken@101
   245
	}
slouken@101
   246
slouken@101
   247
	/* RLE4 and RLE8 BMP compression is supported */
slouken@106
   248
	Rmask = Gmask = Bmask = Amask = 0;
slouken@101
   249
	switch (biCompression) {
slouken@101
   250
		case BI_RGB:
slouken@101
   251
			/* If there are no masks, use the defaults */
slouken@101
   252
			if ( bfOffBits == (14+biSize) ) {
slouken@101
   253
				/* Default values for the BMP format */
slouken@101
   254
				switch (biBitCount) {
slouken@101
   255
					case 15:
slouken@101
   256
					case 16:
slouken@101
   257
						Rmask = 0x7C00;
slouken@101
   258
						Gmask = 0x03E0;
slouken@101
   259
						Bmask = 0x001F;
slouken@101
   260
						break;
slouken@101
   261
					case 24:
slouken@101
   262
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
slouken@101
   263
					        Rmask = 0x000000FF;
slouken@101
   264
					        Gmask = 0x0000FF00;
slouken@101
   265
					        Bmask = 0x00FF0000;
slouken@106
   266
#else
slouken@106
   267
						Rmask = 0x00FF0000;
slouken@106
   268
						Gmask = 0x0000FF00;
slouken@106
   269
						Bmask = 0x000000FF;
slouken@106
   270
#endif
slouken@101
   271
						break;
slouken@101
   272
					case 32:
slouken@106
   273
						Amask = 0xFF000000;
slouken@101
   274
						Rmask = 0x00FF0000;
slouken@101
   275
						Gmask = 0x0000FF00;
slouken@101
   276
						Bmask = 0x000000FF;
slouken@101
   277
						break;
slouken@101
   278
					default:
slouken@101
   279
						break;
slouken@101
   280
				}
slouken@101
   281
				break;
slouken@101
   282
			}
slouken@101
   283
			/* Fall through -- read the RGB masks */
slouken@101
   284
slouken@101
   285
		default:
slouken@101
   286
			switch (biBitCount) {
slouken@101
   287
				case 15:
slouken@101
   288
				case 16:
slouken@101
   289
				case 32:
slouken@101
   290
					Rmask = SDL_ReadLE32(src);
slouken@101
   291
					Gmask = SDL_ReadLE32(src);
slouken@101
   292
					Bmask = SDL_ReadLE32(src);
slouken@106
   293
					Amask = SDL_ReadLE32(src);
slouken@101
   294
					break;
slouken@101
   295
				default:
slouken@101
   296
					break;
slouken@101
   297
			}
slouken@101
   298
			break;
slouken@101
   299
	}
slouken@101
   300
slouken@101
   301
	/* Create a compatible surface, note that the colors are RGB ordered */
slouken@101
   302
	surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
slouken@106
   303
			biWidth, biHeight, biBitCount, Rmask, Gmask, Bmask, Amask);
slouken@101
   304
	if ( surface == NULL ) {
slouken@101
   305
		was_error = 1;
slouken@101
   306
		goto done;
slouken@101
   307
	}
slouken@101
   308
slouken@101
   309
	/* Load the palette, if any */
slouken@101
   310
	palette = (surface->format)->palette;
slouken@101
   311
	if ( palette ) {
slouken@151
   312
		if ( SDL_RWseek(src, fp_offset+14+biSize, SEEK_SET) < 0 ) {
slouken@151
   313
			SDL_Error(SDL_EFSEEK);
slouken@151
   314
			was_error = 1;
slouken@151
   315
			goto done;
slouken@151
   316
		}
slouken@151
   317
slouken@101
   318
		/*
slouken@101
   319
		| guich: always use 1<<bpp b/c some bitmaps can bring wrong information
slouken@101
   320
		| for colorsUsed
slouken@101
   321
		*/
slouken@101
   322
		/* if ( biClrUsed == 0 ) {  */
slouken@101
   323
		biClrUsed = 1 << biBitCount;
slouken@101
   324
		/* } */
slouken@101
   325
		if ( biSize == 12 ) {
slouken@101
   326
			for ( i = 0; i < (int)biClrUsed; ++i ) {
slouken@101
   327
				SDL_RWread(src, &palette->colors[i].b, 1, 1);
slouken@101
   328
				SDL_RWread(src, &palette->colors[i].g, 1, 1);
slouken@101
   329
				SDL_RWread(src, &palette->colors[i].r, 1, 1);
slouken@101
   330
				palette->colors[i].unused = 0;
slouken@101
   331
			}	
slouken@101
   332
		} else {
slouken@101
   333
			for ( i = 0; i < (int)biClrUsed; ++i ) {
slouken@101
   334
				SDL_RWread(src, &palette->colors[i].b, 1, 1);
slouken@101
   335
				SDL_RWread(src, &palette->colors[i].g, 1, 1);
slouken@101
   336
				SDL_RWread(src, &palette->colors[i].r, 1, 1);
slouken@101
   337
				SDL_RWread(src, &palette->colors[i].unused, 1, 1);
slouken@101
   338
			}	
slouken@101
   339
		}
slouken@101
   340
		palette->ncolors = biClrUsed;
slouken@101
   341
	}
slouken@101
   342
slouken@101
   343
	/* Read the surface pixels.  Note that the bmp image is upside down */
slouken@101
   344
	if ( SDL_RWseek(src, fp_offset+bfOffBits, SEEK_SET) < 0 ) {
slouken@101
   345
		SDL_Error(SDL_EFSEEK);
slouken@101
   346
		was_error = 1;
slouken@101
   347
		goto done;
slouken@101
   348
	}
slouken@101
   349
	if ((biCompression == BI_RLE4) || (biCompression == BI_RLE8)) {
slouken@101
   350
		was_error = readRlePixels(surface, src, biCompression == BI_RLE8);
slouken@101
   351
		if (was_error) SDL_SetError("Error reading from BMP");
slouken@101
   352
		goto done;
slouken@101
   353
	}
slouken@101
   354
	bits = (Uint8 *)surface->pixels+(surface->h*surface->pitch);
slouken@101
   355
	switch (ExpandBMP) {
slouken@101
   356
		case 1:
slouken@101
   357
			bmpPitch = (biWidth + 7) >> 3;
slouken@101
   358
			pad  = (((bmpPitch)%4) ? (4-((bmpPitch)%4)) : 0);
slouken@101
   359
			break;
slouken@101
   360
		case 4:
slouken@101
   361
			bmpPitch = (biWidth + 1) >> 1;
slouken@101
   362
			pad  = (((bmpPitch)%4) ? (4-((bmpPitch)%4)) : 0);
slouken@101
   363
			break;
slouken@101
   364
		default:
slouken@101
   365
			pad  = ((surface->pitch%4) ?
slouken@101
   366
					(4-(surface->pitch%4)) : 0);
slouken@101
   367
			break;
slouken@101
   368
	}
slouken@101
   369
	while ( bits > (Uint8 *)surface->pixels ) {
slouken@101
   370
		bits -= surface->pitch;
slouken@101
   371
		switch (ExpandBMP) {
slouken@101
   372
			case 1:
slouken@101
   373
			case 4: {
slouken@101
   374
			Uint8 pixel = 0;
slouken@101
   375
			int   shift = (8-ExpandBMP);
slouken@101
   376
			for ( i=0; i<surface->w; ++i ) {
slouken@101
   377
				if ( i%(8/ExpandBMP) == 0 ) {
slouken@101
   378
					if ( !SDL_RWread(src, &pixel, 1, 1) ) {
slouken@101
   379
						SDL_SetError(
slouken@101
   380
					"Error reading from BMP");
slouken@101
   381
						was_error = 1;
slouken@101
   382
						goto done;
slouken@101
   383
					}
slouken@101
   384
				}
slouken@101
   385
				*(bits+i) = (pixel>>shift);
slouken@101
   386
				pixel <<= ExpandBMP;
slouken@101
   387
			} }
slouken@101
   388
			break;
slouken@101
   389
slouken@101
   390
			default:
slouken@101
   391
			if ( SDL_RWread(src, bits, 1, surface->pitch)
slouken@101
   392
							 != surface->pitch ) {
slouken@101
   393
				SDL_Error(SDL_EFREAD);
slouken@101
   394
				was_error = 1;
slouken@101
   395
				goto done;
slouken@101
   396
			}
slouken@101
   397
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
slouken@101
   398
			/* Byte-swap the pixels if needed. Note that the 24bpp
slouken@101
   399
			   case has already been taken care of above. */
slouken@101
   400
			switch(biBitCount) {
slouken@101
   401
				case 15:
slouken@101
   402
				case 16: {
slouken@101
   403
				        Uint16 *pix = (Uint16 *)bits;
slouken@101
   404
					for(i = 0; i < surface->w; i++)
slouken@101
   405
					        pix[i] = SDL_Swap16(pix[i]);
slouken@101
   406
					break;
slouken@101
   407
				}
slouken@101
   408
slouken@101
   409
				case 32: {
slouken@101
   410
				        Uint32 *pix = (Uint32 *)bits;
slouken@101
   411
					for(i = 0; i < surface->w; i++)
slouken@101
   412
					        pix[i] = SDL_Swap32(pix[i]);
slouken@101
   413
					break;
slouken@101
   414
				}
slouken@101
   415
			}
slouken@101
   416
#endif
slouken@101
   417
			break;
slouken@101
   418
		}
slouken@101
   419
		/* Skip padding bytes, ugh */
slouken@101
   420
		if ( pad ) {
slouken@101
   421
			Uint8 padbyte;
slouken@101
   422
			for ( i=0; i<pad; ++i ) {
slouken@101
   423
				SDL_RWread(src, &padbyte, 1, 1);
slouken@101
   424
			}
slouken@101
   425
		}
slouken@101
   426
	}
slouken@101
   427
done:
slouken@101
   428
	if ( was_error ) {
slouken@118
   429
		if ( src ) {
slouken@118
   430
			SDL_RWseek(src, fp_offset, SEEK_SET);
slouken@118
   431
		}
slouken@101
   432
		if ( surface ) {
slouken@101
   433
			SDL_FreeSurface(surface);
slouken@101
   434
		}
slouken@101
   435
		surface = NULL;
slouken@101
   436
	}
slouken@101
   437
	if ( freesrc && src ) {
slouken@101
   438
		SDL_RWclose(src);
slouken@101
   439
	}
slouken@101
   440
	return(surface);
slouken@101
   441
}
slouken@101
   442
slouken@0
   443
/* Load a BMP type image from an SDL datasource */
slouken@0
   444
SDL_Surface *IMG_LoadBMP_RW(SDL_RWops *src)
slouken@0
   445
{
slouken@101
   446
	return(LoadBMP_RW(src, 0));
slouken@0
   447
}
slouken@0
   448
slouken@0
   449
#else
slouken@0
   450
slouken@0
   451
/* See if an image is contained in a data source */
slouken@0
   452
int IMG_isBMP(SDL_RWops *src)
slouken@0
   453
{
slouken@0
   454
	return(0);
slouken@0
   455
}
slouken@0
   456
slouken@0
   457
/* Load a BMP type image from an SDL datasource */
slouken@0
   458
SDL_Surface *IMG_LoadBMP_RW(SDL_RWops *src)
slouken@0
   459
{
slouken@0
   460
	return(NULL);
slouken@0
   461
}
slouken@0
   462
slouken@0
   463
#endif /* LOAD_BMP */