summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/signpost.c
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2024-07-23 06:05:45 -0400
committerFranklin Wei <franklin@rockbox.org>2024-07-23 06:05:45 -0400
commit62b0456a4b1415d3e4138e8dbca4b22f88d374d6 (patch)
tree393620d5f8ac19bddf40aaf90721e792017e1623 /apps/plugins/puzzles/src/signpost.c
parent09aa8de52cb962f1ceebfb1fd44f2c54a924fc5c (diff)
downloadrockbox-62b0456a4b1415d3e4138e8dbca4b22f88d374d6.tar.gz
rockbox-62b0456a4b1415d3e4138e8dbca4b22f88d374d6.zip
puzzles: resync with upstream (adds new Palisade cursor interface).
Resyncs properly with this slightly modified upstream: https://www.franklinwei.com/git/puzzles/commit/?h=rockbox-devel&id=1c62dac3f4f1a819a394ff33cc82912cf9079b50 Change-Id: I2018e81647c22010f9d74d8d14d13982f2969a8f
Diffstat (limited to 'apps/plugins/puzzles/src/signpost.c')
-rw-r--r--apps/plugins/puzzles/src/signpost.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugins/puzzles/src/signpost.c b/apps/plugins/puzzles/src/signpost.c
index 9aed67bb4a..4d2f5849fd 100644
--- a/apps/plugins/puzzles/src/signpost.c
+++ b/apps/plugins/puzzles/src/signpost.c
@@ -1895,8 +1895,9 @@ static void draw_star(drawing *dr, int cx, int cy, int rad, int npoints,
1895 coords = snewn(npoints * 2 * 2, int); 1895 coords = snewn(npoints * 2 * 2, int);
1896 1896
1897 for (n = 0; n < npoints * 2; n++) { 1897 for (n = 0; n < npoints * 2; n++) {
1898 a = 2.0 * PI * ((double)n / ((double)npoints * 2.0)) + angle_offset; 1898 /* hack to accomodate rockbox's concave polygon drawing */
1899 r = (n % 2) ? (double)rad/2.0 : (double)rad; 1899 a = 2.0 * PI * ((double)n / ((double)npoints * 2.0)) + angle_offset - PI / npoints;
1900 r = (n % 2 == 0) ? (double)rad/2.0 : (double)rad;
1900 1901
1901 /* We're rotating the point at (0, -r) by a degrees */ 1902 /* We're rotating the point at (0, -r) by a degrees */
1902 coords[2*n+0] = cx + (int)( r * sin(a)); 1903 coords[2*n+0] = cx + (int)( r * sin(a));