summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/filling.c
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2020-07-06 22:59:58 -0400
committerFranklin Wei <franklin@rockbox.org>2020-07-06 23:00:13 -0400
commit5094aaa4d49573c0491399e987c2c866c00796a5 (patch)
tree7d625f9982e3263e6c242babe26be7ad5474b357 /apps/plugins/puzzles/src/filling.c
parent443ad25e75a29d114bc6c7d34387e6ad1f873a81 (diff)
downloadrockbox-5094aaa4d49573c0491399e987c2c866c00796a5.tar.gz
rockbox-5094aaa4d49573c0491399e987c2c866c00796a5.zip
puzzles: Follow cursor in zoom mode and general code cleanup.
Frontends now have a way to retrieve the backend cursor position with some changes I've submitted upstream. With this information, we can now follow the cursor around in "interaction mode" while zoomed in, eliminating (most) need for mode switching. Also does some cleanup of the frontend code. Change-Id: I1ba118f67564a3baed95435f5619b73cfa3ae87a
Diffstat (limited to 'apps/plugins/puzzles/src/filling.c')
-rw-r--r--apps/plugins/puzzles/src/filling.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/filling.c b/apps/plugins/puzzles/src/filling.c
index f67d9fadba..6d9beb5c28 100644
--- a/apps/plugins/puzzles/src/filling.c
+++ b/apps/plugins/puzzles/src/filling.c
@@ -2060,6 +2060,20 @@ static float game_flash_length(const game_state *oldstate,
2060 return 0.0F; 2060 return 0.0F;
2061} 2061}
2062 2062
2063static void game_get_cursor_location(const game_ui *ui,
2064 const game_drawstate *ds,
2065 const game_state *state,
2066 const game_params *params,
2067 int *x, int *y, int *w, int *h)
2068{
2069 if(ui->cur_visible)
2070 {
2071 *x = BORDER + ui->cur_x * TILE_SIZE;
2072 *y = BORDER + ui->cur_y * TILE_SIZE;
2073 *w = *h = TILE_SIZE;
2074 }
2075}
2076
2063static int game_status(const game_state *state) 2077static int game_status(const game_state *state)
2064{ 2078{
2065 return state->completed ? +1 : 0; 2079 return state->completed ? +1 : 0;
@@ -2165,6 +2179,7 @@ const struct game thegame = {
2165 game_redraw, 2179 game_redraw,
2166 game_anim_length, 2180 game_anim_length,
2167 game_flash_length, 2181 game_flash_length,
2182 game_get_cursor_location,
2168 game_status, 2183 game_status,
2169 true, false, game_print_size, game_print, 2184 true, false, game_print_size, game_print,
2170 false, /* wants_statusbar */ 2185 false, /* wants_statusbar */