summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/solo.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/solo.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/solo.c')
-rw-r--r--apps/plugins/puzzles/src/solo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/solo.c b/apps/plugins/puzzles/src/solo.c
index cfe38c5bd9..49753f41dc 100644
--- a/apps/plugins/puzzles/src/solo.c
+++ b/apps/plugins/puzzles/src/solo.c
@@ -5297,6 +5297,19 @@ static float game_flash_length(const game_state *oldstate,
5297 return 0.0F; 5297 return 0.0F;
5298} 5298}
5299 5299
5300static void game_get_cursor_location(const game_ui *ui,
5301 const game_drawstate *ds,
5302 const game_state *state,
5303 const game_params *params,
5304 int *x, int *y, int *w, int *h)
5305{
5306 if(ui->hshow) {
5307 *x = BORDER + ui->hx * TILE_SIZE + 1 + GRIDEXTRA;
5308 *y = BORDER + ui->hy * TILE_SIZE + 1 + GRIDEXTRA;
5309 *w = *h = TILE_SIZE;
5310 }
5311}
5312
5300static int game_status(const game_state *state) 5313static int game_status(const game_state *state)
5301{ 5314{
5302 return state->completed ? +1 : 0; 5315 return state->completed ? +1 : 0;
@@ -5622,6 +5635,7 @@ const struct game thegame = {
5622 game_redraw, 5635 game_redraw,
5623 game_anim_length, 5636 game_anim_length,
5624 game_flash_length, 5637 game_flash_length,
5638 game_get_cursor_location,
5625 game_status, 5639 game_status,
5626 true, false, game_print_size, game_print, 5640 true, false, game_print_size, game_print,
5627 false, /* wants_statusbar */ 5641 false, /* wants_statusbar */