-static const unsigned char concharimage[FONT_FILESIZE] =
-{
-#include "lhfont.h"
-};
-
-static rtexture_t *draw_generateconchars(void)
-{
- int i;
- unsigned char *data;
- double random;
- rtexture_t *tex;
-
- data = LoadTGA_BGRA (concharimage, FONT_FILESIZE, NULL);
-// Gold numbers
- for (i = 0;i < 8192;i++)
- {
- random = lhrandom (0.0,1.0);
- data[i*4+3] = data[i*4+0];
- data[i*4+2] = 83 + (unsigned char)(random * 64);
- data[i*4+1] = 71 + (unsigned char)(random * 32);
- data[i*4+0] = 23 + (unsigned char)(random * 16);
- }
-// White chars
- for (i = 8192;i < 32768;i++)
- {
- random = lhrandom (0.0,1.0);
- data[i*4+3] = data[i*4+0];
- data[i*4+2] = 95 + (unsigned char)(random * 64);
- data[i*4+1] = 95 + (unsigned char)(random * 64);
- data[i*4+0] = 95 + (unsigned char)(random * 64);
- }
-// Gold numbers
- for (i = 32768;i < 40960;i++)
- {
- random = lhrandom (0.0,1.0);
- data[i*4+3] = data[i*4+0];
- data[i*4+2] = 83 + (unsigned char)(random * 64);
- data[i*4+1] = 71 + (unsigned char)(random * 32);
- data[i*4+0] = 23 + (unsigned char)(random * 16);
- }
-// Red chars
- for (i = 40960;i < 65536;i++)
- {
- random = lhrandom (0.0,1.0);
- data[i*4+3] = data[i*4+0];
- data[i*4+2] = 96 + (unsigned char)(random * 64);
- data[i*4+1] = 43 + (unsigned char)(random * 32);
- data[i*4+0] = 27 + (unsigned char)(random * 32);
- }
-
-#if 0
- Image_WriteTGABGRA ("gfx/generated_conchars.tga", 256, 256, data);
-#endif
-
- tex = R_LoadTexture2D(drawtexturepool, "conchars", 256, 256, data, TEXTYPE_BGRA, TEXF_ALPHA, -1, NULL);
- Mem_Free(data);
- return tex;
-}
-
-static rtexture_t *draw_generateditherpattern(void)
-{
- int x, y;
- unsigned char pixels[8][8];
- for (y = 0;y < 8;y++)
- for (x = 0;x < 8;x++)
- pixels[y][x] = ((x^y) & 4) ? 254 : 0;
- return R_LoadTexture2D(drawtexturepool, "ditherpattern", 8, 8, pixels[0], TEXTYPE_PALETTE, TEXF_FORCENEAREST, -1, palette_bgra_transparent);
-}
-
-typedef struct embeddedpic_s
-{
- const char *name;
- int width;
- int height;
- const char *pixels;
-}
-embeddedpic_t;
-
-static const embeddedpic_t embeddedpics[] =
-{
- {
- "gfx/prydoncursor001", 16, 16,
- "477777774......."
- "77.....6........"
- "7.....6........."
- "7....6.........."
- "7.....6........."
- "7..6...6........"
- "7.6.6...6......."
- "76...6...6......"
- "4.....6.6......."
- ".......6........"
- "................"
- "................"
- "................"
- "................"
- "................"
- "................"
- },
- {
- "ui/mousepointer", 16, 16,
- "477777774......."
- "77.....6........"
- "7.....6........."
- "7....6.........."
- "7.....6........."
- "7..6...6........"
- "7.6.6...6......."
- "76...6...6......"
- "4.....6.6......."
- ".......6........"
- "................"
- "................"
- "................"
- "................"
- "................"
- "................"
- },
- {
- "gfx/crosshair1", 16, 16,
- "................"
- "................"
- "................"
- "...33......33..."
- "...355....553..."
- "....577..775...."
- ".....77..77....."
- "................"
- "................"
- ".....77..77....."
- "....577..775...."
- "...355....553..."
- "...33......33..."
- "................"
- "................"
- "................"
- },
- {
- "gfx/crosshair2", 16, 16,
- "................"
- "................"
- "................"
- "...3........3..."
- "....5......5...."
- ".....7....7....."
- "......7..7......"
- "................"
- "................"
- "......7..7......"
- ".....7....7....."
- "....5......5...."
- "...3........3..."
- "................"
- "................"
- "................"
- },
- {
- "gfx/crosshair3", 16, 16,
- "................"
- ".......77......."
- ".......77......."
- "................"
- "................"
- ".......44......."
- ".......44......."
- ".77..44..44..77."
- ".77..44..44..77."
- ".......44......."
- ".......44......."
- "................"
- "................"
- ".......77......."
- ".......77......."
- "................"
- },
- {
- "gfx/crosshair4", 16, 16,
- "................"
- "................"
- "................"
- "................"
- "................"
- "................"
- "................"
- "................"
- "........7777777."
- "........752....."
- "........72......"
- "........7......."
- "........7......."
- "........7......."
- "........7......."
- "................"
- },
- {
- "gfx/crosshair5", 8, 8,
- "........"
- "........"
- "....7..."
- "........"
- "..7.7.7."
- "........"
- "....7..."
- "........"
- },
- {
- "gfx/crosshair6", 2, 2,
- "77"
- "77"
- },
- {
- "gfx/crosshair7", 16, 16,
- "................"
- ".3............3."
- "..5...2332...5.."
- "...7.3....3.7..."
- "....7......7...."
- "...3.7....7.3..."
- "..2...7..7...2.."
- "..3..........3.."
- "..3..........3.."
- "..2...7..7...2.."
- "...3.7....7.3..."
- "....7......7...."
- "...7.3....3.7..."
- "..5...2332...5.."
- ".3............3."
- "................"
- },
- {NULL, 0, 0, NULL}
-};
-
-static rtexture_t *draw_generatepic(const char *name, qboolean quiet)
-{
- const embeddedpic_t *p;
- for (p = embeddedpics;p->name;p++)
- if (!strcmp(name, p->name))
- return R_LoadTexture2D(drawtexturepool, p->name, p->width, p->height, (const unsigned char *)p->pixels, TEXTYPE_PALETTE, TEXF_ALPHA, -1, palette_bgra_embeddedpic);
- if (!strcmp(name, "gfx/conchars"))
- return draw_generateconchars();
- if (!strcmp(name, "gfx/colorcontrol/ditherpattern"))
- return draw_generateditherpattern();
- if (!quiet)
- Con_DPrintf("Draw_CachePic: failed to load %s\n", name);
- return r_texture_notexture;
-}
-