From 34f208afa27f2ad73ac56e9cc31ee05ae3f5cccf Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 15 Mar 2016 22:17:04 +0000 Subject: [PATCH] Make sprite tails and label borders purple if the sprite is blocking. git-svn-id: https://svn.eduke32.com/eduke32@5670 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 12 +++++++----- polymer/eduke32/build/src/engine.c | 2 +- polymer/eduke32/source/astub.c | 9 ++++++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index d51dbf227..22908bc55 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -3293,9 +3293,11 @@ static void drawspritelabel(int i) return; // KEEPINSYNC drawscreen_drawsprite() - uint8_t const spritecol = spritecol2d[sprite[i].picnum][(sprite[i].cstat&1)]; + tspritetype const * s = (tspritetype *)&sprite[i]; + uint8_t const spritecol = spritecol2d[s->picnum][(s->cstat&1)]; int col = spritecol ? editorcolors[spritecol] : getspritecol(i); - int bordercol = col; + int const blocking = s->cstat & 1; + int bordercol = blocking ? editorcolors[5] : col; // group selection if (show2dsprite[i>>3]&pow2char[i&7]) @@ -3309,14 +3311,14 @@ static void drawspritelabel(int i) col -= M32_THROB>>1; else col += M32_THROB>>2; - if (bordercol > col) + if (bordercol > col && !blocking) bordercol = col; } - else if (sprite[i].sectnum < 0) + else if (s->sectnum < 0) col = bordercol = editorcolors[4]; // red - drawsmallabel(dabuffer, editorcolors[0], col, bordercol, sprite[i].x, sprite[i].y, sprite[i].z); + drawsmallabel(dabuffer, editorcolors[0], col, bordercol, s->x, s->y, s->z); } #define EDITING_MAP_P() (newnumwalls>=0 || joinsector[0]>=0 || circlewall>=0 || (bstatus&1) || isc.active) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 54b571117..b8336bdec 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -17320,7 +17320,7 @@ static void drawscreen_drawsprite(int32_t j, int32_t posxe, int32_t posye, int32 if (spr->sectnum<0) col = editorcolors[4]; // red else - col = spritecol ? editorcolors[spritecol] : getspritecol(j); + col = spritecol ? editorcolors[spritecol] : blocking ? editorcolors[5] : getspritecol(j); if (editstatus == 1) { diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 7bb517683..8b5edb0d1 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -887,8 +887,6 @@ const char *ExtGetSpriteCaption(int16_t spritenum) static char tempbuf[1024]; int32_t retfast = 0, lt; - Bmemset(tempbuf,0,sizeof(tempbuf)); - if (!(onnames>=3 && onnames<=8) || (onnames==7 && sprite[spritenum].picnum!=SECTOREFFECTOR)) retfast = 1; if (onnames==5 && !tileInGroup(tilegroupItems, sprite[spritenum].picnum)) @@ -896,6 +894,8 @@ const char *ExtGetSpriteCaption(int16_t spritenum) if (onnames==6 && sprite[spritenum].picnum != sprite[cursprite].picnum) retfast = 1; + tempbuf[0] = 0; + if (retfast) return tempbuf; @@ -905,7 +905,9 @@ const char *ExtGetSpriteCaption(int16_t spritenum) if ((sprite[spritenum].lotag|sprite[spritenum].hitag) == 0) { + Bmemset(tempbuf, 0, sizeof(tempbuf)); SpriteName(spritenum,lo); + if (lo[0]!=0) { Bsprintf(tempbuf,"%s",lo); @@ -925,14 +927,15 @@ const char *ExtGetSpriteCaption(int16_t spritenum) { if (onnames!=8) { + Bmemset(tempbuf, 0, sizeof(tempbuf)); Bsprintf(lo,"%s",SectorEffectorText(spritenum)); Bsprintf(tempbuf,"%s, %s",lo, histr); } } else { + Bmemset(tempbuf, 0, sizeof(tempbuf)); taglab_handle1(lt&1, sprite[spritenum].lotag, lostr); - SpriteName(spritenum,lo); if (sprite[spritenum].extra != -1)