From 09cb453f0b3181d5c8be054a1f577fc2bca3a70b Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sat, 2 Oct 2010 14:43:23 +0000 Subject: Resistor plugin: crop the smallest bitmap so it's usable for any small screen and nut just the c200 make the layout a bit more flexible git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28193 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/bitmaps/native/SOURCES | 6 +-- apps/plugins/bitmaps/native/resistor.132x80x16.bmp | Bin 7974 -> 0 bytes apps/plugins/bitmaps/native/resistor.68x20x16.bmp | Bin 0 -> 4134 bytes apps/plugins/resistor.c | 55 ++++++--------------- 4 files changed, 17 insertions(+), 44 deletions(-) delete mode 100644 apps/plugins/bitmaps/native/resistor.132x80x16.bmp create mode 100644 apps/plugins/bitmaps/native/resistor.68x20x16.bmp diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 6b51cdb078..598f75975a 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES @@ -897,10 +897,10 @@ resistor.220x176x16.bmp resistor.176x220x16.bmp #elif (LCD_WIDTH >= 160) resistor.160x128x16.bmp -#elif (LCD_WIDTH >= 132) -resistor.132x80x16.bmp -#elif (LCD_WIDTH >= 128) +#elif (LCD_WIDTH >= 128) && (LCD_HEIGHT >= 96) resistor.128x128x16.bmp +#else +resistor.68x20x16.bmp #endif #endif /* HAVE_LCD_BITMAP */ diff --git a/apps/plugins/bitmaps/native/resistor.132x80x16.bmp b/apps/plugins/bitmaps/native/resistor.132x80x16.bmp deleted file mode 100644 index 1401e4f400..0000000000 Binary files a/apps/plugins/bitmaps/native/resistor.132x80x16.bmp and /dev/null differ diff --git a/apps/plugins/bitmaps/native/resistor.68x20x16.bmp b/apps/plugins/bitmaps/native/resistor.68x20x16.bmp new file mode 100644 index 0000000000..6d90cafa84 Binary files /dev/null and b/apps/plugins/bitmaps/native/resistor.68x20x16.bmp differ diff --git a/apps/plugins/resistor.c b/apps/plugins/resistor.c index 28e4ae85b8..e5e8bb3f5a 100644 --- a/apps/plugins/resistor.c +++ b/apps/plugins/resistor.c @@ -13,8 +13,7 @@ TODO: /* Defining player-specific constants */ #if defined(HAVE_LCD_COLOR) -#define RESISTOR_BMP_X 0 -/* The BMPs are now the exact width of the screen */ +#define RESISTOR_BMP_X ((LCD_WIDTH - BMPWIDTH_resistor) / 2) #if LCD_WIDTH >= 320 && LCD_HEIGHT >= 240 /* iPod video or larger */ #define RESISTOR_BMP_Y 3 @@ -37,7 +36,7 @@ TODO: #elif LCD_WIDTH >= 128 && LCD_HEIGHT >= 128 /* GoGear */ #define RESISTOR_BMP_Y 3 -#elif LCD_WIDTH >= 132 && LCD_HEIGHT >= 80 /* c200 */ +#else /* Small screens */ #define RESISTOR_BMP_Y 0 /* And along with the tiny screen comes a whole bunch of exceptions */ @@ -74,21 +73,6 @@ TODO: #include "pluginbitmaps/resistor.h" -#if LCD_WIDTH == 132 && LCD_HEIGHT == 80 -/* Proboably not the best solution */ -/* Special for the c200 */ -#define band_width 5 -#define band_height 16 - -#define first_band_x 50 -#define second_band_x 60 -#define third_band_x 70 -#define fourth_band_x 80 -#define universal_y 2 - -#else /* LCD_WIDTH == 132 && LCD_HEIGHT == 80 */ -/* Everything else */ - #define band_width (BMPWIDTH_resistor/15) #define band_height (BMPHEIGHT_resistor*9/10) @@ -98,39 +82,28 @@ TODO: #define fourth_band_x (3*BMPWIDTH_resistor/4 + RESISTOR_BMP_X - band_width/2) #define universal_y (RESISTOR_BMP_Y+(BMPHEIGHT_resistor)/2 - band_height/2) -#endif /* LCD_WIDTH == 132 && LCD_HEIGHT == 80 */ - -#if LCD_HEIGHT <= 128 +#if LCD_WIDTHT <= 128 #define total_resistance_str_x 1 -#define total_resistance_str_y (BMPHEIGHT_resistor + RESISTOR_BMP_Y + 3) - #define tolerance_str_x 1 -#define tolerance_str_y total_resistance_str_y + 20 #define resistance_val_x 1 -#define resistance_val_y total_resistance_str_y + 20 #define r_to_c_out_str_x 1 -#define r_to_c_out_str_y total_resistance_str_y + 30 - -#elif LCD_WIDTH == 132 && LCD_HEIGHT == 80 /* Special for the c200 */ -#define total_resistance_str_x 0 -#define total_resistance_str_y BMPHEIGHT_resistor + 1 +#else /* LCD_WIDTHT <= 128 */ +#define total_resistance_str_x (LCD_WIDTH/14) +#define tolerance_str_x (LCD_WIDTH/14) +#define resistance_val_x (LCD_WIDTH/14) +#define r_to_c_out_str_x (LCD_WIDTH/14) +#endif -#define tolerance_str_x 0 -#define tolerance_str_y total_resistance_str_y + 8 -#define resistance_val_x 0 -#define resistance_val_y tolerance_resistance_str_y + 8 -#define r_to_c_out_str_x 0 -#define r_to_c_out_str_y tolerance_resistance_str_y + 16 +#if LCD_HEIGHT <= 128 +#define total_resistance_str_y (BMPHEIGHT_resistor + RESISTOR_BMP_Y + 3) +#define tolerance_str_y total_resistance_str_y + 20 +#define resistance_val_y total_resistance_str_y + 20 +#define r_to_c_out_str_y total_resistance_str_y + 30 #else /* LCD_HEIGHT <= 128 */ -#define total_resistance_str_x (LCD_WIDTH/14) #define total_resistance_str_y (2*RESISTOR_BMP_Y + BMPHEIGHT_resistor) - -#define tolerance_str_x (LCD_WIDTH/14) #define tolerance_str_y (total_resistance_str_y + 15) -#define resistance_val_x (LCD_WIDTH/14) #define resistance_val_y (total_resistance_str_y + 15) -#define r_to_c_out_str_x (LCD_WIDTH/14) #define r_to_c_out_str_y (total_resistance_str_y + 25) /* tolerance_str and resistance_val will never be shown at the same time */ -- cgit v1.2.3