summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/inertia.c
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2024-08-11 23:34:57 -0400
committerFranklin Wei <franklin@rockbox.org>2024-08-16 16:31:28 -0400
commitea0e3704a8aacf87f20ba87e3b33bc4b3966c731 (patch)
tree8db0a329800cffd661f6a80767ce2f956eb57ab8 /apps/plugins/puzzles/src/inertia.c
parent903e8c5b32285e50907e6525388162bd459cbef8 (diff)
downloadrockbox-ea0e3704a8aacf87f20ba87e3b33bc4b3966c731.tar.gz
rockbox-ea0e3704a8aacf87f20ba87e3b33bc4b3966c731.zip
puzzles: resync with upstream 262f709.
This is the first resync with a fully unmodified upstream repo. This includes a new scanline polygon renderer in the upstream puzzles distribution. This allows us to get rid of the monstrosity of a polygon renderer we had been shipping in rockbox.c. Change-Id: I23628c74bb5ff7a9e7932bf16d68a1c867c49969
Diffstat (limited to 'apps/plugins/puzzles/src/inertia.c')
-rw-r--r--apps/plugins/puzzles/src/inertia.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/apps/plugins/puzzles/src/inertia.c b/apps/plugins/puzzles/src/inertia.c
index 1d5a028add..fe174f3b56 100644
--- a/apps/plugins/puzzles/src/inertia.c
+++ b/apps/plugins/puzzles/src/inertia.c
@@ -722,18 +722,6 @@ static int move_goes_to(int w, int h, char *grid, int x, int y, int d)
722 return (y*w+x)*DP1+dr; 722 return (y*w+x)*DP1+dr;
723} 723}
724 724
725static int compare_integers(const void *av, const void *bv)
726{
727 const int *a = (const int *)av;
728 const int *b = (const int *)bv;
729 if (*a < *b)
730 return -1;
731 else if (*a > *b)
732 return +1;
733 else
734 return 0;
735}
736
737static char *solve_game(const game_state *state, const game_state *currstate, 725static char *solve_game(const game_state *state, const game_state *currstate,
738 const char *aux, const char **error) 726 const char *aux, const char **error)
739{ 727{
@@ -1886,11 +1874,6 @@ static void draw_player(drawing *dr, game_drawstate *ds, int x, int y,
1886 coords[d*4+2] = x + TILESIZE/2 + (int)((TILESIZE*3/7) * x2); 1874 coords[d*4+2] = x + TILESIZE/2 + (int)((TILESIZE*3/7) * x2);
1887 coords[d*4+3] = y + TILESIZE/2 + (int)((TILESIZE*3/7) * y2); 1875 coords[d*4+3] = y + TILESIZE/2 + (int)((TILESIZE*3/7) * y2);
1888 } 1876 }
1889 /* rockbox hack */
1890 int tmp[2] = { coords[0], coords[1] };
1891 memmove(coords, coords + 2, sizeof(int) * DIRECTIONS * 4 - 2);
1892 memcpy(coords + DIRECTIONS * 4 - 2, tmp, 2 * sizeof(int));
1893
1894 draw_polygon(dr, coords, DIRECTIONS*2, COL_DEAD_PLAYER, COL_OUTLINE); 1877 draw_polygon(dr, coords, DIRECTIONS*2, COL_DEAD_PLAYER, COL_OUTLINE);
1895 } else { 1878 } else {
1896 draw_circle(dr, x + TILESIZE/2, y + TILESIZE/2, 1879 draw_circle(dr, x + TILESIZE/2, y + TILESIZE/2,
@@ -1906,6 +1889,8 @@ static void draw_player(drawing *dr, game_drawstate *ds, int x, int y,
1906 int coords[14], *c; 1889 int coords[14], *c;
1907 1890
1908 c = coords; 1891 c = coords;
1892 *c++ = ox + px/9;
1893 *c++ = oy + py/9;
1909 *c++ = ox + px/9 + ax*2/3; 1894 *c++ = ox + px/9 + ax*2/3;
1910 *c++ = oy + py/9 + ay*2/3; 1895 *c++ = oy + py/9 + ay*2/3;
1911 *c++ = ox + px/3 + ax*2/3; 1896 *c++ = ox + px/3 + ax*2/3;
@@ -1918,8 +1903,6 @@ static void draw_player(drawing *dr, game_drawstate *ds, int x, int y,
1918 *c++ = oy - py/9 + ay*2/3; 1903 *c++ = oy - py/9 + ay*2/3;
1919 *c++ = ox - px/9; 1904 *c++ = ox - px/9;
1920 *c++ = oy - py/9; 1905 *c++ = oy - py/9;
1921 *c++ = ox + px/9;
1922 *c++ = oy + py/9;
1923 draw_polygon(dr, coords, 7, COL_HINT, COL_OUTLINE); 1906 draw_polygon(dr, coords, 7, COL_HINT, COL_OUTLINE);
1924 } 1907 }
1925 1908