mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Translucent slope texture mapping; make overhead view always display grayed-out walls instead of only non-TRORed ones
git-svn-id: https://svn.eduke32.com/eduke32@1889 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b391bb8ad9
commit
219dc6dd26
4 changed files with 114 additions and 56 deletions
|
@ -513,7 +513,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
// init dummy texture for YAX
|
// init dummy texture for YAX
|
||||||
// must be after loadpics(), which inits BUILD's cache
|
// must be after loadpics(), which inits BUILD's cache
|
||||||
|
|
||||||
i = MAXTILES-1;
|
for (i=MAXTILES-1; i>=MAXTILES-2; i--)
|
||||||
if (tilesizx[i]==0 && tilesizy[i]==0)
|
if (tilesizx[i]==0 && tilesizy[i]==0)
|
||||||
{
|
{
|
||||||
static char R[8*16] = { //
|
static char R[8*16] = { //
|
||||||
|
@ -535,9 +535,13 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
allocache(&waloff[i], sx*sy, &walock[i]);
|
allocache(&waloff[i], sx*sy, &walock[i]);
|
||||||
newtile = (char *)waloff[i];
|
newtile = (char *)waloff[i];
|
||||||
|
|
||||||
|
if (i==MAXTILES-1)
|
||||||
col = getclosestcol(128>>2, 128>>2, 0);
|
col = getclosestcol(128>>2, 128>>2, 0);
|
||||||
|
else
|
||||||
|
col = getclosestcol(63, 0, 63);
|
||||||
for (j=0; j<(signed)sizeof(R); j++)
|
for (j=0; j<(signed)sizeof(R); j++)
|
||||||
R[j] *= col;
|
if (R[j])
|
||||||
|
R[j] = col;
|
||||||
|
|
||||||
Bmemset(newtile, 0, sx*sy);
|
Bmemset(newtile, 0, sx*sy);
|
||||||
for (j=0; j<8; j++)
|
for (j=0; j<8; j++)
|
||||||
|
|
|
@ -620,7 +620,7 @@ static void yax_tweakpicnums(int32_t bunchnum, int32_t cf, int32_t restore)
|
||||||
{
|
{
|
||||||
opicnum[cf][i] = SECTORFLD(i,picnum, cf);
|
opicnum[cf][i] = SECTORFLD(i,picnum, cf);
|
||||||
if (editstatus && showinvisibility)
|
if (editstatus && showinvisibility)
|
||||||
SECTORFLD(i,picnum, cf) = MAXTILES-1;
|
SECTORFLD(i,picnum, cf) = MAXTILES-1-((SECTORFLD(i,stat, cf)&4096)>>12);
|
||||||
else
|
else
|
||||||
SECTORFLD(i,picnum, cf) = 13; //FOF;
|
SECTORFLD(i,picnum, cf) = 13; //FOF;
|
||||||
}
|
}
|
||||||
|
@ -3717,6 +3717,48 @@ static inline void ceilspritescan(int32_t x1, int32_t x2)
|
||||||
faketimerhandler();
|
faketimerhandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////// translucent slope vline, based on a-c.c's slopevlin //////////
|
||||||
|
static int32_t gglogx, gglogy, ggpinc;
|
||||||
|
static char *ggbuf, *ggpal;
|
||||||
|
|
||||||
|
static void setupslopevlin_alsotrans(int32_t logylogx, intptr_t bufplc, int32_t pinc)
|
||||||
|
{
|
||||||
|
setupslopevlin(logylogx, bufplc, pinc);
|
||||||
|
gglogx = (logylogx&255); gglogy = (logylogx>>8);
|
||||||
|
ggbuf = (char *)bufplc; ggpinc = pinc;
|
||||||
|
ggpal = palookup[globalpal] + (getpalookup(0,globalshade)<<8);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void tslopevlin(intptr_t p, int32_t i, intptr_t slopaloffs, int32_t cnt, int32_t bx, int32_t by)
|
||||||
|
{
|
||||||
|
intptr_t *slopalptr;
|
||||||
|
int32_t bz, bzinc;
|
||||||
|
uint32_t u, v;
|
||||||
|
|
||||||
|
char ch;
|
||||||
|
|
||||||
|
bz = asm3; bzinc = (asm1>>3);
|
||||||
|
slopalptr = (intptr_t *)slopaloffs;
|
||||||
|
|
||||||
|
for (; cnt>0; cnt--)
|
||||||
|
{
|
||||||
|
i = krecipasm(bz>>6); bz += bzinc;
|
||||||
|
u = bx+globalx3*i;
|
||||||
|
v = by+globaly3*i;
|
||||||
|
ch = *(char *)(slopalptr[0] + ggbuf[((u>>(32-gglogx))<<gglogy)+(v>>(32-gglogy))]);
|
||||||
|
if (globalorientation&128)
|
||||||
|
{
|
||||||
|
if (ch != 255) *((char *)p) = transluc[*((char *)p)+(ggpal[ch]<<8)];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (ch != 255) *((char *)p) = transluc[(*((char *)p)<<8)+ggpal[ch]];
|
||||||
|
}
|
||||||
|
|
||||||
|
slopalptr--;
|
||||||
|
p += ggpinc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// grouscan (internal)
|
// grouscan (internal)
|
||||||
|
@ -3835,7 +3877,8 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
|
||||||
globvis = mulscale16(globvis,xdimscale);
|
globvis = mulscale16(globvis,xdimscale);
|
||||||
j = FP_OFF(palookup[globalpal]);
|
j = FP_OFF(palookup[globalpal]);
|
||||||
|
|
||||||
setupslopevlin(((int32_t)(picsiz[globalpicnum]&15))+(((int32_t)(picsiz[globalpicnum]>>4))<<8),waloff[globalpicnum],-ylookup[1]);
|
setupslopevlin_alsotrans(((int32_t)(picsiz[globalpicnum]&15))+(((int32_t)(picsiz[globalpicnum]>>4))<<8),
|
||||||
|
waloff[globalpicnum],-ylookup[1]);
|
||||||
|
|
||||||
l = (globalzd>>16);
|
l = (globalzd>>16);
|
||||||
|
|
||||||
|
@ -3870,7 +3913,10 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
|
||||||
globalx3 = (globalx2>>10);
|
globalx3 = (globalx2>>10);
|
||||||
globaly3 = (globaly2>>10);
|
globaly3 = (globaly2>>10);
|
||||||
asm3 = mulscale16(y2,globalzd) + (globalzx>>6);
|
asm3 = mulscale16(y2,globalzd) + (globalzx>>6);
|
||||||
|
if ((globalorientation&256)==0)
|
||||||
slopevlin(ylookup[y2]+x+frameoffset,krecipasm(asm3>>3),(intptr_t)nptr2,y2-y1+1,globalx1,globaly1);
|
slopevlin(ylookup[y2]+x+frameoffset,krecipasm(asm3>>3),(intptr_t)nptr2,y2-y1+1,globalx1,globaly1);
|
||||||
|
else
|
||||||
|
tslopevlin(ylookup[y2]+x+frameoffset,krecipasm(asm3>>3),(intptr_t)nptr2,y2-y1+1,globalx1,globaly1);
|
||||||
|
|
||||||
if ((x&15) == 0) faketimerhandler();
|
if ((x&15) == 0) faketimerhandler();
|
||||||
}
|
}
|
||||||
|
@ -4193,7 +4239,11 @@ static void drawalls(int32_t bunch)
|
||||||
{
|
{
|
||||||
if ((cz[2] <= cz[0]) && (cz[3] <= cz[1]))
|
if ((cz[2] <= cz[0]) && (cz[3] <= cz[1]))
|
||||||
{
|
{
|
||||||
if (globparaceilclip)
|
if (globparaceilclip
|
||||||
|
#ifdef YAX_ENABLE
|
||||||
|
|| (sector[globalcursectnum].ceilingstat&4096)
|
||||||
|
#endif
|
||||||
|
)
|
||||||
for (x=x1; x<=x2; x++)
|
for (x=x1; x<=x2; x++)
|
||||||
if (uplc[x] > umost[x])
|
if (uplc[x] > umost[x])
|
||||||
if (umost[x] <= dmost[x])
|
if (umost[x] <= dmost[x])
|
||||||
|
@ -4285,8 +4335,7 @@ static void drawalls(int32_t bunch)
|
||||||
{
|
{
|
||||||
if (globparaflorclip
|
if (globparaflorclip
|
||||||
#ifdef YAX_ENABLE
|
#ifdef YAX_ENABLE
|
||||||
// || ((sec->floorstat&2) && yax_globallev < YAX_MAXDRAWS)
|
|| (sector[globalcursectnum].floorstat&4096)
|
||||||
// || yax_getbunch(wallnum, YAX_FLOOR) < 0
|
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
for (x=x1; x<=x2; x++)
|
for (x=x1; x<=x2; x++)
|
||||||
|
@ -14023,21 +14072,11 @@ static void drawscreen_drawwall(int32_t i, int32_t posxe, int32_t posye, int32_t
|
||||||
if (!m32_sideview && (j >= 0) && (i > j)) return;
|
if (!m32_sideview && (j >= 0) && (i > j)) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
|
||||||
//def YAX_ENABLE
|
|
||||||
if ((graywallbitmap[i>>3] & (1<<(i&7))) || (j>=0 && (graywallbitmap[j>>3] & (1<<(j&7)))))
|
if ((graywallbitmap[i>>3] & (1<<(i&7))) || (j>=0 && (graywallbitmap[j>>3] & (1<<(j&7)))))
|
||||||
{
|
{
|
||||||
#ifdef YAX_ENABLE
|
|
||||||
// yax'ed grayed out walls are always cleared from the overhead map.
|
|
||||||
// normal walls cleared out due to editorzrange are displayed, though
|
|
||||||
if (!m32_sideview && ((wall[i].cstat&YAX_NEXTWALLBITS) || (j>=0 && wall[j].cstat&YAX_NEXTWALLBITS)))
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
col = 8;
|
col = 8;
|
||||||
}
|
}
|
||||||
else
|
else if (j < 0)
|
||||||
#endif
|
|
||||||
if (j < 0)
|
|
||||||
{
|
{
|
||||||
col = 15;
|
col = 15;
|
||||||
if (i == linehighlight)
|
if (i == linehighlight)
|
||||||
|
@ -14395,8 +14434,16 @@ void draw2dscreen(const vec3_t *pos, int16_t cursectnum, int16_t ange, int32_t z
|
||||||
m32_swcnt = 0;
|
m32_swcnt = 0;
|
||||||
|
|
||||||
if (!m32_sideview)
|
if (!m32_sideview)
|
||||||
|
{
|
||||||
for (i=numwalls-1; i>=0; i--)
|
for (i=numwalls-1; i>=0; i--)
|
||||||
|
#ifdef YAX_ENABLE
|
||||||
|
if (graywallbitmap[(i)>>3]&(1<<((i)&7)))
|
||||||
drawscreen_drawwall(i,posxe,posye,posze,zoome);
|
drawscreen_drawwall(i,posxe,posye,posze,zoome);
|
||||||
|
for (i=numwalls-1; i>=0; i--)
|
||||||
|
if ((graywallbitmap[(i)>>3]&(1<<((i)&7)))==0)
|
||||||
|
#endif
|
||||||
|
drawscreen_drawwall(i,posxe,posye,posze,zoome);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i=0; i<numsectors; i++)
|
for (i=0; i<numsectors; i++)
|
||||||
|
@ -14852,7 +14899,7 @@ int32_t screencapture_png(const char *filename, char inverseit, const char *vers
|
||||||
}
|
}
|
||||||
|
|
||||||
png_set_gAMA(png_ptr, info_ptr, vid_gamma); // 1.0/vid_gamma ?
|
png_set_gAMA(png_ptr, info_ptr, vid_gamma); // 1.0/vid_gamma ?
|
||||||
png_set_sRGB(png_ptr, info_ptr, PNG_sRGB_INTENT_SATURATION); // hm...
|
// png_set_sRGB(png_ptr, info_ptr, PNG_sRGB_INTENT_SATURATION); // hm...
|
||||||
|
|
||||||
text = (png_textp)png_malloc(png_ptr, 2*png_sizeof(png_text));
|
text = (png_textp)png_malloc(png_ptr, 2*png_sizeof(png_text));
|
||||||
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
|
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// uncomment to clear the screen before each top-level draw
|
// uncomment to clear the screen before each top-level draw
|
||||||
// (classic only)
|
// (classic only)
|
||||||
// #define ENGINE_CLEAR_SCREEN
|
//#define ENGINE_CLEAR_SCREEN
|
||||||
|
|
||||||
#ifdef YAX_ENABLE
|
#ifdef YAX_ENABLE
|
||||||
# define YAX_MAXDRAWS 8
|
# define YAX_MAXDRAWS 8
|
||||||
|
|
|
@ -72,11 +72,12 @@ static int32_t __fastcall VM_AccessWall(int32_t how, int32_t lVar1, int32_t lLab
|
||||||
case WALL_NEXTWALL: wall[i].nextwall=lValue; break;
|
case WALL_NEXTWALL: wall[i].nextwall=lValue; break;
|
||||||
case WALL_NEXTSECTOR: wall[i].nextsector=lValue; break;
|
case WALL_NEXTSECTOR: wall[i].nextsector=lValue; break;
|
||||||
case WALL_CSTAT:
|
case WALL_CSTAT:
|
||||||
wall[i].cstat = lValue & (0x03ff
|
|
||||||
#ifdef YAX_ENABLE
|
#ifdef YAX_ENABLE
|
||||||
| (m32_script_expertmode ? YAX_NEXTWALLBITS : 0)
|
if (!m32_script_expertmode)
|
||||||
|
SET_PROTECT_BITS(wall[i].cstat, lValue, YAX_NEXTWALLBITS);
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
);
|
wall[i].cstat = lValue;
|
||||||
break;
|
break;
|
||||||
case WALL_PICNUM: wall[i].picnum=lValue; break;
|
case WALL_PICNUM: wall[i].picnum=lValue; break;
|
||||||
case WALL_OVERPICNUM: wall[i].overpicnum=lValue; break;
|
case WALL_OVERPICNUM: wall[i].overpicnum=lValue; break;
|
||||||
|
@ -170,16 +171,24 @@ static int32_t __fastcall VM_AccessSector(int32_t how, int32_t lVar1, int32_t lL
|
||||||
case SECTOR_CEILINGZ: sector[i].ceilingz=lValue; break;
|
case SECTOR_CEILINGZ: sector[i].ceilingz=lValue; break;
|
||||||
case SECTOR_FLOORZ: sector[i].floorz=lValue; break;
|
case SECTOR_FLOORZ: sector[i].floorz=lValue; break;
|
||||||
case SECTOR_CEILINGSTAT:
|
case SECTOR_CEILINGSTAT:
|
||||||
sector[i].ceilingstat = lValue&0x01fd;
|
#ifdef YAX_ENABLE
|
||||||
|
if (!m32_script_expertmode)
|
||||||
|
SET_PROTECT_BITS(sector[i].ceilingstat, lValue, YAX_BIT);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
sector[i].ceilingstat = lValue;
|
||||||
break;
|
break;
|
||||||
case SECTOR_FLOORSTAT:
|
case SECTOR_FLOORSTAT:
|
||||||
sector[i].floorstat = lValue&0x01fd;
|
#ifdef YAX_ENABLE
|
||||||
|
if (!m32_script_expertmode)
|
||||||
|
SET_PROTECT_BITS(sector[i].floorstat, lValue, YAX_BIT);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
sector[i].floorstat = lValue;
|
||||||
break;
|
break;
|
||||||
case SECTOR_CEILINGPICNUM: sector[i].ceilingpicnum=lValue; break;
|
case SECTOR_CEILINGPICNUM: sector[i].ceilingpicnum=lValue; break;
|
||||||
case SECTOR_CEILINGSLOPE:
|
case SECTOR_CEILINGSLOPE:
|
||||||
sector[i].ceilingheinum = lValue;
|
setslope(i, 0, lValue);
|
||||||
if (lValue) sector[i].ceilingstat |= 2;
|
|
||||||
else sector[i].ceilingstat &= ~2;
|
|
||||||
break;
|
break;
|
||||||
case SECTOR_CEILINGSHADE: sector[i].ceilingshade=lValue; break;
|
case SECTOR_CEILINGSHADE: sector[i].ceilingshade=lValue; break;
|
||||||
case SECTOR_CEILINGPAL: sector[i].ceilingpal=lValue; break;
|
case SECTOR_CEILINGPAL: sector[i].ceilingpal=lValue; break;
|
||||||
|
@ -187,9 +196,7 @@ static int32_t __fastcall VM_AccessSector(int32_t how, int32_t lVar1, int32_t lL
|
||||||
case SECTOR_CEILINGYPANNING: sector[i].ceilingypanning=lValue; break;
|
case SECTOR_CEILINGYPANNING: sector[i].ceilingypanning=lValue; break;
|
||||||
case SECTOR_FLOORPICNUM: sector[i].floorpicnum=lValue; break;
|
case SECTOR_FLOORPICNUM: sector[i].floorpicnum=lValue; break;
|
||||||
case SECTOR_FLOORSLOPE:
|
case SECTOR_FLOORSLOPE:
|
||||||
sector[i].floorheinum = lValue;
|
setslope(i, 1, lValue);
|
||||||
if (lValue) sector[i].floorstat |= 2;
|
|
||||||
else sector[i].floorstat &= ~2;
|
|
||||||
break;
|
break;
|
||||||
case SECTOR_FLOORSHADE: sector[i].floorshade=lValue; break;
|
case SECTOR_FLOORSHADE: sector[i].floorshade=lValue; break;
|
||||||
case SECTOR_FLOORPAL: sector[i].floorpal=lValue; break;
|
case SECTOR_FLOORPAL: sector[i].floorpal=lValue; break;
|
||||||
|
|
Loading…
Reference in a new issue