diff --git a/polymer/build/include/editor.h b/polymer/build/include/editor.h index 3e244dc05..f97a4ef6e 100644 --- a/polymer/build/include/editor.h +++ b/polymer/build/include/editor.h @@ -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); diff --git a/polymer/build/src/build.c b/polymer/build/src/build.c index 553356b14..b43240a30 100644 --- a/polymer/build/src/build.c +++ b/polymer/build/src/build.c @@ -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); diff --git a/polymer/build/src/engine.c b/polymer/build/src/engine.c index f81d353f5..aa255f37e 100644 --- a/polymer/build/src/engine.c +++ b/polymer/build/src/engine.c @@ -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); } } diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index da17db425..35ba6de41 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -2955,6 +2955,150 @@ static void Keys3d(void) } */ + + if (usedcount && !helpon) + { + if (searchstat!=3) + { + count=0; + for (i=0;i 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;i640?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 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;i640?0:1); - printext256(x,y,whitecol,-1,lines[i],xdimgame>640?0:1); - y+=ydimgame>>6; - } - enddrawing(); - } for (i=0,tspr=&tsprite[0];i