deepstone

annotate src/texture.h @ 27:dcfe615c4c5f

moved firstp.c to main.c
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 22 Sep 2013 02:47:46 +0300
parents c3e0bccd673e
children
rev   line source
nuclear@3 1 /*
nuclear@3 2 256-color 3D graphics hack for real-mode DOS.
nuclear@3 3 Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org>
nuclear@3 4
nuclear@3 5 This program is free software: you can redistribute it and/or modify
nuclear@3 6 it under the terms of the GNU General Public License as published by
nuclear@3 7 the Free Software Foundation, either version 3 of the License, or
nuclear@3 8 (at your option) any later version.
nuclear@3 9
nuclear@3 10 This program is distributed in the hope that it will be useful,
nuclear@3 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@3 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@3 13 GNU General Public License for more details.
nuclear@3 14
nuclear@3 15 You should have received a copy of the GNU General Public License
nuclear@3 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@3 17 */
nuclear@3 18 #ifndef TEXTURE_H_
nuclear@3 19 #define TEXTURE_H_
nuclear@3 20
nuclear@3 21 struct texture {
nuclear@3 22 int width, height;
nuclear@3 23 unsigned char *pixels;
nuclear@4 24
nuclear@4 25 struct {
nuclear@4 26 unsigned char r, g, b;
nuclear@4 27 } *palette;
nuclear@4 28 int num_colors;
nuclear@4 29
nuclear@4 30 FILE *file;
nuclear@3 31 };
nuclear@3 32
nuclear@4 33 struct texture *load_texture(const char *fname);
nuclear@4 34 void free_texture(struct texture *tex);
nuclear@3 35
nuclear@4 36 unsigned char *get_texture_pixels(struct texture *tex);
nuclear@4 37 int find_texture_color(struct texture *tex, int r, int g, int b);
nuclear@4 38
nuclear@7 39 struct texture *tex_gen_checker(int xsz, int ysz, int usub, int vsub, int c1, int c2);
nuclear@7 40
nuclear@3 41 #endif /* TEXTURE_H_ */