summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2010-10-02 14:43:23 +0000
committerFrank Gevaerts <frank@gevaerts.be>2010-10-02 14:43:23 +0000
commit09cb453f0b3181d5c8be054a1f577fc2bca3a70b (patch)
treed275b0cec84efe51d38fc15a6c8501207ff3245f
parent23718ad646175d4cec9e584c18f5cddd4ec28c07 (diff)
downloadrockbox-09cb453f0b3181d5c8be054a1f577fc2bca3a70b.tar.gz
rockbox-09cb453f0b3181d5c8be054a1f577fc2bca3a70b.zip
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
-rw-r--r--apps/plugins/bitmaps/native/SOURCES6
-rw-r--r--apps/plugins/bitmaps/native/resistor.132x80x16.bmpbin7974 -> 0 bytes
-rw-r--r--apps/plugins/bitmaps/native/resistor.68x20x16.bmpbin0 -> 4134 bytes
-rw-r--r--apps/plugins/resistor.c55
4 files changed, 17 insertions, 44 deletions
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
897resistor.176x220x16.bmp 897resistor.176x220x16.bmp
898#elif (LCD_WIDTH >= 160) 898#elif (LCD_WIDTH >= 160)
899resistor.160x128x16.bmp 899resistor.160x128x16.bmp
900#elif (LCD_WIDTH >= 132) 900#elif (LCD_WIDTH >= 128) && (LCD_HEIGHT >= 96)
901resistor.132x80x16.bmp
902#elif (LCD_WIDTH >= 128)
903resistor.128x128x16.bmp 901resistor.128x128x16.bmp
902#else
903resistor.68x20x16.bmp
904#endif 904#endif
905 905
906#endif /* HAVE_LCD_BITMAP */ 906#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
--- a/apps/plugins/bitmaps/native/resistor.132x80x16.bmp
+++ /dev/null
Binary files 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
--- /dev/null
+++ b/apps/plugins/bitmaps/native/resistor.68x20x16.bmp
Binary files 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:
13/* Defining player-specific constants */ 13/* Defining player-specific constants */
14 14
15#if defined(HAVE_LCD_COLOR) 15#if defined(HAVE_LCD_COLOR)
16#define RESISTOR_BMP_X 0 16#define RESISTOR_BMP_X ((LCD_WIDTH - BMPWIDTH_resistor) / 2)
17/* The BMPs are now the exact width of the screen */
18 17
19#if LCD_WIDTH >= 320 && LCD_HEIGHT >= 240 /* iPod video or larger */ 18#if LCD_WIDTH >= 320 && LCD_HEIGHT >= 240 /* iPod video or larger */
20#define RESISTOR_BMP_Y 3 19#define RESISTOR_BMP_Y 3
@@ -37,7 +36,7 @@ TODO:
37#elif LCD_WIDTH >= 128 && LCD_HEIGHT >= 128 /* GoGear */ 36#elif LCD_WIDTH >= 128 && LCD_HEIGHT >= 128 /* GoGear */
38#define RESISTOR_BMP_Y 3 37#define RESISTOR_BMP_Y 3
39 38
40#elif LCD_WIDTH >= 132 && LCD_HEIGHT >= 80 /* c200 */ 39#else /* Small screens */
41#define RESISTOR_BMP_Y 0 40#define RESISTOR_BMP_Y 0
42/* And along with the tiny screen comes a whole bunch of exceptions */ 41/* And along with the tiny screen comes a whole bunch of exceptions */
43 42
@@ -74,21 +73,6 @@ TODO:
74 73
75#include "pluginbitmaps/resistor.h" 74#include "pluginbitmaps/resistor.h"
76 75
77#if LCD_WIDTH == 132 && LCD_HEIGHT == 80
78/* Proboably not the best solution */
79/* Special for the c200 */
80#define band_width 5
81#define band_height 16
82
83#define first_band_x 50
84#define second_band_x 60
85#define third_band_x 70
86#define fourth_band_x 80
87#define universal_y 2
88
89#else /* LCD_WIDTH == 132 && LCD_HEIGHT == 80 */
90/* Everything else */
91
92#define band_width (BMPWIDTH_resistor/15) 76#define band_width (BMPWIDTH_resistor/15)
93#define band_height (BMPHEIGHT_resistor*9/10) 77#define band_height (BMPHEIGHT_resistor*9/10)
94 78
@@ -98,39 +82,28 @@ TODO:
98#define fourth_band_x (3*BMPWIDTH_resistor/4 + RESISTOR_BMP_X - band_width/2) 82#define fourth_band_x (3*BMPWIDTH_resistor/4 + RESISTOR_BMP_X - band_width/2)
99#define universal_y (RESISTOR_BMP_Y+(BMPHEIGHT_resistor)/2 - band_height/2) 83#define universal_y (RESISTOR_BMP_Y+(BMPHEIGHT_resistor)/2 - band_height/2)
100 84
101#endif /* LCD_WIDTH == 132 && LCD_HEIGHT == 80 */ 85#if LCD_WIDTHT <= 128
102
103#if LCD_HEIGHT <= 128
104#define total_resistance_str_x 1 86#define total_resistance_str_x 1
105#define total_resistance_str_y (BMPHEIGHT_resistor + RESISTOR_BMP_Y + 3)
106
107#define tolerance_str_x 1 87#define tolerance_str_x 1
108#define tolerance_str_y total_resistance_str_y + 20
109#define resistance_val_x 1 88#define resistance_val_x 1
110#define resistance_val_y total_resistance_str_y + 20
111#define r_to_c_out_str_x 1 89#define r_to_c_out_str_x 1
112#define r_to_c_out_str_y total_resistance_str_y + 30 90#else /* LCD_WIDTHT <= 128 */
113 91#define total_resistance_str_x (LCD_WIDTH/14)
114#elif LCD_WIDTH == 132 && LCD_HEIGHT == 80 /* Special for the c200 */ 92#define tolerance_str_x (LCD_WIDTH/14)
115#define total_resistance_str_x 0 93#define resistance_val_x (LCD_WIDTH/14)
116#define total_resistance_str_y BMPHEIGHT_resistor + 1 94#define r_to_c_out_str_x (LCD_WIDTH/14)
95#endif
117 96
118#define tolerance_str_x 0
119#define tolerance_str_y total_resistance_str_y + 8
120#define resistance_val_x 0
121#define resistance_val_y tolerance_resistance_str_y + 8
122#define r_to_c_out_str_x 0
123#define r_to_c_out_str_y tolerance_resistance_str_y + 16
124 97
98#if LCD_HEIGHT <= 128
99#define total_resistance_str_y (BMPHEIGHT_resistor + RESISTOR_BMP_Y + 3)
100#define tolerance_str_y total_resistance_str_y + 20
101#define resistance_val_y total_resistance_str_y + 20
102#define r_to_c_out_str_y total_resistance_str_y + 30
125#else /* LCD_HEIGHT <= 128 */ 103#else /* LCD_HEIGHT <= 128 */
126#define total_resistance_str_x (LCD_WIDTH/14)
127#define total_resistance_str_y (2*RESISTOR_BMP_Y + BMPHEIGHT_resistor) 104#define total_resistance_str_y (2*RESISTOR_BMP_Y + BMPHEIGHT_resistor)
128
129#define tolerance_str_x (LCD_WIDTH/14)
130#define tolerance_str_y (total_resistance_str_y + 15) 105#define tolerance_str_y (total_resistance_str_y + 15)
131#define resistance_val_x (LCD_WIDTH/14)
132#define resistance_val_y (total_resistance_str_y + 15) 106#define resistance_val_y (total_resistance_str_y + 15)
133#define r_to_c_out_str_x (LCD_WIDTH/14)
134#define r_to_c_out_str_y (total_resistance_str_y + 25) 107#define r_to_c_out_str_y (total_resistance_str_y + 25)
135/* tolerance_str and resistance_val will never be shown at the same time */ 108/* tolerance_str and resistance_val will never be shown at the same time */
136 109