- re-enabled all model specific code in Duke's animatesprites function and removed some remaining software renderer-only code in the engine.

This commit is contained in:
Christoph Oelckers 2020-12-01 23:57:39 +01:00
parent 9a507e5d0a
commit 25ef58f897
12 changed files with 142 additions and 201 deletions

View file

@ -94,11 +94,8 @@ template<typename T> tspritetype* viewInsertTSprite(int nSector, int nStatnum, T
pTSprite->owner = pSprite->owner; pTSprite->owner = pSprite->owner;
pTSprite->ang = pSprite->ang; pTSprite->ang = pSprite->ang;
} }
if (videoGetRenderMode() >= REND_POLYMOST) pTSprite->x += Cos(gCameraAng)>>25;
{ pTSprite->y += Sin(gCameraAng)>>25;
pTSprite->x += Cos(gCameraAng)>>25;
pTSprite->y += Sin(gCameraAng)>>25;
}
return pTSprite; return pTSprite;
} }
@ -573,7 +570,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
nAnim--; nAnim--;
} }
if ((pTSprite->cstat&48) != 48 && r_voxels && videoGetRenderMode() != REND_POLYMER && !(spriteext[nSprite].flags&SPREXT_NOTMD)) if ((pTSprite->cstat&48) != 48 && r_voxels && !(spriteext[nSprite].flags&SPREXT_NOTMD))
{ {
int const nRootTile = pTSprite->picnum; int const nRootTile = pTSprite->picnum;
int nAnimTile = pTSprite->picnum + animateoffs_replace(pTSprite->picnum, 32768+pTSprite->owner); int nAnimTile = pTSprite->picnum + animateoffs_replace(pTSprite->picnum, 32768+pTSprite->owner);

View file

@ -298,8 +298,6 @@ void sub_557C4(int x, int y, int interpolation)
void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int viewPlayer) void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int viewPlayer)
{ {
if (videoGetRenderMode() == REND_POLYMER)
return;
for (int i = mirrorcnt - 1; i >= 0; i--) for (int i = mirrorcnt - 1; i >= 0; i--)
{ {
int nTile = 4080+i; int nTile = 4080+i;

View file

@ -841,7 +841,7 @@ void viewDrawScreen(bool sceneonly)
if ((v78 || bDelirium) && !sceneonly) if ((v78 || bDelirium) && !sceneonly)
{ {
if (videoGetRenderMode() == REND_POLYMOST && gDeliriumBlur) if (gDeliriumBlur)
{ {
// todo: Implement using modern techniques instead of relying on deprecated old stuff that isn't well supported anymore. // todo: Implement using modern techniques instead of relying on deprecated old stuff that isn't well supported anymore.
/* names broken up so that searching for GL keywords won't find them anymore /* names broken up so that searching for GL keywords won't find them anymore

View file

@ -41,12 +41,6 @@ EXTERN int16_t sintable[2048];
typedef int64_t coord_t; typedef int64_t coord_t;
enum rendmode_t {
REND_CLASSIC,
REND_POLYMOST = 3,
REND_POLYMER
};
enum enum
{ {
MAXSECTORS = 4096, MAXSECTORS = 4096,
@ -350,9 +344,6 @@ extern int16_t tiletovox[MAXTILES];
extern int32_t voxscale[MAXVOXELS]; extern int32_t voxscale[MAXVOXELS];
extern char g_haveVoxels; extern char g_haveVoxels;
#ifdef USE_OPENGL
extern int32_t rendmode;
#endif
extern uint8_t globalr, globalg, globalb; extern uint8_t globalr, globalg, globalb;
enum { enum {
@ -367,15 +358,6 @@ extern const char *engineerrstr;
EXTERN int32_t editorzrange[2]; EXTERN int32_t editorzrange[2];
static FORCE_INLINE int32_t videoGetRenderMode(void)
{
#ifndef USE_OPENGL
return REND_CLASSIC;
#else
return rendmode;
#endif
}
enum { enum {
ENGINECOMPATIBILITY_NONE = 0, ENGINECOMPATIBILITY_NONE = 0,
ENGINECOMPATIBILITY_19950829, // Powerslave/Exhumed ENGINECOMPATIBILITY_19950829, // Powerslave/Exhumed
@ -744,7 +726,6 @@ EXTERN_CVAR(Bool, r_voxels)
extern int32_t r_downsize; extern int32_t r_downsize;
extern int32_t mdtims, omdtims; extern int32_t mdtims, omdtims;
extern int32_t glrendmode;
extern int32_t r_rortexture; extern int32_t r_rortexture;
extern int32_t r_rortexturerange; extern int32_t r_rortexturerange;

View file

@ -4,12 +4,9 @@
#include "mdsprite.h" #include "mdsprite.h"
void Polymost_CacheHitList(uint8_t* hash);
typedef struct { uint8_t r, g, b, a; } coltype; typedef struct { uint8_t r, g, b, a; } coltype;
typedef struct { float r, g, b, a; } coltypef; typedef struct { float r, g, b, a; } coltypef;
extern int32_t rendmode;
extern float gtang; extern float gtang;
extern double gxyaspect; extern double gxyaspect;
extern float grhalfxdown10x; extern float grhalfxdown10x;
@ -23,7 +20,6 @@ void polymost_outputGLDebugMessage(uint8_t severity, const char* format, ...);
void polymost_drawsprite(int32_t snum); void polymost_drawsprite(int32_t snum);
void polymost_drawmaskwall(int32_t damaskwallcnt); void polymost_drawmaskwall(int32_t damaskwallcnt);
void polymost_dorotatespritemodel(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, int8_t dashade, uint8_t dapalnum, int32_t dastat, uint8_t daalpha, uint8_t dablend, int32_t uniqid); void polymost_dorotatespritemodel(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, int8_t dashade, uint8_t dapalnum, int32_t dastat, uint8_t daalpha, uint8_t dablend, int32_t uniqid);
void polymost_fillpolygon(int32_t npoints);
void polymost_initosdfuncs(void); void polymost_initosdfuncs(void);
void polymost_drawrooms(void); void polymost_drawrooms(void);
void polymost_prepareMirror(int32_t dax, int32_t day, int32_t daz, fixed_t daang, fixed_t dahoriz, int16_t mirrorWall); void polymost_prepareMirror(int32_t dax, int32_t day, int32_t daz, fixed_t daang, fixed_t dahoriz, int16_t mirrorWall);

View file

@ -40,8 +40,6 @@
#endif #endif
int32_t rendmode=0;
int32_t glrendmode = REND_POLYMOST;
int32_t r_rortexture = 0; int32_t r_rortexture = 0;
int32_t r_rortexturerange = 0; int32_t r_rortexturerange = 0;
int32_t r_rorphase = 0; int32_t r_rorphase = 0;
@ -327,10 +325,7 @@ static void renderDrawSprite(int32_t snum)
// //
static void renderDrawMaskedWall(int16_t damaskwallcnt) static void renderDrawMaskedWall(int16_t damaskwallcnt)
{ {
if (videoGetRenderMode() == REND_POLYMOST) polymost_drawmaskwall(damaskwallcnt); return;
{
polymost_drawmaskwall(damaskwallcnt); return;
}
} }
@ -1130,16 +1125,12 @@ static inline int32_t sameside(const _equation *eq, const vec2f_t *p1, c
static inline int comparetsprites(int const k, int const l) static inline int comparetsprites(int const k, int const l)
{ {
#ifdef USE_OPENGL if ((tspriteptr[k]->cstat & 48) != (tspriteptr[l]->cstat & 48))
if (videoGetRenderMode() == REND_POLYMOST) return (tspriteptr[k]->cstat & 48) - (tspriteptr[l]->cstat & 48);
{
if ((tspriteptr[k]->cstat & 48) != (tspriteptr[l]->cstat & 48)) if ((tspriteptr[k]->cstat & 48) == 16 && tspriteptr[k]->ang != tspriteptr[l]->ang)
return (tspriteptr[k]->cstat & 48) - (tspriteptr[l]->cstat & 48); return tspriteptr[k]->ang - tspriteptr[l]->ang;
if ((tspriteptr[k]->cstat & 48) == 16 && tspriteptr[k]->ang != tspriteptr[l]->ang)
return tspriteptr[k]->ang - tspriteptr[l]->ang;
}
#endif
if (tspriteptr[k]->statnum != tspriteptr[l]->statnum) if (tspriteptr[k]->statnum != tspriteptr[l]->statnum)
return tspriteptr[k]->statnum - tspriteptr[l]->statnum; return tspriteptr[k]->statnum - tspriteptr[l]->statnum;
@ -1230,29 +1221,18 @@ void renderDrawMasks(void)
int32_t i = spritesortcnt-1; int32_t i = spritesortcnt-1;
int32_t numSprites = spritesortcnt; int32_t numSprites = spritesortcnt;
#ifdef USE_OPENGL spritesortcnt = 0;
if (videoGetRenderMode() == REND_POLYMOST) int32_t back = i;
for (; i >= 0; --i)
{ {
spritesortcnt = 0; if (polymost_spriteHasTranslucency(&tsprite[i]))
int32_t back = i;
for (; i >= 0; --i)
{ {
if (polymost_spriteHasTranslucency(&tsprite[i])) tspriteptr[spritesortcnt] = &tsprite[i];
{ ++spritesortcnt;
tspriteptr[spritesortcnt] = &tsprite[i]; } else
++spritesortcnt;
} else
{
tspriteptr[back] = &tsprite[i];
--back;
}
}
} else
#endif
{
for (; i >= 0; --i)
{ {
tspriteptr[i] = &tsprite[i]; tspriteptr[back] = &tsprite[i];
--back;
} }
} }
@ -1260,9 +1240,7 @@ void renderDrawMasks(void)
{ {
const int32_t xs = tspriteptr[i]->x-globalposx, ys = tspriteptr[i]->y-globalposy; const int32_t xs = tspriteptr[i]->x-globalposx, ys = tspriteptr[i]->y-globalposy;
const int32_t yp = dmulscale6(xs,cosviewingrangeglobalang,ys,sinviewingrangeglobalang); const int32_t yp = dmulscale6(xs,cosviewingrangeglobalang,ys,sinviewingrangeglobalang);
#ifdef USE_OPENGL
const int32_t modelp = polymost_spriteIsModelOrVoxel(tspriteptr[i]); const int32_t modelp = polymost_spriteIsModelOrVoxel(tspriteptr[i]);
#endif
if (yp > (4<<8)) if (yp > (4<<8))
{ {
@ -1276,9 +1254,7 @@ void renderDrawMasks(void)
else if ((tspriteptr[i]->cstat&48) == 0) else if ((tspriteptr[i]->cstat&48) == 0)
{ {
killsprite: killsprite:
#ifdef USE_OPENGL
if (!modelp) if (!modelp)
#endif
{ {
//Delete face sprite if on wrong side! //Delete face sprite if on wrong side!
if (i >= spritesortcnt) if (i >= spritesortcnt)
@ -1315,81 +1291,76 @@ killsprite:
sortsprites(spritesortcnt, numSprites); sortsprites(spritesortcnt, numSprites);
renderBeginScene(); renderBeginScene();
#ifdef USE_OPENGL GLInterface.EnableBlend(false);
if (videoGetRenderMode() == REND_POLYMOST) GLInterface.EnableAlphaTest(true);
GLInterface.SetDepthBias(-2, -256);
if (spritesortcnt < numSprites)
{ {
GLInterface.EnableBlend(false); i = spritesortcnt;
GLInterface.EnableAlphaTest(true); for (bssize_t i = spritesortcnt; i < numSprites;)
GLInterface.SetDepthBias(-2, -256);
if (spritesortcnt < numSprites)
{ {
i = spritesortcnt; int32_t py = spritesxyz[i].y;
for (bssize_t i = spritesortcnt; i < numSprites;) int32_t pcstat = tspriteptr[i]->cstat & 48;
int32_t pangle = tspriteptr[i]->ang;
int j = i + 1;
if (!polymost_spriteIsModelOrVoxel(tspriteptr[i]))
{ {
int32_t py = spritesxyz[i].y; while (j < numSprites && py == spritesxyz[j].y && pcstat == (tspriteptr[j]->cstat & 48) && (pcstat != 16 || pangle == tspriteptr[j]->ang)
int32_t pcstat = tspriteptr[i]->cstat & 48; && !polymost_spriteIsModelOrVoxel(tspriteptr[j]))
int32_t pangle = tspriteptr[i]->ang;
int j = i + 1;
if (!polymost_spriteIsModelOrVoxel(tspriteptr[i]))
{ {
while (j < numSprites && py == spritesxyz[j].y && pcstat == (tspriteptr[j]->cstat & 48) && (pcstat != 16 || pangle == tspriteptr[j]->ang) j++;
&& !polymost_spriteIsModelOrVoxel(tspriteptr[j]))
{
j++;
}
} }
if (j - i == 1)
{
debugmask_add(i | 32768, tspriteptr[i]->owner);
renderDrawSprite(i);
tspriteptr[i] = NULL;
}
else
{
GLInterface.SetDepthMask(false);
for (bssize_t k = j-1; k >= i; k--)
{
debugmask_add(k | 32768, tspriteptr[k]->owner);
renderDrawSprite(k);
}
GLInterface.SetDepthMask(true);
GLInterface.SetColorMask(false);
for (bssize_t k = j-1; k >= i; k--)
{
renderDrawSprite(k);
tspriteptr[k] = NULL;
}
GLInterface.SetColorMask(true);
}
i = j;
} }
} if (j - i == 1)
int32_t numMaskWalls = maskwallcnt;
maskwallcnt = 0;
for (i = 0; i < numMaskWalls; i++)
{
if (polymost_maskWallHasTranslucency((uwalltype *) &wall[thewall[maskwall[i]]]))
{ {
maskwall[maskwallcnt] = maskwall[i]; debugmask_add(i | 32768, tspriteptr[i]->owner);
maskwallcnt++; renderDrawSprite(i);
tspriteptr[i] = NULL;
} }
else else
renderDrawMaskedWall(i); {
} GLInterface.SetDepthMask(false);
GLInterface.EnableBlend(true); for (bssize_t k = j-1; k >= i; k--)
GLInterface.EnableAlphaTest(true); {
GLInterface.SetDepthMask(false); debugmask_add(k | 32768, tspriteptr[k]->owner);
renderDrawSprite(k);
}
GLInterface.SetDepthMask(true);
GLInterface.SetColorMask(false);
for (bssize_t k = j-1; k >= i; k--)
{
renderDrawSprite(k);
tspriteptr[k] = NULL;
}
GLInterface.SetColorMask(true);
}
i = j;
}
} }
#endif
int32_t numMaskWalls = maskwallcnt;
maskwallcnt = 0;
for (i = 0; i < numMaskWalls; i++)
{
if (polymost_maskWallHasTranslucency((uwalltype *) &wall[thewall[maskwall[i]]]))
{
maskwall[maskwallcnt] = maskwall[i];
maskwallcnt++;
}
else
renderDrawMaskedWall(i);
}
GLInterface.EnableBlend(true);
GLInterface.EnableAlphaTest(true);
GLInterface.SetDepthMask(false);
vec2f_t pos; vec2f_t pos;
@ -1401,8 +1372,7 @@ killsprite:
while (maskwallcnt) while (maskwallcnt)
{ {
// PLAG: sorting stuff // PLAG: sorting stuff
const int32_t w = (videoGetRenderMode()==REND_POLYMER) ? const int32_t w = thewall[maskwall[maskwallcnt-1]];
maskwall[maskwallcnt-1] : thewall[maskwall[maskwallcnt-1]];
maskwallcnt--; maskwallcnt--;
@ -1878,8 +1848,6 @@ int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daups
strcpy(kensmessage,"!!!! BUILD engine&tools programmed by Ken Silverman of E.G. RI." strcpy(kensmessage,"!!!! BUILD engine&tools programmed by Ken Silverman of E.G. RI."
" (c) Copyright 1995 Ken Silverman. Summary: BUILD = Ken. !!!!"); " (c) Copyright 1995 Ken Silverman. Summary: BUILD = Ken. !!!!");
rendmode = REND_POLYMOST;
upscalefactor = 1; upscalefactor = 1;
xdim = daupscaledxdim; xdim = daupscaledxdim;
ydim = daupscaledydim; ydim = daupscaledydim;

View file

@ -2452,8 +2452,6 @@ static void polymost_initmosts(const float * px, const float * py, int const n)
void polymost_drawrooms() void polymost_drawrooms()
{ {
if (videoGetRenderMode() == REND_CLASSIC) return;
polymost_outputGLDebugMessage(3, "polymost_drawrooms()"); polymost_outputGLDebugMessage(3, "polymost_drawrooms()");
GLInterface.ClearDepth(); GLInterface.ClearDepth();
@ -3596,7 +3594,6 @@ void polymost_precache(int32_t dapicnum, int32_t dapalnum, int32_t datype)
// basically this just means walls are repeating // basically this just means walls are repeating
// while sprites are clamped // while sprites are clamped
if (videoGetRenderMode() < REND_POLYMOST) return;
if ((dapalnum < (MAXPALOOKUPS - RESERVEDPALS)) && (!lookups.checkTable(dapalnum))) return;//dapalnum = 0; if ((dapalnum < (MAXPALOOKUPS - RESERVEDPALS)) && (!lookups.checkTable(dapalnum))) return;//dapalnum = 0;
//Printf("precached %d %d type %d\n", dapicnum, dapalnum, datype); //Printf("precached %d %d type %d\n", dapicnum, dapalnum, datype);

View file

@ -624,7 +624,7 @@ int seq_PlotSequence(short nSprite, short edx, short nFrame, short ecx)
} }
pTSprite->cstat = 0x22; // transluscence, floor sprite pTSprite->cstat = 0x22; // transluscence, floor sprite
pTSprite->z = videoGetRenderMode() >= REND_POLYMOST ? nFloorZ : nFloorZ + 1; pTSprite->z = nFloorZ;
pTSprite->yrepeat = (uint8_t)edx; pTSprite->yrepeat = (uint8_t)edx;
pTSprite->xrepeat = (uint8_t)edx; pTSprite->xrepeat = (uint8_t)edx;
pTSprite->statnum = -3; pTSprite->statnum = -3;

View file

@ -81,12 +81,11 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
t->xrepeat = t->yrepeat = 0; t->xrepeat = t->yrepeat = 0;
continue; continue;
case CHAIR3: case CHAIR3:
/* if (hw_models && md_tilehasmodel(t->picnum, t->pal) >= 0)
if (bpp > 8 && usemodels && md_tilehasmodel(t->picnum) >= 0) { {
t->cstat &= ~4; t->cstat &= ~4;
break; break;
} }
*/
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7; k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4) if (k > 4)
@ -279,10 +278,11 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
t->picnum = GROWSPARK + ((ud.levelclock >> 4) & 3); t->picnum = GROWSPARK + ((ud.levelclock >> 4) & 3);
break; break;
case RPG: case RPG:
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0)
{
t->cstat &= ~4; t->cstat &= ~4;
break; break;
}*/ }
k = getangle(s->x - x, s->y - y); k = getangle(s->x - x, s->y - y);
k = (((s->ang + 3072 + 128 - k) & 2047) / 170); k = (((s->ang + 3072 + 128 - k) & 2047) / 170);
@ -296,10 +296,11 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
break; break;
case RECON: case RECON:
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0)
{
t->cstat &= ~4; t->cstat &= ~4;
break; break;
}*/ }
k = getangle(s->x - x, s->y - y); k = getangle(s->x - x, s->y - y);
if (h->temp_data[0] < 4) if (h->temp_data[0] < 4)
@ -387,10 +388,13 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
if (!h->GetOwner()) if (!h->GetOwner())
{ {
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0)
{
k = 0; k = 0;
t->cstat &= ~4; t->cstat &= ~4;
} else*/ { }
else
{
k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7; k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4) if (k > 4)
{ {
@ -504,10 +508,13 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
{ {
l = ScriptCode[t4 + 2]; l = ScriptCode[t4 + 2];
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0)
{
k = 0; k = 0;
t->cstat &= ~4; t->cstat &= ~4;
} else*/ switch (l) { }
else switch (l)
{
case 2: case 2:
k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 1; k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 1;
break; break;
@ -599,25 +606,20 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
shadowspr->z = daz; shadowspr->z = daz;
shadowspr->pal = 4; shadowspr->pal = 4;
if (videoGetRenderMode() >= REND_POLYMOST) if (hw_models && md_tilehasmodel(t->picnum, t->pal) >= 0)
{ {
/* shadowspr->yrepeat = 0;
if (hw_models && md_tilehasmodel(t->picnum, t->pal) >= 0) // 512:trans reverse
{ //1024:tell MD2SPRITE.C to use Z-buffer hacks to hide overdraw issues
shadowspr->yrepeat = 0; shadowspr->clipdist |= TSPR_FLAGS_MDHACK;
// 512:trans reverse shadowspr->cstat |= 512;
//1024:tell MD2SPRITE.C to use Z-buffer hacks to hide overdraw issues }
shadowspr->clipdist |= TSPR_FLAGS_MDHACK; else
shadowspr->cstat |= 512; {
} // Alter the shadow's position so that it appears behind the sprite itself.
else int look = getangle(shadowspr->x - ps[screenpeek].posx, shadowspr->y - ps[screenpeek].posy);
*/ shadowspr->x += bcos(look, -9);
{ shadowspr->y += bsin(look, -9);
// Alter the shadow's position so that it appears behind the sprite itself.
int look = getangle(shadowspr->x - ps[screenpeek].posx, shadowspr->y - ps[screenpeek].posy);
shadowspr->x += bcos(look, -9);
shadowspr->y += bsin(look, -9);
}
} }
spritesortcnt++; spritesortcnt++;
} }
@ -672,10 +674,13 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
t->picnum += (s->shade >> 1); t->picnum += (s->shade >> 1);
break; break;
case PLAYERONWATER: case PLAYERONWATER:
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0)
{
k = 0; k = 0;
t->cstat &= ~4; t->cstat &= ~4;
} else*/ { }
else
{
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7; k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4) if (k > 4)
{ {
@ -726,10 +731,11 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
case CAMERA1: case CAMERA1:
case RAT: case RAT:
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0)
{
t->cstat &= ~4; t->cstat &= ~4;
break; break;
}*/ }
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7; k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4) if (k > 4)

View file

@ -438,10 +438,12 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
if (!h->GetOwner()) if (!h->GetOwner())
{ {
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0)
{
k = 0; k = 0;
t->cstat &= ~4; t->cstat &= ~4;
} else*/ { } else
{
k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7; k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4) if (k > 4)
{ {
@ -642,10 +644,13 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
{ {
l = ScriptCode[t4 + 2]; l = ScriptCode[t4 + 2];
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0)
{
k = 0; k = 0;
t->cstat &= ~4; t->cstat &= ~4;
} else*/ switch (l) { }
else switch (l)
{
case 2: case 2:
k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 1; k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 1;
break; break;
@ -760,25 +765,20 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
shadowspr->z = daz; shadowspr->z = daz;
shadowspr->pal = 4; shadowspr->pal = 4;
if (videoGetRenderMode() >= REND_POLYMOST) if (hw_models && md_tilehasmodel(t->picnum, t->pal) >= 0)
{ {
/* shadowspr->yrepeat = 0;
if (hw_models && md_tilehasmodel(t->picnum, t->pal) >= 0) // 512:trans reverse
{ //1024:tell MD2SPRITE.C to use Z-buffer hacks to hide overdraw issues
shadowspr->yrepeat = 0; shadowspr->clipdist |= TSPR_FLAGS_MDHACK;
// 512:trans reverse shadowspr->cstat |= 512;
//1024:tell MD2SPRITE.C to use Z-buffer hacks to hide overdraw issues }
shadowspr->clipdist |= TSPR_FLAGS_MDHACK; else
shadowspr->cstat |= 512; {
} // Alter the shadow's position so that it appears behind the sprite itself.
else int look = getangle(shadowspr->x - ps[screenpeek].posx, shadowspr->y - ps[screenpeek].posy);
*/ shadowspr->x += bcos(look, -9);
{ shadowspr->y += bsin(look, -9);
// Alter the shadow's position so that it appears behind the sprite itself.
int look = getangle(shadowspr->x - ps[screenpeek].posx, shadowspr->y - ps[screenpeek].posy);
shadowspr->x += bcos(look, -9);
shadowspr->y += bsin(look, -9);
}
} }
spritesortcnt++; spritesortcnt++;
} }

View file

@ -366,7 +366,6 @@ void renderSetVisibility(float vis)
void renderBeginScene() void renderBeginScene()
{ {
if (videoGetRenderMode() < REND_POLYMOST) return;
assert(BufferLock == 0); assert(BufferLock == 0);
vp.mPalLightLevels = numshades | (static_cast<int>(gl_fogmode) << 8) | ((int)5 << 16); vp.mPalLightLevels = numshades | (static_cast<int>(gl_fogmode) << 8) | ((int)5 << 16);
@ -380,7 +379,6 @@ void renderBeginScene()
void renderFinishScene() void renderFinishScene()
{ {
if (videoGetRenderMode() < REND_POLYMOST) return;
assert(BufferLock == 1); assert(BufferLock == 1);
if (--BufferLock == 0) if (--BufferLock == 0)
{ {

View file

@ -1045,7 +1045,7 @@ JAnalyzeSprites(tspriteptr_t tspr)
// Take care of autosizing // Take care of autosizing
DoAutoSize(tspr); DoAutoSize(tspr);
if (videoGetRenderMode() >= REND_POLYMOST && md_tilehasmodel(tspr->picnum, 0) >= 0 && hw_models) return; if (md_tilehasmodel(tspr->picnum, 0) >= 0 && hw_models) return;
// Check for voxels // Check for voxels
//if (bVoxelsOn) //if (bVoxelsOn)