Okay. That's because the signature of the vec_set is:

vec_set ( VECTOR* vector1, VECTOR* vector2)

You see, vec_set expects both parameters to be VECTOR*(VECTOR pointer). But mouse_pos and mouse_cursor are defined as VECTOR and not VECTOR* in avars.h (which is included in acknex.h)

This means they are the VECTOR structs themselves and not pointers to these structs. You need pointers to these structs so you use the reference operator which is &.

&mouse_pos means "address of mouse_pos" which gives you what you need = a pointer to mouse_pos.

so you do

vec_set(&mouse_pos,&mouse_cursor);


#define PRAGMA_POINTER makes pointers in lite-c more or less work as the same way as in c/c++.

I will give you the short version but read up on pointers in C for further explanation as to why this is required or why it works this way in C:

--
I actually wrote some stuff there but i realized it was more confusing than helping without more background knowledge on C and pointers and stack and heap and how memory works. So, read up on them if you want more details. In fact do read about them, it will almost definitely be helpful in the future.

--

EDIT: not sure about the mtlfx part, it could be that it's written with the assumption that PRAGMA_POINTER is not defined.





Last edited by Quad; 07/30/14 20:33.

3333333333