From c6ed542a98174c254c387b73460ca9e0139cb536 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 26 Apr 2009 20:51:00 +0000 Subject: [PATCH] various input enhancements for mapster32 git-svn-id: https://svn.eduke32.com/eduke32@1348 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 2 +- polymer/eduke32/source/astub.c | 76 +++++++++++++++++++++++-------- 2 files changed, 58 insertions(+), 20 deletions(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 20d3be6e2..d78bee14a 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -4998,7 +4998,7 @@ int32_t getpointhighlight(int32_t xplc, int32_t yplc, int32_t point) dst = klabs(xplc-sprite[i].x) + klabs(yplc-sprite[i].y); // was (dst <= dist), but this way, when duplicating sprites, // the selected ones are dragged first - if (dst < dist) + if (dst < dist || (dst == dist && (show2dsprite[i>>3]&(1<<(i&7))))) dist = dst, closest = i+16384; } return(closest); diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 059fe7b3a..9c4eca09d 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -5287,7 +5287,7 @@ static void Keys3d(void) sector[searchsector].floorz = sector[searchsector].ceilingz; if (searchstat == 3) { - if (eitherCTRL) //CTRL - put sprite on ceiling + if (eitherCTRL && !eitherALT) //CTRL - put sprite on ceiling { sprite[searchwall].z = spriteonceilingz(searchwall); } @@ -5304,7 +5304,7 @@ static void Keys3d(void) if (k == 0) { - sprite[searchwall].z -= updownunits; + sprite[searchwall].z -= updownunits << ((eitherCTRL && mouseaction)*3); if (!spnoclip)sprite[searchwall].z = max(sprite[searchwall].z,spriteonceilingz(searchwall)); Bsprintf(getmessage,"Sprite %d z = %d",searchwall,sprite[searchwall].z); message(getmessage); @@ -5434,7 +5434,7 @@ static void Keys3d(void) sector[searchsector].ceilingz = sector[searchsector].floorz; if (searchstat == 3) { - if (eitherCTRL) //CTRL - put sprite on ground + if (eitherCTRL && !eitherALT) //CTRL - put sprite on ground { sprite[searchwall].z = spriteongroundz(searchwall); } @@ -5451,7 +5451,7 @@ static void Keys3d(void) if (k == 0) { - sprite[searchwall].z += updownunits; + sprite[searchwall].z += updownunits << ((eitherCTRL && mouseaction)*3); if (!spnoclip)sprite[searchwall].z = min(sprite[searchwall].z,spriteongroundz(searchwall)); Bsprintf(getmessage,"Sprite %d z = %d",searchwall,sprite[searchwall].z); message(getmessage); @@ -5534,15 +5534,31 @@ static void Keys3d(void) { case 0: case 4: - if (eitherSHIFT) Bsprintf(tempbuf,"PAN"); - if (eitherCTRL) Bsprintf(tempbuf,"SCALE"); - if (eitherALT) Bsprintf(tempbuf,"Z"); + if (eitherSHIFT) + { + Bsprintf(tempbuf,"PAN"); + if (eitherCTRL) + Bstrcat(tempbuf, " 8"); + } + if (eitherCTRL && !eitherALT && !eitherSHIFT) + Bsprintf(tempbuf,"SCALE"); + if (eitherALT) + { + Bsprintf(tempbuf,"Z"); + if (eitherCTRL) + Bstrcat(tempbuf, " 512"); + } break; case 1: case 2: if (eitherSHIFT) Bsprintf(tempbuf,"PAN"); - if (eitherCTRL) Bsprintf(tempbuf,"SLOPE"); - if (eitherALT) Bsprintf(tempbuf,"Z"); + if (eitherCTRL && !eitherALT) Bsprintf(tempbuf,"SLOPE"); + if (eitherALT) + { + Bsprintf(tempbuf,"Z"); + if (eitherCTRL) + Bstrcat(tempbuf, " 512"); + } break; case 3: if (eitherSHIFT) @@ -5551,8 +5567,14 @@ static void Keys3d(void) if (eitherCTRL) Bstrcat(tempbuf, " GRID"); } - if (eitherCTRL && !eitherSHIFT) Bsprintf(tempbuf,"SIZE"); - if (eitherALT) Bsprintf(tempbuf,"MOVE Z"); + if (eitherCTRL && !eitherALT && !eitherSHIFT) + Bsprintf(tempbuf,"SIZE"); + if (eitherALT) + { + Bsprintf(tempbuf,"MOVE Z"); + if (eitherCTRL) + Bstrcat(tempbuf, " 1024"); + } break; } } @@ -6078,7 +6100,7 @@ static void Keys3d(void) if (eitherALT) { i = wall[searchwall].nextsector; - if (i >= 0) + if (i >= 0 && !mouseaction) switch (searchstat) { case 0: @@ -6142,7 +6164,7 @@ static void Keys3d(void) if (eitherALT) { i = wall[searchwall].nextsector; - if (i >= 0) + if (i >= 0 && !mouseaction) switch (searchstat) { case 1: @@ -6326,6 +6348,7 @@ static void Keys3d(void) i=wall[searchwall].cstat; i=((i>>3)&1)+((i>>7)&2); if (i==1||i==3)changedir*=-1; + if (eitherCTRL) updownunits *= 8; } while (updownunits--)wall[searchwall].xpanning = changechar(wall[searchwall].xpanning,changedir,smooshyalign,0); message("Wall %d panning: %d, %d",searchwall,wall[searchwall].xpanning,wall[searchwall].ypanning); @@ -6461,6 +6484,8 @@ static void Keys3d(void) } else { + if (mouseaction && eitherCTRL) + updownunits *= 8; while (updownunits--) wall[searchwall].ypanning = changechar(wall[searchwall].ypanning,changedir,smooshyalign,0); message("Wall %d panning: %d, %d",searchwall,wall[searchwall].xpanning,wall[searchwall].ypanning); @@ -7152,11 +7177,14 @@ NEXTSPRITE: printmessage16("%s Sprite search: none found", dir<0 ? "<" : ">"); } +extern int32_t graphicsmode; + static void Keys2d(void) { int16_t temp=0; int32_t i=0, j,k; - int32_t repeatcountx=0,repeatcounty=0,smooshyalign,changedir; + int32_t smooshyalign,changedir; + static int32_t repeatcountx=0,repeatcounty=0; static int32_t opointhighlight=-1, olinehighlight=-1, ocursectornum=-1; /* for(i=0;i<0x50;i++) @@ -7413,6 +7441,15 @@ static void Keys2d(void) sprite[cursprite].yrepeat = 64; } } + else if (graphicsmode != 0) + { + for (i=0; i