_vector_current = (_vector_current+1)%64;
That's what I assumed too, but after 64 draw calls (using vector()) the draw function receives odd values.
VECTOR* vec_setxyz (VECTOR* v, float x, float y, float z)
Hm yeah splitting stuff to a separate function at least solves the problem, although now I'm not entirely sure why.
draw_line3d( vec_add( vec_rotate( vec_create( vecTemp, -4, -4, 0 ), vec_create( vecTemp, angle, 0, 0) ), pos ), vec_create( vecTemp, 100,100,100), 100 );
After 64 draw_lin3d calls, the position is screwed up here.
But why?
VECTOR* rotate_point( VECTOR* relativePosition, VECTOR* absolutePosition, VECTOR* angle )
{
vec_rotate( relativePosition, angle );
vec_add( relativePosition, absolutePosition );
return relativePosition;
}
draw_line3d( rotate_point( vector(-4, -4, 0 ), vPos, vAngle ), vector( 100,100,100), 100 );
Now it works also above 64 draw calls.
So why didn't the former approach work?