mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
clean up "renderer setup" menu a bit so we can put polymer shit in it later
git-svn-id: https://svn.eduke32.com/eduke32@1534 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
cfc8b8d3da
commit
4e4ef98ae6
9 changed files with 82 additions and 85 deletions
|
@ -595,7 +595,7 @@ extern int32_t glanisotropy;
|
|||
extern int32_t glusetexcompr;
|
||||
extern int32_t gltexfiltermode;
|
||||
extern int32_t glredbluemode;
|
||||
extern int32_t glusetexcache, glusetexcachecompression;
|
||||
extern int32_t glusetexcache;
|
||||
extern int32_t glmultisample, glnvmultisamplehint;
|
||||
extern int32_t glwidescreen, glprojectionhacks;
|
||||
extern int32_t gltexmaxsize;
|
||||
|
|
|
@ -155,16 +155,10 @@ int32_t loadsetup(const char *fn)
|
|||
if (readconfig(fp, "usemodels", val, VL) > 0) usemodels = Batoi(val)?1:0;
|
||||
if (readconfig(fp, "usehightile", val, VL) > 0) usehightile = Batoi(val)?1:0;
|
||||
|
||||
glusetexcache = glusetexcachecompression = -1;
|
||||
glusetexcache = -1;
|
||||
if (readconfig(fp, "glusetexcache", val, VL) > 0)
|
||||
{
|
||||
if (Batoi(val) != 0) glusetexcache = 1;
|
||||
else glusetexcache = 0;
|
||||
}
|
||||
if (readconfig(fp, "glusetexcachecompression", val, VL) > 0)
|
||||
{
|
||||
if (Batoi(val) != 0) glusetexcachecompression = 1;
|
||||
else glusetexcachecompression = 0;
|
||||
glusetexcache = clamp(Batoi(val), 0, 2);
|
||||
}
|
||||
if (readconfig(fp, "gltexfiltermode", val, VL) > 0)
|
||||
{
|
||||
|
@ -318,7 +312,6 @@ int32_t writesetup(const char *fn)
|
|||
"usemodels = %d\n"
|
||||
"usehightile = %d\n"
|
||||
"glusetexcache = %d\n"
|
||||
"glusetexcachecompression = %d\n"
|
||||
"gltexfiltermode = %d\n"
|
||||
"glanisotropy = %d\n"
|
||||
"\n"
|
||||
|
@ -463,7 +456,7 @@ int32_t writesetup(const char *fn)
|
|||
editorgridextent,
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
usemodels, usehightile,
|
||||
glusetexcache, glusetexcachecompression, gltexfiltermode, glanisotropy,
|
||||
glusetexcache, gltexfiltermode, glanisotropy,
|
||||
#endif
|
||||
#ifdef RENDERTYPEWIN
|
||||
maxrefreshfreq, windowpos, windowx, windowy,
|
||||
|
|
|
@ -573,8 +573,8 @@ int32_t mdloadskin_trytexcache(char *fn, int32_t len, int32_t pal, char effect,
|
|||
head->quality = B_LITTLE32(head->quality);
|
||||
|
||||
if (head->quality != r_downsize) goto failure;
|
||||
if ((head->flags & 4) && !glusetexcachecompression) goto failure;
|
||||
if (!(head->flags & 4) && glusetexcachecompression) goto failure;
|
||||
if ((head->flags & 4) && glusetexcache != 2) goto failure;
|
||||
if (!(head->flags & 4) && glusetexcache == 2) goto failure;
|
||||
if (gltexmaxsize && (head->xdim > (1<<gltexmaxsize) || head->ydim > (1<<gltexmaxsize))) goto failure;
|
||||
if (!glinfo.texnpot && (head->flags & 1)) goto failure;
|
||||
|
||||
|
|
|
@ -138,8 +138,7 @@ struct glfiltermodes glfiltermodes[numglfiltermodes] =
|
|||
int32_t glanisotropy = 1; // 0 = maximum supported by card
|
||||
int32_t glusetexcompr = 1;
|
||||
int32_t gltexfiltermode = 2; // GL_NEAREST_MIPMAP_NEAREST
|
||||
int32_t glusetexcache = 0;
|
||||
int32_t glusetexcachecompression = 1;
|
||||
int32_t glusetexcache = 2;
|
||||
int32_t glmultisample = 0, glnvmultisamplehint = 0;
|
||||
int32_t gltexmaxsize = 0; // 0 means autodetection on first run
|
||||
int32_t gltexmiplevel = 0; // discards this many mipmap levels
|
||||
|
@ -1300,8 +1299,8 @@ int32_t trytexcache(char *fn, int32_t len, int32_t dameth, char effect, texcache
|
|||
head->flags = B_LITTLE32(head->flags);
|
||||
head->quality = B_LITTLE32(head->quality);
|
||||
|
||||
if ((head->flags & 4) && !glusetexcachecompression) goto failure;
|
||||
if (!(head->flags & 4) && glusetexcachecompression) goto failure;
|
||||
if ((head->flags & 4) && glusetexcache != 2) goto failure;
|
||||
if (!(head->flags & 4) && glusetexcache == 2) goto failure;
|
||||
|
||||
if (!(head->flags & 8) && head->quality != r_downsize) return -1; // handle nocompress
|
||||
if (gltexmaxsize && (head->xdim > (1<<gltexmaxsize) || head->ydim > (1<<gltexmaxsize))) goto failure;
|
||||
|
@ -1361,7 +1360,7 @@ void writexcache(char *fn, int32_t len, int32_t dameth, char effect, texcachehea
|
|||
|
||||
Bmemcpy(head->magic, "PMST", 4); // sizes are set by caller
|
||||
|
||||
if (glusetexcachecompression) head->flags |= 4;
|
||||
if (glusetexcache == 2) head->flags |= 4;
|
||||
|
||||
head->xdim = B_LITTLE32(head->xdim);
|
||||
head->ydim = B_LITTLE32(head->ydim);
|
||||
|
@ -5937,8 +5936,7 @@ void polymost_initosdfuncs(void)
|
|||
{ "r_redbluemode","r_redbluemode: enable/disable experimental OpenGL red-blue glasses mode",(void *)&glredbluemode, CVAR_BOOL, 0, 0, 1 },
|
||||
{ "r_shadescale","r_shadescale: multiplier for lighting",(void *)&shadescale, CVAR_FLOAT, 0, 0, 10 },
|
||||
{ "r_swapinterval","r_swapinterval: sets the GL swap interval (VSync)",(void *)&vsync, CVAR_BOOL|CVAR_FUNCPTR, 0, 0, 1 },
|
||||
{ "r_texcachecompression","r_texcachecompression: enable/disable compression of files in the OpenGL compressed texture cache",(void *)&glusetexcachecompression, CVAR_BOOL, 0, 0, 1 },
|
||||
{ "r_texcache","r_texcache: enable/disable OpenGL compressed texture cache",(void *)&glusetexcache, CVAR_BOOL, 0, 0, 1 },
|
||||
{ "r_texcache","r_texcache: enable/disable OpenGL compressed texture cache",(void *)&glusetexcache, CVAR_INT, 0, 0, 2 },
|
||||
{ "r_texcompr","r_texcompr: enable/disable OpenGL texture compression",(void *)&glusetexcompr, CVAR_BOOL, 0, 0, 1 },
|
||||
{ "r_textureanisotropy", "r_textureanisotropy: changes the OpenGL texture anisotropy setting", (void *)&glanisotropy, CVAR_INT|CVAR_FUNCPTR, 0, 0, 16 },
|
||||
{ "r_texturemaxsize","r_texturemaxsize: changes the maximum OpenGL texture size limit",(void *)&gltexmaxsize, CVAR_INT, 0, 0, 4096 },
|
||||
|
@ -6094,7 +6092,7 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
|||
void *writebuf;
|
||||
#if (USEKENFILTER == 0)
|
||||
uint32_t cleng,j;
|
||||
if (glusetexcachecompression)
|
||||
if (glusetexcache == 2)
|
||||
{
|
||||
#ifdef USELZF
|
||||
cleng = fastlz_compress(pic, miplen, packbuf/*, miplen-1*/);
|
||||
|
@ -6135,7 +6133,7 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
|||
for (k=0; k<8; k++) *cptr++ = pic[k];
|
||||
for (j=stride; (unsigned)j<miplen; j+=stride)
|
||||
for (k=0; k<8; k++) *cptr++ = pic[j+k];
|
||||
if (glusetexcachecompression)
|
||||
if (glusetexcache == 2)
|
||||
{
|
||||
#ifdef USELZF
|
||||
j = (miplen/stride)<<3;
|
||||
|
@ -6166,7 +6164,7 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
|||
for (k=0; k<=2; k+=2)
|
||||
for (j=0; (unsigned)j<miplen; j+=stride)
|
||||
{ *(int16_t *)cptr = hicosub(*(int16_t *)(&pic[offs+j+k])); cptr += 2; }
|
||||
if (glusetexcachecompression)
|
||||
if (glusetexcache == 2)
|
||||
{
|
||||
#ifdef USELZF
|
||||
j = (miplen/stride)<<2;
|
||||
|
@ -6202,7 +6200,7 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
|||
cptr[3] = ((c2[0]>>6)&3) + (((c2[1]>>6)&3)<<2) + (((c2[2]>>6)&3)<<4) + (((c2[3]>>6)&3)<<6);
|
||||
cptr += 4;
|
||||
}
|
||||
if (glusetexcachecompression)
|
||||
if (glusetexcache == 2)
|
||||
{
|
||||
#ifdef USELZF
|
||||
j = (miplen/stride)<<2;
|
||||
|
|
|
@ -9948,12 +9948,12 @@ int32_t ExtInit(void)
|
|||
bpp = 32;
|
||||
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
glusetexcache = glusetexcachecompression = -1;
|
||||
glusetexcache = -1;
|
||||
|
||||
initprintf("Using config file '%s'.\n",setupfilename);
|
||||
if (loadsetup(setupfilename) < 0) initprintf("Configuration file not found, using defaults.\n"), rv = 1;
|
||||
|
||||
if (glusetexcache == -1 || glusetexcachecompression == -1)
|
||||
if (glusetexcache == -1)
|
||||
{
|
||||
int32_t i;
|
||||
#if 0
|
||||
|
@ -9964,8 +9964,8 @@ int32_t ExtInit(void)
|
|||
i = 1;
|
||||
#endif
|
||||
if (i)
|
||||
glusetexcompr = glusetexcache = glusetexcachecompression = 1;
|
||||
else glusetexcache = glusetexcachecompression = 0;
|
||||
glusetexcompr = 1, glusetexcache = 2;
|
||||
else glusetexcache = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -795,7 +795,6 @@ int32_t CONFIG_ReadSetup(void)
|
|||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", &r_downsize);
|
||||
r_downsizevar = r_downsize;
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLUseCompressedTextureCache", &glusetexcache);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCacheCompression", &glusetexcachecompression);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCompr", &glusetexcompr);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVBOCount", &r_vbocount);
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVBOs", &r_vbos);
|
||||
|
@ -1104,7 +1103,6 @@ void CONFIG_WriteSetup(void)
|
|||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,FALSE,FALSE);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", r_downsize,FALSE,FALSE);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,FALSE,FALSE);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCacheCompression", glusetexcachecompression,FALSE,FALSE);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,FALSE,FALSE);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVBOCount", r_vbocount,FALSE,FALSE);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVBOs", r_vbos,FALSE,FALSE);
|
||||
|
|
|
@ -10560,7 +10560,7 @@ void app_main(int32_t argc,const char **argv)
|
|||
}
|
||||
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
glusetexcache = glusetexcachecompression = -1;
|
||||
glusetexcache = -1;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -10623,7 +10623,7 @@ void app_main(int32_t argc,const char **argv)
|
|||
#endif
|
||||
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
if (glusetexcache == -1 || glusetexcachecompression == -1)
|
||||
if (glusetexcache == -1)
|
||||
{
|
||||
#if 0
|
||||
i=wm_ynbox("Texture Cache",
|
||||
|
@ -10632,8 +10632,8 @@ void app_main(int32_t argc,const char **argv)
|
|||
#else
|
||||
i = 1;
|
||||
#endif
|
||||
if (i) ud.config.useprecache = glusetexcompr = glusetexcache = glusetexcachecompression = 1;
|
||||
else glusetexcache = glusetexcachecompression = 0;
|
||||
if (i) ud.config.useprecache = glusetexcompr = 1, glusetexcache = 2;
|
||||
else glusetexcache = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
//-------------------------------------------------------------------------
|
||||
#include "duke3d.h"
|
||||
|
||||
const char *s_buildDate = "20091015";
|
||||
const char *s_buildDate = "20091017";
|
||||
char *MusicPtr = NULL;
|
||||
int32_t g_musicSize;
|
||||
|
||||
|
|
|
@ -2401,23 +2401,18 @@ cheat_for_port_credits:
|
|||
int32_t io, ii, yy, d=c+160+40, enabled;
|
||||
char *opts[] =
|
||||
{
|
||||
"Widescreen",
|
||||
"Aspect ratio",
|
||||
"Anisotropic filtering",
|
||||
"Use VSync",
|
||||
"Ambient light level",
|
||||
"-",
|
||||
"Enable hires textures",
|
||||
"Hires texture quality",
|
||||
"Precache hires textures",
|
||||
"GL texture compression",
|
||||
"Cache textures on disk",
|
||||
"Compress disk cache",
|
||||
"Pre-load map textures",
|
||||
"On disk texture cache",
|
||||
"Use detail textures",
|
||||
"Use glow textures",
|
||||
"-",
|
||||
"Use models",
|
||||
"Blend model animations",
|
||||
"Model occlusion checking",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -2455,9 +2450,44 @@ cheat_for_port_credits:
|
|||
switch (io)
|
||||
{
|
||||
case 0:
|
||||
if (x==io) glwidescreen = 1-glwidescreen;
|
||||
modval(0,1,(int32_t *)&glwidescreen,1,probey==io);
|
||||
mgametextpal(d,yy, glwidescreen ? "Yes" : "No", MENUHIGHLIGHT(io), 0);
|
||||
if (getrendermode() == 3)
|
||||
{
|
||||
if (x==io) glwidescreen = 1-glwidescreen;
|
||||
modval(0,1,(int32_t *)&glwidescreen,1,probey==io);
|
||||
mgametextpal(d,yy, glwidescreen ? "Wide" : "Regular", MENUHIGHLIGHT(io), 0);
|
||||
}
|
||||
#ifdef POLYMER
|
||||
else
|
||||
{
|
||||
float ratios[] = { 0.0, 1.33, 1.66, 1.78, 1.85, 2.35 };
|
||||
|
||||
int32_t j = (sizeof(ratios)/sizeof(ratios[0]));
|
||||
|
||||
for (i = 0; i<j; i++)
|
||||
if (ratios[i] == pr_customaspect)
|
||||
break;
|
||||
|
||||
modval(0,j-1,(int32_t *)&i,1,probey==io);
|
||||
if (x == io)
|
||||
{
|
||||
i++;
|
||||
if (i >= j)
|
||||
i = 0;
|
||||
}
|
||||
if (i == j)
|
||||
Bsprintf(tempbuf,"Custom");
|
||||
else
|
||||
{
|
||||
if (i == 0) Bsprintf(tempbuf,"Auto");
|
||||
else Bsprintf(tempbuf,"%.2f:1",ratios[i]);
|
||||
|
||||
if (ratios[i] != pr_customaspect)
|
||||
pr_customaspect = ratios[i];
|
||||
}
|
||||
mgametextpal(d,yy,tempbuf, MENUHIGHLIGHT(io), 0);
|
||||
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
|
@ -2526,52 +2556,30 @@ cheat_for_port_credits:
|
|||
mgametextpal(d,yy, ud.config.useprecache ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
|
||||
break;
|
||||
case 7:
|
||||
enabled = usehightile;
|
||||
if (enabled && x==io) glusetexcompr = !glusetexcompr;
|
||||
if (enabled) modval(0,1,(int32_t *)&glusetexcompr,1,probey==io);
|
||||
mgametextpal(d,yy, glusetexcompr ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
|
||||
{
|
||||
char *s[] = { "Off", "On", "Compress" };
|
||||
enabled = (glusetexcompr && usehightile);
|
||||
if (enabled && x==io)
|
||||
{
|
||||
glusetexcache++;
|
||||
if (glusetexcache > 2)
|
||||
glusetexcache = 0;
|
||||
}
|
||||
if (enabled) modval(0,2,(int32_t *)&glusetexcache,1,probey==io);
|
||||
mgametextpal(d,yy, s[glusetexcache], enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
enabled = (glusetexcompr && usehightile);
|
||||
if (enabled && x==io) glusetexcache = !glusetexcache;
|
||||
if (enabled) modval(0,1,(int32_t *)&glusetexcache,1,probey==io);
|
||||
mgametextpal(d,yy, glusetexcache ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
|
||||
break;
|
||||
case 9:
|
||||
enabled = (glusetexcompr && usehightile && glusetexcache);
|
||||
if (enabled && x==io) glusetexcachecompression = !glusetexcachecompression;
|
||||
if (enabled) modval(0,1,(int32_t *)&glusetexcachecompression,1,probey==io);
|
||||
mgametextpal(d,yy, glusetexcachecompression ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
|
||||
break;
|
||||
case 10:
|
||||
enabled = usehightile;
|
||||
if (enabled && x==io) r_detailmapping = !r_detailmapping;
|
||||
if (enabled) modval(0,1,(int32_t *)&r_detailmapping,1,probey==io);
|
||||
mgametextpal(d,yy, r_detailmapping ? "Yes" : "No", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
|
||||
break;
|
||||
case 11:
|
||||
enabled = usehightile;
|
||||
if (enabled && x==io) r_glowmapping = !r_glowmapping;
|
||||
if (enabled) modval(0,1,(int32_t *)&r_glowmapping,1,probey==io);
|
||||
mgametextpal(d,yy, r_glowmapping ? "Yes" : "No", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
|
||||
break;
|
||||
case 12:
|
||||
case 9:
|
||||
if (x==io) usemodels = 1-usemodels;
|
||||
modval(0,1,(int32_t *)&usemodels,1,probey==io);
|
||||
mgametextpal(d,yy, usemodels ? "Yes" : "No", MENUHIGHLIGHT(io), 0);
|
||||
break;
|
||||
case 13:
|
||||
enabled = usemodels;
|
||||
if (enabled && x==io) r_animsmoothing = !r_animsmoothing;
|
||||
if (enabled) modval(0,1,(int32_t *)&r_animsmoothing,1,probey==io);
|
||||
mgametextpal(d,yy, r_animsmoothing ? "Yes" : "No", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
|
||||
break;
|
||||
case 14:
|
||||
enabled = usemodels;
|
||||
if (enabled && x==io) r_modelocclusionchecking = !r_modelocclusionchecking;
|
||||
if (enabled) modval(0,1,(int32_t *)&r_modelocclusionchecking,1,probey==io);
|
||||
mgametextpal(d,yy, r_modelocclusionchecking ? "Yes" : "No", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -2857,9 +2865,9 @@ cheat_for_port_credits:
|
|||
"Parental lock",
|
||||
"-",
|
||||
"Show inv & pickup messages",
|
||||
"HUD weapon display",
|
||||
"Use alternate HUD",
|
||||
"Use camera view in demos",
|
||||
"Display current weapon",
|
||||
"Upgraded status bar",
|
||||
"Camera view in demos",
|
||||
"-",
|
||||
"DM: Ignore map votes",
|
||||
"DM: Use private messages",
|
||||
|
@ -2932,7 +2940,7 @@ cheat_for_port_credits:
|
|||
}
|
||||
modval(0,2,(int32_t *)&ud.drawweapon,1,probey==io);
|
||||
{
|
||||
char *s[] = { "Off", "Normal", "Icon only" };
|
||||
char *s[] = { "Off", "On", "Icon only" };
|
||||
mgametextpal(d,yy, s[ud.drawweapon], MENUHIGHLIGHT(io), 0);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue