-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBMAP.H
62 lines (54 loc) · 2.02 KB
/
BMAP.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Bitmap.h
#ifndef BMAPH
#define BMAPH
#include "datasize.h"
typedef struct RGBcol {
unsigned char R, G, B;
} RGBcol;
struct PCXheader { // Header för filer av typen PCX
char mfacturer; // ID-byte, 0A (10) betyder PCX
char version; // Version av PCX-formatet bilden sparats i
char encoding; // Packningsmetod, alltid 1 = R(un)L(ength)E(ncoding)
char bit_per_pixel; // Bitsperpixel, 8 = 256 colour, 4 = 16 cols..
short Xmin; // Bla bla
short Ymin; // Bla bla
short Xmax; // Max X
short Ymax; // Max Y
short Hres; // nåt med printern
short Vres;
char hpalette[48]; // skräp (för EGA-kort)
char reserved; // reserverad
char planes; // Colour planes, 1 för 256c-läge
short bpline; // Bytes per horisontell linje
short palettetype; // ska vara 1
char filler[58]; // reserverade/ej specifierade...
};
#define EXTRAS_NONE 0
#define EXTRAS_ARRAY 1
#define EXTRAS_BITMAP 2
typedef struct Bitmap {
int xSize, ySize;
uchar *data;
void *extras;
int extrasType;
RGBcol cols[256];
int transpVal;
int projectionDistance; // needed in perspective correct texture mapping
int bCmdBlock, blockRefresh;
char pathOrBlockString[256];
struct Bitmap *next;
} Bitmap;
int PCXload (Bitmap *bild,char filename[]); // only 256 color image supported (but should use only first 16 colors for cmdgfx)
void putBitmap (int x, int y, Bitmap *bild);
void put_transparent_Bitmap (int x, int y, Bitmap *bild);
void putBitmap_scaled (int x, int y, int xrange, int yrange, Bitmap *bild);
void put_transBitmap_scaled (int x, int y, int xrange, int yrange, Bitmap *bild);
void shadeBitmap (int x, int y, Bitmap *bild, int addon);
void freeBitmap(Bitmap *bild, int bFreeBasePointer);
#ifdef _RGB32
int BMPload (Bitmap *bild,char filename[]); // only 32-bit
int BMPsave (uchar *cols,char filename[], int w, int h);
int BXYsave (unsigned char *chars, uchar *cols, char filename[], int w, int h);
int BXYload (Bitmap *bCols,Bitmap *bChars,char filename[]);
#endif
#endif