MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / fade_hook_update

Function fade_hook_update

src/SB/Game/zEntPlayerBungeeState.cpp:788–822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

786 }
787 }
788 static void fade_hook_update(float dt)
789 {
790 if ((shared.flags & 0x60) == 0)
791 {
792 return;
793 }
794
795 xModelInstance* hook = get_hook_model();
796 if (hook == NULL)
797 {
798 return;
799 }
800
801 float vel = (1.0f - fixed.hook_fade_alpha) / fixed.hook_fade_time;
802 if (shared.flags & 0x40)
803 {
804 hook->Alpha = -(vel * dt - hook->Alpha);
805 if (hook->Alpha <= fixed.hook_fade_alpha)
806 {
807 hook->Alpha = fixed.hook_fade_alpha;
808 shared.flags &= ~0x40;
809 }
810 }
811 else
812 {
813 hook->Alpha = vel * dt + hook->Alpha;
814 if (hook->Alpha >= 1.0f)
815 {
816 hook->Alpha = 1.0f;
817 shared.flags &= ~0x20;
818 hook->Flags &= 0xbfff;
819 hook->PipeFlags &= ~0x30;
820 }
821 }
822 }
823
824 void start()
825 {

Callers

nothing calls this directly

Calls 1

get_hook_modelFunction · 0.85

Tested by

no test coverage detected