mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
fixes: various ones accumulated in the forum (falling into infinity, stuck in doors), crash in polymer mouse picker when in void space, creation of surplus loops on sector split when sector has weird geometry.
addition: disable sprite sectnum checking with m32script expert mode enabled. git-svn-id: https://svn.eduke32.com/eduke32@1843 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0c2157f5eb
commit
16557ff1bb
7 changed files with 457 additions and 439 deletions
|
@ -69,7 +69,9 @@ extern "C" {
|
||||||
#define YAX_SECTORFLD(Sect,Fld, Cf) (*((Cf) ? (§or[Sect].floor##Fld) : (§or[Sect].ceiling##Fld)))
|
#define YAX_SECTORFLD(Sect,Fld, Cf) (*((Cf) ? (§or[Sect].floor##Fld) : (§or[Sect].ceiling##Fld)))
|
||||||
|
|
||||||
int16_t yax_getbunch(int16_t i, int16_t cf);
|
int16_t yax_getbunch(int16_t i, int16_t cf);
|
||||||
|
void yax_getbunches(int16_t i, int16_t *cb, int16_t *fb);
|
||||||
void yax_setbunch(int16_t i, int16_t cf, int16_t bunchnum);
|
void yax_setbunch(int16_t i, int16_t cf, int16_t bunchnum);
|
||||||
|
void yax_setbunches(int16_t i, int16_t cb, int16_t fb);
|
||||||
|
|
||||||
|
|
||||||
#define CLIPMASK0 (((1L)<<16)+1L)
|
#define CLIPMASK0 (((1L)<<16)+1L)
|
||||||
|
|
|
@ -123,6 +123,8 @@ extern int32_t corruptlevel, numcorruptthings, corruptthings[MAXCORRUPTTHINGS];
|
||||||
extern int32_t autocorruptcheck;
|
extern int32_t autocorruptcheck;
|
||||||
extern int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing);
|
extern int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing);
|
||||||
|
|
||||||
|
extern int32_t m32_script_expertmode; // if true, make read-only vars writable
|
||||||
|
|
||||||
extern void showsectordata(int16_t sectnum, int16_t small);
|
extern void showsectordata(int16_t sectnum, int16_t small);
|
||||||
extern void showwalldata(int16_t wallnum, int16_t small);
|
extern void showwalldata(int16_t wallnum, int16_t small);
|
||||||
extern void showspritedata(int16_t spritenum, int16_t small);
|
extern void showspritedata(int16_t spritenum, int16_t small);
|
||||||
|
|
|
@ -172,7 +172,6 @@ extern uint32_t m32_drawlinepat;
|
||||||
|
|
||||||
extern int32_t g_iReturnVar;
|
extern int32_t g_iReturnVar;
|
||||||
extern int32_t m32_sortvar1, m32_sortvar2;
|
extern int32_t m32_sortvar1, m32_sortvar2;
|
||||||
extern int32_t m32_script_expertmode; // if true, make read-only vars writable
|
|
||||||
|
|
||||||
//extern int32_t g_numRealPalettes;
|
//extern int32_t g_numRealPalettes;
|
||||||
//extern int32_t g_scriptDebug;
|
//extern int32_t g_scriptDebug;
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -173,24 +173,45 @@ static int16_t maphacklight[PR_MAXLIGHTS];
|
||||||
inline int32_t getscreenvdisp(int32_t bz, int32_t zoome);
|
inline int32_t getscreenvdisp(int32_t bz, int32_t zoome);
|
||||||
void screencoords(int32_t *xres, int32_t *yres, int32_t x, int32_t y, int32_t zoome);
|
void screencoords(int32_t *xres, int32_t *yres, int32_t x, int32_t y, int32_t zoome);
|
||||||
|
|
||||||
|
int16_t editstatus = 0;
|
||||||
|
|
||||||
|
|
||||||
////////// YAX //////////
|
////////// YAX //////////
|
||||||
#define YAX_BUNCHNUM(Sect, Cf) (*(int16_t *)(§or[Sect].ceilingxpanning + 6*Cf))
|
|
||||||
|
|
||||||
|
#ifdef YAX_ENABLE
|
||||||
|
// all references to floor/ceiling bunchnums should be through the
|
||||||
|
// get/set functions!
|
||||||
|
|
||||||
|
// game-time YAX data structures
|
||||||
|
static int16_t yax_bunchnum[MAXSECTORS][2];
|
||||||
|
|
||||||
|
#define YAX_BUNCHNUM(Sect, Cf) (*(int16_t *)(§or[Sect].ceilingxpanning + 6*Cf))
|
||||||
int16_t yax_getbunch(int16_t i, int16_t cf)
|
int16_t yax_getbunch(int16_t i, int16_t cf)
|
||||||
{
|
{
|
||||||
|
if (editstatus==0)
|
||||||
|
return yax_bunchnum[i][cf];
|
||||||
|
|
||||||
if (((*(§or[i].ceilingstat + cf))&YAX_BIT)==0)
|
if (((*(§or[i].ceilingstat + cf))&YAX_BIT)==0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return YAX_BUNCHNUM(i, cf);
|
return YAX_BUNCHNUM(i, cf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void yax_getbunches(int16_t i, int16_t *cb, int16_t *fb)
|
||||||
|
{
|
||||||
|
*cb = yax_getbunch(i, YAX_CEILING);
|
||||||
|
*fb = yax_getbunch(i, YAX_FLOOR);
|
||||||
|
}
|
||||||
|
|
||||||
void yax_setbunch(int16_t i, int16_t cf, int16_t bunchnum)
|
void yax_setbunch(int16_t i, int16_t cf, int16_t bunchnum)
|
||||||
{
|
{
|
||||||
if (i<0)
|
if (editstatus==0)
|
||||||
|
yax_bunchnum[i][cf] = bunchnum;
|
||||||
|
|
||||||
|
if (bunchnum<0)
|
||||||
{
|
{
|
||||||
*(§or[i].ceilingstat + cf) &= ~YAX_BIT;
|
*(§or[i].ceilingstat + cf) &= ~YAX_BIT;
|
||||||
YAX_BUNCHNUM(i, cf) = 0;
|
// YAX_BUNCHNUM(i, cf) = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,6 +219,15 @@ void yax_setbunch(int16_t i, int16_t cf, int16_t bunchnum)
|
||||||
YAX_BUNCHNUM(i, cf) = bunchnum;
|
YAX_BUNCHNUM(i, cf) = bunchnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void yax_setbunches(int16_t i, int16_t cb, int16_t fb)
|
||||||
|
{
|
||||||
|
yax_setbunch(i, YAX_CEILING, cb);
|
||||||
|
yax_setbunch(i, YAX_FLOOR, fb);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef YAX_BUNCHNUM
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
////////// editor side view //////////
|
////////// editor side view //////////
|
||||||
int32_t m32_sideview = 0;
|
int32_t m32_sideview = 0;
|
||||||
|
@ -1147,7 +1177,7 @@ static char tablesloaded = 0;
|
||||||
int32_t pageoffset, ydim16, qsetmode = 0;
|
int32_t pageoffset, ydim16, qsetmode = 0;
|
||||||
int32_t startposx, startposy, startposz;
|
int32_t startposx, startposy, startposz;
|
||||||
int16_t startang, startsectnum;
|
int16_t startang, startsectnum;
|
||||||
int16_t pointhighlight, linehighlight, highlightcnt;
|
int16_t pointhighlight=-1, linehighlight=-1, highlightcnt=0;
|
||||||
int32_t lastx[MAXYDIM];
|
int32_t lastx[MAXYDIM];
|
||||||
char *transluc = NULL, paletteloaded = 0;
|
char *transluc = NULL, paletteloaded = 0;
|
||||||
|
|
||||||
|
@ -1196,7 +1226,6 @@ char vgapal16[4*256] =
|
||||||
63,63,63,00
|
63,63,63,00
|
||||||
};
|
};
|
||||||
|
|
||||||
int16_t editstatus = 0;
|
|
||||||
int16_t searchit;
|
int16_t searchit;
|
||||||
int32_t searchx = -1, searchy; //search input
|
int32_t searchx = -1, searchy; //search input
|
||||||
int16_t searchsector, searchwall, searchstat; //search output
|
int16_t searchsector, searchwall, searchstat; //search output
|
||||||
|
@ -6215,7 +6244,7 @@ int32_t preinitengine(void)
|
||||||
{
|
{
|
||||||
dynarray[0].size += M32_FIXME_SECTORS*sizeof(sectortype); // join sectors needs a temp. sector
|
dynarray[0].size += M32_FIXME_SECTORS*sizeof(sectortype); // join sectors needs a temp. sector
|
||||||
dynarray[1].size += M32_FIXME_WALLS*sizeof(walltype);
|
dynarray[1].size += M32_FIXME_WALLS*sizeof(walltype);
|
||||||
Bprintf("FIXME: Allocating additional space beyond wall[] for editor bugs.\n");
|
// Bprintf("FIXME: Allocating additional space beyond wall[] for editor bugs.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<(signed)(sizeof(dynarray)/sizeof(dynarray[0])); i++)
|
for (i=0; i<(signed)(sizeof(dynarray)/sizeof(dynarray[0])); i++)
|
||||||
|
@ -6318,10 +6347,6 @@ int32_t initengine(void)
|
||||||
clearbuf(&show2dwall[0],(int32_t)((MAXWALLS+3)>>5),0L);
|
clearbuf(&show2dwall[0],(int32_t)((MAXWALLS+3)>>5),0L);
|
||||||
automapping = 0;
|
automapping = 0;
|
||||||
|
|
||||||
pointhighlight = -1;
|
|
||||||
linehighlight = -1;
|
|
||||||
highlightcnt = 0;
|
|
||||||
|
|
||||||
totalclock = 0;
|
totalclock = 0;
|
||||||
visibility = 512;
|
visibility = 512;
|
||||||
parallaxvisibility = 512;
|
parallaxvisibility = 512;
|
||||||
|
|
|
@ -1148,10 +1148,17 @@ void polymer_editorpick(void)
|
||||||
scrvxz[0] = x-scrx;
|
scrvxz[0] = x-scrx;
|
||||||
scrvxz[1] = z-scrz;
|
scrvxz[1] = z-scrz;
|
||||||
|
|
||||||
if (searchstat==1)
|
if (prsectors[searchsector]==NULL)
|
||||||
pl = &prsectors[searchsector]->ceil.plane[0];
|
{
|
||||||
|
//OSD_Printf("polymer_editorpick: prsectors[searchsector]==NULL !!!\n");
|
||||||
|
searchwall = sector[num].wallptr;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
pl = &prsectors[searchsector]->floor.plane[0];
|
{
|
||||||
|
if (searchstat==1)
|
||||||
|
pl = &(prsectors[searchsector]->ceil.plane[0]);
|
||||||
|
else
|
||||||
|
pl = &(prsectors[searchsector]->floor.plane[0]);
|
||||||
|
|
||||||
t = dot3f(pl,scrv);
|
t = dot3f(pl,scrv);
|
||||||
svcoeff = -(dot3f(pl,scr)+pl[3])/t;
|
svcoeff = -(dot3f(pl,scr)+pl[3])/t;
|
||||||
|
@ -1197,6 +1204,7 @@ void polymer_editorpick(void)
|
||||||
|
|
||||||
searchwall = sector[searchsector].wallptr + bestk;
|
searchwall = sector[searchsector].wallptr + bestk;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// :P
|
// :P
|
||||||
|
|
||||||
// searchwall = sector[num].wallptr;
|
// searchwall = sector[num].wallptr;
|
||||||
|
|
|
@ -206,7 +206,7 @@ extern int16_t capturecount;
|
||||||
extern int32_t editorgridextent; // in engine.c
|
extern int32_t editorgridextent; // in engine.c
|
||||||
extern char game_executable[BMAX_PATH];
|
extern char game_executable[BMAX_PATH];
|
||||||
|
|
||||||
extern int32_t fillsector(int16_t sectnum, char fillcolor);
|
//extern int32_t fillsector(int16_t sectnum, char fillcolor);
|
||||||
|
|
||||||
static void drawgradient()
|
static void drawgradient()
|
||||||
{
|
{
|
||||||
|
@ -9294,13 +9294,13 @@ void app_crashhandler(void)
|
||||||
|
|
||||||
void ExtUnInit(void)
|
void ExtUnInit(void)
|
||||||
{
|
{
|
||||||
int32_t i;
|
// int32_t i;
|
||||||
// setvmode(0x03);
|
// setvmode(0x03);
|
||||||
writesetup(setupfilename);
|
writesetup(setupfilename);
|
||||||
|
|
||||||
S_SoundShutdown();
|
S_SoundShutdown();
|
||||||
uninitgroupfile();
|
uninitgroupfile();
|
||||||
|
#if 0
|
||||||
for (i = MAX_TILE_GROUPS-1; i >= 0; i--)
|
for (i = MAX_TILE_GROUPS-1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
if (s_TileGroups[i].pIds != NULL)
|
if (s_TileGroups[i].pIds != NULL)
|
||||||
|
@ -9310,6 +9310,7 @@ void ExtUnInit(void)
|
||||||
}
|
}
|
||||||
for (i = numhelppages-1; i >= 0; i--) Bfree(helppage[i]);
|
for (i = numhelppages-1; i >= 0; i--) Bfree(helppage[i]);
|
||||||
if (helppage) Bfree(helppage);
|
if (helppage) Bfree(helppage);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtPreCheckKeys(void) // just before drawrooms
|
void ExtPreCheckKeys(void) // just before drawrooms
|
||||||
|
|
Loading…
Reference in a new issue