aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2020-07-06 22:36:25 -0400
committerFranklin Wei <franklin@rockbox.org>2020-12-07 19:27:19 -0500
commit0d188b7c6771c300fe0d63562c2bde7243a2de64 (patch)
tree08a15c53a884c4df3d263a6b67828ce77b6151b1
parent6f99f40e0a11acbf60c95ca2fdcc53aa492e4354 (diff)
downloadpuzzles-rockbox.zip
puzzles-rockbox.tar.gz
puzzles-rockbox.tar.bz2
puzzles-rockbox.tar.xz
Untangle: Implement game_get_cursor_location.rockbox
Diffstat (limited to '')
-rw-r--r--untangle.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/untangle.c b/untangle.c
index a270277..0d3e0e6 100644
--- a/untangle.c
+++ b/untangle.c
@@ -1587,6 +1587,17 @@ static void game_get_cursor_location(const game_ui *ui,
const game_params *params,
int *x, int *y, int *w, int *h)
{
+ if(ui->dragpoint >= 0 || ui->cursorpoint >= 0) {
+ int idx = (ui->dragpoint >= 0) ? ui->dragpoint : ui->cursorpoint;
+
+ int cx, cy;
+ cx = ds->x[idx];
+ cy = ds->y[idx];
+
+ *x = cx - CIRCLE_RADIUS;
+ *y = cy - CIRCLE_RADIUS;
+ *w = *h = 2 * CIRCLE_RADIUS + 1;
+ }
}
static int game_status(const game_state *state)