From ee6324b3e4ade7e07f086bd4cb4485726a48f639 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Sun, 28 Mar 2010 09:53:12 +0000 Subject: [PATCH] For casting light from Player-object, smooth out thrust to prevent flickering on high FPS --- CHANGELOG.txt | 4 ++++ main/lighting.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a1aceed14..49c0a75b8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20100328 +-------- +main/lighting.c: For casting light from Player-object, smooth out thrust to prevent flickering on high FPS + 20100327 -------- main/kmatrix.c, main/net_udp.c: Initialise 'playing' to 0 for UDP kmatrix, making sure player progresses to next level; always return 1 when starting to join a UDP game so it doesn't immediately return to the main menu diff --git a/main/lighting.c b/main/lighting.c index 5a9debb7f..0a6df210d 100644 --- a/main/lighting.c +++ b/main/lighting.c @@ -252,8 +252,14 @@ fix compute_light_intensity(int objnum) switch (objtype) { case OBJ_PLAYER: - return max(vm_vec_mag_quick(&obj->mtype.phys_info.thrust)/4, F1_0*2) + F1_0/2; + { + vms_vector sthrust = obj->mtype.phys_info.thrust; + fix k = fixmuldiv(obj->mtype.phys_info.mass,obj->mtype.phys_info.drag,(f1_0-obj->mtype.phys_info.drag)); + // smooth thrust value like set_thrust_from_velocity() + vm_vec_copy_scale(&sthrust,&obj->mtype.phys_info.velocity,k); + return max(vm_vec_mag_quick(&sthrust)/4, F1_0*2) + F1_0/2; break; + } case OBJ_FIREBALL: if (obj->id != 0xff) { if (obj->lifeleft < F1_0*4)