#include <math.h>
#ifdef STANDALONE
-# ifdef HAVE_COCOA
-# include <OpenGL/gl.h>
-# include <OpenGL/glu.h>
-# else
+# ifndef HAVE_COCOA
# include <GL/gl.h>
# include <GL/glu.h>
# endif
}
else
{
+ if (!path1) path1 = st->path;
path2 = (tnPath *)malloc(sizeof(tnPath));
path1->next = path2;
path1 = path2;
cmpos = st->cam_pos;
/* Get current curve */
- if (st->cam_pos->next->next->next)
+ if (st->cam_pos->next &&
+ st->cam_pos->next->next &&
+ st->cam_pos->next->next->next)
{
p1 = st->cam_pos;
for (i=0; i<4; i++)
/* End of tunnel */
st->ModeX = 1.0;
st->ModeXFlag = 0;
+ glEnd();
return;
}
cvCatmullRom(p4, t, &op);
/* End of tunnel */
st->ModeX = 1.0;
st->ModeXFlag = 0;
+ glEnd();
return;
}