mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 08:20:40 +00:00
Allow uncaching of qpics.
qpics loaded via Draw_CachePic can now be uncached via Draw_UncachePic.
This commit is contained in:
parent
a849cf7698
commit
7e406c20e5
5 changed files with 75 additions and 6 deletions
|
@ -249,6 +249,21 @@ Draw_CachePic (const char *path, qboolean alpha)
|
|||
return &pic->pic;
|
||||
}
|
||||
|
||||
VISIBLE void
|
||||
Draw_UncachePic (const char *path)
|
||||
{
|
||||
cachepic_t *pic;
|
||||
int i;
|
||||
|
||||
//FIXME chachpic and uncachepic suck in GL
|
||||
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++) {
|
||||
if ((!strcmp (path, pic->name)) && !pic->dirty) {
|
||||
pic->dirty = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VISIBLE void
|
||||
Draw_TextBox (int x, int y, int width, int lines, byte alpha)
|
||||
{
|
||||
|
|
|
@ -299,6 +299,12 @@ Draw_CachePic (const char *path, qboolean alpha)
|
|||
return pic;
|
||||
}
|
||||
|
||||
VISIBLE void
|
||||
Draw_UncachePic (const char *path)
|
||||
{
|
||||
Hash_Free (pic_cache, Hash_Del (pic_cache, path));
|
||||
}
|
||||
|
||||
VISIBLE void
|
||||
Draw_TextBox (int x, int y, int width, int lines, byte alpha)
|
||||
{
|
||||
|
|
|
@ -113,9 +113,14 @@ Draw_CachePic (const char *path, qboolean alpha)
|
|||
break;
|
||||
|
||||
if (i == numcachepics) {
|
||||
if (numcachepics == MAX_CACHED_PICS)
|
||||
Sys_Error ("numcachepics == MAX_CACHED_PICS");
|
||||
numcachepics++;
|
||||
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++)
|
||||
if (!pic->name[0])
|
||||
break;
|
||||
if (i == numcachepics) {
|
||||
if (numcachepics == MAX_CACHED_PICS)
|
||||
Sys_Error ("numcachepics == MAX_CACHED_PICS");
|
||||
numcachepics++;
|
||||
}
|
||||
strcpy (pic->name, path);
|
||||
}
|
||||
|
||||
|
@ -137,6 +142,21 @@ Draw_CachePic (const char *path, qboolean alpha)
|
|||
return dat;
|
||||
}
|
||||
|
||||
VISIBLE void
|
||||
Draw_UncachePic (const char *path)
|
||||
{
|
||||
cachepic_t *pic;
|
||||
int i;
|
||||
|
||||
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++) {
|
||||
if (!strcmp (path, pic->name)) {
|
||||
Cache_Release (&pic->cache);
|
||||
pic->name[0] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VISIBLE void
|
||||
Draw_TextBox (int x, int y, int width, int lines, byte alpha)
|
||||
|
|
|
@ -113,9 +113,14 @@ Draw_CachePic (const char *path, qboolean alpha)
|
|||
break;
|
||||
|
||||
if (i == numcachepics) {
|
||||
if (numcachepics == MAX_CACHED_PICS)
|
||||
Sys_Error ("numcachepics == MAX_CACHED_PICS");
|
||||
numcachepics++;
|
||||
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++)
|
||||
if (!pic->name[0])
|
||||
break;
|
||||
if (i == numcachepics) {
|
||||
if (numcachepics == MAX_CACHED_PICS)
|
||||
Sys_Error ("numcachepics == MAX_CACHED_PICS");
|
||||
numcachepics++;
|
||||
}
|
||||
strcpy (pic->name, path);
|
||||
}
|
||||
|
||||
|
@ -137,6 +142,21 @@ Draw_CachePic (const char *path, qboolean alpha)
|
|||
return dat;
|
||||
}
|
||||
|
||||
VISIBLE void
|
||||
Draw_UncachePic (const char *path)
|
||||
{
|
||||
cachepic_t *pic;
|
||||
int i;
|
||||
|
||||
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++) {
|
||||
if (!strcmp (path, pic->name)) {
|
||||
Cache_Release (&pic->cache);
|
||||
pic->name[0] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VISIBLE void
|
||||
Draw_TextBox (int x, int y, int width, int lines, byte alpha)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue