forked from len0rd/rockbox
puzzles: fix star drawing in Signpost
- change point ordering to make concave polygon rendering work - also enables an "Easter egg" of sorts Change-Id: I3b4044a374dce1cff889d5f3744de9e634978591
This commit is contained in:
parent
e7a35ba383
commit
3a70222a73
2 changed files with 5 additions and 2 deletions
|
|
@ -12,6 +12,8 @@ int sprintf_wrapper(char *str, const char *fmt, ...)
|
||||||
|
|
||||||
char *getenv_wrapper(const char *c)
|
char *getenv_wrapper(const char *c)
|
||||||
{
|
{
|
||||||
|
if(!strcmp(c, "SIGNPOST_GEARS"))
|
||||||
|
return "y";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1810,8 +1810,9 @@ static void draw_star(drawing *dr, int cx, int cy, int rad, int npoints,
|
||||||
coords = snewn(npoints * 2 * 2, int);
|
coords = snewn(npoints * 2 * 2, int);
|
||||||
|
|
||||||
for (n = 0; n < npoints * 2; n++) {
|
for (n = 0; n < npoints * 2; n++) {
|
||||||
a = 2.0 * PI * ((double)n / ((double)npoints * 2.0)) + angle_offset;
|
/* hack to accomodate rockbox's concave polygon drawing */
|
||||||
r = (n % 2) ? (double)rad/2.0 : (double)rad;
|
a = 2.0 * PI * ((double)n / ((double)npoints * 2.0)) + angle_offset - PI / npoints;
|
||||||
|
r = (n % 2 == 0) ? (double)rad/2.0 : (double)rad;
|
||||||
|
|
||||||
/* We're rotating the point at (0, -r) by a degrees */
|
/* We're rotating the point at (0, -r) by a degrees */
|
||||||
coords[2*n+0] = cx + (int)( r * sin(a));
|
coords[2*n+0] = cx + (int)( r * sin(a));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue