diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index bed8241bd..c94764c69 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -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; diff --git a/polymer/eduke32/build/src/config.c b/polymer/eduke32/build/src/config.c index b6d7c460f..be6ecdbdd 100644 --- a/polymer/eduke32/build/src/config.c +++ b/polymer/eduke32/build/src/config.c @@ -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, diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index c93e74275..886f98053 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -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<ydim > (1<flags & 1)) goto failure; diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index ef0c62175..85e3143bd 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -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<ydim > (1<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>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; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 7cc3310b8..66e7e5d1f 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -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 diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 4cf944cff..84c10bc6e 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -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); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index a595fbfb1..f12d036a3 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -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 diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index 1a49a1565..e5f42e895 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -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; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 60566b4ee..45b76f5ae 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -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 = 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; }