Merge branch 'Saturn-Next' into Saturn-Testing
This commit is contained in:
commit
f869393da4
3 files changed
+46
-56
No files matched your search
+1
-1
@@ -302,7 +302,7 @@ else
|
||||
$(OBJDIR)/hw_md2load.o $(OBJDIR)/hw_md3load.o $(OBJDIR)/hw_model.o $(OBJDIR)/u_list.o $(OBJDIR)/hw_batching.o $(OBJDIR)/hw_shaders.o
|
||||
endif
|
||||
|
||||
OPTS += -DCOMPVERSION -fwrapv
|
||||
OPTS += -DCOMPVERSION
|
||||
|
||||
ifndef NONX86
|
||||
ifndef GCC29
|
||||
|
||||
+27
-42
@@ -541,7 +541,6 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
if (!xsub->planepoly)
|
||||
return;
|
||||
|
||||
pv = xsub->planepoly->pts;
|
||||
nrPlaneVerts = xsub->planepoly->numpts;
|
||||
|
||||
if (nrPlaneVerts < 3) //not even a triangle ?
|
||||
@@ -611,6 +610,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
break;
|
||||
}
|
||||
|
||||
pv = xsub->planepoly->pts;
|
||||
|
||||
// reference point for flat texture coord for each vertex around the polygon
|
||||
flatxref = (float)(((fixed_t)pv->x & (~flatflag)) / fflatsize);
|
||||
flatyref = (float)(((fixed_t)pv->y & (~flatflag)) / fflatsize);
|
||||
@@ -978,7 +979,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
||||
|
||||
for (INT32 i = 0; i < sector->numlights; i++)
|
||||
{
|
||||
if (endtop < endrealbot && top < realbot)
|
||||
if ((endtop < endrealbot) && (top < realbot))
|
||||
return;
|
||||
|
||||
lightlist_t *list = sector->lightlist;
|
||||
@@ -1044,20 +1045,13 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
||||
endbheight = endrealbot;
|
||||
}
|
||||
|
||||
if (endbheight > endtop)
|
||||
endbot = endtop;
|
||||
|
||||
if (bheight >= top)
|
||||
if ((endbheight >= endtop) && (bheight >= top))
|
||||
continue;
|
||||
|
||||
// Found a break
|
||||
// The heights are clamped to ensure the polygon doesn't cross itself.
|
||||
bot = bheight;
|
||||
|
||||
if (bot < realbot)
|
||||
bot = realbot;
|
||||
|
||||
endbot = min(max(endbheight, endrealbot), endtop);
|
||||
bot = CLAMP(bheight, realbot, top);
|
||||
endbot = CLAMP(endbheight, endrealbot, endtop);
|
||||
|
||||
Surf->PolyColor.s.alpha = alpha;
|
||||
|
||||
@@ -1085,7 +1079,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
||||
|
||||
bot = realbot;
|
||||
endbot = endrealbot;
|
||||
if (endtop <= endrealbot && top <= realbot)
|
||||
if ((endtop <= endrealbot) && (top <= realbot))
|
||||
return;
|
||||
|
||||
Surf->PolyColor.s.alpha = alpha;
|
||||
@@ -1186,7 +1180,7 @@ static void HWR_DrawSkyWall(FOutVector *wallVerts, FSurfaceInfo *Surf)
|
||||
}
|
||||
|
||||
// Returns true if the midtexture is visible, and false if... it isn't...
|
||||
static boolean HWR_BlendMidtextureSurface(FSurfaceInfo *pSurf)
|
||||
static inline boolean HWR_BlendMidtextureSurface(FSurfaceInfo *pSurf)
|
||||
{
|
||||
FUINT blendmode = PF_Masked;
|
||||
|
||||
@@ -1224,23 +1218,16 @@ static boolean HWR_BlendMidtextureSurface(FSurfaceInfo *pSurf)
|
||||
case 908:
|
||||
blendmode = HWR_TranstableToAlpha(tr_trans90, pSurf);
|
||||
break;
|
||||
// Translucent
|
||||
// Translucent linedef types
|
||||
case 102:
|
||||
case 121:
|
||||
case 123:
|
||||
case 124:
|
||||
case 125:
|
||||
case 141:
|
||||
case 142:
|
||||
case 144:
|
||||
case 145:
|
||||
case 121 ... 125:
|
||||
case 141 ... 145:
|
||||
case 174:
|
||||
case 175:
|
||||
case 192:
|
||||
case 195:
|
||||
case 221:
|
||||
case 253:
|
||||
case 256:
|
||||
case 253 ... 256:
|
||||
blendmode = PF_Translucent;
|
||||
break;
|
||||
default:
|
||||
@@ -1252,9 +1239,10 @@ static boolean HWR_BlendMidtextureSurface(FSurfaceInfo *pSurf)
|
||||
{
|
||||
// Polyobject translucency is shared between all of its lines
|
||||
if (gl_curline->polyseg->translucency >= NUMTRANSMAPS) // wall not drawn
|
||||
{
|
||||
pSurf->PolyColor.s.alpha = 0x00; // This shouldn't draw anything regardless of blendmode
|
||||
return false;
|
||||
//Surf.PolyColor.s.alpha = 0x00; // This shouldn't draw anything regardless of blendmode
|
||||
//blendmode = PF_Masked;
|
||||
}
|
||||
else
|
||||
blendmode = HWR_TranstableToAlpha(gl_curline->polyseg->translucency, pSurf);
|
||||
}
|
||||
@@ -1351,7 +1339,9 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline);
|
||||
|
||||
FSurfaceInfo Surf;
|
||||
Surf.PolyColor.s.alpha = 255;
|
||||
|
||||
if (gl_frontsector)
|
||||
Surf.PolyColor.s.alpha = 255;
|
||||
|
||||
INT32 gl_midtexture = R_GetTextureNum(gl_sidedef->midtexture);
|
||||
GLMapTexture_t *glTex = NULL;
|
||||
@@ -1747,6 +1737,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
// Single sided line... Deal only with the middletexture (if one exists)
|
||||
if (gl_midtexture && gl_linedef->special != HORIZONSPECIAL) // Ignore horizon line for OGL
|
||||
{
|
||||
glTex = HWR_GetTexture(gl_midtexture, noencore);
|
||||
|
||||
fixed_t texturevpeg;
|
||||
|
||||
// PEGGING
|
||||
@@ -1757,8 +1749,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
else
|
||||
texturevpeg = gl_sidedef->rowoffset; // top of texture at top
|
||||
|
||||
glTex = HWR_GetTexture(gl_midtexture, noencore);
|
||||
|
||||
wallVerts[3].t = wallVerts[2].t = texturevpeg * glTex->scaleY;
|
||||
wallVerts[0].t = wallVerts[1].t = (texturevpeg + gl_frontsector->ceilingheight - gl_frontsector->floorheight) * glTex->scaleY;
|
||||
wallVerts[0].s = wallVerts[3].s = cliplow * glTex->scaleX;
|
||||
@@ -3669,7 +3659,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
||||
|
||||
for (i = 0; i < sector->numlights; i++)
|
||||
{
|
||||
if (endtop < endrealbot && top < realbot)
|
||||
if ((endtop < endrealbot) && (top < realbot))
|
||||
return;
|
||||
|
||||
// even if we aren't changing colormap or lightlevel, we still need to continue drawing down the sprite
|
||||
@@ -3694,18 +3684,13 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
||||
endbheight = endrealbot;
|
||||
}
|
||||
|
||||
if (endbheight >= endtop && bheight >= top)
|
||||
if ((endbheight >= endtop) && (bheight >= top))
|
||||
continue;
|
||||
|
||||
bot = bheight;
|
||||
|
||||
if (bot < realbot)
|
||||
bot = realbot;
|
||||
|
||||
endbot = endbheight;
|
||||
|
||||
if (endbot < endrealbot)
|
||||
endbot = endrealbot;
|
||||
// Found a break
|
||||
// The heights are clamped to ensure the polygon doesn't cross itself.
|
||||
bot = CLAMP(bheight, realbot, top);
|
||||
endbot = CLAMP(endbheight, endrealbot, endtop);
|
||||
|
||||
wallVerts[3].t = towtop + ((realtop - top) * towmult);
|
||||
wallVerts[2].t = towtop + ((endrealtop - endtop) * towmult);
|
||||
@@ -3753,7 +3738,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
||||
bot = realbot;
|
||||
endbot = endrealbot;
|
||||
|
||||
if (endtop <= endrealbot && top <= realbot)
|
||||
if ((endtop <= endrealbot) && (top <= realbot))
|
||||
return;
|
||||
|
||||
// If we're ever down here, somehow the above loop hasn't draw all the light levels of sprite
|
||||
|
||||
+18
-13
@@ -91,19 +91,24 @@ static levelinterpolator_t **levelinterpolators;
|
||||
static size_t levelinterpolators_len;
|
||||
static size_t levelinterpolators_size;
|
||||
|
||||
static inline fixed_t R_LerpFixedView(fixed_t from, fixed_t to, fixed_t frac)
|
||||
{
|
||||
return from + FixedMul(frac, to - from);
|
||||
}
|
||||
|
||||
static inline angle_t R_LerpAngleView(angle_t from, angle_t to, fixed_t frac)
|
||||
{
|
||||
return from + FixedMul(frac, to - from);
|
||||
}
|
||||
|
||||
static inline fixed_t R_LerpFixed(fixed_t from, fixed_t to, fixed_t frac)
|
||||
{
|
||||
if (from == to)
|
||||
return to;
|
||||
return from + FixedMul(frac, to - from);
|
||||
return ((from == to) ? to : (from + FixedMul(frac, to - from)));
|
||||
}
|
||||
|
||||
static inline angle_t R_LerpAngle(angle_t from, angle_t to, fixed_t frac)
|
||||
{
|
||||
if (from == to)
|
||||
return to;
|
||||
return from + FixedMul(frac, to - from);
|
||||
return ((from == to) ? to : (from + FixedMul(frac, to - from)));
|
||||
}
|
||||
|
||||
/*static vector2_t *R_LerpVector2(const vector2_t *from, const vector2_t *to, fixed_t frac, vector2_t *out)
|
||||
@@ -153,7 +158,7 @@ static void R_SetupFreelook(void)
|
||||
|
||||
void R_InterpolateViewRollAngle(fixed_t frac)
|
||||
{
|
||||
viewroll = R_LerpAngle(oldview->roll, newview->roll, frac);
|
||||
viewroll = R_LerpAngleView(oldview->roll, newview->roll, frac);
|
||||
}
|
||||
|
||||
void R_InterpolateView(fixed_t frac, boolean forceinvalid)
|
||||
@@ -181,13 +186,13 @@ void R_InterpolateView(fixed_t frac, boolean forceinvalid)
|
||||
prevview = newview;
|
||||
}
|
||||
|
||||
viewx = R_LerpFixed(prevview->x, newview->x, frac);
|
||||
viewy = R_LerpFixed(prevview->y, newview->y, frac);
|
||||
viewz = R_LerpFixed(prevview->z, newview->z, frac);
|
||||
viewx = R_LerpFixedView(prevview->x, newview->x, frac);
|
||||
viewy = R_LerpFixedView(prevview->y, newview->y, frac);
|
||||
viewz = R_LerpFixedView(prevview->z, newview->z, frac);
|
||||
|
||||
viewangle = R_LerpAngle(prevview->angle, newview->angle, frac);
|
||||
aimingangle = R_LerpAngle(prevview->aim, newview->aim, frac);
|
||||
viewroll = R_LerpAngle(prevview->roll, newview->roll, frac);
|
||||
viewangle = R_LerpAngleView(prevview->angle, newview->angle, frac);
|
||||
aimingangle = R_LerpAngleView(prevview->aim, newview->aim, frac);
|
||||
viewroll = R_LerpAngleView(prevview->roll, newview->roll, frac);
|
||||
|
||||
viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT);
|
||||
viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
|
||||
|
||||
Reference in new issue
Block a user