Skip to content

Commit 1c5e305

Browse files
committed
Fix spline1 function in non-static-linking builds
1 parent a5d9ffd commit 1c5e305

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/xrEngine/FDemoPlay.cpp

+21-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,27 @@ void CDemoPlay::stat_Stop()
198198
#define FIX(a) \
199199
while (a >= m_count) \
200200
a -= m_count
201-
extern void spline1(float t, Fvector* p, Fvector* ret);
201+
static void spline1(float t, Fvector* p, Fvector* ret)
202+
{
203+
float t2 = t * t;
204+
float t3 = t2 * t;
205+
float m[4];
206+
207+
ret->x = 0.0f;
208+
ret->y = 0.0f;
209+
ret->z = 0.0f;
210+
m[0] = (0.5f * ((-1.0f * t3) + (2.0f * t2) + (-1.0f * t)));
211+
m[1] = (0.5f * ((3.0f * t3) + (-5.0f * t2) + (0.0f * t) + 2.0f));
212+
m[2] = (0.5f * ((-3.0f * t3) + (4.0f * t2) + (1.0f * t)));
213+
m[3] = (0.5f * ((1.0f * t3) + (-1.0f * t2) + (0.0f * t)));
214+
215+
for (int i = 0; i < 4; i++)
216+
{
217+
ret->x += p[i].x * m[i];
218+
ret->y += p[i].y * m[i];
219+
ret->z += p[i].z * m[i];
220+
}
221+
}
202222

203223
bool CDemoPlay::ProcessCam(SCamEffectorInfo& info)
204224
{

0 commit comments

Comments
 (0)