Lines Matching refs:cache
27 qboolean r_cache_thrash; // set if surface cache is thrashing
87 Con_Printf ("%ik surface cache\n", size/1024);
136 Sys_Error ("D_SCAlloc: bad cache width %d\n", width);
139 Sys_Error ("D_SCAlloc: bad cache size %d\n", size);
144 Sys_Error ("D_SCAlloc: %i > cache size",size);
266 surfcache_t *cache;
269 // if the surface is animating or flashing, flush the cache
278 // see if the cache holds apropriate data
280 cache = surface->cachespots[miplevel];
282 if (cache && !cache->dlight && surface->dlightframe != r_framecount
283 && cache->texture == r_drawsurf.texture
284 && cache->lightadj[0] == r_drawsurf.lightadj[0]
285 && cache->lightadj[1] == r_drawsurf.lightadj[1]
286 && cache->lightadj[2] == r_drawsurf.lightadj[2]
287 && cache->lightadj[3] == r_drawsurf.lightadj[3] )
288 return cache;
302 if (!cache) // if a texture just animated, don't reallocate it
304 cache = D_SCAlloc (r_drawsurf.surfwidth,
306 surface->cachespots[miplevel] = cache;
307 cache->owner = &surface->cachespots[miplevel];
308 cache->mipscale = surfscale;
312 cache->dlight = 1;
314 cache->dlight = 0;
316 r_drawsurf.surfdat = (pixel_t *)cache->data;
318 cache->texture = r_drawsurf.texture;
319 cache->lightadj[0] = r_drawsurf.lightadj[0];
320 cache->lightadj[1] = r_drawsurf.lightadj[1];
321 cache->lightadj[2] = r_drawsurf.lightadj[2];
322 cache->lightadj[3] = r_drawsurf.lightadj[3];