int cx, cy;
double angle;
- cx = state->squares[state->current].x * GRID_SCALE + ds->ox;
- cy = state->squares[state->current].y * GRID_SCALE + ds->oy;
+ cx = (int)(state->squares[state->current].x * GRID_SCALE) + ds->ox;
+ cy = (int)(state->squares[state->current].y * GRID_SCALE) + ds->oy;
if (x == cx && y == cy)
return NULL; /* clicked in exact centre! */
{
struct bbox bb = find_bbox(params);
- ds->gridscale = tilesize;
+ ds->gridscale = (float)tilesize;
ds->ox = (int)(-(bb.l - solids[params->solid]->border) * ds->gridscale);
ds->oy = (int)(-(bb.u - solids[params->solid]->border) * ds->gridscale);
}
{
struct game_drawstate *ds = snew(struct game_drawstate);
- ds->ox = ds->oy = ds->gridscale = 0.0F;/* not decided yet */
+ ds->ox = ds->oy = 0;
+ ds->gridscale = 0.0F; /* not decided yet */
return ds;
}