summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c0722a4)
If "select_mode" is true(tile not being dragged) then
selection_box.visible is true. Previously this check was done using
"current_tile == -1", which was unclear.
It could be said that it is redundant to set "select_mode" and *then*
set "selection_box.visible" to true, but it very clearly shows what
is being done and when. In addition, checking select_mode may be used
later on with a completely different purpose.
RsvgHandle *blanktile;
int current_tile;
RsvgHandle *blanktile;
int current_tile;
int diff_x, diff_y;
int click_x, click_y;
int release_x, release_y; /*Currently unused*/
int diff_x, diff_y;
int click_x, click_y;
int release_x, release_y; /*Currently unused*/
if (error)
FATAL_ERROR (error->message);
if (error)
FATAL_ERROR (error->message);
- /*This line appears to be useless, has been replaced by line below*/
- //game->current_tile = game->deck.num_tiles - 1;
- game->current_tile = -1;
+ game->current_tile = game->deck.num_tiles - 1;
+ game->select_mode = 1;
game->diff_x = game->diff_y = 0;
}
game->diff_x = game->diff_y = 0;
}
game->diff_y = event->y - tile_y;
}
}
game->diff_y = event->y - tile_y;
}
}
- if (game->current_tile == -1)
{
game->selection_box.visible = 1;
/*These next two lines are likely to be replaced by...*/
{
game->selection_box.visible = 1;
/*These next two lines are likely to be replaced by...*/
static gboolean on_button_release_event (GtkWidget *widget, GdkEventButton *event, game_t *game)
{
static gboolean on_button_release_event (GtkWidget *widget, GdkEventButton *event, game_t *game)
{
- if (game->current_tile == -1)
selection_box_t *box;
box = &game->selection_box;
selection_box_t *box;
box = &game->selection_box;
tile_print(group.tiles[i]);
}
tile_print(group.tiles[i]);
}
- game->current_tile = -1;
static gboolean on_button_motion_event (GtkWidget *widget, GdkEventMotion *event,
game_t *game, cairo_t *cr)
{
static gboolean on_button_motion_event (GtkWidget *widget, GdkEventMotion *event,
game_t *game, cairo_t *cr)
{
- if (game->current_tile == -1)
{
selection_box_t *box;
box = &game->selection_box;
{
selection_box_t *box;
box = &game->selection_box;