dl.dropboxusercontent.com/u/210143/editor.rar
Problem is that tiles aren’t always placed in “cell” I click, sometime there is one tile offset when I click near edges of tile. Problem is either with my formula (which is 99% correct, as I’ve done extensive testing of it against various data in spreadsheet) or round function used by GD. If latter assumption is correct and round in fact is giving out wrong results, then I’d like to propose following replacement:
int round (double d) {
double tempd = d - (int)d;
if (tempd<=0.5d) {
return (int)d;
} else {
return (int)(d+1);
}
}
which would give 100% correct results.