/* * This file is part of OpenTTD. * OpenTTD 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, version 2. * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>. *//** @file bmp.h Read and write support for bmps. */#ifndef BMP_H#define BMP_H#include"gfx_type.h"structBmpInfo{uint32offset;///< offset of bitmap data from .bmp file beginninguint32width;///< bitmap widthuint32height;///< bitmap heightboolos2_bmp;///< true if OS/2 1.x or windows 2.x bitmapuint16bpp;///< bits per pixeluint32compression;///< compression method (0 = none, 1 = 8-bit RLE, 2 = 4-bit RLE)uint32palette_size;///< number of colours in palette};structBmpData{Colour*palette;byte*bitmap;};#define BMP_BUFFER_SIZE 1024structBmpBuffer{bytedata[BMP_BUFFER_SIZE];intpos;intread;FILE*file;uintreal_pos;};voidBmpInitializeBuffer(BmpBuffer*buffer,FILE*file);boolBmpReadHeader(BmpBuffer*buffer,BmpInfo*info,BmpData*data);boolBmpReadBitmap(BmpBuffer*buffer,BmpInfo*info,BmpData*data);voidBmpDestroyData(BmpData*data);#endif /* BMP_H */