diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2010-10-02 14:43:23 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2010-10-02 14:43:23 +0000 |
commit | 09cb453f0b3181d5c8be054a1f577fc2bca3a70b (patch) | |
tree | d275b0cec84efe51d38fc15a6c8501207ff3245f /apps/plugins/resistor.c | |
parent | 23718ad646175d4cec9e584c18f5cddd4ec28c07 (diff) | |
download | rockbox-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
Diffstat (limited to 'apps/plugins/resistor.c')
-rw-r--r-- | apps/plugins/resistor.c | 55 |
1 files changed, 14 insertions, 41 deletions
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 | ||