From a15d8bfb985006e3ca8a4c5c2090aa4e3cd83d55 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 10 Jul 2011 15:39:21 +0000 Subject: [PATCH] * 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 --- polymer/eduke32/build/include/editor.h | 1 + polymer/eduke32/build/src/config.c | 26 ++++++++++++++++++++----- polymer/eduke32/source/astub.c | 23 ++++++++++++++++------ polymer/eduke32/source/gamedef.c | 2 ++ polymer/eduke32/source/gamedef.h | 2 ++ polymer/eduke32/source/gamestructures.c | 19 ++++++++++++++++++ 6 files changed, 62 insertions(+), 11 deletions(-) diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index 464de572e..f4e463bb9 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -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 diff --git a/polymer/eduke32/build/src/config.c b/polymer/eduke32/build/src/config.c index 47f1171ae..344dd413e 100644 --- a/polymer/eduke32/build/src/config.c +++ b/polymer/eduke32/build/src/config.c @@ -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, diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index c049961a2..2fa237f09 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -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=0 && nw=0 && nw>3]&(1<<(nw&7))) { diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 01e07aa42..8096263c2 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -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 }; diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index d8fcd5197..6192aca86 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -444,6 +444,8 @@ enum SectorLabel_t SECTOR_LOTAG, SECTOR_HITAG, SECTOR_EXTRA, + SECTOR_CEILINGBUNCH, + SECTOR_FLOORBUNCH, SECTOR_END }; diff --git a/polymer/eduke32/source/gamestructures.c b/polymer/eduke32/source/gamestructures.c index 8c67ea30b..956eb2601 100644 --- a/polymer/eduke32/source/gamestructures.c +++ b/polymer/eduke32/source/gamestructures.c @@ -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; } }