(dx < 0 ? MB_LEFTBUTTON :
dx > 0 ? MB_RIGHTBUTTON : MB_RELEASED));
}
- else
+ else if (!tile_cursor.moving)
{
int old_xpos = tile_cursor.xpos;
int old_ypos = tile_cursor.ypos;
{
tile_cursor.enabled = FALSE;
tile_cursor.active = FALSE;
+ tile_cursor.moving = FALSE;
tile_cursor.xpos = 0;
tile_cursor.ypos = 0;
tile_cursor.ypos = y;
tile_cursor.target_x = gfx.sx + x * gfx.game_tile_size;
tile_cursor.target_y = gfx.sy + y * gfx.game_tile_size;
+
+ tile_cursor.moving = TRUE;
}
void SetTileCursorXY(int x, int y)
tile_cursor.x = tile_cursor.target_x;
tile_cursor.y = tile_cursor.target_y;
+
+ tile_cursor.moving = FALSE;
}
void SetOverlayEnabled(boolean enabled)
{
boolean enabled; /* tile cursor generally enabled or disabled */
boolean active; /* tile cursor activated (depending on game) */
+ boolean moving; /* tile cursor moving to target position */
int xpos, ypos; /* tile cursor level playfield position */
int x, y; /* tile cursor current screen position */
!tile_cursor.active)
return;
- if (tile_cursor.x != tile_cursor.target_x ||
- tile_cursor.y != tile_cursor.target_y)
+ if (tile_cursor.moving)
{
- int step = TILESIZE_VAR / (GADGET_FRAME_DELAY / video.frame_delay_value);
+ int step = TILESIZE_VAR / 4;
int dx = tile_cursor.target_x - tile_cursor.x;
int dy = tile_cursor.target_y - tile_cursor.y;
tile_cursor.y = tile_cursor.target_y;
else
tile_cursor.y += SIGN(dy) * step;
+
+ if (tile_cursor.x == tile_cursor.target_x &&
+ tile_cursor.y == tile_cursor.target_y)
+ tile_cursor.moving = FALSE;
}
dst_x = tile_cursor.x;