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

Function xAnimPlayStartTransition

src/SB/Core/x/xAnim.cpp:1868–1938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1866}
1867
1868void xAnimPlayStartTransition(xAnimPlay* play, xAnimTransition* transition)
1869{
1870 xAnimSingle* single = &play->Single[transition->Dest->Flags & 0xf];
1871 xAnimSingle* bl = single->Blend;
1872
1873 if (transition->SrcTime != 0.0f || (transition->Flags & 0x4 && bl != NULL && bl->State))
1874 {
1875 single->Sync = transition;
1876 return;
1877 }
1878
1879 if (bl != NULL && bl->State != NULL)
1880 {
1881 EffectSingleStop(bl);
1882 bl->State = NULL;
1883 single->BlendFactor = 0.0f;
1884 }
1885
1886 if (transition->BlendRecip == 0.0f || single->Blend == NULL)
1887 {
1888 EffectSingleStop(single);
1889 if (single->Tran != NULL && single->Tran->Flags & 0x2)
1890 {
1891 xMemPoolFree(&sxAnimTempTranPool, single->Tran);
1892 }
1893 single->Tran = NULL;
1894 }
1895 else
1896 {
1897 if (single->State != NULL)
1898 {
1899 bl->State = single->State;
1900 bl->Time = single->Time;
1901 bl->CurrentSpeed = single->CurrentSpeed;
1902 bl->BilinearLerp[0] = single->BilinearLerp[0];
1903 bl->BilinearLerp[1] = single->BilinearLerp[1];
1904 bl->Effect = single->Effect;
1905
1906 bl->LastTime = single->LastTime;
1907
1908 memcpy(bl->ActiveList, single->ActiveList,
1909 single->ActiveCount * sizeof(xAnimActiveEffect));
1910 single->ActiveList[0].Effect = NULL;
1911 }
1912
1913 if (single->Tran != NULL && single->Tran->Flags & 0x2)
1914 {
1915 xMemPoolFree(&sxAnimTempTranPool, single->Tran);
1916 }
1917 single->Tran = transition;
1918 single->BlendFactor = 0.0000001f;
1919 }
1920
1921 TransitionTimeInit(single, transition);
1922 single->State = transition->Dest;
1923 single->CurrentSpeed = single->State->Speed;
1924 single->BilinearLerp[0] = 0.0f;
1925 single->BilinearLerp[1] = 0.0f;

Callers 4

AnimStartMethod · 0.50
killFunction · 0.50
startMethod · 0.50

Calls 5

memcpyFunction · 0.85
TransitionTimeInitFunction · 0.85
EffectSingleStopFunction · 0.70
xMemPoolFreeFunction · 0.70
EffectSingleStartFunction · 0.70

Tested by

no test coverage detected