Hi,
I'm converting some cpp code to work in my pascal project.
(BjA¬?rn BergstrA¬?m's recursive shadowcasting)
The following line that casts from integer to double to integer, where xCenter is an integer:
int xStart=(int)((double)xCenter + 0.5 - (startSlope * distance));
xStart := Integer( Double(xCenter) + 0.5 - (startSlope * distance) ) yields an invalid typecast error.
So I though about doing something like this:
xStart := Round( xCenter + 0.5 - (StartSlope * distance) );
Would this give the correct result ?
Thanks,
Balaras
Bookmarks