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

This commit is contained in:
terminx 2008-08-28 15:04:16 +00:00
parent 7e4b936033
commit ffca366c8d
5 changed files with 223 additions and 186 deletions

View file

@ -37,9 +37,9 @@ extern short searchsector, searchwall, searchstat;
extern int zmode, kensplayerheight;
extern short defaultspritecstat;
extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
extern unsigned char temppal, tempxrepeat, tempyrepeat;
signed char tempshade;
extern int temppicnum, tempcstat, templotag, temphitag, tempextra;
extern unsigned int temppal, tempvis, tempxrepeat, tempyrepeat;
extern int tempshade, tempxvel, tempyvel, tempzvel;
extern unsigned char somethingintab;
extern unsigned char buildkeys[NUMBUILDKEYS];
@ -50,6 +50,7 @@ extern int pk_turnaccel,pk_turndecel,pk_uedaccel;
extern int revertCTRL,scrollamount;
extern int autosave;
extern int mlook;
extern short prefixtiles[16];
extern int ExtInit(void);
extern int ExtPreInit(int argc,const char **argv);

View file

@ -122,9 +122,9 @@ extern char textfont[128][8];
char pskysearch[MAXSECTORS];
short temppicnum, tempcstat, templotag, temphitag, tempextra;
unsigned char temppal, tempvis, tempxrepeat, tempyrepeat;
signed char tempshade;
int temppicnum, tempcstat, templotag, temphitag, tempextra;
unsigned int temppal, tempvis, tempxrepeat, tempyrepeat;
int tempshade, tempxvel, tempyvel, tempzvel;
unsigned char somethingintab = 255;
int mlook = 0,mskip=0;
@ -142,6 +142,7 @@ static int currentlist=0;
static int fillist[640];
int mousx, mousy;
short prefixtiles[16] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
/*
static char scantoasc[128] =
{
@ -4660,7 +4661,7 @@ void overheadeditor(void)
for (i=0x02; i<=0x0b; i++) // keys '1' to '0' on the upper row
if (keystatus[i])
{
prefixarg = i-1;
prefixarg = prefixtiles[i-2];
break;
}
@ -6794,6 +6795,12 @@ int getnumber256(char namestart[80], int num, int maxnumber, char sign)
ch = bgetchar();
if (keystatus[0x1]) break;
clearkeys();
ExtCheckKeys();
Bsprintf(buffer,"%s%d",namestart,danum);
if (totalclock & 32) Bstrcat(buffer,"_ ");
printmessage256(buffer);

View file

@ -11172,37 +11172,32 @@ void draw2dscreen(int posxe, int posye, short ange, int zoome, short gride)
drawline16(halfxdim16+xp1,midydim16+yp1,halfxdim16+xp2,midydim16+yp2,col);
{
int k = getangle(xp1-xp2, yp1-yp2);
int dax = ((wal->x+wall[wal->point2].x)>>1);
int day = ((wal->y+wall[wal->point2].y)>>1);
dax = mulscale14(dax-posxe,zoome);
day = mulscale14(day-posye,zoome);
// drawline16(halfxdim16+dax,midydim16+day,halfxdim16+dax+dax2,midydim16+day+day2,col);
int dax = mulscale14(((wal->x+wall[wal->point2].x)>>1)-posxe,zoome);
int day = mulscale14(((wal->y+wall[wal->point2].y)>>1)-posye,zoome);
if (wal->nextsector >= 0)
{
int ii = sector[sectorofwall(i)].floorz;
int jj = sector[wal->nextsector].floorz;
int dax2;
int day2;
if (jj == ii)
{
dax2 = mulscale11(sintable[(k+1024)&2047],zoome) / 2048;
day2 = mulscale11(sintable[(k+512)&2047],zoome) / 2048;
drawline16(halfxdim16+dax,midydim16+day,halfxdim16+dax+dax2,midydim16+day+day2,col);
dax2 = mulscale11(sintable[(k+2048)&2047],zoome) / 1536;
day2 = mulscale11(sintable[(k+1536)&2047],zoome) / 1536;
drawline16(halfxdim16+dax,midydim16+day,halfxdim16+dax+dax2,midydim16+day+day2,col);
/* int dax3 = mulscale11(sintable[(k+1024)&2047],zoome) / 2048;
int day3 = mulscale11(sintable[(k+512)&2047],zoome) / 2048;
int dax2 = mulscale11(sintable[(k+2048)&2047],zoome) / 1536;
int day2 = mulscale11(sintable[(k+1536)&2047],zoome) / 1536;
drawline16(halfxdim16+dax+dax3,midydim16+day+day3,halfxdim16+dax+dax2,midydim16+day+day2,col); */
}
else if (jj > ii)
{
dax2 = mulscale11(sintable[(k+1024)&2047],zoome) / 2048;
day2 = mulscale11(sintable[(k+512)&2047],zoome) / 2048;
int dax2 = mulscale11(sintable[(k+1024)&2047],zoome) / 2048;
int day2 = mulscale11(sintable[(k+512)&2047],zoome) / 2048;
drawline16(halfxdim16+dax,midydim16+day,halfxdim16+dax+dax2,midydim16+day+day2,col);
}
else
{
dax2 = mulscale11(sintable[(k+2048)&2047],zoome) / 1536;
day2 = mulscale11(sintable[(k+1536)&2047],zoome) / 1536;
int dax2 = mulscale11(sintable[(k+2048)&2047],zoome) / 1536;
int day2 = mulscale11(sintable[(k+1536)&2047],zoome) / 1536;
drawline16(halfxdim16+dax,midydim16+day,halfxdim16+dax+dax2,midydim16+day+day2,col);
}
}

View file

@ -2955,6 +2955,150 @@ static void Keys3d(void)
}
*/
if (usedcount && !helpon)
{
if (searchstat!=3)
{
count=0;
for (i=0;i<numwalls;i++)
{
if (wall[i].picnum == temppicnum) count++;
if (wall[i].overpicnum == temppicnum) count++;
}
for (i=0;i<numsectors;i++)
{
if (sector[i].ceilingpicnum == temppicnum) count++;
if (sector[i].floorpicnum == temppicnum) count++;
}
}
if (searchstat==3)
{
count=0;
statnum=0;
i = headspritestat[statnum];
while (i != -1)
{
nexti = nextspritestat[i];
if (sprite[i].picnum == temppicnum) count++;
i = nexti;
}
}
drawtileinfo("Clipboard",3,124,temppicnum,tempshade,temppal,tempcstat,templotag,temphitag,tempextra);
}// end if usedcount
// if (infobox&1)
{
char lines[8][64];
int dax, day, dist, height1=0,height2=0,height3=0, num=0;
int x,y;
if (infobox&1)
{
height2=sector[searchsector].floorz-sector[searchsector].ceilingz;
switch (searchstat)
{
case 0:
case 4:
drawtileinfo("Current",WIND1X,WIND1Y,wall[searchwall].picnum,wall[searchwall].shade,
wall[searchwall].pal,wall[searchwall].cstat,wall[searchwall].lotag,
wall[searchwall].hitag,wall[searchwall].extra);
dax = wall[searchwall].x-wall[wall[searchwall].point2].x;
day = wall[searchwall].y-wall[wall[searchwall].point2].y;
dist = ksqrt(dax*dax+day*day);
if (wall[searchwall].nextsector!=-1)
{
int nextsect=wall[searchwall].nextsector;
height1=sector[searchsector].floorz-sector[nextsect].floorz;
height2=sector[nextsect].floorz-sector[nextsect].ceilingz;
height3=sector[nextsect].ceilingz-sector[searchsector].ceilingz;
}
Bsprintf(lines[num++],"Panning: %d, %d",wall[searchwall].xpanning,wall[searchwall].ypanning);
Bsprintf(lines[num++],"Repeat: %d, %d",wall[searchwall].xrepeat,wall[searchwall].yrepeat);
Bsprintf(lines[num++],"Overpic: %d",wall[searchwall].overpicnum);
lines[num++][0]=0;
if (getmessageleng)
break;
Bsprintf(lines[num++],"^251Wall %d^31",searchwall);
if (wall[searchwall].nextsector!=-1)
Bsprintf(lines[num++],"LoHeight:%d, HiHeight:%d, Length:%d",height1,height3,dist);
else
Bsprintf(lines[num++],"Height:%d, Length:%d",height2,dist);
break;
case 1:
drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].ceilingpicnum,sector[searchsector].ceilingshade,
sector[searchsector].ceilingpal,sector[searchsector].ceilingstat,
sector[searchsector].lotag,sector[searchsector].hitag,sector[searchsector].extra);
Bsprintf(lines[num++],"Panning: %d, %d",sector[searchsector].ceilingxpanning,sector[searchsector].ceilingypanning);
Bsprintf(lines[num++],"CeilingZ: %d",sector[searchsector].ceilingz);
Bsprintf(lines[num++],"Slope: %d",sector[searchsector].ceilingheinum);
lines[num++][0]=0;
if (getmessageleng)
break;
Bsprintf(lines[num++],"^251Sector %d^31 ceiling Lotag:%s",searchsector,ExtGetSectorCaption(searchsector));
Bsprintf(lines[num++],"Height: %d, Visibility:%d",height2,sector[searchsector].visibility);
break;
case 2:
drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].floorpicnum,sector[searchsector].floorshade,
sector[searchsector].floorpal,sector[searchsector].floorstat,
sector[searchsector].lotag,sector[searchsector].hitag,sector[searchsector].extra);
Bsprintf(lines[num++],"Panning: %d,%d",sector[searchsector].floorxpanning,sector[searchsector].floorypanning);
Bsprintf(lines[num++],"FloorZ: %d",sector[searchsector].floorz);
Bsprintf(lines[num++],"Slope: %d",sector[searchsector].floorheinum);
lines[num++][0]=0;
if (getmessageleng)
break;
Bsprintf(lines[num++],"^251Sector %d^31 floor Lotag:%s",searchsector,ExtGetSectorCaption(searchsector));
Bsprintf(lines[num++],"Height:%d, Visibility:%d",height2,sector[searchsector].visibility);
break;
case 3:
drawtileinfo("Current",WIND1X,WIND1Y,sprite[searchwall].picnum,sprite[searchwall].shade,
sprite[searchwall].pal,sprite[searchwall].cstat,sprite[searchwall].lotag,
sprite[searchwall].hitag,sprite[searchwall].extra);
Bsprintf(lines[num++],"Repeat: %d,%d",sprite[searchwall].xrepeat,sprite[searchwall].yrepeat);
Bsprintf(lines[num++],"PosXY: %d,%d",sprite[searchwall].x,sprite[searchwall].y);
Bsprintf(lines[num++],"PosZ: "" %d",sprite[searchwall].z);// prevents tab character
lines[num++][0]=0;
if (getmessageleng)
break;
if (strlen(names[sprite[searchwall].picnum]) > 0)
{
if (sprite[searchwall].picnum==SECTOREFFECTOR)
Bsprintf(lines[num++],"^251Sprite %d^31 %s",searchwall,SectorEffectorText(searchwall));
else Bsprintf(lines[num++],"^251Sprite %d^31 %s",searchwall,names[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);
break;
}
}
x=WIND1X;y=WIND1Y;
x*=xdimgame/320.;
y*=ydimgame/200.;
y+=(ydimgame>>6)*8;
if (getmessageleng)
{
while (num < 4)
lines[num++][0] = 0;
Bsprintf(lines[num++],"^251%s",getmessage);
}
begindrawing();
for (i=0;i<num;i++)
{
printext256(x+2,y+2,0,-1,lines[i],xdimgame>640?0:1);
printext256(x,y,whitecol,-1,lines[i],xdimgame>640?0:1);
y+=ydimgame>>6;
}
enddrawing();
}
if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_V]) // ' V
{
keystatus[KEYSC_V] = 0;
@ -5324,6 +5468,9 @@ static void Keys3d(void)
templotag = sprite[searchwall].lotag;
temphitag = sprite[searchwall].hitag;
tempextra = sprite[searchwall].extra;
tempxvel = sprite[searchwall].xvel;
tempyvel = sprite[searchwall].xvel;
tempzvel = sprite[searchwall].xvel;
}
if (searchstat == 4)
{
@ -5568,6 +5715,9 @@ static void Keys3d(void)
sprite[searchwall].lotag = templotag;
sprite[searchwall].hitag = temphitag;
sprite[searchwall].extra = tempextra;
sprite[searchwall].xvel = tempxvel;
sprite[searchwall].yvel = tempyvel;
sprite[searchwall].zvel = tempzvel;
}
}
if (searchstat == 4)
@ -6173,25 +6323,48 @@ static void Keys2d(void)
}
}
if (keystatus[KEYSC_G]) // G (grid on/off)
{
grid += eitherSHIFT?-1:1;
if (grid == -1 || grid == 9)
static int autogrid = 0;
if (keystatus[KEYSC_G]) // G (grid on/off)
{
switch (grid)
if (autogrid)
{
case -1:
grid = 8;
break;
case 9:
grid = 0;
break;
if (eitherSHIFT)
grid = 8;
autogrid = 0;
}
else
{
grid += eitherSHIFT?-1:1;
if (grid == -1 || grid == 9)
{
switch (grid)
{
case -1:
autogrid = 1;
grid = 8;
break;
case 9:
autogrid = 1;
grid = 0;
break;
}
}
}
if (autogrid) sprintf(tempbuf,"Grid size: 9 (autosize)");
else if (!grid) sprintf(tempbuf,"Grid off");
else sprintf(tempbuf,"Grid size: %d (%d units)",grid,2048>>grid);
printmessage16(tempbuf);
keystatus[KEYSC_G] = 0;
}
if (autogrid)
{
grid = scale(zoom,6,3072);
if (grid > 7) grid = 7;
if (grid < 0) grid = 0;
}
if (!grid) sprintf(tempbuf,"Grid off");
else sprintf(tempbuf,"Grid size: %d (%d units)",grid,2048>>grid);
printmessage16(tempbuf);
keystatus[KEYSC_G] = 0;
}
if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_L]) // ' L
@ -7089,6 +7262,7 @@ int parsetilegroups(scriptfile *script)
{ "define", T_DEFINE },
{ "#define", T_DEFINE },
{ "tilegroup", T_TILEGROUP },
{ "spritehotkey", T_HOTKEY },
};
while (1)
@ -7097,6 +7271,15 @@ int parsetilegroups(scriptfile *script)
cmdtokptr = script->ltextptr;
switch (tokn)
{
case T_HOTKEY:
{
int i, j;
if (scriptfile_getsymbol(script,&i)) break;
if (scriptfile_getsymbol(script,&j)) break;
if (i < 0 || i > 9 || j < 0 || j >= MAXTILES) break;
prefixtiles[i] = j;
break;
}
case T_INCLUDE:
{
char *fn;
@ -7599,151 +7782,6 @@ void ExtAnalyzeSprites(void)
int i, k;
spritetype *tspr;
int frames=0, l;
int count, nexti;
short statnum = 0;
if (usedcount && !helpon)
{
if (searchstat!=3)
{
count=0;
for (i=0;i<numwalls;i++)
{
if (wall[i].picnum == temppicnum) count++;
if (wall[i].overpicnum == temppicnum) count++;
}
for (i=0;i<numsectors;i++)
{
if (sector[i].ceilingpicnum == temppicnum) count++;
if (sector[i].floorpicnum == temppicnum) count++;
}
}
if (searchstat==3)
{
count=0;
statnum=0;
i = headspritestat[statnum];
while (i != -1)
{
nexti = nextspritestat[i];
if (sprite[i].picnum == temppicnum) count++;
i = nexti;
}
}
drawtileinfo("Clipboard",3,124,temppicnum,tempshade,temppal,tempcstat,templotag,temphitag,tempextra);
}// end if usedcount
// if (infobox&1)
{
char lines[8][64];
int dax, day, dist, height1=0,height2=0,height3=0, num=0;
int x,y;
if (infobox&1)
{
height2=sector[searchsector].floorz-sector[searchsector].ceilingz;
switch (searchstat)
{
case 0:
case 4:
drawtileinfo("Current",WIND1X,WIND1Y,wall[searchwall].picnum,wall[searchwall].shade,
wall[searchwall].pal,wall[searchwall].cstat,wall[searchwall].lotag,
wall[searchwall].hitag,wall[searchwall].extra);
dax = wall[searchwall].x-wall[wall[searchwall].point2].x;
day = wall[searchwall].y-wall[wall[searchwall].point2].y;
dist = ksqrt(dax*dax+day*day);
if (wall[searchwall].nextsector!=-1)
{
int nextsect=wall[searchwall].nextsector;
height1=sector[searchsector].floorz-sector[nextsect].floorz;
height2=sector[nextsect].floorz-sector[nextsect].ceilingz;
height3=sector[nextsect].ceilingz-sector[searchsector].ceilingz;
}
Bsprintf(lines[num++],"Panning: %d, %d",wall[searchwall].xpanning,wall[searchwall].ypanning);
Bsprintf(lines[num++],"Repeat: %d, %d",wall[searchwall].xrepeat,wall[searchwall].yrepeat);
Bsprintf(lines[num++],"Overpic: %d",wall[searchwall].overpicnum);
lines[num++][0]=0;
if (getmessageleng)
break;
Bsprintf(lines[num++],"^251Wall %d^31",searchwall);
if (wall[searchwall].nextsector!=-1)
Bsprintf(lines[num++],"LoHeight:%d, HiHeight:%d, Length:%d",height1,height3,dist);
else
Bsprintf(lines[num++],"Height:%d, Length:%d",height2,dist);
break;
case 1:
drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].ceilingpicnum,sector[searchsector].ceilingshade,
sector[searchsector].ceilingpal,sector[searchsector].ceilingstat,
sector[searchsector].lotag,sector[searchsector].hitag,sector[searchsector].extra);
Bsprintf(lines[num++],"Panning: %d, %d",sector[searchsector].ceilingxpanning,sector[searchsector].ceilingypanning);
Bsprintf(lines[num++],"CeilingZ: %d",sector[searchsector].ceilingz);
Bsprintf(lines[num++],"Slope: %d",sector[searchsector].ceilingheinum);
lines[num++][0]=0;
if (getmessageleng)
break;
Bsprintf(lines[num++],"^251Sector %d^31 ceiling Lotag:%s",searchsector,ExtGetSectorCaption(searchsector));
Bsprintf(lines[num++],"Height: %d, Visibility:%d",height2,sector[searchsector].visibility);
break;
case 2:
drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].floorpicnum,sector[searchsector].floorshade,
sector[searchsector].floorpal,sector[searchsector].floorstat,
sector[searchsector].lotag,sector[searchsector].hitag,sector[searchsector].extra);
Bsprintf(lines[num++],"Panning: %d,%d",sector[searchsector].floorxpanning,sector[searchsector].floorypanning);
Bsprintf(lines[num++],"FloorZ: %d",sector[searchsector].floorz);
Bsprintf(lines[num++],"Slope: %d",sector[searchsector].floorheinum);
lines[num++][0]=0;
if (getmessageleng)
break;
Bsprintf(lines[num++],"^251Sector %d^31 floor Lotag:%s",searchsector,ExtGetSectorCaption(searchsector));
Bsprintf(lines[num++],"Height:%d, Visibility:%d",height2,sector[searchsector].visibility);
break;
case 3:
drawtileinfo("Current",WIND1X,WIND1Y,sprite[searchwall].picnum,sprite[searchwall].shade,
sprite[searchwall].pal,sprite[searchwall].cstat,sprite[searchwall].lotag,
sprite[searchwall].hitag,sprite[searchwall].extra);
Bsprintf(lines[num++],"Repeat: %d,%d",sprite[searchwall].xrepeat,sprite[searchwall].yrepeat);
Bsprintf(lines[num++],"PosXY: %d,%d",sprite[searchwall].x,sprite[searchwall].y);
Bsprintf(lines[num++],"PosZ: "" %d",sprite[searchwall].z);// prevents tab character
lines[num++][0]=0;
if (getmessageleng)
break;
if (strlen(names[sprite[searchwall].picnum]) > 0)
{
if (sprite[searchwall].picnum==SECTOREFFECTOR)
Bsprintf(lines[num++],"^251Sprite %d^31 %s",searchwall,SectorEffectorText(searchwall));
else Bsprintf(lines[num++],"^251Sprite %d^31 %s",searchwall,names[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);
break;
}
}
x=WIND1X;y=WIND1Y;
x*=xdimgame/320.;
y*=ydimgame/200.;
y+=(ydimgame>>6)*8;
if (getmessageleng)
{
while (num < 4)
lines[num++][0] = 0;
Bsprintf(lines[num++],"^251%s",getmessage);
}
begindrawing();
for (i=0;i<num;i++)
{
printext256(x+2,y+2,0,-1,lines[i],xdimgame>640?0:1);
printext256(x,y,whitecol,-1,lines[i],xdimgame>640?0:1);
y+=ydimgame>>6;
}
enddrawing();
}
for (i=0,tspr=&tsprite[0];i<spritesortcnt;i++,tspr++)
{

View file

@ -43,10 +43,6 @@ extern short editstatus, searchit;
extern int searchx, searchy, osearchx, osearchy; //search input
extern short searchsector, searchwall, searchstat; //search output
extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
extern unsigned char temppal, tempvis, tempxrepeat, tempyrepeat, somethingintab;
extern signed char tempshade;
#define AVERAGEFRAMES 128
#define COLOR_RED 248
#define COLOR_WHITE 31