* new editor cfg options: corruptcheck_noalreadyrefd (silinces 'already referenced warning'), r_usenewaspect, r_screenxy

* Read-only CON access to sector bunchnums by adding the labels '.ceilingbunch' and '.floorbunch' to the CON sector structure

git-svn-id: https://svn.eduke32.com/eduke32@1931 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-07-10 15:39:21 +00:00
parent 606589f605
commit a15d8bfb98
6 changed files with 62 additions and 11 deletions

View File

@ -179,6 +179,7 @@ extern const char *SaveBoard(const char *fn, uint32_t flags);
#define MAXCORRUPTTHINGS 64
extern int32_t corruptlevel, numcorruptthings, corruptthings[MAXCORRUPTTHINGS];
extern int32_t autocorruptcheck;
extern int32_t corruptcheck_noalreadyrefd;
extern int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing);
extern int32_t m32_script_expertmode; // if true, make read-only vars writable

View File

@ -191,14 +191,18 @@ int32_t loadsetup(const char *fn)
r_downsizevar = r_downsize;
}
if (readconfig(fp, "r_texcompr", val, VL) > 0)
{
glusetexcompr = !!atoi_safe(val);
}
if (readconfig(fp, "r_shadescale", val, VL) > 0)
{
shadescale = clampd(Bstrtod(val, NULL), 0.0, 10.0);
}
#endif
if (readconfig(fp, "r_usenewaspect", val, VL) > 0)
r_usenewaspect = !!atoi_safe(val);
if (readconfig(fp, "r_screenxy", val, VL) > 0)
{
r_screenxy = clamp(atoi_safe(val), 0, 9999);
if (r_screenxy/100==0 || r_screenxy%100==0)
r_screenxy = 403;
}
if (readconfig(fp, "gameexecutable", val, VL) > 0)
Bstrcpy(game_executable, val);
@ -260,6 +264,8 @@ int32_t loadsetup(const char *fn)
// if (readconfig(fp, "autosave", val, VL) > 0) autosave = atoi_safe(val)*60;
if (readconfig(fp, "autosavesec", val, VL) > 0) autosave = max(0, atoi_safe(val));
if (readconfig(fp, "autocorruptchecksec", val, VL) > 0) autocorruptcheck = max(0, atoi_safe(val));
if (readconfig(fp, "corruptcheck_noalreadyrefd", val, VL) > 0)
corruptcheck_noalreadyrefd = !!atoi_safe(val);
if (readconfig(fp, "showheightindicators", val, VL) > 0)
showheightindicators = clamp(atoi_safe(val), 0, 2);
@ -384,6 +390,11 @@ int32_t writesetup(const char *fn)
"r_shadescale = %g\n"
"\n"
#endif
"; Use new aspect determination code? (classic/Polymost)\n"
"r_usenewaspect = %d\n"
"; Screen aspect for fullscreen, in the form WWHH (e.g. 1609 for 16:9)\n"
"r_screenxy = %d\n"
"\n"
#ifdef RENDERTYPEWIN
"; Maximum OpenGL mode refresh rate (Windows only, in Hertz)\n"
@ -459,6 +470,10 @@ int32_t writesetup(const char *fn)
"; Auto corruption check interval (seconds)\n"
"autocorruptchecksec = %d\n"
"\n"
"; Ignore 'already referenced wall' warnings\n"
"; (toggled with 'corruptcheck noalreadyrefd')\n"
"corruptcheck_noalreadyrefd = %d\n"
"\n"
"; Height indicators (0:none, 1:only 2-sided&different, 2:all)\n"
"showheightindicators = %d\n"
"\n"
@ -544,6 +559,7 @@ int32_t writesetup(const char *fn)
glusetexcache, gltexfiltermode, glanisotropy,r_downsize,glusetexcompr,
shadescale,
#endif
r_usenewaspect, r_screenxy,
#ifdef RENDERTYPEWIN
maxrefreshfreq, windowpos, windowx, windowy,
#endif
@ -557,7 +573,7 @@ int32_t writesetup(const char *fn)
msens, unrealedlook, pk_uedaccel, quickmapcycling,
sideview_reversehrot,
revertCTRL,scrollamount,pk_turnaccel,pk_turndecel,autosave,autocorruptcheck,
showheightindicators,showambiencesounds,
corruptcheck_noalreadyrefd, showheightindicators,showambiencesounds,
autogray,showinnergray,
graphicsmode,
MixRate,AmbienceToggle,ParentalLock, !!m32_osd_tryscript,

View File

@ -123,6 +123,7 @@ int32_t showambiencesounds=2;
int32_t autocorruptcheck = 0;
static int32_t corruptchecktimer;
static int32_t curcorruptthing=-1, corrupt_tryfix_alt=0;
int32_t corruptcheck_noalreadyrefd=0;
int32_t corruptlevel=0, numcorruptthings=0, corruptthings[MAXCORRUPTTHINGS];
@ -8913,7 +8914,14 @@ static int32_t osdcmd_vars_pk(const osdfuncparm_t *parm)
if (parm->numparms >= 1 || tryfix)
{
if (!Bstrcasecmp(parm->parms[0], "now"))
if (!Bstrcasecmp(parm->parms[0], "noalreadyrefd"))
{
corruptcheck_noalreadyrefd = !corruptcheck_noalreadyrefd;
OSD_Printf("%sgnore 'already referenced' corruption\n",
corruptcheck_noalreadyrefd?"I":"Don't i");
return OSDCMD_OK;
}
else if (!Bstrcasecmp(parm->parms[0], "now"))
{
int32_t printfromlevel = 1;
if (parm->numparms > 1)
@ -11270,10 +11278,13 @@ int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing)
return bad;
}
seen_nextwalls = Bcalloc((numwalls+7)>>3,1);
if (!seen_nextwalls) return 5;
lastnextwallsource = Bmalloc(numwalls*sizeof(lastnextwallsource[0]));
if (!lastnextwallsource) { Bfree(seen_nextwalls); return 5; }
if (!corruptcheck_noalreadyrefd)
{
seen_nextwalls = Bcalloc((numwalls+7)>>3,1);
if (!seen_nextwalls) return 5;
lastnextwallsource = Bmalloc(numwalls*sizeof(lastnextwallsource[0]));
if (!lastnextwallsource) { Bfree(seen_nextwalls); return 5; }
}
for (i=0; i<numsectors; i++)
{
@ -11421,7 +11432,7 @@ int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing)
}
}
if (nw>=0 && nw<numwalls)
if (!corruptcheck_noalreadyrefd && nw>=0 && nw<numwalls)
{
if (seen_nextwalls[nw>>3]&(1<<(nw&7)))
{

View File

@ -590,6 +590,8 @@ const memberlabel_t SectorLabels[]=
{ "lotag", SECTOR_LOTAG, 0, 0 },
{ "hitag", SECTOR_HITAG, 0, 0 },
{ "extra", SECTOR_EXTRA, 0, 0 },
{ "ceilingbunch", SECTOR_EXTRA, 0, 0 },
{ "floorbunch", SECTOR_EXTRA, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST
};

View File

@ -444,6 +444,8 @@ enum SectorLabel_t
SECTOR_LOTAG,
SECTOR_HITAG,
SECTOR_EXTRA,
SECTOR_CEILINGBUNCH,
SECTOR_FLOORBUNCH,
SECTOR_END
};

View File

@ -2352,6 +2352,18 @@ static void __fastcall VM_AccessSector(int32_t iSet, int32_t lVar1, int32_t lLab
Gv_SetVarX(lVar2, sector[iSector].extra);
return;
case SECTOR_CEILINGBUNCH:
case SECTOR_FLOORBUNCH:
if (!iSet)
{
#ifdef YAX_ENABLE
Gv_SetVarX(lVar2, yax_getbunch(iSector, lLabelID==SECTOR_FLOORBUNCH));
#else
Gv_SetVarX(lVar2, -1);
#endif
}
return;
default:
return;
}
@ -3459,6 +3471,13 @@ static int32_t __fastcall VM_AccessSectorX(int32_t iSector, int32_t lLabelID)
case SECTOR_LOTAG: return sector[iSector].lotag;
case SECTOR_HITAG: return sector[iSector].hitag;
case SECTOR_EXTRA: return sector[iSector].extra;
case SECTOR_CEILINGBUNCH:
case SECTOR_FLOORBUNCH:
#ifdef YAX_ENABLE
return yax_getbunch(iSector, lLabelID==SECTOR_FLOORBUNCH);
#else
return -1;
#endif
default: return -1;
}
}