summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/unfinished
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/unfinished
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/unfinished')
-rw-r--r--apps/plugins/puzzles/src/unfinished/group.c9
-rw-r--r--apps/plugins/puzzles/src/unfinished/separate.c9
-rw-r--r--apps/plugins/puzzles/src/unfinished/slide.c9
-rw-r--r--apps/plugins/puzzles/src/unfinished/sokoban.c9
4 files changed, 36 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/unfinished/group.c b/apps/plugins/puzzles/src/unfinished/group.c
index 006a9e0ee6..8e0185741e 100644
--- a/apps/plugins/puzzles/src/unfinished/group.c
+++ b/apps/plugins/puzzles/src/unfinished/group.c
@@ -2196,6 +2196,14 @@ static float game_flash_length(const game_state *oldstate,
2196 return 0.0F; 2196 return 0.0F;
2197} 2197}
2198 2198
2199static void game_get_cursor_location(const game_ui *ui,
2200 const game_drawstate *ds,
2201 const game_state *state,
2202 const game_params *params,
2203 int *x, int *y, int *w, int *h)
2204{
2205}
2206
2199static int game_status(const game_state *state) 2207static int game_status(const game_state *state)
2200{ 2208{
2201 return state->completed ? +1 : 0; 2209 return state->completed ? +1 : 0;
@@ -2320,6 +2328,7 @@ const struct game thegame = {
2320 game_redraw, 2328 game_redraw,
2321 game_anim_length, 2329 game_anim_length,
2322 game_flash_length, 2330 game_flash_length,
2331 game_get_cursor_location,
2323 game_status, 2332 game_status,
2324 true, false, game_print_size, game_print, 2333 true, false, game_print_size, game_print,
2325 false, /* wants_statusbar */ 2334 false, /* wants_statusbar */
diff --git a/apps/plugins/puzzles/src/unfinished/separate.c b/apps/plugins/puzzles/src/unfinished/separate.c
index 88dc8ed060..39243afb92 100644
--- a/apps/plugins/puzzles/src/unfinished/separate.c
+++ b/apps/plugins/puzzles/src/unfinished/separate.c
@@ -799,6 +799,14 @@ static float game_flash_length(const game_state *oldstate,
799 return 0.0F; 799 return 0.0F;
800} 800}
801 801
802static void game_get_cursor_location(const game_ui *ui,
803 const game_drawstate *ds,
804 const game_state *state,
805 const game_params *params,
806 int *x, int *y, int *w, int *h)
807{
808}
809
802static int game_status(const game_state *state) 810static int game_status(const game_state *state)
803{ 811{
804 return 0; 812 return 0;
@@ -853,6 +861,7 @@ const struct game thegame = {
853 game_redraw, 861 game_redraw,
854 game_anim_length, 862 game_anim_length,
855 game_flash_length, 863 game_flash_length,
864 game_get_cursor_location,
856 game_status, 865 game_status,
857 false, false, game_print_size, game_print, 866 false, false, game_print_size, game_print,
858 false, /* wants_statusbar */ 867 false, /* wants_statusbar */
diff --git a/apps/plugins/puzzles/src/unfinished/slide.c b/apps/plugins/puzzles/src/unfinished/slide.c
index 5ad1237d58..c7a3dcecf7 100644
--- a/apps/plugins/puzzles/src/unfinished/slide.c
+++ b/apps/plugins/puzzles/src/unfinished/slide.c
@@ -2297,6 +2297,14 @@ static float game_flash_length(const game_state *oldstate,
2297 return 0.0F; 2297 return 0.0F;
2298} 2298}
2299 2299
2300static void game_get_cursor_location(const game_ui *ui,
2301 const game_drawstate *ds,
2302 const game_state *state,
2303 const game_params *params,
2304 int *x, int *y, int *w, int *h)
2305{
2306}
2307
2300static int game_status(const game_state *state) 2308static int game_status(const game_state *state)
2301{ 2309{
2302 return state->completed ? +1 : 0; 2310 return state->completed ? +1 : 0;
@@ -2351,6 +2359,7 @@ const struct game thegame = {
2351 game_redraw, 2359 game_redraw,
2352 game_anim_length, 2360 game_anim_length,
2353 game_flash_length, 2361 game_flash_length,
2362 game_get_cursor_location,
2354 game_status, 2363 game_status,
2355 false, false, game_print_size, game_print, 2364 false, false, game_print_size, game_print,
2356 true, /* wants_statusbar */ 2365 true, /* wants_statusbar */
diff --git a/apps/plugins/puzzles/src/unfinished/sokoban.c b/apps/plugins/puzzles/src/unfinished/sokoban.c
index 7d42a12c5d..ecc222c906 100644
--- a/apps/plugins/puzzles/src/unfinished/sokoban.c
+++ b/apps/plugins/puzzles/src/unfinished/sokoban.c
@@ -1415,6 +1415,14 @@ static float game_flash_length(const game_state *oldstate,
1415 return 0.0F; 1415 return 0.0F;
1416} 1416}
1417 1417
1418static void game_get_cursor_location(const game_ui *ui,
1419 const game_drawstate *ds,
1420 const game_state *state,
1421 const game_params *params,
1422 int *x, int *y, int *w, int *h)
1423{
1424}
1425
1418static int game_status(const game_state *state) 1426static int game_status(const game_state *state)
1419{ 1427{
1420 return state->completed ? +1 : 0; 1428 return state->completed ? +1 : 0;
@@ -1469,6 +1477,7 @@ const struct game thegame = {
1469 game_redraw, 1477 game_redraw,
1470 game_anim_length, 1478 game_anim_length,
1471 game_flash_length, 1479 game_flash_length,
1480 game_get_cursor_location,
1472 game_status, 1481 game_status,
1473 false, false, game_print_size, game_print, 1482 false, false, game_print_size, game_print,
1474 false, /* wants_statusbar */ 1483 false, /* wants_statusbar */