I'm trying to convert this lite-c snippet i wrote to C# but i can't seem to get it to work...

(Lite-C) "Both executed in the main function"
Code:
BMAP* arrow = "arrow.pcx";
mouse_map = arrow;
mouse_mode = 2;
int snap_amount = 30;
double ux = 0.0;
double uy = 0.0;

while (1) // move it over the screen
{  
ux = mouse_cursor.x / snap_amount;
uy = mouse_cursor.y / snap_amount;
		
mouse_pos.x = (integer(ux)*snap_amount);
mouse_pos.y = (integer(uy)*snap_amount);
wait(1);
}


(Wrapper attempt)
Code:
BMAP* arrow = EngFun.bmap_create("arrow.pcx");
EngVar.mouse_map = arrow;
EngVar.mouse_mode.IntValue = 2;
int snap_amount = 30;
double ux = 0.0;
double uy = 0.0;

while(true)
{
ux = (EngVar.mouse_cursor.x.FloatValue / snap_amount);
uy = (EngVar.mouse_cursor.y.FloatValue / snap_amount);

EngVar.mouse_pos.x.IntValue = (EngFun.integer((Var)ux).IntValue * snap_amount);
EngVar.mouse_pos.y.IntValue = (EngFun.integer((Var)uy).IntValue * snap_amount);
yeild return 1;
}



Thanks.

Last edited by DJBMASTER; 08/20/09 16:15.