diff options
author | Franklin Wei <git@fwei.tk> | 2017-08-16 11:38:04 -0400 |
---|---|---|
committer | Franklin Wei <git@fwei.tk> | 2017-08-16 11:40:42 -0400 |
commit | ef9c2f44579543d2fa83632106343ba8b730f734 (patch) | |
tree | 4327bc5a65e74c71bb98888383ce964d4e7a88c5 /apps/plugins/puzzles/src | |
parent | f31a400bac0b72e773e32d2a17ac839145dded2b (diff) | |
download | rockbox-ef9c2f44579543d2fa83632106343ba8b730f734.tar.gz rockbox-ef9c2f44579543d2fa83632106343ba8b730f734.zip |
puzzles: fix polygon drawing in Inertia
Yet another hack to accommodate our polygon algorithm...
Change-Id: Ic5d304be23d30c380b19771ab68cf01c416261b4
Diffstat (limited to 'apps/plugins/puzzles/src')
-rw-r--r-- | apps/plugins/puzzles/src/inertia.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/plugins/puzzles/src/inertia.c b/apps/plugins/puzzles/src/inertia.c index c22d2e17d4..918f9797e5 100644 --- a/apps/plugins/puzzles/src/inertia.c +++ b/apps/plugins/puzzles/src/inertia.c | |||
@@ -1871,6 +1871,11 @@ static void draw_player(drawing *dr, game_drawstate *ds, int x, int y, | |||
1871 | coords[d*4+2] = x + TILESIZE/2 + (int)((TILESIZE*3/7) * x2); | 1871 | coords[d*4+2] = x + TILESIZE/2 + (int)((TILESIZE*3/7) * x2); |
1872 | coords[d*4+3] = y + TILESIZE/2 + (int)((TILESIZE*3/7) * y2); | 1872 | coords[d*4+3] = y + TILESIZE/2 + (int)((TILESIZE*3/7) * y2); |
1873 | } | 1873 | } |
1874 | /* rockbox hack */ | ||
1875 | int tmp[2] = { coords[0], coords[1] }; | ||
1876 | memmove(coords, coords + 2, sizeof(int) * DIRECTIONS * 4 - 2); | ||
1877 | memcpy(coords + DIRECTIONS * 4 - 2, tmp, 2 * sizeof(int)); | ||
1878 | |||
1874 | draw_polygon(dr, coords, DIRECTIONS*2, COL_DEAD_PLAYER, COL_OUTLINE); | 1879 | draw_polygon(dr, coords, DIRECTIONS*2, COL_DEAD_PLAYER, COL_OUTLINE); |
1875 | } else { | 1880 | } else { |
1876 | draw_circle(dr, x + TILESIZE/2, y + TILESIZE/2, | 1881 | draw_circle(dr, x + TILESIZE/2, y + TILESIZE/2, |
@@ -1886,8 +1891,6 @@ static void draw_player(drawing *dr, game_drawstate *ds, int x, int y, | |||
1886 | int coords[14], *c; | 1891 | int coords[14], *c; |
1887 | 1892 | ||
1888 | c = coords; | 1893 | c = coords; |
1889 | *c++ = ox + px/9; | ||
1890 | *c++ = oy + py/9; | ||
1891 | *c++ = ox + px/9 + ax*2/3; | 1894 | *c++ = ox + px/9 + ax*2/3; |
1892 | *c++ = oy + py/9 + ay*2/3; | 1895 | *c++ = oy + py/9 + ay*2/3; |
1893 | *c++ = ox + px/3 + ax*2/3; | 1896 | *c++ = ox + px/3 + ax*2/3; |
@@ -1900,6 +1903,8 @@ static void draw_player(drawing *dr, game_drawstate *ds, int x, int y, | |||
1900 | *c++ = oy - py/9 + ay*2/3; | 1903 | *c++ = oy - py/9 + ay*2/3; |
1901 | *c++ = ox - px/9; | 1904 | *c++ = ox - px/9; |
1902 | *c++ = oy - py/9; | 1905 | *c++ = oy - py/9; |
1906 | *c++ = ox + px/9; | ||
1907 | *c++ = oy + py/9; | ||
1903 | draw_polygon(dr, coords, 7, COL_HINT, COL_OUTLINE); | 1908 | draw_polygon(dr, coords, 7, COL_HINT, COL_OUTLINE); |
1904 | } | 1909 | } |
1905 | 1910 | ||