Subversion Repositories ipe_artfile_utils

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 daniel-mar 1
/**
2
 * Bitmap Export for Imagination Pilots Entertainment 32-bit games (IPE32)
3
 * - Where's Waldo? Exploring Geography
4
 * - Eraser Turnabout by Imagination Pilots
5
 * - Virtual K'Nex by Imagination Pilots
6
 * ART file packer and unpacker by Daniel Marschall, ViaThinkSoft (C) 2014-2018
7
 * Revision: 2018-02-15
8
 **/
9
 
10
#include <stdio.h>
11
#include <stdint.h>
12
#include <stdlib.h>
13
#include <string.h>
14
 
15
#include "bitmap.h"
16
#include "ipe32_bmpexport.h"
17
 
18
void ipe32_write_bmp(FILE* output, unsigned char* imagedata, size_t imagedata_len) {
19
        BITMAPFILEHEADER bh={0};
20
        bh.bfType = BI_SIGNATURE;
21
        bh.bfSize = sizeof(bh) + imagedata_len;
22
        bh.bfReserved1 = 0;
23
        bh.bfReserved2 = 0;
24
        bh.bfOffBits = 0x436;
25
 
26
        fwrite(&bh, 1, sizeof(bh), output);
27
        fwrite(imagedata, 1, imagedata_len, output);
28
}
29