#include #include #include char shaders[][64] = { "fixedemu", "q3terrain", "altwater", "bloom_blur", "bloom_filter", "bloom_final", "colourtint", "crepuscular_opaque", "crepuscular_rays", "crepuscular_sky", "depthonly", "default2d", "defaultadditivesprite", "defaultskin", "defaultsky", "defaultskybox", "defaultfill", "defaultsprite", "defaultwall", "defaultwarp", "defaultgammacb", "drawflat_wall", "wireframe", "itemtimer", "lpp_depthnorm", "lpp_light", "lpp_wall", "postproc_fisheye", "postproc_panorama", "postproc_laea", "postproc_stereographic", "postproc_equirectangular", "postproc_ascii", "fxaa", "underwaterwarp", "menutint", "terrain", "rtlight", "" }; void dumpprogstring(FILE *out, FILE *src) { int j; char line[1024]; while(fgets(line, sizeof(line), src)) { j = 0; while (line[j] == ' ' || line[j] == '\t') j++; if ((line[j] == '/' && line[j] == '/') || line[j] == '\r' || line[j] == '\n') { for (; line[j]; j++) { if (line[j] != '\r') fputc(line[j], out); } } else { fputc('\"', out); while (line[j] && line[j] != '\r' && line[j] != '\n') { if (line[j] == '\t') fputc(' ', out); else if (line[j] == '\"') { fputc('\\', out); fputc(line[j], out); } else fputc(line[j], out); j++; } fputs("\\n\"\n", out); } } fflush(out); } void dumpprogblob(FILE *out, FILE *src) { unsigned char *buf; unsigned int size; fseek(src, 0, SEEK_END); size = ftell(src); fseek(src, 0, SEEK_SET); buf = malloc(size); fread(buf, size, 1, src); size_t totallen, i, linelen; totallen = 0; linelen = 32; fprintf(out, "\""); for (i=0;i