aboutsummaryrefslogtreecommitdiff
path: root/unfinished
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2020-07-06 22:06:30 -0400
committerSimon Tatham <anakin@pobox.com>2020-12-07 19:40:06 +0000
commit78bc9ea7f79f379634f822d5f95242900f5716b9 (patch)
tree20dd3aa4e3ea4025fb72953c9d9950792ada7023 /unfinished
parent9aa7b7cdfb2bcd200f45941a58d6ae698882a2d4 (diff)
downloadpuzzles-78bc9ea7f79f379634f822d5f95242900f5716b9.zip
puzzles-78bc9ea7f79f379634f822d5f95242900f5716b9.tar.gz
puzzles-78bc9ea7f79f379634f822d5f95242900f5716b9.tar.bz2
puzzles-78bc9ea7f79f379634f822d5f95242900f5716b9.tar.xz
Add method for frontends to query the backend's cursor location.
The Rockbox frontend allows games to be displayed in a "zoomed-in" state targets with small displays. Currently we use a modal interface -- a "viewing" mode in which the cursor keys are used to pan around the rendered bitmap; and an "interaction" mode that actually sends keys to the game. This commit adds a midend_get_cursor_location() function to allow the frontend to retrieve the backend's cursor location or other "region of interest" -- such as the player location in Cube or Inertia. With this information, the Rockbox frontend can now intelligently follow the cursor around in the zoomed-in state, eliminating the need for a modal interface.
Diffstat (limited to 'unfinished')
-rw-r--r--unfinished/group.c9
-rw-r--r--unfinished/separate.c9
-rw-r--r--unfinished/slide.c9
-rw-r--r--unfinished/sokoban.c9
4 files changed, 36 insertions, 0 deletions
diff --git a/unfinished/group.c b/unfinished/group.c
index 006a9e0..8e01857 100644
--- a/unfinished/group.c
+++ b/unfinished/group.c
@@ -2196,6 +2196,14 @@ static float game_flash_length(const game_state *oldstate,
return 0.0F;
}
+static void game_get_cursor_location(const game_ui *ui,
+ const game_drawstate *ds,
+ const game_state *state,
+ const game_params *params,
+ int *x, int *y, int *w, int *h)
+{
+}
+
static int game_status(const game_state *state)
{
return state->completed ? +1 : 0;
@@ -2320,6 +2328,7 @@ const struct game thegame = {
game_redraw,
game_anim_length,
game_flash_length,
+ game_get_cursor_location,
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
diff --git a/unfinished/separate.c b/unfinished/separate.c
index 88dc8ed..39243af 100644
--- a/unfinished/separate.c
+++ b/unfinished/separate.c
@@ -799,6 +799,14 @@ static float game_flash_length(const game_state *oldstate,
return 0.0F;
}
+static void game_get_cursor_location(const game_ui *ui,
+ const game_drawstate *ds,
+ const game_state *state,
+ const game_params *params,
+ int *x, int *y, int *w, int *h)
+{
+}
+
static int game_status(const game_state *state)
{
return 0;
@@ -853,6 +861,7 @@ const struct game thegame = {
game_redraw,
game_anim_length,
game_flash_length,
+ game_get_cursor_location,
game_status,
false, false, game_print_size, game_print,
false, /* wants_statusbar */
diff --git a/unfinished/slide.c b/unfinished/slide.c
index 5ad1237..c7a3dce 100644
--- a/unfinished/slide.c
+++ b/unfinished/slide.c
@@ -2297,6 +2297,14 @@ static float game_flash_length(const game_state *oldstate,
return 0.0F;
}
+static void game_get_cursor_location(const game_ui *ui,
+ const game_drawstate *ds,
+ const game_state *state,
+ const game_params *params,
+ int *x, int *y, int *w, int *h)
+{
+}
+
static int game_status(const game_state *state)
{
return state->completed ? +1 : 0;
@@ -2351,6 +2359,7 @@ const struct game thegame = {
game_redraw,
game_anim_length,
game_flash_length,
+ game_get_cursor_location,
game_status,
false, false, game_print_size, game_print,
true, /* wants_statusbar */
diff --git a/unfinished/sokoban.c b/unfinished/sokoban.c
index 7d42a12..ecc222c 100644
--- a/unfinished/sokoban.c
+++ b/unfinished/sokoban.c
@@ -1415,6 +1415,14 @@ static float game_flash_length(const game_state *oldstate,
return 0.0F;
}
+static void game_get_cursor_location(const game_ui *ui,
+ const game_drawstate *ds,
+ const game_state *state,
+ const game_params *params,
+ int *x, int *y, int *w, int *h)
+{
+}
+
static int game_status(const game_state *state)
{
return state->completed ? +1 : 0;
@@ -1469,6 +1477,7 @@ const struct game thegame = {
game_redraw,
game_anim_length,
game_flash_length,
+ game_get_cursor_location,
game_status,
false, false, game_print_size, game_print,
false, /* wants_statusbar */