Revise shade preview; fix PGUP/PGDN with selected sectors; allow INS/DEL in 2D side-view mode; 64-bit printf cleanup

git-svn-id: https://svn.eduke32.com/eduke32@1860 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-04-09 13:27:08 +00:00
parent 8eda9d683d
commit 76a7799d7c
5 changed files with 63 additions and 30 deletions

View File

@ -600,6 +600,7 @@ static inline int32_t deletesprite(int16_t spritenum)
int32_t changespritesect(int16_t spritenum, int16_t newsectnum);
int32_t changespritestat(int16_t spritenum, int16_t newstatnum);
int32_t setsprite(int16_t spritenum, const vec3_t *new) ATTRIBUTE((nonnull(2)));
int32_t setspritez(int16_t spritenum, const vec3_t *new) ATTRIBUTE((nonnull(2)));
void spriteheightofs(int16_t i, int32_t *height, int32_t *zofs);

View File

@ -1745,7 +1745,7 @@ static void sideview_filter_keys(void)
{
switch (i)
{
case 0xd2: case 0xd3: // ins, del
// case 0xd2: case 0xd3: // ins, del
case 0x2e: case 0x39: // c, space
// case 0xb8: // ralt
keystatus[i] = 0;
@ -2950,6 +2950,7 @@ void overheadeditor(void)
update_highlightsector();
message("Extended %ss of highlighted sectors, creating bunch %d", cfs[cf], k);
asksave = 1;
end_yax: ;
}
#endif
@ -5540,7 +5541,7 @@ int32_t LoadBoard(const char *filename, uint32_t flags)
startang = ang;
startsectnum = cursectnum;
#ifdef YAX_ENABLE
yax_resetbunchnums();
// yax_resetbunchnums();
#endif
return 0;

View File

@ -7455,7 +7455,9 @@ int32_t loadboard(char *filename, char flags, int32_t *daposx, int32_t *daposy,
sprite[i].picnum = 0;
}
}
#ifdef YAX_ENABLE
yax_update(0);
#endif
for (i=0; i<numsprites; i++)
{
int32_t k;
@ -11096,8 +11098,8 @@ restart_grand:
mcf++;
clipsectcnt = 0; clipsectnum = 0;
clipspritecnt = 0; clipspritenum = 0;
didchange = 0;
didchange = 0;
if (cb>=0 && mcf==0 && *ceilhit==sectnum+16384)
{
for (i=0; i<origclipsectnum; i++)
@ -11116,8 +11118,10 @@ restart_grand:
if (clipsectnum==0)
mcf++;
}
else mcf++;
else if (mcf==0)
mcf++;
didchange = 0;
if (fb>=0 && mcf==1 && *florhit==sectnum+16384)
{
// (almost) same as above, but with floors...

View File

@ -587,7 +587,9 @@ int32_t map_undoredo(int32_t dir)
if (qsetmode == 200 && rendmode == 4)
polymer_loadboard();
#endif
#ifdef YAX_ENABLE
yax_update(0);
#endif
CheckMapCorruption(4, 0);
return 0;
@ -3835,10 +3837,6 @@ restart:
tilescreen_drawrest(iSelected, showmsg);
enddrawing();
showframe(1);
begindrawing();
k = (mousex || mousey || mouseb);
if (!k)
for (i=0; i<(signed)(sizeof(keystatus)/sizeof(keystatus[0])); i++)
@ -3853,6 +3851,10 @@ restart:
showframe(1);
return 1;
}
enddrawing();
showframe(1);
begindrawing();
}
}
}
@ -5392,7 +5394,7 @@ static void Keys3d(void)
k = 0;
if (highlightsectorcnt > 0 && searchsector>=0 && searchsector<numsectors)
{
if (show2dwall[searchsector>>3]&(1<<(searchsector&7)))
if (hlsectorbitmap[searchsector>>3]&(1<<(searchsector&7)))
k = highlightsectorcnt;
}
@ -9873,7 +9875,7 @@ void ExtAnalyzeSprites(void)
{
int32_t i, k;
spritetype *tspr;
int32_t frames=0, l;
int32_t frames=0, sh;
for (i=0,tspr=&tsprite[0]; i<spritesortcnt; i++,tspr++)
{
@ -9896,28 +9898,39 @@ void ExtAnalyzeSprites(void)
tspr->cstat |= 2+512;
}
if (shadepreview && !(tspr->cstat & 16))
/* Shade preview rules (thanks to Gambini)
*
* 1st rule: Any pal value not equal to 0 in the floor of a sector will
* turn all the sprites within this sector to that pal value.
*
* 2nd rule: The shade of a sprite will be taken from the floor unless the
* ceiling is parallaxed, in which case will be taken from the
* ceiling. But not the pal which always follow the 1st rule.
*
* 3rd rule: relative to wall sprites will keep their own shade unless
* they're actors, but they will still retain the floor pal.
*/
if (shadepreview)
{
int32_t wallaligned = (tspr->cstat & 16);
if (tspr->sectnum<0)
continue;
if (sector[tspr->sectnum].ceilingstat&1)
{
l = sector[tspr->sectnum].ceilingshade;
if (sector[tspr->sectnum].ceilingpal != 0 && sector[tspr->sectnum].ceilingpal < num_tables)
tspr->pal=sector[tspr->sectnum].ceilingpal;
}
else
{
l = sector[tspr->sectnum].floorshade;
if (sector[tspr->sectnum].floorpal != 0 && sector[tspr->sectnum].floorpal < num_tables)
tspr->pal=sector[tspr->sectnum].floorpal;
}
// 1st rule
if (sector[tspr->sectnum].floorpal > 0 && sector[tspr->sectnum].floorpal < num_tables)
tspr->pal = sector[tspr->sectnum].floorpal;
if ((tspr->owner>=0 && (sprite[tspr->owner].cstat&2048)==0))
// 2nd and 3rd rule minus "actor condition"
if (!wallaligned && (tspr->cstat&2048)==0)
{
inpclamp(&l, -127, 127);
// tspr->shade = l;
if (sector[tspr->sectnum].ceilingstat&1)
sh = sector[tspr->sectnum].ceilingshade;
else
sh = sector[tspr->sectnum].floorshade;
inpclamp(&sh, -127, 127);
tspr->shade = sh;
}
}
@ -10747,7 +10760,7 @@ static void EditSectorData(int16_t sectnum)
#ifdef YAX_ENABLE
if (med_editval)
{
if ((row==0 || row==1 || row==3 || row==5) && yax_getbunch(sectnum, (col==2)) >= 0)
if ((row==1 || row==3 || row==5) && yax_getbunch(sectnum, (col==2)) >= 0)
med_editval = 0;
}
#endif
@ -10757,8 +10770,15 @@ static void EditSectorData(int16_t sectnum)
switch (row)
{
case 0:
#ifdef YAX_ENABLE
i = sector[sectnum].ceilingstat&YAX_BIT;
#endif
handlemed(1, "Flags (hex)", "Ceiling Flags", &sector[sectnum].ceilingstat,
sizeof(sector[sectnum].ceilingstat), 65535, 0);
#ifdef YAX_ENABLE
sector[sectnum].ceilingstat &= ~YAX_BIT;
sector[sectnum].ceilingstat |= i;
#endif
break;
case 1:
for (i=Bsprintf(med_disptext,"(X,Y)pan: %d, %d",sector[sectnum].ceilingxpanning,sector[sectnum].ceilingypanning); i < med_dispwidth; i++) med_disptext[i] = ' ';
@ -10798,8 +10818,15 @@ static void EditSectorData(int16_t sectnum)
switch (row)
{
case 0:
#ifdef YAX_ENABLE
i = sector[sectnum].ceilingstat&YAX_BIT;
#endif
handlemed(1, "Flags (hex)", "Floor Flags", &sector[sectnum].floorstat,
sizeof(sector[sectnum].floorstat), 65535, 0);
#ifdef YAX_ENABLE
sector[sectnum].ceilingstat &= ~YAX_BIT;
sector[sectnum].ceilingstat |= i;
#endif
break;
case 1:

View File

@ -798,7 +798,7 @@ int32_t __fastcall Gv_GetVarX(register int32_t id)
}
badindex:
OSD_Printf(CON_ERROR "Gv_GetVar(): invalid array index (%s[%d])\n",g_errorLineNum,keyw[g_tw],aGameArrays[id].szLabel,negateResult);
OSD_Printf(CON_ERROR "Gv_GetVar(): invalid array index (%s[%d])\n",g_errorLineNum,keyw[g_tw],aGameArrays[id].szLabel,(int32_t)negateResult);
return -1;
badvarid: