#define MAX_CACHED_PICS 256
#define CACHEPICHASHSIZE 256
static cachepic_t *cachepichash[CACHEPICHASHSIZE];
#define MAX_CACHED_PICS 256
#define CACHEPICHASHSIZE 256
static cachepic_t *cachepichash[CACHEPICHASHSIZE];
static rtexture_t *draw_generateconchars(void)
{
int i;
qbyte buffer[65536][4], *data = NULL;
static rtexture_t *draw_generateconchars(void)
{
int i;
qbyte buffer[65536][4], *data = NULL;
- buffer[i][0] = 115;
- buffer[i][1] = 87;
- buffer[i][2] = 31;
+ random = lhrandom (0.0,1.0);
+ buffer[i][0] = 83 + (qbyte)(random * 64);
+ buffer[i][1] = 71 + (qbyte)(random * 32);
+ buffer[i][2] = 23 + (qbyte)(random * 16);
- buffer[i][0] = 123;
- buffer[i][1] = 123;
- buffer[i][2] = 123;
+ random = lhrandom (0.0,1.0);
+ buffer[i][0] = 95 + (qbyte)(random * 64);
+ buffer[i][1] = 95 + (qbyte)(random * 64);
+ buffer[i][2] = 95 + (qbyte)(random * 64);
- buffer[i][0] = 115;
- buffer[i][1] = 87;
- buffer[i][2] = 31;
+ random = lhrandom (0.0,1.0);
+ buffer[i][0] = 83 + (qbyte)(random * 64);
+ buffer[i][1] = 71 + (qbyte)(random * 32);
+ buffer[i][2] = 23 + (qbyte)(random * 16);
- buffer[i][0] = 143;
- buffer[i][1] = 67;
- buffer[i][2] = 51;
+ random = lhrandom (0.0,1.0);
+ buffer[i][0] = 96 + (qbyte)(random * 64);
+ buffer[i][1] = 43 + (qbyte)(random * 32);
+ buffer[i][2] = 27 + (qbyte)(random * 32);
Mem_Free(data);
return R_LoadTexture2D(drawtexturepool, "conchars", 256, 256, &buffer[0][0], TEXTYPE_RGBA, TEXF_ALPHA | TEXF_PRECACHE, NULL);
}
Mem_Free(data);
return R_LoadTexture2D(drawtexturepool, "conchars", 256, 256, &buffer[0][0], TEXTYPE_RGBA, TEXF_ALPHA | TEXF_PRECACHE, NULL);
}
hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
if (!strcmp (path, pic->name))
return pic;
if (numcachepics == MAX_CACHED_PICS)
hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
if (!strcmp (path, pic->name))
return pic;
if (numcachepics == MAX_CACHED_PICS)
pic = cachepics + (numcachepics++);
strlcpy (pic->name, path, sizeof(pic->name));
// link into list
pic->chain = cachepichash[hashkey];
cachepichash[hashkey] = pic;
pic = cachepics + (numcachepics++);
strlcpy (pic->name, path, sizeof(pic->name));
// link into list
pic->chain = cachepichash[hashkey];
cachepichash[hashkey] = pic;
- pic->tex = loadtextureimage(drawtexturepool, path, 0, 0, false, TEXF_ALPHA | persistentflag);
+ pic->tex = loadtextureimage(drawtexturepool, path, 0, 0, false, flags);
if (pic->tex == NULL && !strncmp(path, "gfx/", 4))
{
// compatibility with older versions
if (pic->tex == NULL && !strncmp(path, "gfx/", 4))
{
// compatibility with older versions
- pic->tex = loadtextureimage(drawtexturepool, path + 4, 0, 0, false, TEXF_ALPHA | persistentflag);
+ pic->tex = loadtextureimage(drawtexturepool, path + 4, 0, 0, false, flags);
- pic->tex = R_LoadTexture2D(drawtexturepool, path, 128, 128, pix, TEXTYPE_PALETTE, TEXF_ALPHA | persistentflag, palette_complete);
+ pic->tex = R_LoadTexture2D(drawtexturepool, path, 128, 128, pix, TEXTYPE_PALETTE, flags, palette_complete);
- pic->tex = R_LoadTexture2D(drawtexturepool, path, p->width, p->height, p->data, TEXTYPE_PALETTE, TEXF_ALPHA | persistentflag, palette_complete);
+ pic->tex = R_LoadTexture2D(drawtexturepool, path, p->width, p->height, p->data, TEXTYPE_PALETTE, flags, palette_complete);
pic->tex = draw_generatecrosshair(3);
if (pic->tex == NULL && !strcmp(path, "gfx/crosshair5.tga"))
pic->tex = draw_generatecrosshair(4);
pic->tex = draw_generatecrosshair(3);
if (pic->tex == NULL && !strcmp(path, "gfx/crosshair5.tga"))
pic->tex = draw_generatecrosshair(4);
if (pic->tex == NULL && !strcmp(path, "gfx/colorcontrol/ditherpattern.tga"))
pic->tex = draw_generateditherpattern();
if (pic->tex == NULL)
if (pic->tex == NULL && !strcmp(path, "gfx/colorcontrol/ditherpattern.tga"))
pic->tex = draw_generateditherpattern();
if (pic->tex == NULL)
hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
if (!strcmp (picname, pic->name))
hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
if (!strcmp (picname, pic->name))
pic = cachepics + (numcachepics++);
strcpy (pic->name, picname);
// link into list
pic = cachepics + (numcachepics++);
strcpy (pic->name, picname);
// link into list
hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
{
hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
{
m.pointer_vertex = mesh->data_vertex3f;
m.pointer_color = mesh->data_color4f;
m.pointer_texcoord[0] = mesh->data_texcoord2f;
m.pointer_vertex = mesh->data_vertex3f;
m.pointer_color = mesh->data_color4f;
m.pointer_texcoord[0] = mesh->data_texcoord2f;