nuclear@3: /* nuclear@3: 256-color 3D graphics hack for real-mode DOS. nuclear@3: Copyright (C) 2011 John Tsiombikas nuclear@3: nuclear@3: This program is free software: you can redistribute it and/or modify nuclear@3: it under the terms of the GNU General Public License as published by nuclear@3: the Free Software Foundation, either version 3 of the License, or nuclear@3: (at your option) any later version. nuclear@3: nuclear@3: This program is distributed in the hope that it will be useful, nuclear@3: but WITHOUT ANY WARRANTY; without even the implied warranty of nuclear@3: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nuclear@3: GNU General Public License for more details. nuclear@3: nuclear@3: You should have received a copy of the GNU General Public License nuclear@3: along with this program. If not, see . nuclear@3: */ nuclear@3: nuclear@3: #include nuclear@3: #include "texture.h" nuclear@3: #include "palman.h" nuclear@3: nuclear@3: struct texture *tex_load(const char *fname) nuclear@3: { nuclear@3: return 0; /* TODO */ nuclear@3: } nuclear@3: nuclear@3: struct texture *tex_gen_checker(int xsz, int ysz, int ush, int vsh, int c1, int c2) nuclear@3: { nuclear@3: int i, j; nuclear@3: struct texture *tex; nuclear@3: unsigned char *pptr; nuclear@3: nuclear@3: if(!(tex = malloc(sizeof *tex))) { nuclear@3: return 0; nuclear@3: } nuclear@3: if(!(tex->pixels = malloc(xsz * ysz))) { nuclear@3: free(tex); nuclear@3: return 0; nuclear@3: } nuclear@3: tex->width = xsz; nuclear@3: tex->height = ysz; nuclear@3: nuclear@3: pptr = tex->pixels; nuclear@3: for(i=0; i> vsh) & 1) == ((j >> ush) & 1) ? c1 : c2; nuclear@3: *pptr++ = c; nuclear@3: } nuclear@3: } nuclear@3: return tex; nuclear@3: }