X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/fa3abef5abe95dd9668a87b1cc57a724dcbf6354..d3fc6146c0fd38562c28eac50bc932b2992b97a5:/cube.c diff --git a/cube.c b/cube.c index 5df5fcb..60730c0 100644 --- a/cube.c +++ b/cube.c @@ -1115,8 +1115,8 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds, 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! */ @@ -1476,7 +1476,7 @@ static void game_set_size(drawing *dr, game_drawstate *ds, { 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); } @@ -1503,7 +1503,8 @@ static game_drawstate *game_new_drawstate(drawing *dr, game_state *state) { 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; }