Tweak various interpolators.
This commit is contained in:
parent
0207a54da8
commit
5d443cf33c
9 changed files with 19 additions and 19 deletions
|
|
@ -10,7 +10,7 @@ Class ItamexHammer : SWWMWeapon
|
|||
override void HudTick()
|
||||
{
|
||||
Super.HudTick();
|
||||
if ( !ChargeInter ) ChargeInter = SmoothDynamicValueInterpolator.Create(charge,.5,1.,25.);
|
||||
if ( !ChargeInter ) ChargeInter = SmoothDynamicValueInterpolator.Create(charge,.5);
|
||||
ChargeInter.Update(charge);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Class HeavyMahSheenGun : SWWMWeapon
|
|||
override void HudTick()
|
||||
{
|
||||
Super.HudTick();
|
||||
if ( !HeatInter ) HeatInter = SmoothDynamicValueInterpolator.Create(barrelheat,.5,1.,25.);
|
||||
if ( !HeatInter ) HeatInter = SmoothDynamicValueInterpolator.Create(barrelheat,.5);
|
||||
HeatInter.Update(barrelheat);
|
||||
if ( lastfirespeed && (lastfirespeed != firespeed+1) && (Owner.player == players[consoleplayer]) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -523,9 +523,9 @@ extend Class SWWMHandler
|
|||
hmax = thealth;
|
||||
for ( int i=0; i<30; i++ ) oldhealth[i] = thealth;
|
||||
cummdamage = 0;
|
||||
if ( !ihealth ) ihealth = SmoothLinearValueInterpolator.Create(thealth,max(1,hmax/120));
|
||||
if ( !ihealth ) ihealth = SmoothLinearValueInterpolator.Create(thealth,max(1,hmax/50));
|
||||
else ihealth.Reset(thealth);
|
||||
if ( !ihealthr ) ihealthr = SmoothDynamicValueInterpolator.Create(thealth,.5,1,100);
|
||||
if ( !ihealthr ) ihealthr = SmoothDynamicValueInterpolator.Create(thealth,.5);
|
||||
else ihealthr.Reset(thealth);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1283,9 +1283,9 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
minimapzoom = oldminimapzoom = 1.;
|
||||
LastHealth = CPlayer?CPlayer.health:100;
|
||||
let d = Demolitionist(CPlayer?CPlayer.mo:null);
|
||||
HealthInter = SmoothDynamicValueInterpolator.Create(LastHealth,.5,1,100);
|
||||
FuelInter = SmoothDynamicValueInterpolator.Create(d?(d.dashfuel/2):120,.5,1,120);
|
||||
DashInter = SmoothDynamicValueInterpolator.Create(d?((40-d.dashcooldown)*3):40,.5,1,40);
|
||||
HealthInter = SmoothDynamicValueInterpolator.Create(LastHealth,.5);
|
||||
FuelInter = SmoothDynamicValueInterpolator.Create(d?(d.dashfuel/2):120,.5);
|
||||
DashInter = SmoothDynamicValueInterpolator.Create(d?((40-d.dashcooldown)*3):40,.5);
|
||||
LagHealthInter = SmoothLinearValueInterpolator.Create(LastHealth,2);
|
||||
for ( int i=0; i<10; i++ ) LagHealth[i] = LastHealth;
|
||||
AmmoSlots[0] = 'RedShell';
|
||||
|
|
@ -1539,10 +1539,10 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
Screen.DrawTexture(EnemyHTex[2],false,barpos.x+2,barpos.y+2,DTA_VirtualWidthF,ss1.x,DTA_VirtualHeightF,ss1.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowLeftF,ohw,DTA_WindowRightF,hw);
|
||||
if ( ct.cummdamage <= 0 ) continue;
|
||||
double calph = clamp(ct.cummspan-fractic,0.,20.)/20.;
|
||||
Screen.DrawText(MiniHUDFontOutline,mhudfontcol[MCR_RED],barpos.x+3,barpos.y+10,String.Format("%d",ct.cummdamage),DTA_VirtualWidthF,ss1.x,DTA_VirtualHeightF,ss1.y,DTA_KeepRatio,true,DTA_Alpha,calph*alph);
|
||||
Screen.DrawText(MiniHUDFontOutline,mhudfontcol[MCR_RED],barpos.x+3,barpos.y+10,(ct.cummdamage>=Actor.TELEFRAG_DAMAGE)?"∞":String.Format("%d",ct.cummdamage),DTA_VirtualWidthF,ss1.x,DTA_VirtualHeightF,ss1.y,DTA_KeepRatio,true,DTA_Alpha,calph*alph);
|
||||
if ( ct.cummflash <= 0 ) continue;
|
||||
double falph = max((ct.cummflash-FracTic)/15.,0.)**1.5;
|
||||
Screen.DrawText(MiniHUDFontOutline,mhudfontcol[MCR_REDFLASH],barpos.x+3,barpos.y+10,String.Format("%d",ct.cummdamage),DTA_VirtualWidthF,ss1.x,DTA_VirtualHeightF,ss1.y,DTA_KeepRatio,true,DTA_Alpha,falph*calph*alph,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
Screen.DrawText(MiniHUDFontOutline,mhudfontcol[MCR_REDFLASH],barpos.x+3,barpos.y+10,(ct.cummdamage>=Actor.TELEFRAG_DAMAGE)?"∞":String.Format("%d",ct.cummdamage),DTA_VirtualWidthF,ss1.x,DTA_VirtualHeightF,ss1.y,DTA_KeepRatio,true,DTA_Alpha,falph*calph*alph,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
}
|
||||
// player-owned trackers are drawn last
|
||||
cti.Reinit();
|
||||
|
|
@ -1627,7 +1627,7 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
Screen.DrawText(MiniHUDFontOutline,mhudfontcol[MCR_RED],barpos.x+3,barpos.y+10,(ct.cummdamage>=Actor.TELEFRAG_DAMAGE)?"∞":String.Format("%d",ct.cummdamage),DTA_VirtualWidthF,ss1.x,DTA_VirtualHeightF,ss1.y,DTA_KeepRatio,true,DTA_Alpha,calph*alph);
|
||||
if ( ct.cummflash <= 0 ) continue;
|
||||
double falph = max((ct.cummflash-FracTic)/15.,0.)**1.5;
|
||||
Screen.DrawText(MiniHUDFontOutline,mhudfontcol[MCR_REDFLASH],barpos.x+3,barpos.y+10,String.Format("%d",ct.cummdamage),DTA_VirtualWidthF,ss1.x,DTA_VirtualHeightF,ss1.y,DTA_KeepRatio,true,DTA_Alpha,falph*calph*alph,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
Screen.DrawText(MiniHUDFontOutline,mhudfontcol[MCR_REDFLASH],barpos.x+3,barpos.y+10,(ct.cummdamage>=Actor.TELEFRAG_DAMAGE)?"∞":String.Format("%d",ct.cummdamage),DTA_VirtualWidthF,ss1.x,DTA_VirtualHeightF,ss1.y,DTA_KeepRatio,true,DTA_Alpha,falph*calph*alph,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -292,8 +292,8 @@ Class SWWMQuickCombatTracker : Inventory
|
|||
t.cummspan = target.bISMONSTER?120:30;
|
||||
t.cummflash = 15;
|
||||
}
|
||||
t.intp = SmoothDynamicValueInterpolator.Create(t.lasthealth,.5,1,100);
|
||||
t.intpl = SmoothLinearValueInterpolator.Create(t.laghealth[9],max(1,t.maxhealth/20));
|
||||
t.intp = SmoothDynamicValueInterpolator.Create(t.lasthealth,.5);
|
||||
t.intpl = SmoothLinearValueInterpolator.Create(t.laghealth[9],max(1,t.maxhealth/50));
|
||||
t.lifespan = target.bISMONSTER?((damage>0)?700:70):((damage>0)?140:35);
|
||||
t.fadein = 0;
|
||||
t.lvheight = target.Height;
|
||||
|
|
@ -383,7 +383,7 @@ Class SmoothDynamicValueInterpolator
|
|||
{
|
||||
private double val, oldval, factor, mindiff, maxdiff;
|
||||
|
||||
static SmoothDynamicValueInterpolator Create( double val, double factor, double mindiff, double maxdiff )
|
||||
static SmoothDynamicValueInterpolator Create( double val, double factor, double mindiff = 1., double maxdiff = 0. )
|
||||
{
|
||||
let v = new("SmoothDynamicValueInterpolator");
|
||||
v.oldval = v.val = val;
|
||||
|
|
@ -402,7 +402,7 @@ Class SmoothDynamicValueInterpolator
|
|||
if ( abs(newval-val) < mindiff ) val = newval;
|
||||
else
|
||||
{
|
||||
double diff = min(abs(newval-val)*factor,maxdiff);
|
||||
double diff = (maxdiff>0.)?min(abs(newval-val)*factor,maxdiff):(abs(newval-val)*factor);
|
||||
if ( val > newval ) val = max(newval,val-diff);
|
||||
else val = min(newval,val+diff);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Class Ynykron : SWWMWeapon
|
|||
override void HudTick()
|
||||
{
|
||||
Super.HudTick();
|
||||
if ( !ChargeInter ) ChargeInter = SmoothDynamicValueInterpolator.Create(chargelevel*10,.5,1.,400.);
|
||||
if ( !ChargeInter ) ChargeInter = SmoothDynamicValueInterpolator.Create(chargelevel*10,.5);
|
||||
ChargeInter.Update(chargelevel*10);
|
||||
if ( lastmode && (lastmode != inverted+1) && (Owner.player == players[consoleplayer]) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ Class DeepImpact : SWWMWeapon
|
|||
override void HudTick()
|
||||
{
|
||||
Super.HudTick();
|
||||
if ( !ChargeInter ) ChargeInter = SmoothDynamicValueInterpolator.Create(clipcount,.5,1.,25.);
|
||||
if ( !ChargeInter ) ChargeInter = SmoothDynamicValueInterpolator.Create(clipcount,.5);
|
||||
ChargeInter.Update(clipcount);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ Class SilverBullet : SWWMWeapon
|
|||
override void HudTick()
|
||||
{
|
||||
Super.HudTick();
|
||||
if ( !ZoomInter ) ZoomInter = SmoothDynamicValueInterpolator.Create(zoomlevel*10,.5,1.,20.);
|
||||
if ( !ZoomInter ) ZoomInter = SmoothDynamicValueInterpolator.Create(zoomlevel*10,.5);
|
||||
ZoomInter.Update(zoomlevel*10);
|
||||
if ( lastammo && (lastammo != fcbselected+1) && (Owner.player == players[consoleplayer]) )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue