diff options
author | Franklin Wei <git@fwei.tk> | 2017-10-23 17:19:29 -0400 |
---|---|---|
committer | Franklin Wei <git@fwei.tk> | 2017-10-23 17:19:29 -0400 |
commit | ef1306764e6443d67612542654f252b376c5993e (patch) | |
tree | 5f064178c1f9a23695b1b52b8bd487434be9006e /apps/plugins/puzzles/src/grid.c | |
parent | 7a8c9daf7ef5a8b38d4c4f6625ff2d9d8eb1aa0a (diff) | |
download | rockbox-ef1306764e6443d67612542654f252b376c5993e.tar.gz rockbox-ef1306764e6443d67612542654f252b376c5993e.zip |
puzzles: resync with upstream
There have been some improvements with regard to small screen sizes,
which will be nice to have.
Change-Id: I30c740514156258d2818fde325c1a751500f7611
Diffstat (limited to 'apps/plugins/puzzles/src/grid.c')
-rw-r--r-- | apps/plugins/puzzles/src/grid.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/plugins/puzzles/src/grid.c b/apps/plugins/puzzles/src/grid.c index 4929b5c7d3..52648e5a92 100644 --- a/apps/plugins/puzzles/src/grid.c +++ b/apps/plugins/puzzles/src/grid.c | |||
@@ -1529,8 +1529,8 @@ static void grid_size_triangular(int width, int height, | |||
1529 | *yextent = height * vec_y; | 1529 | *yextent = height * vec_y; |
1530 | } | 1530 | } |
1531 | 1531 | ||
1532 | static char *grid_validate_desc_triangular(grid_type type, int width, | 1532 | static const char *grid_validate_desc_triangular(grid_type type, int width, |
1533 | int height, const char *desc) | 1533 | int height, const char *desc) |
1534 | { | 1534 | { |
1535 | /* | 1535 | /* |
1536 | * Triangular grids: an absent description is valid (indicating | 1536 | * Triangular grids: an absent description is valid (indicating |
@@ -2855,8 +2855,9 @@ static char *grid_new_desc_penrose(grid_type type, int width, int height, random | |||
2855 | return dupstr(gd); | 2855 | return dupstr(gd); |
2856 | } | 2856 | } |
2857 | 2857 | ||
2858 | static char *grid_validate_desc_penrose(grid_type type, int width, int height, | 2858 | static const char *grid_validate_desc_penrose(grid_type type, |
2859 | const char *desc) | 2859 | int width, int height, |
2860 | const char *desc) | ||
2860 | { | 2861 | { |
2861 | int tilesize = PENROSE_TILESIZE, startsz, depth, xoff, yoff, aoff, inner_radius; | 2862 | int tilesize = PENROSE_TILESIZE, startsz, depth, xoff, yoff, aoff, inner_radius; |
2862 | double outer_radius; | 2863 | double outer_radius; |
@@ -3032,8 +3033,8 @@ char *grid_new_desc(grid_type type, int width, int height, random_state *rs) | |||
3032 | } | 3033 | } |
3033 | } | 3034 | } |
3034 | 3035 | ||
3035 | char *grid_validate_desc(grid_type type, int width, int height, | 3036 | const char *grid_validate_desc(grid_type type, int width, int height, |
3036 | const char *desc) | 3037 | const char *desc) |
3037 | { | 3038 | { |
3038 | if (type == GRID_PENROSE_P2 || type == GRID_PENROSE_P3) { | 3039 | if (type == GRID_PENROSE_P2 || type == GRID_PENROSE_P3) { |
3039 | return grid_validate_desc_penrose(type, width, height, desc); | 3040 | return grid_validate_desc_penrose(type, width, height, desc); |
@@ -3048,7 +3049,7 @@ char *grid_validate_desc(grid_type type, int width, int height, | |||
3048 | 3049 | ||
3049 | grid *grid_new(grid_type type, int width, int height, const char *desc) | 3050 | grid *grid_new(grid_type type, int width, int height, const char *desc) |
3050 | { | 3051 | { |
3051 | char *err = grid_validate_desc(type, width, height, desc); | 3052 | const char *err = grid_validate_desc(type, width, height, desc); |
3052 | if (err) assert(!"Invalid grid description."); | 3053 | if (err) assert(!"Invalid grid description."); |
3053 | 3054 | ||
3054 | return grid_news[type](width, height, desc); | 3055 | return grid_news[type](width, height, desc); |