deepstone
diff src/texture.h @ 4:c3e0bccd673e
added texture mapping
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 21 Nov 2011 11:51:23 +0200 |
parents | 0e781cc43178 |
children | 3239511d1a76 |
line diff
1.1 --- a/src/texture.h Mon Nov 21 10:16:09 2011 +0200 1.2 +++ b/src/texture.h Mon Nov 21 11:51:23 2011 +0200 1.3 @@ -21,10 +21,21 @@ 1.4 struct texture { 1.5 int width, height; 1.6 unsigned char *pixels; 1.7 + 1.8 + struct { 1.9 + unsigned char r, g, b; 1.10 + } *palette; 1.11 + int num_colors; 1.12 + 1.13 + FILE *file; 1.14 }; 1.15 1.16 -struct texture *tex_load(const char *fname); 1.17 +struct texture *load_texture(const char *fname); 1.18 +void free_texture(struct texture *tex); 1.19 1.20 struct texture *tex_gen_checker(int xsz, int ysz, int usub, int vsub, int c1, int c2); 1.21 1.22 +unsigned char *get_texture_pixels(struct texture *tex); 1.23 +int find_texture_color(struct texture *tex, int r, int g, int b); 1.24 + 1.25 #endif /* TEXTURE_H_ */