diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2009-07-17 05:08:08 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2009-07-17 05:08:08 +0000 |
commit | 867eb5feb3d8aaa92cdd647018a4e3ea49bec975 (patch) | |
tree | f0880b115467bcdf33d428752bc6077dd10f9a80 /apps/plugins | |
parent | 9660a8589cbe9e1a5e5fc8e6b6d94f2c83ac63a2 (diff) |
Jewels: Simplify support for new target screen sizes. Just adding new bitmaps for the target should now be enough.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21915 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/jewels.c | 79 |
1 files changed, 11 insertions, 68 deletions
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index 6c436cfb24..e3dfcc3866 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c @@ -25,6 +25,7 @@ #include "lib/display_text.h" #include "lib/highscore.h" #include "lib/playback_control.h" +#include "pluginbitmaps/jewels.h" #ifdef HAVE_LCD_BITMAP @@ -272,81 +273,23 @@ CONFIG_KEYPAD == MROBE500_PAD #endif #endif -/* use 30x30 tiles (iPod Video, Gigabeat, Onda VX747) */ -#if (LCD_HEIGHT == 240) && (LCD_WIDTH == 320) || \ - ((LCD_HEIGHT == 320) && (LCD_WIDTH == 240)) || \ - ((LCD_HEIGHT == 400) && (LCD_WIDTH == 240)) -#define TILE_WIDTH 30 -#define TILE_HEIGHT 30 -#define YOFS 0 -#define NUM_SCORES 10 - -/* use 22x22 tiles (H300, iPod Color) */ -#elif ((LCD_HEIGHT == 176) && (LCD_WIDTH == 220)) || \ - ((LCD_HEIGHT == 220) && (LCD_WIDTH == 176)) -#define TILE_WIDTH 22 -#define TILE_HEIGHT 22 -#define YOFS 0 -#define NUM_SCORES 5 - -/* use 16x16 tiles (iPod Nano) */ -#elif (LCD_HEIGHT == 132) && (LCD_WIDTH == 176) -#define TILE_WIDTH 16 -#define TILE_HEIGHT 16 -#define YOFS 4 -#define NUM_SCORES 5 - -/* use 16x16 tiles (H100, iAudio X5, iPod 3G, iPod 4G grayscale) */ -#elif (LCD_HEIGHT == 128) && (LCD_WIDTH == 160) -#define TILE_WIDTH 16 -#define TILE_HEIGHT 16 -#define YOFS 0 -#define NUM_SCORES 5 - -/* use 14x14 tiles (H10 5/6 GB) */ -#elif (LCD_HEIGHT == 128) && (LCD_WIDTH == 128) -#define TILE_WIDTH 14 -#define TILE_HEIGHT 14 -#define YOFS 0 -#define NUM_SCORES 5 - -/* use 13x13 tiles (iPod Mini) */ -#elif (LCD_HEIGHT == 110) && (LCD_WIDTH == 138) -#define TILE_WIDTH 13 -#define TILE_HEIGHT 13 -#define YOFS 6 -#define NUM_SCORES 5 - -/* use 12x12 tiles (iAudio M3) */ -#elif (LCD_HEIGHT == 96) && (LCD_WIDTH == 128) -#define TILE_WIDTH 12 -#define TILE_HEIGHT 12 -#define YOFS 0 -#define NUM_SCORES 5 - -/* use 10x10 tiles (Sansa c200) */ -#elif (LCD_HEIGHT == 80) && (LCD_WIDTH == 132) -#define TILE_WIDTH 10 -#define TILE_HEIGHT 10 -#define YOFS 0 -#define NUM_SCORES 5 - /* use 10x8 tiles (iFP 700) */ -#elif (LCD_HEIGHT == 64) && (LCD_WIDTH == 128) -#define TILE_WIDTH 10 -#define TILE_HEIGHT 8 -#define YOFS 0 +#if (LCD_HEIGHT == 64) && (LCD_WIDTH == 128) #define NUM_SCORES 5 /* use 10x8 tiles (Recorder, Ondio) */ #elif (LCD_HEIGHT == 64) && (LCD_WIDTH == 112) -#define TILE_WIDTH 10 -#define TILE_HEIGHT 8 -#define YOFS 0 #define NUM_SCORES 5 +#endif -#else - #error JEWELS: Unsupported LCD +#define TILE_WIDTH BMPWIDTH_jewels +#define TILE_HEIGHT (BMPHEIGHT_jewels/23) + +/* This calculation assumes integer division w/ LCD_HEIGHT/TILE_HEIGHT */ +#define YOFS LCD_HEIGHT-((LCD_HEIGHT/TILE_HEIGHT)*TILE_HEIGHT) + +#if !defined(NUM_SCORES) +#define NUM_SCORES LCD_HEIGHT/10 #endif /* swap directions */ |