It seems to be a bug with the vec_to_screen function.

Before anything else I say about the bug: You shouldn't use Player directly in the argument and also the Camera should not have a ".X" (I mean: camera.x).

this is the difinition:

vec_set(temp,player.x);
if (vec_to_screen(temp,camera) != NULL)
{
//Codes
}

there is no problem till here ok?

The buggy thing is here:

The problem I have is something strange.

Code:
if (my.flag1==on )
{
vec_set(temp,player.x);
if(vec_to_screen(temp, cam_sta)!=NULL)
{
//my codes
}

//if (vec_to_screen(temp, another_cam)!=NULL)
//{
//
//}
}



The problem is: this function I wrote should work without any problem. But it does not.

I accidentally noticed that the function works as I want only when an empty if clause like this, is used:

Code:
if (vec_to_screen(temp, another_cam)!=NULL)
{
//Nothing here. just emptiness!
}



When I comment the above if clause, the function doesn't work as I want.

Why this happens? I mean this is just an If statement and it does not apply any effects. But why it affects my function when I comment it?


Last edited by Mahdi; 03/27/11 18:42.

I don't care!