Add Z-buffer, fixes issue with pyramidal studs
[render.git] / tga.h
1 #ifndef _TGA_H
2 #define _TGA_H
3
4 #include <stdint.h>
5 #include "array.h"
6
7 #pragma pack(push, 1)
8 struct tga_head
9 {
10   uint8_t id_length;
11   uint8_t color_map_type;
12   uint8_t image_type;
13   uint16_t color_map_offset;
14   uint16_t color_map_length;
15   uint8_t color_map_size;
16   uint16_t image_x_origin;
17   uint16_t image_y_origin;
18   uint16_t image_width;
19   uint16_t image_height;
20   uint8_t image_depth;
21   uint8_t image_descriptor;
22 };
23 #pragma pack(pop)
24
25 struct tga {
26   struct tga_head head;
27   struct array *data;
28 };
29
30 struct tga *tga_read(const char *filename);
31 void tga_free(struct tga *self);
32
33 #endif