use sprite's cstat bit 2048 for approximately the same effect as spritenoshade; some side-view and other editor tweaks

git-svn-id: https://svn.eduke32.com/eduke32@1793 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-02-13 21:48:22 +00:00
parent 86eaeaa727
commit 8e4def18ba
4 changed files with 82 additions and 49 deletions

View file

@ -137,7 +137,9 @@ typedef struct
// bit 7: 1 = Real centered centering, 0 = foot center "C"
// bit 8: 1 = Blocking sprite (use with hitscan / cliptype 1) "H"
// bit 9: 1 = Transluscence reversing, 0 = normal "T"
// bits 10-12: reserved
// bit 10: reserved (in use by a renderer hack)
// bit 11: 1 = determine shade based only on its own shade member (see CON's spritenoshade command)
// bit 12: reserved
// bit 13: 1 = does not cast shadow
// bit 14: 1 = invisible but casts shadow
// bit 15: 1 = Invisible sprite, 0 = not invisible

View file

@ -2731,7 +2731,8 @@ void overheadeditor(void)
}
else
{
int32_t didmakered = (highlightsectorcnt<0);
int32_t didmakered = (highlightsectorcnt<0), hadouterpoint=0;
int16_t tmprefsect;
for (i=0; i<highlightsectorcnt; i++)
{
@ -2740,10 +2741,17 @@ void overheadeditor(void)
if (wall[j].nextwall >= 0)
checksectorpointer(wall[j].nextwall,wall[j].nextsector);
didmakered |= !!checksectorpointer((int16_t)j,highlightsector[i]);
if (!didmakered)
{
updatesectorexclude(wall[j].x, wall[j].y, &tmprefsect, hlsectorbitmap);
if (tmprefsect<0)
hadouterpoint = 1;
}
}
}
if (!didmakered && newnumwalls<0)
if (!didmakered && !hadouterpoint && newnumwalls<0)
{
char blackcol=editorcolors[0], greycol=whitecol-25, *cp;
@ -2762,7 +2770,8 @@ void overheadeditor(void)
clearkeys();
}
while (!didmakered && newnumwalls<0) // if
while (!didmakered && !hadouterpoint && newnumwalls<0) // if
{
int32_t tmpnumwalls=0, refwall;
uint8_t *visitedwall = Bcalloc((numwalls+7)>>3,1);
@ -3308,8 +3317,8 @@ SKIP:
drawlinepat = 0x11111111;
if (y1 != INT_MAX)
drawline16base(halfxdim16,midydim16, 0,0, 0,y1, editorcolors[14]);
else
drawline16base(halfxdim16,midydim16, 0,0, 0,getscreenvdisp(-pos.z, zoom), editorcolors[14]);
// else
// drawline16base(halfxdim16,midydim16, 0,0, 0,getscreenvdisp(-pos.z, zoom), editorcolors[14]);
drawlinepat = opat;
}
@ -3320,7 +3329,7 @@ SKIP:
else if ((oldmousebstatus&6) > 0)
updatesectorz(pos.x,pos.y,pos.z,&cursectnum);
if (circlewall != -1 && (keystatus[0x4a] || ((bstatus&32) && !eitherCTRL))) // -
if (circlewall != -1 && (keystatus[0x4a] || ((bstatus&32) && !eitherCTRL))) // -, mousewheel down
{
if (circlepoints > 1)
circlepoints--;
@ -3328,7 +3337,7 @@ SKIP:
mouseb &= ~32;
bstatus &= ~32;
}
if (circlewall != -1 && (keystatus[0x4e] || ((bstatus&16) && !eitherCTRL))) // +
if (circlewall != -1 && (keystatus[0x4e] || ((bstatus&16) && !eitherCTRL))) // +, mousewheel up
{
if (circlepoints < 63)
circlepoints++;
@ -3376,18 +3385,18 @@ SKIP:
_printmessage16("Sideview angle: %d", (int32_t)m32_sideang);
}
if (m32_sideview && keystatus[0x2a]) // LShift
if (m32_sideview && (keystatus[0x2a] || (bstatus&(16|32)))) // LShift
{
if (DOWN_BK(MOVEUP) && m32_sideelev < 512)
if ((DOWN_BK(MOVEUP) || (bstatus&16)) && m32_sideelev < 512)
{
m32_sideelev += synctics<<1;
m32_sideelev += synctics<<(1+!!(bstatus&16));
if (m32_sideelev > 512)
m32_sideelev = 512;
_printmessage16("Sideview elevation: %d", m32_sideelev);
}
if (DOWN_BK(MOVEDOWN) && m32_sideelev > 0)
if ((DOWN_BK(MOVEDOWN) || (bstatus&32)) && m32_sideelev > 0)
{
m32_sideelev -= synctics<<1;
m32_sideelev -= synctics<<(1+!!(bstatus&32));
if (m32_sideelev < 0)
m32_sideelev = 0;
_printmessage16("Sideview elevation: %d", m32_sideelev);
@ -3395,31 +3404,30 @@ SKIP:
}
else
{
int32_t didzoom=0;
if ((DOWN_BK(MOVEUP) || (bstatus&16)) && zoom < 65536)
{
zoom += synctics*(zoom>>4);
if (zoom < 24) zoom += 2;
if ((bstatus&16) && eitherALT)
{
searchx = halfxdim16;
searchy = midydim16;
pos.x = mousxplc;
pos.y = mousyplc;
}
if (zoom > 65536) zoom = 65536;
_printmessage16("Zoom: %d",zoom);
didzoom = 1;
}
if ((DOWN_BK(MOVEDOWN) || (bstatus&32)) && zoom > 8)
{
zoom -= synctics*(zoom>>4);
if ((bstatus&32) && eitherALT)
didzoom = 1;
}
if (didzoom)
{
if (eitherALT)
{
searchx = halfxdim16;
searchy = midydim16;
pos.x = mousxplc;
pos.y = mousyplc;
}
if (zoom < 8) zoom = 8;
zoom = clamp(zoom, 8, 65536);
_printmessage16("Zoom: %d",zoom);
}
}

View file

@ -5754,6 +5754,16 @@ static void Keys3d(void)
}
}
// N (set "spritenoshade" bit)
if (PRESSED_KEYSC(N) && !eitherCTRL && !keystatus[KEYSC_QUOTE])
{
if (AIMING_AT_SPRITE)
{
sprite[searchwall].cstat ^= 2048;
message("Sprite %d spritenoshade bit: %s", searchwall, ONOFF(sprite[searchwall].cstat&2048));
}
}
if (PRESSED_KEYSC(T)) // T (transluscence for sprites/masked walls)
{
if (AIMING_AT_CEILING_OR_FLOOR) //Set masked/transluscent ceilings/floors
@ -9280,16 +9290,23 @@ void ExtPreCheckKeys(void) // just before drawrooms
if (shadepreview)
{
int32_t i = 0;
for (i=numsprites-1; i>=0; i--)
for (i=0; i<MAXSPRITES; i++)
{
if (sprite[i].statnum==MAXSTATUS)
continue;
if (sprite[i].picnum == SECTOREFFECTOR && (sprite[i].lotag == 12 || sprite[i].lotag == 3))
{
int32_t w, isec=sprite[i].sectnum;
int32_t start_wall = sector[isec].wallptr;
int32_t end_wall = start_wall + sector[isec].wallnum;
int32_t start_wall;
int32_t end_wall;
if (isec<0)
continue;
start_wall = sector[isec].wallptr;
end_wall = start_wall + sector[isec].wallnum;
for (w = start_wall; w < end_wall; w++)
{
if (!wallflag[w])
@ -9475,6 +9492,7 @@ void ExtPreCheckKeys(void) // just before drawrooms
}
#endif // POLYMER
}
}
}
if (floor_over_floor) SE40Code(pos.x,pos.y,pos.z,ang,horiz);
@ -9581,7 +9599,6 @@ void ExtPreCheckKeys(void) // just before drawrooms
break;
default:
break;
}
xp1 = mulscale14(sprite[i].x-pos.x,zoom);
@ -9609,25 +9626,27 @@ void ExtPreCheckKeys(void) // just before drawrooms
{
for (ii=0; ii<numsectors; ii++)
for (i=headspritesect[ii]; i>=0; i=nextspritesect[i])
if (sprite[i].picnum == MUSICANDSFX /*&& zoom >= 256*/ )
{
if (showambiencesounds==1 && sprite[i].sectnum!=cursectnum)
continue;
{
if (sprite[i].picnum != MUSICANDSFX /*|| zoom < 256*/ )
continue;
screencoords(&xp1,&yp1, sprite[i].x-pos.x,sprite[i].y-pos.y, zoom);
if (m32_sideview)
yp1 += getscreenvdisp(sprite[i].z-pos.z, zoom);
if (showambiencesounds==1 && sprite[i].sectnum!=cursectnum)
continue;
radius = mulscale14(sprite[i].hitag,zoom);
col = 6;
if (i+16384 == pointhighlight)
if (totalclock & 32) col += (2<<2);
drawlinepat = 0xf0f0f0f0;
drawcircle16(halfxdim16+xp1, midydim16+yp1, radius, scalescreeny(16384), editorcolors[(int32_t)col]);
drawlinepat = 0xffffffff;
// radius = mulscale15(sprite[i].hitag,zoom);
// drawcircle16(halfxdim16+xp1, midydim16+yp1, radius, col);
}
screencoords(&xp1,&yp1, sprite[i].x-pos.x,sprite[i].y-pos.y, zoom);
if (m32_sideview)
yp1 += getscreenvdisp(sprite[i].z-pos.z, zoom);
radius = mulscale14(sprite[i].hitag,zoom);
col = 6;
if (i+16384 == pointhighlight)
if (totalclock & 32) col += (2<<2);
drawlinepat = 0xf0f0f0f0;
drawcircle16(halfxdim16+xp1, midydim16+yp1, radius, scalescreeny(16384), editorcolors[(int32_t)col]);
drawlinepat = 0xffffffff;
// radius = mulscale15(sprite[i].hitag,zoom);
// drawcircle16(halfxdim16+xp1, midydim16+yp1, radius, col);
}
}
enddrawing(); //}}}
@ -9676,11 +9695,12 @@ void ExtAnalyzeSprites(void)
if (sector[tspr->sectnum].floorpal != 0 && sector[tspr->sectnum].floorpal < num_tables)
tspr->pal=sector[tspr->sectnum].floorpal;
}
if (l < -127) l = -127;
if (l > 126) l = 127;
tspr->shade = l;
if ((tspr->owner>=0 && (sprite[tspr->owner].cstat&2048)==0))
{
l = clamp(l, -127, 127);
// tspr->shade = l;
}
}
switch (tspr->picnum)

View file

@ -1085,6 +1085,9 @@ static inline void prelevel(char g)
{
if (PN == SECTOREFFECTOR && SLT == 14)
A_Spawn(-1,i);
if (sprite[i].cstat&2048)
actor[i].flags |= SPRITE_NOSHADE;
}
lotaglist = 0;