From d9e51bc8ac1d03aa0a6b4a5274b96c8098524ac3 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 20 Jul 2006 05:02:55 +0000 Subject: [PATCH] Boredom. git-svn-id: https://svn.eduke32.com/eduke32@225 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/build.c | 4 - polymer/eduke32/source/astub.c | 602 ++++++++++++++++++++------------- 2 files changed, 362 insertions(+), 244 deletions(-) diff --git a/polymer/build/src/build.c b/polymer/build/src/build.c index 7d6fc1270..78a6144b7 100644 --- a/polymer/build/src/build.c +++ b/polymer/build/src/build.c @@ -530,10 +530,6 @@ void editinput(void) if (mlook == 1) { - if(klabs(mousx) > klabs(mousy)) - mousy /= 3; - else mousx /= 3; - ang += mousx>>1; horiz -= (mousy>>2); diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 8442a2359..603f925dc 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -3300,6 +3300,39 @@ void Keys2d(void) {if(keystatus[i]==1) {Bsprintf(tempbuf,"key %ld",i); printmessage16(tempbuf); }} */ + + if ((totalclock > getmessagetimeoff) && (totalclock > (lastpm16time + 120*3))) + { + updatesector(mousxplc,mousyplc,&cursectornum); + if (pointhighlight >= 16384) + { + char tmpbuf[2048]; + i = pointhighlight-16384; + if (strlen(names[sprite[i].picnum]) > 0) { + if (sprite[i].picnum==SECTOREFFECTOR) + Bsprintf(tmpbuf,"Sprite %d %s: lo:%d hi:%d",i,SectorEffectorText(i),sprite[i].lotag,sprite[i].hitag); + else Bsprintf(tmpbuf,"Sprite %d %s: lo:%d hi:%d ex:%d",i,names[sprite[i].picnum],sprite[i].lotag,sprite[i].hitag,sprite[i].extra); + } + else Bsprintf(tmpbuf,"Sprite %d picnum %d: lo:%d hi:%d ex:%d",i,sprite[i].picnum,sprite[i].lotag,sprite[i].hitag,sprite[i].extra); + _printmessage16(tmpbuf); + } + else if ((linehighlight >= 0) && (sectorofwall(linehighlight) == cursectornum)) + { + long dax, day, dist; + dax = wall[linehighlight].x-wall[wall[linehighlight].point2].x; + day = wall[linehighlight].y-wall[wall[linehighlight].point2].y; + dist = ksqrt(dax*dax+day*day); + Bsprintf(tempbuf,"Wall %d: length:%ld lo:%d hi:%d",linehighlight,dist,wall[linehighlight].lotag,wall[linehighlight].hitag); + _printmessage16(tempbuf); + } + else if (cursectornum >= 0) + { + Bsprintf(tempbuf,"Sector %d: lo:%d hi:%d",cursectornum,sector[cursectornum].lotag,sector[cursectornum].hitag); + _printmessage16(tempbuf); + } + else _printmessage16(""); + } + begindrawing(); for(i=0;i= 0) - { - for(j=0;j0) // [ search backward @@ -3683,38 +3683,6 @@ void Keys2d(void) keystatus[0x22] = 0; } - if ((totalclock > getmessagetimeoff) && (totalclock > (lastpm16time + 120*3))) - { - updatesector(mousxplc,mousyplc,&cursectornum); - if (pointhighlight >= 16384) - { - char tmpbuf[2048]; - i = pointhighlight-16384; - if (strlen(names[sprite[i].picnum]) > 0) { - if (sprite[i].picnum==SECTOREFFECTOR) - Bsprintf(tmpbuf,"Sprite %d %s: lo:%d hi:%d",i,SectorEffectorText(i),sprite[i].lotag,sprite[i].hitag); - else Bsprintf(tmpbuf,"Sprite %d %s: lo:%d hi:%d ex:%d",i,names[sprite[i].picnum],sprite[i].lotag,sprite[i].hitag,sprite[i].extra); - } - else Bsprintf(tmpbuf,"Sprite %d picnum %d: lo:%d hi:%d ex:%d",i,sprite[i].picnum,sprite[i].lotag,sprite[i].hitag,sprite[i].extra); - _printmessage16(tmpbuf); - } - else if ((linehighlight >= 0) && (sectorofwall(linehighlight) == cursectornum)) - { - long dax, day, dist; - dax = wall[linehighlight].x-wall[wall[linehighlight].point2].x; - day = wall[linehighlight].y-wall[wall[linehighlight].point2].y; - dist = ksqrt(dax*dax+day*day); - Bsprintf(tempbuf,"Wall %d: length:%ld lo:%d hi:%d",linehighlight,dist,wall[linehighlight].lotag,wall[linehighlight].hitag); - _printmessage16(tempbuf); - } - else if (cursectornum >= 0) - { - Bsprintf(tempbuf,"Sector %d: lo:%d hi:%d",cursectornum,sector[cursectornum].lotag,sector[cursectornum].hitag); - _printmessage16(tempbuf); - } - else _printmessage16(""); - } - if ((keystatus[0x26] > 0) && (keystatus[KEYSC_QUOTE] > 0)) // ' L { if (pointhighlight >= 16384) @@ -3746,176 +3714,6 @@ void Keys2d(void) keystatus[0x26] = 0; } - if(keystatus[KEYSC_QUOTE]==1 && keystatus[0x06]==1) // ' 5 - { - signed char shade; - keystatus[0x06]=0; - - shade=getnumber16("Global parallaxed sky shade: ",0,128,1); - - for(i=0;i>1,255); - } - for(i=0;i>= 1; - sector[i].floorz >>= 1; - } - for(i=0;i>= 1; - wall[i].y >>= 1; - wall[i].yrepeat = min(wall[i].yrepeat<<1,255); - } - for(i=0;i>= 1; - sprite[i].y >>= 1; - sprite[i].z >>= 1; - sprite[i].xrepeat = max(sprite[i].xrepeat>>1,1); - sprite[i].yrepeat = max(sprite[i].yrepeat>>1,1); - } - printmessage16("Map scaled"); - } - if(keystatus[KEYSC_QUOTE]==1 && keystatus[0x04]==1) // ' 3 { @@ -5094,8 +4892,8 @@ void EditSpriteData(short spritenum) { char disptext[80]; char edittext[80]; - char col=1, row=0, rowmax=5, dispwidth = 24; - long xpos = 200, ypos = ydim-STATUS2DSIZ+48; + char col=0, row=0, rowmax=2, dispwidth = 24; + long xpos = 8, ypos = ydim-STATUS2DSIZ+48; int i = -1; char editval = 0; disptext[dispwidth] = 0; @@ -5566,3 +5364,327 @@ void ContextHelp(short spritenum) } while(t!='@' && t!='#'); } */ + +void FuncMenuOpts(void) +{ + char snotbuf[80]; + + Bsprintf(snotbuf,"Special functions"); + printext16(8,ydim-STATUS2DSIZ+32,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Replace invalid tiles"); + printext16(8,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Mass sprite delete"); + printext16(8,ydim-STATUS2DSIZ+56,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Global sky shade"); + printext16(8,ydim-STATUS2DSIZ+64,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Global sky height"); + printext16(8,ydim-STATUS2DSIZ+72,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Global Z coord shift"); + printext16(8,ydim-STATUS2DSIZ+80,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Scale map up"); + printext16(8,ydim-STATUS2DSIZ+88,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Scale map down"); + printext16(8,ydim-STATUS2DSIZ+96,11,-1,snotbuf,0); + + /* + Bsprintf(snotbuf," (0x%x), (0x%x)",sprite[spritenum].hitag,sprite[spritenum].lotag); + printext16(8,ydim-STATUS2DSIZ+104,11,-1,snotbuf,0); + + printext16(200,ydim-STATUS2DSIZ+32,11,-1,names[sprite[spritenum].picnum],0); + Bsprintf(snotbuf,"Flags (hex): %x",sprite[spritenum].cstat); + printext16(200,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Shade: %d",sprite[spritenum].shade); + printext16(200,ydim-STATUS2DSIZ+56,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Pal: %d",sprite[spritenum].pal); + printext16(200,ydim-STATUS2DSIZ+64,11,-1,snotbuf,0); + Bsprintf(snotbuf,"(X,Y)repeat: %d, %d",sprite[spritenum].xrepeat,sprite[spritenum].yrepeat); + printext16(200,ydim-STATUS2DSIZ+72,11,-1,snotbuf,0); + Bsprintf(snotbuf,"(X,Y)offset: %d, %d",sprite[spritenum].xoffset,sprite[spritenum].yoffset); + printext16(200,ydim-STATUS2DSIZ+80,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Tile number: %d",sprite[spritenum].picnum); + printext16(200,ydim-STATUS2DSIZ+88,11,-1,snotbuf,0); + + Bsprintf(snotbuf,"Angle (2048 degrees): %d",sprite[spritenum].ang); + printext16(400,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0); + Bsprintf(snotbuf,"X-Velocity: %d",sprite[spritenum].xvel); + printext16(400,ydim-STATUS2DSIZ+56,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Y-Velocity: %d",sprite[spritenum].yvel); + printext16(400,ydim-STATUS2DSIZ+64,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Z-Velocity: %d",sprite[spritenum].zvel); + printext16(400,ydim-STATUS2DSIZ+72,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Owner: %d",sprite[spritenum].owner); + printext16(400,ydim-STATUS2DSIZ+80,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Clipdist: %d",sprite[spritenum].clipdist); + printext16(400,ydim-STATUS2DSIZ+88,11,-1,snotbuf,0); + Bsprintf(snotbuf,"Extra: %d",sprite[spritenum].extra); + printext16(400,ydim-STATUS2DSIZ+96,11,-1,snotbuf,0); */ +} + +void FuncMenu(void) +{ + char disptext[80]; + char col=0, row=0, rowmax=6, dispwidth = 24; + long xpos = 8, ypos = ydim-STATUS2DSIZ+48; + int i = -1, j; + char editval = 0; + disptext[dispwidth] = 0; + clearmidstatbar16(); + + FuncMenuOpts(); + + while(!editval && keystatus[1] == 0) + { + begindrawing(); + if (handleevents()) { + if (quitevent) quitevent = 0; + } + printmessage16("Select an option, press to exit"); + if (keystatus[0xd0] > 0) + { + if (row < rowmax) + { + printext16(xpos,ypos+row*8,11,0,disptext,0); + row++; + } + keystatus[0xd0] = 0; + } + if (keystatus[0xc8] > 0) + { + if (row > 0) + { + printext16(xpos,ypos+row*8,11,0,disptext,0); + row--; + } + keystatus[0xc8] = 0; + } + /* + if (keystatus[0xcb] > 0) + { + if (col == 2) + { + printext16(xpos,ypos+row*8,11,0,disptext,0); + col = 1; + xpos = 200; + rowmax = 6; + dispwidth = 24; + disptext[dispwidth] = 0; + if (row > rowmax) row = rowmax; + } + else if (col == 1) + { + printext16(xpos,ypos+row*8,11,0,disptext,0); + col = 0; + xpos = 8; + rowmax = 6; + dispwidth = 23; + disptext[dispwidth] = 0; + if (row > rowmax) row = rowmax; + } + keystatus[0xcb] = 0; + } + if (keystatus[0xcd] > 0) + { + if (col == 0) + { + printext16(xpos,ypos+row*8,11,0,disptext,0); + col = 1; + xpos = 200; + rowmax = 6; + dispwidth = 24; + disptext[dispwidth] = 0; + if (row > rowmax) row = rowmax; + } + else if (col == 1) + { + printext16(xpos,ypos+row*8,11,0,disptext,0); + col = 2; + xpos = 400; + rowmax = 6; + dispwidth = 26; + disptext[dispwidth] = 0; + if (row > rowmax) row = rowmax; + } + keystatus[0xcd] = 0; + } + */ + if (keystatus[0x1c] > 0) + { + keystatus[0x1c] = 0; + editval = 1; + } + switch (col) + { + case 0: + if (row == 0) + { + for (i=Bsprintf(disptext,"Replace invalid tiles"); i < dispwidth; i++) disptext[i] = ' '; + if (editval) + { + j = 0; + for(i=0;i= 0) + { + for(j=0;j