Revert paperprojection, but keep it as a #define in case someone fixes it in a patch.
This commit is contained in:
parent
d02648450a
commit
0bd1399c52
|
@ -7087,7 +7087,7 @@ static void P_SpawnMinecartSegments(mobj_t *mobj, boolean mode)
|
||||||
seg = P_SpawnMobj(x, y, z, MT_MINECARTSEG);
|
seg = P_SpawnMobj(x, y, z, MT_MINECARTSEG);
|
||||||
P_SetMobjState(seg, (statenum_t)(S_MINECARTSEG_FRONT + i));
|
P_SetMobjState(seg, (statenum_t)(S_MINECARTSEG_FRONT + i));
|
||||||
if (i >= 2)
|
if (i >= 2)
|
||||||
seg->extravalue1 = (i == 2) ? -20 : 20;
|
seg->extravalue1 = (i == 2) ? -18 : 18; // make -20/20 when papersprite projection fixed
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
seg->extravalue2 = (i == 0) ? 24 : -24;
|
seg->extravalue2 = (i == 0) ? 24 : -24;
|
||||||
|
|
|
@ -1082,6 +1082,8 @@ static void R_SplitSprite(vissprite_t *sprite)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#define PROPERPAPER // This was reverted less than 7 hours before 2.2's release because of very strange, frequent crashes.
|
||||||
|
|
||||||
//
|
//
|
||||||
// R_ProjectSprite
|
// R_ProjectSprite
|
||||||
// Generates a vissprite for a thing
|
// Generates a vissprite for a thing
|
||||||
|
@ -1137,6 +1139,10 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
UINT32 rollangle = AngleFixed(arollangle)>>FRACBITS;
|
UINT32 rollangle = AngleFixed(arollangle)>>FRACBITS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef PROPERPAPER
|
||||||
|
fixed_t ang_scale = FRACUNIT;
|
||||||
|
#endif
|
||||||
|
|
||||||
// transform the origin point
|
// transform the origin point
|
||||||
tr_x = thing->x - viewx;
|
tr_x = thing->x - viewx;
|
||||||
tr_y = thing->y - viewy;
|
tr_y = thing->y - viewy;
|
||||||
|
@ -1221,6 +1227,10 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
if (sprframe->rotate != SRF_SINGLE || papersprite)
|
if (sprframe->rotate != SRF_SINGLE || papersprite)
|
||||||
{
|
{
|
||||||
ang = R_PointToAngle (thing->x, thing->y) - (thing->player ? thing->player->drawangle : thing->angle);
|
ang = R_PointToAngle (thing->x, thing->y) - (thing->player ? thing->player->drawangle : thing->angle);
|
||||||
|
#ifndef PROPERPAPER
|
||||||
|
if (papersprite)
|
||||||
|
ang_scale = abs(FINESINE(ang>>ANGLETOFINESHIFT));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sprframe->rotate == SRF_SINGLE)
|
if (sprframe->rotate == SRF_SINGLE)
|
||||||
|
@ -1282,11 +1292,31 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
else
|
else
|
||||||
offset = -spr_offset;
|
offset = -spr_offset;
|
||||||
offset = FixedMul(offset, this_scale);
|
offset = FixedMul(offset, this_scale);
|
||||||
|
#ifndef PROPERPAPER
|
||||||
|
tx += FixedMul(offset, ang_scale);
|
||||||
|
x1 = (centerxfrac + FixedMul (tx,xscale)) >>FRACBITS;
|
||||||
|
|
||||||
|
// off the right side?
|
||||||
|
if (x1 > viewwidth)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
offset2 = FixedMul(spr_width, this_scale);
|
offset2 = FixedMul(spr_width, this_scale);
|
||||||
|
#ifndef PROPERPAPER
|
||||||
|
tx += FixedMul(offset2, ang_scale);
|
||||||
|
x2 = ((centerxfrac + FixedMul (tx,xscale)) >> FRACBITS) - (papersprite ? 2 : 1);
|
||||||
|
|
||||||
|
// off the left side
|
||||||
|
if (x2 < 0)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (papersprite)
|
if (papersprite)
|
||||||
{
|
{
|
||||||
fixed_t xscale2, yscale2, cosmul, sinmul, tz2;
|
fixed_t
|
||||||
|
#ifdef PROPERPAPER
|
||||||
|
xscale2,
|
||||||
|
#endif
|
||||||
|
yscale2, cosmul, sinmul, tz2;
|
||||||
INT32 range;
|
INT32 range;
|
||||||
|
|
||||||
if (ang >= ANGLE_180)
|
if (ang >= ANGLE_180)
|
||||||
|
@ -1306,6 +1336,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
yscale = FixedDiv(projectiony, tz);
|
yscale = FixedDiv(projectiony, tz);
|
||||||
if (yscale < 64) return; // Fix some funky visuals
|
if (yscale < 64) return; // Fix some funky visuals
|
||||||
|
|
||||||
|
#ifdef PROPERPAPER
|
||||||
gxt = -FixedMul(tr_x, viewsin);
|
gxt = -FixedMul(tr_x, viewsin);
|
||||||
gyt = FixedMul(tr_y, viewcos);
|
gyt = FixedMul(tr_y, viewcos);
|
||||||
tx = -(gyt + gxt);
|
tx = -(gyt + gxt);
|
||||||
|
@ -1315,6 +1346,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
// off the right side?
|
// off the right side?
|
||||||
if (x1 > viewwidth)
|
if (x1 > viewwidth)
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
tr_x += FixedMul(offset2, cosmul);
|
tr_x += FixedMul(offset2, cosmul);
|
||||||
tr_y += FixedMul(offset2, sinmul);
|
tr_y += FixedMul(offset2, sinmul);
|
||||||
|
@ -1324,6 +1356,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
yscale2 = FixedDiv(projectiony, tz2);
|
yscale2 = FixedDiv(projectiony, tz2);
|
||||||
if (yscale2 < 64) return; // ditto
|
if (yscale2 < 64) return; // ditto
|
||||||
|
|
||||||
|
#ifdef PROPERPAPER
|
||||||
gxt = -FixedMul(tr_x, viewsin);
|
gxt = -FixedMul(tr_x, viewsin);
|
||||||
gyt = FixedMul(tr_y, viewcos);
|
gyt = FixedMul(tr_y, viewcos);
|
||||||
tx = -(gyt + gxt);
|
tx = -(gyt + gxt);
|
||||||
|
@ -1333,6 +1366,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
// off the left side
|
// off the left side
|
||||||
if (x2 < 0)
|
if (x2 < 0)
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-papersprite clipping is handled earlier
|
if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-papersprite clipping is handled earlier
|
||||||
return;
|
return;
|
||||||
|
@ -1340,10 +1374,18 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
if ((range = x2 - x1) <= 0)
|
if ((range = x2 - x1) <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef PROPERPAPER
|
||||||
range++; // fencepost problem
|
range++; // fencepost problem
|
||||||
|
#endif
|
||||||
|
|
||||||
scalestep = (yscale2 - yscale)/range;
|
scalestep = (yscale2 - yscale)/range;
|
||||||
xscale = FixedDiv(range<<FRACBITS, abs(offset2));
|
xscale =
|
||||||
|
#ifdef PROPERPAPER
|
||||||
|
FixedDiv(range<<FRACBITS, abs(offset2))+1
|
||||||
|
#else
|
||||||
|
FixedMul(xscale, ang_scale)
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
// The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2?
|
// The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2?
|
||||||
// sortscale = max(yscale, yscale2);
|
// sortscale = max(yscale, yscale2);
|
||||||
|
@ -1353,6 +1395,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
{
|
{
|
||||||
scalestep = 0;
|
scalestep = 0;
|
||||||
yscale = sortscale;
|
yscale = sortscale;
|
||||||
|
#ifdef PROPERPAPER
|
||||||
tx += offset;
|
tx += offset;
|
||||||
x1 = (centerxfrac + FixedMul(tx,xscale))>>FRACBITS;
|
x1 = (centerxfrac + FixedMul(tx,xscale))>>FRACBITS;
|
||||||
|
|
||||||
|
@ -1366,6 +1409,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
// off the left side
|
// off the left side
|
||||||
if (x2 < 0)
|
if (x2 < 0)
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY)
|
if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY)
|
||||||
|
|
Loading…
Reference in a new issue