git-svn-id: https://svn.eduke32.com/eduke32@747 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-05-31 01:57:14 +00:00
parent 8e40b85cfa
commit ca83297b10
3 changed files with 127 additions and 78 deletions

View File

@ -171,9 +171,10 @@ typedef struct BPACK {
} spriteexttype; } spriteexttype;
typedef struct BPACK { typedef struct BPACK {
float smoothduration;
short mdcurframe, mdoldframe; short mdcurframe, mdoldframe;
short mdsmooth; short mdsmooth;
float smoothduration; char filler[2];
} spritesmoothtype; } spritesmoothtype;
#define SPREXT_NOTMD 1 #define SPREXT_NOTMD 1

View File

@ -5612,6 +5612,18 @@ static void sighandler(int sig, const siginfo_t *info, void *ctx)
// preinitengine // preinitengine
// //
static int preinitcalled = 0; static int preinitcalled = 0;
#define DYNALLOC_ARRAYS
#ifndef DYNALLOC_ARRAYS
spriteexttype spriteext_s[MAXSPRITES+MAXUNIQHUDID];
spritesmoothtype spritesmooth_s[MAXSPRITES+MAXUNIQHUDID];
sectortype sector_s[MAXSECTORS];
walltype wall_s[MAXWALLS];
spritetype sprite_s[MAXSPRITES];
spritetype tsprite_s[MAXSPRITESONSCREEN];
#endif
int preinitengine(void) int preinitengine(void)
{ {
char *e; char *e;
@ -5621,6 +5633,7 @@ int preinitengine(void)
// this shite is to help get around data segment size limits on some platforms // this shite is to help get around data segment size limits on some platforms
#ifdef DYNALLOC_ARRAYS
sector = Bcalloc(MAXSECTORS,sizeof(sectortype)); sector = Bcalloc(MAXSECTORS,sizeof(sectortype));
wall = Bcalloc(MAXWALLS,sizeof(walltype)); wall = Bcalloc(MAXWALLS,sizeof(walltype));
sprite = Bcalloc(MAXSPRITES,sizeof(spritetype)); sprite = Bcalloc(MAXSPRITES,sizeof(spritetype));
@ -5630,6 +5643,14 @@ int preinitengine(void)
if (!sector || !wall || !sprite || !tsprite || !spriteext || !spritesmooth) if (!sector || !wall || !sprite || !tsprite || !spriteext || !spritesmooth)
return 1; return 1;
#else
sector = sector_s;
wall = wall_s;
sprite = sprite_s;
tsprite = tsprite_s;
spriteext = spriteext_s;
spritesmooth = spritesmooth_s;
#endif
if ((e = Bgetenv("BUILD_NOP6")) != NULL) if ((e = Bgetenv("BUILD_NOP6")) != NULL)
if (!Bstrcasecmp(e, "TRUE")) if (!Bstrcasecmp(e, "TRUE"))
@ -5758,6 +5779,7 @@ void uninitengine(void)
for (i=0;i<MAXPALOOKUPS;i++) for (i=0;i<MAXPALOOKUPS;i++)
if (palookup[i] != NULL) { kkfree(palookup[i]); palookup[i] = NULL; } if (palookup[i] != NULL) { kkfree(palookup[i]); palookup[i] = NULL; }
#ifdef DYNALLOC_ARRAYS
if (sector != NULL) if (sector != NULL)
Bfree(sector); Bfree(sector);
if (wall != NULL) if (wall != NULL)
@ -5770,6 +5792,7 @@ void uninitengine(void)
Bfree(spriteext); Bfree(spriteext);
if (spritesmooth != NULL) if (spritesmooth != NULL)
Bfree(spritesmooth); Bfree(spritesmooth);
#endif
} }

View File

@ -1584,7 +1584,7 @@ static inline void _message(char message[162])
{ {
Bstrcpy(getmessage,message); Bstrcpy(getmessage,message);
getmessageleng = strlen(getmessage); getmessageleng = strlen(getmessage);
getmessagetimeoff = totalclock+120*5; getmessagetimeoff = totalclock+120*3;
} }
static void message(char message[162]) static void message(char message[162])
@ -2645,12 +2645,14 @@ static void Keys3d(void)
drawtileinfo("Clipboard",3,124,temppicnum,tempshade,temppal,tempcstat,templotag,temphitag,tempextra); drawtileinfo("Clipboard",3,124,temppicnum,tempshade,temppal,tempcstat,templotag,temphitag,tempextra);
}// end if usedcount }// end if usedcount
if (infobox&1) // if (infobox&1)
{ {
char lines[8][64]; char lines[8][64];
int dax, day, dist, height1=0,height2=0,height3=0, num=0; int dax, day, dist, height1=0,height2=0,height3=0, num=0;
int x,y; int x,y;
if (infobox&1)
{
height2=sector[searchsector].floorz-sector[searchsector].ceilingz; height2=sector[searchsector].floorz-sector[searchsector].ceilingz;
switch (searchstat) switch (searchstat)
{ {
@ -2674,11 +2676,14 @@ static void Keys3d(void)
Bsprintf(lines[num++],"Repeat: %3d, %3d",wall[searchwall].xrepeat,wall[searchwall].yrepeat); Bsprintf(lines[num++],"Repeat: %3d, %3d",wall[searchwall].xrepeat,wall[searchwall].yrepeat);
Bsprintf(lines[num++],"Overpic: %3d",wall[searchwall].overpicnum); Bsprintf(lines[num++],"Overpic: %3d",wall[searchwall].overpicnum);
lines[num++][0]=0; lines[num++][0]=0;
if (!getmessageleng)
{
Bsprintf(lines[num++],"^251Wall %d^31",searchwall); Bsprintf(lines[num++],"^251Wall %d^31",searchwall);
if (wall[searchwall].nextsector!=-1) if (wall[searchwall].nextsector!=-1)
Bsprintf(lines[num++],"LoHeight:%d, HiHeight:%d, Length:%d",height1,height3,dist); Bsprintf(lines[num++],"LoHeight:%d, HiHeight:%d, Length:%d",height1,height3,dist);
else else
Bsprintf(lines[num++],"Height:%d, Length:%d",height2,dist); Bsprintf(lines[num++],"Height:%d, Length:%d",height2,dist);
}
break; break;
case 1: case 1:
drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].ceilingpicnum,sector[searchsector].ceilingshade, drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].ceilingpicnum,sector[searchsector].ceilingshade,
@ -2689,8 +2694,11 @@ static void Keys3d(void)
Bsprintf(lines[num++],"CeilingZ: %d",sector[searchsector].ceilingz); Bsprintf(lines[num++],"CeilingZ: %d",sector[searchsector].ceilingz);
Bsprintf(lines[num++],"Slope: %d",sector[searchsector].ceilingheinum); Bsprintf(lines[num++],"Slope: %d",sector[searchsector].ceilingheinum);
lines[num++][0]=0; lines[num++][0]=0;
if (!getmessageleng)
{
Bsprintf(lines[num++],"^251Sector %d^31 ceiling Lotag:%s",searchsector,ExtGetSectorCaption(searchsector)); Bsprintf(lines[num++],"^251Sector %d^31 ceiling Lotag:%s",searchsector,ExtGetSectorCaption(searchsector));
Bsprintf(lines[num++],"Height: %d, Visibility:%d",height2,sector[searchsector].visibility); Bsprintf(lines[num++],"Height: %d, Visibility:%d",height2,sector[searchsector].visibility);
}
break; break;
case 2: case 2:
drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].floorpicnum,sector[searchsector].floorshade, drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].floorpicnum,sector[searchsector].floorshade,
@ -2701,8 +2709,11 @@ static void Keys3d(void)
Bsprintf(lines[num++],"FloorZ: %d",sector[searchsector].floorz); Bsprintf(lines[num++],"FloorZ: %d",sector[searchsector].floorz);
Bsprintf(lines[num++],"Slope: %d",sector[searchsector].floorheinum); Bsprintf(lines[num++],"Slope: %d",sector[searchsector].floorheinum);
lines[num++][0]=0; lines[num++][0]=0;
if (!getmessageleng)
{
Bsprintf(lines[num++],"^251Sector %d^31 floor Lotag:%s",searchsector,ExtGetSectorCaption(searchsector)); Bsprintf(lines[num++],"^251Sector %d^31 floor Lotag:%s",searchsector,ExtGetSectorCaption(searchsector));
Bsprintf(lines[num++],"Height:%d, Visibility:%d",height2,sector[searchsector].visibility); Bsprintf(lines[num++],"Height:%d, Visibility:%d",height2,sector[searchsector].visibility);
}
break; break;
case 3: case 3:
drawtileinfo("Current",WIND1X,WIND1Y,sprite[searchwall].picnum,sprite[searchwall].shade, drawtileinfo("Current",WIND1X,WIND1Y,sprite[searchwall].picnum,sprite[searchwall].shade,
@ -2714,6 +2725,8 @@ static void Keys3d(void)
Bsprintf(lines[num++],"PosZ: "" %d",sprite[searchwall].z);// prevents tab character Bsprintf(lines[num++],"PosZ: "" %d",sprite[searchwall].z);// prevents tab character
lines[num++][0]=0; lines[num++][0]=0;
if (!getmessageleng)
{
if (strlen(names[sprite[searchwall].picnum]) > 0) if (strlen(names[sprite[searchwall].picnum]) > 0)
{ {
if (sprite[searchwall].picnum==SECTOREFFECTOR) if (sprite[searchwall].picnum==SECTOREFFECTOR)
@ -2722,12 +2735,20 @@ static void Keys3d(void)
} }
else Bsprintf(lines[num++],"^251Sprite %d^31, picnum %d",searchwall,sprite[searchwall].picnum); else Bsprintf(lines[num++],"^251Sprite %d^31, picnum %d",searchwall,sprite[searchwall].picnum);
Bsprintf(lines[num++],"Elevation:%d",getflorzofslope(searchsector,sprite[searchwall].x,sprite[searchwall].y)-sprite[searchwall].z); Bsprintf(lines[num++],"Elevation:%d",getflorzofslope(searchsector,sprite[searchwall].x,sprite[searchwall].y)-sprite[searchwall].z);
}
break; break;
} }
}
x=WIND1X;y=WIND1Y; x=WIND1X;y=WIND1Y;
x*=xdimgame/320.; x*=xdimgame/320.;
y*=ydimgame/200.; y*=ydimgame/200.;
y+=(ydimgame>>6)*8; y+=(ydimgame>>6)*8;
if (getmessageleng)
{
while (num < 4)
lines[num++][0] = 0;
Bsprintf(lines[num++],"^251%s",getmessage);
}
begindrawing(); begindrawing();
for (i=0;i<num;i++) for (i=0;i<num;i++)
{ {
@ -7323,7 +7344,8 @@ void app_crashhandler(void)
char *f; char *f;
fixspritesectors(); //Do this before saving! fixspritesectors(); //Do this before saving!
updatesector(startposx,startposy,&startsectnum); updatesector(startposx,startposy,&startsectnum);
if (pathsearchmode) f = levelname; if (pathsearchmode)
f = levelname;
else else
{ {
// virtual filesystem mode can't save to directories so drop the file into // virtual filesystem mode can't save to directories so drop the file into
@ -7332,7 +7354,9 @@ void app_crashhandler(void)
if (!f) f = levelname; else f++; if (!f) f = levelname; else f++;
} }
f=strstr(levelname,".map"); f=strstr(levelname,".map");
if (f)Bstrcpy(f,"_crash.map");else Bstrcat(f,"_crash.map"); if (f)
Bstrcpy(f,"_crash.map");
else Bstrcat(f,"_crash.map");
ExtPreSaveMap(); ExtPreSaveMap();
saveboard(levelname,&startposx,&startposy,&startposz,&startang,&startsectnum); saveboard(levelname,&startposx,&startposy,&startposz,&startang,&startsectnum);
ExtSaveMap(levelname); ExtSaveMap(levelname);
@ -7516,7 +7540,7 @@ void ExtAnalyzeSprites(void)
static void Keys2d3d(void) static void Keys2d3d(void)
{ {
int i, j; int i;
if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_A]) // ' a if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_A]) // ' a
{ {
keystatus[KEYSC_A] = 0; keystatus[KEYSC_A] = 0;
@ -7666,9 +7690,9 @@ static void Keys2d3d(void)
if (getmessageleng > 0) if (getmessageleng > 0)
{ {
charsperline = 64; // charsperline = 64;
//if (dimensionmode[snum] == 2) charsperline = 80; //if (dimensionmode[snum] == 2) charsperline = 80;
if (qsetmode == 200) /* if (qsetmode == 200)
{ {
for (i=0;i<=getmessageleng;i+=charsperline) for (i=0;i<=getmessageleng;i+=charsperline)
{ {
@ -7688,7 +7712,8 @@ static void Keys2d3d(void)
enddrawing(); enddrawing();
} }
} }
else printmessage16(getmessage); else */ if (qsetmode != 200)
printmessage16(getmessage);
if (totalclock > getmessagetimeoff) if (totalclock > getmessagetimeoff)
getmessageleng = 0; getmessageleng = 0;
} }