1
0
Fork 0
forked from fte/fteqw

add sw_surfcachesize, essentially -surfcachesize in bytes but only needing a vid_restart to change

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2017 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-02-23 06:28:10 +00:00
parent bdc24a2720
commit 7518dec2f0
2 changed files with 10 additions and 2 deletions

View file

@ -54,6 +54,7 @@ cvar_t r_numedges = SCVAR("r_numedges", "0");
cvar_t r_aliastransbase = SCVAR("r_aliastransbase", "200");
cvar_t r_aliastransadj = SCVAR("r_aliastransadj", "100");
cvar_t d_smooth = SCVAR("d_smooth", "0");
cvar_t sw_surfcachesize = SCVARF("sw_surfcachesize", "0", CVAR_RENDERERLATCH);
#endif
cvar_t gl_skyboxdist = SCVAR("gl_skyboxdist", "2300");
@ -397,6 +398,8 @@ void SWRenderer_Init(void)
Cvar_Register (&d_palconvwrite, SWRENDEREROPTIONS);
Cvar_Register (&d_palremapsize, SWRENDEREROPTIONS);
Cvar_Register (&sw_surfcachesize, SWRENDEREROPTIONS);
}
#endif

View file

@ -36,6 +36,7 @@ surfcache_t *sc_rover, *sc_base;
int D_SurfaceCacheForRes (int width, int height, int bpp)
{
extern cvar_t sw_surfcachesize;
int size, pix;
if (COM_CheckParm ("-surfcachesize"))
@ -43,6 +44,11 @@ int D_SurfaceCacheForRes (int width, int height, int bpp)
size = Q_atoi(com_argv[COM_CheckParm("-surfcachesize")+1]) * 1024;
return size;
}
if (sw_surfcachesize.value >= 512*1024) // force minimum of 512k
{
return (int)sw_surfcachesize.value;
}
size = 4096*1024;//SURFCACHE_SIZE_AT_320X200;
@ -86,8 +92,7 @@ D_InitCaches
*/
void D_InitCaches (void *buffer, int size)
{
// if (!msg_suppress_1)
// Con_Printf ("%ik surface cache\n", size/1024);
// Con_Printf(S_NOTICE "Using %i KB for SW surface cache\n", size / 1024);
sc_size = size - GUARDSIZE;
sc_base = (surfcache_t *)buffer;