]> 4ch.mooo.com Git - 16.git/blob - 16/sauce/tile.h
04dfb2dffa865e11a2bcaeb619f76a80b2e4515c
[16.git] / 16 / sauce / tile.h
1 #ifndef tile_h
2 #define tile_h
3
4
5 #define NUMTIMAGE 10    // size of tile image array
6
7 // all tiles are 16x16 images with no background scanning
8 typedef struct tile_typ
9     {
10     int x_loc;
11     int y_loc;
12     short numimages;
13     short curimage;
14     short state;
15     unsigned char far * images[NUMTIMAGE];
16     }tile;
17
18 //FUNCTIONS
19
20 // allocate memory for a tile with images[frames]
21 // sets tile.state = 0;  returns 1 if memory not allocated
22 int tilecreate(tile *ntile, int frames);
23
24 //frees image memory used by tile
25 void tileclose(tile *dtile);
26
27 // reads all tile images from double buffer
28 // images must be in double buffer b4 called
29 void tileload (tile * in);
30
31 // writes tile to screen(dest points to upper left corner)
32 // at location (tile.x_loc,tile.y_loc)
33 writetile(tile *out, unsigned char far* dest);
34
35 // writes tile to screen(dest) clipping the left or right
36 // edge if necessary, returns 0 if tile completely off screen 
37 int writetile_xclip(tile *out, unsigned char far* dest);
38
39 #endif