mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 10:40:47 +00:00
Fullbright art sprites and walls. Hurray for red eyes.
git-svn-id: https://svn.eduke32.com/eduke32@228 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
17f698c991
commit
793ae80fa8
2 changed files with 53 additions and 13 deletions
|
@ -71,7 +71,7 @@ static unsigned long distrecip[65536];
|
||||||
|
|
||||||
static long *lookups = NULL;
|
static long *lookups = NULL;
|
||||||
static char lookupsalloctype = 255;
|
static char lookupsalloctype = 255;
|
||||||
long dommxoverlay = 1, beforedrawrooms = 1;
|
long dommxoverlay = 1, beforedrawrooms = 1, indrawroomsandmasks = 0;
|
||||||
|
|
||||||
static long oxdimen = -1, oviewingrange = -1, oxyaspect = -1;
|
static long oxdimen = -1, oviewingrange = -1, oxyaspect = -1;
|
||||||
|
|
||||||
|
@ -5633,6 +5633,7 @@ void drawrooms(long daposx, long daposy, long daposz,
|
||||||
short *shortptr1, *shortptr2;
|
short *shortptr1, *shortptr2;
|
||||||
|
|
||||||
beforedrawrooms = 0;
|
beforedrawrooms = 0;
|
||||||
|
indrawroomsandmasks = 1;
|
||||||
|
|
||||||
globalposx = daposx; globalposy = daposy; globalposz = daposz;
|
globalposx = daposx; globalposy = daposy; globalposz = daposz;
|
||||||
globalang = (daang&2047);
|
globalang = (daang&2047);
|
||||||
|
@ -5678,7 +5679,7 @@ void drawrooms(long daposx, long daposy, long daposz,
|
||||||
if (0)
|
if (0)
|
||||||
{
|
{
|
||||||
polymer_drawrooms();
|
polymer_drawrooms();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
//============================================================================= //POLYMOST BEGINS
|
//============================================================================= //POLYMOST BEGINS
|
||||||
|
@ -6088,6 +6089,7 @@ killsprite:
|
||||||
free(walldepths);
|
free(walldepths);
|
||||||
#endif /* goodalpha */
|
#endif /* goodalpha */
|
||||||
|
|
||||||
|
indrawroomsandmasks = 0;
|
||||||
enddrawing(); //}}}
|
enddrawing(); //}}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,6 +139,11 @@ long glwidescreen = 0;
|
||||||
long glprojectionhacks = 1;
|
long glprojectionhacks = 1;
|
||||||
static GLuint polymosttext = 0;
|
static GLuint polymosttext = 0;
|
||||||
extern char nofog;
|
extern char nofog;
|
||||||
|
|
||||||
|
// Those two globals control the drawing of fullbright tiles
|
||||||
|
long fullbrightpass = 0;
|
||||||
|
long shadeforfullbrightpass;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_MSC_PRAGMAS)
|
#if defined(USE_MSC_PRAGMAS)
|
||||||
|
@ -303,7 +308,7 @@ typedef struct pthtyp_t
|
||||||
short picnum;
|
short picnum;
|
||||||
char palnum;
|
char palnum;
|
||||||
char effects;
|
char effects;
|
||||||
char flags; // 1 = clamped (dameth&4), 2 = hightile, 4 = skybox face, 8 = hasalpha, 128 = invalidated
|
char flags; // 1 = clamped (dameth&4), 2 = hightile, 4 = skybox face, 8 = hasalpha, 16 = hasfullbright, 128 = invalidated
|
||||||
char skyface;
|
char skyface;
|
||||||
hicreplctyp *hicr;
|
hicreplctyp *hicr;
|
||||||
|
|
||||||
|
@ -385,9 +390,10 @@ tryart:
|
||||||
(pth->flags & (1+2)) == ((dameth&4)>>2)
|
(pth->flags & (1+2)) == ((dameth&4)>>2)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (pth->flags & 128)
|
if ((pth->flags & 128) || (pth->flags & 16))
|
||||||
{
|
{
|
||||||
pth->flags &= ~128;
|
if (pth->flags & 128)
|
||||||
|
pth->flags &= ~128;
|
||||||
if (gloadtile_art(dapicnum,dapalnum,dameth,pth,0)) return NULL; //reload tile (for animations)
|
if (gloadtile_art(dapicnum,dapalnum,dameth,pth,0)) return NULL; //reload tile (for animations)
|
||||||
}
|
}
|
||||||
return(pth);
|
return(pth);
|
||||||
|
@ -747,7 +753,7 @@ int gloadtile_art (long dapic, long dapal, long dameth, pthtyp *pth, long doallo
|
||||||
{
|
{
|
||||||
coltype *pic, *wpptr;
|
coltype *pic, *wpptr;
|
||||||
long j, x, y, x2, y2, xsiz, ysiz, dacol, tsizx, tsizy;
|
long j, x, y, x2, y2, xsiz, ysiz, dacol, tsizx, tsizy;
|
||||||
char hasalpha = 0;
|
char hasalpha = 0, hasfullbright = 0;
|
||||||
|
|
||||||
tsizx = tilesizx[dapic];
|
tsizx = tilesizx[dapic];
|
||||||
tsizy = tilesizy[dapic];
|
tsizy = tilesizy[dapic];
|
||||||
|
@ -785,12 +791,35 @@ int gloadtile_art (long dapic, long dapal, long dameth, pthtyp *pth, long doallo
|
||||||
{ wpptr->r = wpptr->g = wpptr->b = wpptr->a = 0; continue; }
|
{ wpptr->r = wpptr->g = wpptr->b = wpptr->a = 0; continue; }
|
||||||
if (x < tsizx) x2 = x; else x2 = x-tsizx;
|
if (x < tsizx) x2 = x; else x2 = x-tsizx;
|
||||||
dacol = (long)(*(unsigned char *)(waloff[dapic]+x2*tsizy+y2));
|
dacol = (long)(*(unsigned char *)(waloff[dapic]+x2*tsizy+y2));
|
||||||
if (dacol == 255) {
|
if (!fullbrightpass)
|
||||||
wpptr->a = 0; hasalpha = 1;
|
{
|
||||||
} else {
|
if ((dacol > 239) && (dacol < 255)) { //fullbright colors
|
||||||
wpptr->a = 255;
|
if (indrawroomsandmasks)
|
||||||
dacol = (long)((unsigned char)palookup[dapal][dacol]);
|
{
|
||||||
}
|
wpptr->a = 0; hasalpha = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wpptr->a = 255;
|
||||||
|
dacol = (long)((unsigned char)palookup[dapal][dacol]);
|
||||||
|
}
|
||||||
|
hasfullbright = 1;
|
||||||
|
} else if (dacol == 255) {
|
||||||
|
wpptr->a = 0; hasalpha = 1;
|
||||||
|
} else {
|
||||||
|
wpptr->a = 255;
|
||||||
|
dacol = (long)((unsigned char)palookup[dapal][dacol]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((dacol < 240) || (dacol == 255)) {
|
||||||
|
wpptr->a = 0; hasalpha = 1;
|
||||||
|
} else {
|
||||||
|
wpptr->a = 255; hasfullbright = 1;
|
||||||
|
dacol = (long)((unsigned char)palookup[dapal][dacol]);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (gammabrightness) {
|
if (gammabrightness) {
|
||||||
wpptr->r = curpalette[dacol].r;
|
wpptr->r = curpalette[dacol].r;
|
||||||
wpptr->g = curpalette[dacol].g;
|
wpptr->g = curpalette[dacol].g;
|
||||||
|
@ -837,7 +866,7 @@ int gloadtile_art (long dapic, long dapal, long dameth, pthtyp *pth, long doallo
|
||||||
pth->picnum = dapic;
|
pth->picnum = dapic;
|
||||||
pth->palnum = dapal;
|
pth->palnum = dapal;
|
||||||
pth->effects = 0;
|
pth->effects = 0;
|
||||||
pth->flags = ((dameth&4)>>2) | (hasalpha<<3);
|
pth->flags = ((dameth&4)>>2) | (hasalpha<<3) | (hasfullbright<<4);
|
||||||
pth->hicr = NULL;
|
pth->hicr = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1557,6 +1586,15 @@ void drawpoly (double *dpx, double *dpy, long n, long method)
|
||||||
}
|
}
|
||||||
bglEnd();
|
bglEnd();
|
||||||
}
|
}
|
||||||
|
if ((pth->flags & 16) && (!fullbrightpass) && (indrawroomsandmasks)) // tile has fullbright colors ?
|
||||||
|
{
|
||||||
|
fullbrightpass = 1;
|
||||||
|
shadeforfullbrightpass = globalshade;
|
||||||
|
globalshade = 0;
|
||||||
|
drawpoly(dpx, dpy, n, method); // draw them afterwards, then. :)
|
||||||
|
globalshade = shadeforfullbrightpass;
|
||||||
|
fullbrightpass = 0;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue