Show sector/sectoreffector type in tag input fields

git-svn-id: https://svn.eduke32.com/eduke32@1049 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-09-03 10:47:19 +00:00
parent 7b94cf4758
commit cb84787775
4 changed files with 478 additions and 458 deletions

View file

@ -73,6 +73,7 @@ extern void ExtShowSpriteData(short spritenum);
extern void ExtEditSectorData(short sectnum); extern void ExtEditSectorData(short sectnum);
extern void ExtEditWallData(short wallnum); extern void ExtEditWallData(short wallnum);
extern void ExtEditSpriteData(short spritenum); extern void ExtEditSpriteData(short spritenum);
extern const char *ExtGetSectorType(int lotag);
extern int circlewall; extern int circlewall;
@ -82,8 +83,10 @@ int writesetup(const char *fn); // from config.c
void editinput(void); void editinput(void);
void clearmidstatbar16(void); void clearmidstatbar16(void);
int getnumber256(char namestart[80], int num, int maxnumber, char sign); int _getnumber256(char namestart[80], int num, int maxnumber, char sign, void *(func)(int));
int getnumber16(char namestart[80], int num, int maxnumber, char sign); #define getnumber256(namestart, num, maxnumber, sign) _getnumber256(namestart, num, maxnumber, sign, NULL)
int _getnumber16(char namestart[80], int num, int maxnumber, char sign, void *(func)(int));
#define getnumber16(namestart, num, maxnumber, sign) _getnumber16(namestart, num, maxnumber, sign, NULL)
void printmessage256(char name[82]); void printmessage256(char name[82]);
void _printmessage16(const char *fmt, ...); void _printmessage16(const char *fmt, ...);

View file

@ -45,6 +45,7 @@ extern void ExtShowSpriteData(short spritenum);
extern void ExtEditSectorData(short sectnum); extern void ExtEditSectorData(short sectnum);
extern void ExtEditWallData(short wallnum); extern void ExtEditWallData(short wallnum);
extern void ExtEditSpriteData(short spritenum); extern void ExtEditSpriteData(short spritenum);
extern const char *ExtGetSectorType(int lotag);
extern char spritecol2d[MAXTILES][2]; extern char spritecol2d[MAXTILES][2];
@ -259,13 +260,13 @@ static int osdcmd_vidmode(const osdfuncparm_t *parm)
ydim16 = ydim; ydim16 = ydim;
drawline16(0,ydim-STATUS2DSIZ,xdim-1,ydim-STATUS2DSIZ,1); drawline16(0,ydim-STATUS2DSIZ,xdim-1,ydim-STATUS2DSIZ,1);
drawline16(0,ydim-1,xdim-1,ydim-1,1); /* drawline16(0,ydim-1,xdim-1,ydim-1,1);
drawline16(0,ydim-STATUS2DSIZ,0,ydim-1,1); drawline16(0,ydim-STATUS2DSIZ,0,ydim-1,1);
drawline16(xdim-1,ydim-STATUS2DSIZ,xdim-1,ydim-1,1); drawline16(xdim-1,ydim-STATUS2DSIZ,xdim-1,ydim-1,1);
drawline16(0,ydim-STATUS2DSIZ+24,xdim-1,ydim-STATUS2DSIZ+24,1); drawline16(0,ydim-STATUS2DSIZ+24,xdim-1,ydim-STATUS2DSIZ+24,1);
drawline16(192-24,ydim-STATUS2DSIZ,192-24,ydim-STATUS2DSIZ+24,1); drawline16(192-24,ydim-STATUS2DSIZ,192-24,ydim-STATUS2DSIZ+24,1);
drawline16(0,ydim-1-20,xdim-1,ydim-1-20,1); drawline16(0,ydim-1-20,xdim-1,ydim-1-20,1);
drawline16(256,ydim-1-20,256,ydim-1,1); drawline16(256,ydim-1-20,256,ydim-1,1); */
ydim16 = ydim-STATUS2DSIZ; ydim16 = ydim-STATUS2DSIZ;
enddrawing(); //}}} enddrawing(); //}}}
return OSDCMD_OK; return OSDCMD_OK;
@ -3937,51 +3938,6 @@ void overheadeditor(void)
} }
} }
if (keystatus[0x14]) // T (tag)
{
keystatus[0x14] = 0;
if (keystatus[0x1d]|keystatus[0x9d]) //Ctrl-T
{
showtags ^= 1;
if (showtags == 0)
printmessage16("Show tags OFF");
else
printmessage16("Show tags ON");
}
else if (keystatus[0x38]|keystatus[0xb8]) //ALT
{
if (pointhighlight >= 16384)
{
i = pointhighlight-16384;
Bsprintf(buffer,"Sprite (%d) Lo-tag: ",i);
sprite[i].lotag = getnumber16(buffer,sprite[i].lotag,65536L,0);
clearmidstatbar16();
showspritedata((short)i);
}
else if (linehighlight >= 0)
{
i = linehighlight;
Bsprintf(buffer,"Wall (%d) Lo-tag: ",i);
wall[i].lotag = getnumber16(buffer,wall[i].lotag,65536L,0);
clearmidstatbar16();
showwalldata((short)i);
}
printmessage16("");
}
else
{
for (i=0;i<numsectors;i++)
if (inside(mousxplc,mousyplc,i) == 1)
{
Bsprintf(buffer,"Sector (%d) Lo-tag: ",i);
sector[i].lotag = getnumber16(buffer,sector[i].lotag,65536L,0);
clearmidstatbar16();
showsectordata((short)i);
break;
}
printmessage16("");
}
}
if (keystatus[0x23]) //H (Hi 16 bits of tag) if (keystatus[0x23]) //H (Hi 16 bits of tag)
{ {
keystatus[0x23] = 0; keystatus[0x23] = 0;
@ -6730,7 +6686,7 @@ void clearmidstatbar16(void)
if (overridepm16y < 0) if (overridepm16y < 0)
clearbuf((char *)(frameplace + (bytesperline*(ydim-STATUS2DSIZ+25L))),(bytesperline*(STATUS2DSIZ+2-(25<<1))) >> 2, 0x00000000l); clearbuf((char *)(frameplace + (bytesperline*(ydim-STATUS2DSIZ+25L))),(bytesperline*(STATUS2DSIZ+2-(25<<1))) >> 2, 0x00000000l);
else else
clearbuf((char *)(frameplace + (bytesperline*(ydim-3*STATUS2DSIZ+25L))),(bytesperline*(3*STATUS2DSIZ+2-(25<<1))) >> 2, 0x00000000l); clearbuf((char *)(frameplace + (bytesperline*(ydim-overridepm16y+25L))),(bytesperline*(overridepm16y+2-(25<<1))) >> 2, 0x00000000l);
drawline16(0,ydim-STATUS2DSIZ,0,ydim-1,7); drawline16(0,ydim-STATUS2DSIZ,0,ydim-1,7);
drawline16(xdim-1,ydim-STATUS2DSIZ,xdim-1,ydim-1,7); drawline16(xdim-1,ydim-STATUS2DSIZ,xdim-1,ydim-1,7);
ydim16 = ydim-STATUS2DSIZ; ydim16 = ydim-STATUS2DSIZ;
@ -6777,7 +6733,7 @@ int numloopsofsector(short sectnum)
return(numloops); return(numloops);
} }
int getnumber16(char namestart[80], int num, int maxnumber, char sign) int _getnumber16(char namestart[80], int num, int maxnumber, char sign, void *(func)(int))
{ {
char buffer[80], ch; char buffer[80], ch;
int n, danum, oldnum; int n, danum, oldnum;
@ -6795,7 +6751,9 @@ int getnumber16(char namestart[80], int num, int maxnumber, char sign)
ch = bgetchar(); ch = bgetchar();
Bsprintf(buffer,"%s^011%d",namestart,danum); if (func != NULL)
Bsprintf(buffer,"%s^011%s",namestart,(char *)func((int)danum));
else Bsprintf(buffer,"%s^011%d",namestart,danum);
if (totalclock & 32) Bstrcat(buffer,"_ "); if (totalclock & 32) Bstrcat(buffer,"_ ");
printmessage16(buffer); printmessage16(buffer);
showframe(1); showframe(1);
@ -6832,7 +6790,7 @@ int getnumber16(char namestart[80], int num, int maxnumber, char sign)
return(oldnum); return(oldnum);
} }
int getnumber256(char namestart[80], int num, int maxnumber, char sign) int _getnumber256(char namestart[80], int num, int maxnumber, char sign, void *(func)(int))
{ {
char buffer[80], ch; char buffer[80], ch;
int n, danum, oldnum; int n, danum, oldnum;
@ -6861,7 +6819,10 @@ int getnumber256(char namestart[80], int num, int maxnumber, char sign)
ExtCheckKeys(); ExtCheckKeys();
Bsprintf(buffer,"%s%d",namestart,danum); if (func != NULL)
Bsprintf(buffer,"%s%s",namestart,(char *)func((int)danum));
else Bsprintf(buffer,"%s%d",namestart,danum);
if (totalclock & 32) Bstrcat(buffer,"_ "); if (totalclock & 32) Bstrcat(buffer,"_ ");
printmessage256(buffer); printmessage256(buffer);
showframe(1); showframe(1);
@ -7865,7 +7826,7 @@ void _printmessage16(const char *fmt, ...)
} }
snotbuf[54] = 0; snotbuf[54] = 0;
begindrawing(); begindrawing();
ybase = (overridepm16y >= 0) ? overridepm16y : ydim-STATUS2DSIZ; ybase = (overridepm16y >= 0) ? ydim-overridepm16y : ydim-STATUS2DSIZ;
printext16(200L-24, ybase+8L, 9, 0, snotbuf, 0); printext16(200L-24, ybase+8L, 9, 0, snotbuf, 0);
i = 0; i = 0;
while (i < 54) while (i < 54)
@ -7880,21 +7841,21 @@ void _printmessage16(const char *fmt, ...)
void printmessage256(char name[82]) void printmessage256(char name[82])
{ {
char snotbuf[40]; char snotbuf[64];
int i; int i;
i = 0; i = 0;
while ((name[i] != 0) && (i < 38)) while ((name[i] != 0) && (i < 62))
{ {
snotbuf[i] = name[i]; snotbuf[i] = name[i];
i++; i++;
} }
while (i < 38) while (i < 62)
{ {
snotbuf[i] = 32; snotbuf[i] = 32;
i++; i++;
} }
snotbuf[38] = 0; snotbuf[62] = 0;
printext256(2L,2L,0,-1,snotbuf,0); printext256(2L,2L,0,-1,snotbuf,0);
printext256(0L,0L,whitecol,-1,snotbuf,0); printext256(0L,0L,whitecol,-1,snotbuf,0);
} }

View file

@ -964,7 +964,7 @@ void movedummyplayers(void)
p = sprite[OW].yvel; p = sprite[OW].yvel;
if (g_player[p].ps->on_crane >= 0 || (g_player[p].ps->cursectnum > -1 && sector[g_player[p].ps->cursectnum].lotag != 1) || sprite[g_player[p].ps->i].extra <= 0) if (g_player[p].ps->on_crane >= 0 || (g_player[p].ps->cursectnum >= 0 && sector[g_player[p].ps->cursectnum].lotag != 1) || sprite[g_player[p].ps->i].extra <= 0)
{ {
g_player[p].ps->dummyplayersprite = -1; g_player[p].ps->dummyplayersprite = -1;
KILLIT(i); KILLIT(i);
@ -2263,14 +2263,16 @@ CLEAR_THE_BOLT:
case RUBBERCAN__STATIC: case RUBBERCAN__STATIC:
case STEAM__STATIC: case STEAM__STATIC:
case CEILINGSTEAM__STATIC: case CEILINGSTEAM__STATIC:
if (!actorscrptr[sprite[i].picnum])
goto BOLT;
p = findplayer(s, &x); p = findplayer(s, &x);
if (actorscrptr[sprite[i].picnum]) execute(i,p,x);
execute(i,p,x);
goto BOLT; goto BOLT;
case WATERBUBBLEMAKER__STATIC: case WATERBUBBLEMAKER__STATIC:
if (!actorscrptr[sprite[i].picnum])
goto BOLT;
p = findplayer(s, &x); p = findplayer(s, &x);
if (actorscrptr[sprite[i].picnum]) execute(i,p,x);
execute(i,p,x);
goto BOLT; goto BOLT;
} }
@ -2383,7 +2385,7 @@ static void moveweapons(void)
getglobalz(i); getglobalz(i);
qq = CLIPMASK1; qq = CLIPMASK1;
if (hittype[i].projectile.trail > -1) if (hittype[i].projectile.trail >= 0)
{ {
for (f=0;f<=hittype[i].projectile.tnum;f++) for (f=0;f<=hittype[i].projectile.tnum;f++)
{ {
@ -2444,7 +2446,7 @@ static void moveweapons(void)
if (hittype[i].projectile.syrepeat > 4) if (hittype[i].projectile.syrepeat > 4)
sprite[k].yrepeat=hittype[i].projectile.syrepeat; sprite[k].yrepeat=hittype[i].projectile.syrepeat;
} }
if (hittype[i].projectile.isound > -1) if (hittype[i].projectile.isound >= 0)
spritesound(hittype[i].projectile.isound,i); spritesound(hittype[i].projectile.isound,i);
s->extra=hittype[i].projectile.extra; s->extra=hittype[i].projectile.extra;
@ -2478,7 +2480,7 @@ static void moveweapons(void)
if (hittype[i].projectile.syrepeat > 4) if (hittype[i].projectile.syrepeat > 4)
sprite[k].yrepeat=hittype[i].projectile.syrepeat; sprite[k].yrepeat=hittype[i].projectile.syrepeat;
} }
if (hittype[i].projectile.isound > -1) if (hittype[i].projectile.isound >= 0)
spritesound(hittype[i].projectile.isound,i); spritesound(hittype[i].projectile.isound,i);
s->extra=hittype[i].projectile.extra; s->extra=hittype[i].projectile.extra;
@ -2535,7 +2537,7 @@ static void moveweapons(void)
k = getangle(sprite[j].x-s->x,sprite[j].y-s->y)+(sprite[j].cstat&16?0:512); k = getangle(sprite[j].x-s->x,sprite[j].y-s->y)+(sprite[j].cstat&16?0:512);
s->ang = ((k<<1) - s->ang)&2047; s->ang = ((k<<1) - s->ang)&2047;
if (hittype[i].projectile.bsound > -1) if (hittype[i].projectile.bsound >= 0)
spritesound(hittype[i].projectile.bsound,i); spritesound(hittype[i].projectile.bsound,i);
if (hittype[i].projectile.workslike & PROJECTILE_FLAG_LOSESVELOCITY) if (hittype[i].projectile.workslike & PROJECTILE_FLAG_LOSESVELOCITY)
@ -2595,7 +2597,7 @@ static void moveweapons(void)
sprite[k].yrepeat=hittype[i].projectile.syrepeat; sprite[k].yrepeat=hittype[i].projectile.syrepeat;
} }
if (hittype[i].projectile.isound > -1) if (hittype[i].projectile.isound >= 0)
spritesound(hittype[i].projectile.isound,i); spritesound(hittype[i].projectile.isound,i);
if (!(hittype[i].projectile.workslike & PROJECTILE_FLAG_FORCEIMPACT))KILLIT(i); if (!(hittype[i].projectile.workslike & PROJECTILE_FLAG_FORCEIMPACT))KILLIT(i);
@ -2634,7 +2636,7 @@ static void moveweapons(void)
wall[wall[j].point2].y-wall[j].y); wall[wall[j].point2].y-wall[j].y);
s->ang = ((k<<1) - s->ang)&2047; s->ang = ((k<<1) - s->ang)&2047;
if (hittype[i].projectile.bsound > -1) if (hittype[i].projectile.bsound >= 0)
spritesound(hittype[i].projectile.bsound,i); spritesound(hittype[i].projectile.bsound,i);
if (hittype[i].projectile.workslike & PROJECTILE_FLAG_LOSESVELOCITY) if (hittype[i].projectile.workslike & PROJECTILE_FLAG_LOSESVELOCITY)
@ -2665,7 +2667,7 @@ static void moveweapons(void)
s->yvel--; s->yvel--;
if (hittype[i].projectile.bsound > -1) if (hittype[i].projectile.bsound >= 0)
spritesound(hittype[i].projectile.bsound,i); spritesound(hittype[i].projectile.bsound,i);
if (hittype[i].projectile.workslike & PROJECTILE_FLAG_LOSESVELOCITY) if (hittype[i].projectile.workslike & PROJECTILE_FLAG_LOSESVELOCITY)
@ -2694,18 +2696,16 @@ static void moveweapons(void)
if (hittype[i].projectile.workslike & PROJECTILE_FLAG_HITSCAN) if (hittype[i].projectile.workslike & PROJECTILE_FLAG_HITSCAN)
{ {
if (actorscrptr[sprite[i].picnum]) if (!actorscrptr[sprite[i].picnum])
{ goto BOLT;
p = findplayer(s,&x); p = findplayer(s,&x);
execute(i,p,x); execute(i,p,x);
}
goto BOLT; goto BOLT;
} }
if (hittype[i].projectile.workslike & PROJECTILE_FLAG_RPG) if (hittype[i].projectile.workslike & PROJECTILE_FLAG_RPG)
{ {
if (hittype[i].projectile.isound > -1) if (hittype[i].projectile.isound >= 0)
spritesound(hittype[i].projectile.isound,i); spritesound(hittype[i].projectile.isound,i);
s->extra=hittype[i].projectile.extra; s->extra=hittype[i].projectile.extra;
@ -3046,11 +3046,10 @@ static void moveweapons(void)
goto BOLT; goto BOLT;
case SHOTSPARK1__STATIC: case SHOTSPARK1__STATIC:
if (actorscrptr[sprite[i].picnum]) if (!actorscrptr[sprite[i].picnum])
{ goto BOLT;
p = findplayer(s,&x); p = findplayer(s,&x);
execute(i,p,x); execute(i,p,x);
}
goto BOLT; goto BOLT;
} }
} }
@ -4712,12 +4711,10 @@ DETONATEB:
} }
} }
if (actorscrptr[sprite[i].picnum]) if (!actorscrptr[sprite[i].picnum])
{ goto BOLT;
p = findplayer(s,&x); p = findplayer(s,&x);
execute(i,p,x); execute(i,p,x);
}
BOLT: BOLT:
i = nexti; i = nexti;
} }
@ -5150,11 +5147,10 @@ static void moveexplosions(void) // STATNUM 5
case FORCERIPPLE__STATIC: case FORCERIPPLE__STATIC:
case TRANSPORTERSTAR__STATIC: case TRANSPORTERSTAR__STATIC:
case TRANSPORTERBEAM__STATIC: case TRANSPORTERBEAM__STATIC:
if (actorscrptr[sprite[i].picnum]) if (!actorscrptr[sprite[i].picnum])
{ goto BOLT;
p = findplayer(s,&x); p = findplayer(s,&x);
execute(i,p,x); execute(i,p,x);
}
goto BOLT; goto BOLT;
case SHELL__STATIC: case SHELL__STATIC:

File diff suppressed because it is too large Load diff