mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Use a const for the contrast, and double it for extra impact.
This commit is contained in:
parent
195920acdc
commit
8d34ca0533
1 changed files with 5 additions and 5 deletions
|
|
@ -452,15 +452,16 @@ static inline float P_SegLengthFloat(seg_t *seg)
|
||||||
*/
|
*/
|
||||||
void P_UpdateSegLightOffset(seg_t *li)
|
void P_UpdateSegLightOffset(seg_t *li)
|
||||||
{
|
{
|
||||||
|
const UINT8 contrast = 16;
|
||||||
fixed_t extralight = 0;
|
fixed_t extralight = 0;
|
||||||
|
|
||||||
extralight = -(8*FRACUNIT) +
|
extralight = -((fixed_t)contrast*FRACUNIT) +
|
||||||
FixedDiv(AngleFixed(R_PointToAngle2(0, 0,
|
FixedDiv(AngleFixed(R_PointToAngle2(0, 0,
|
||||||
abs(li->v1->x - li->v2->x),
|
abs(li->v1->x - li->v2->x),
|
||||||
abs(li->v1->y - li->v2->y))), 90*FRACUNIT) * 16;
|
abs(li->v1->y - li->v2->y))), 90*FRACUNIT) * ((fixed_t)contrast * 2);
|
||||||
|
|
||||||
// Between -1 and 1 for software, -8 and 8 for hardware
|
// Between -2 and 2 for software, -16 and 16 for hardware
|
||||||
li->lightOffset = FixedFloor((extralight / 8) + (FRACUNIT / 2)) / FRACUNIT;
|
li->lightOffset = FixedFloor((extralight / contrast) + (FRACUNIT / 2)) / FRACUNIT;
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
li->hwLightOffset = FixedFloor(extralight + (FRACUNIT / 2)) / FRACUNIT;
|
li->hwLightOffset = FixedFloor(extralight + (FRACUNIT / 2)) / FRACUNIT;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -477,7 +478,6 @@ static void P_LoadRawSegs(UINT8 *data, size_t i)
|
||||||
mapseg_t *ml;
|
mapseg_t *ml;
|
||||||
seg_t *li;
|
seg_t *li;
|
||||||
line_t *ldef;
|
line_t *ldef;
|
||||||
fixed_t extralight = 0;
|
|
||||||
|
|
||||||
numsegs = i / sizeof (mapseg_t);
|
numsegs = i / sizeof (mapseg_t);
|
||||||
if (numsegs <= 0)
|
if (numsegs <= 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue