From 09cb453f0b3181d5c8be054a1f577fc2bca3a70b Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sat, 2 Oct 2010 14:43:23 +0000 Subject: [PATCH] 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 +- .../bitmaps/native/resistor.132x80x16.bmp | Bin 7974 -> 0 bytes .../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 1401e4f400cd458f7a4c5d35b7e1534de0e396ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7974 zcmc(k`&&|X9LL$uZF`=rOmpg%Sy?mFsd#Ckrfw<2!0-<9PAl2I+uRK6VCCw8b;EyS?__E3 zv~Gm--O^5thG1R1Y}~xeY#p`Ih8Ce4x9-~R=xsp=wK_!Gi$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fqnn9eD212 z#Osp}do(op9~4q1fm=?HS+fGY@QML=ijJ%nZGo%~N5WGnxQYX#e2J7eLIe-SgB12bGSl&U0?L0_9o)T%VGKYMDQp6bOQgl)y#2nmveQ;G F{{f~-NBIB% diff --git a/apps/plugins/bitmaps/native/resistor.68x20x16.bmp b/apps/plugins/bitmaps/native/resistor.68x20x16.bmp new file mode 100644 index 0000000000000000000000000000000000000000..6d90cafa84aece3d849e510a43bdd702e4bb1bd0 GIT binary patch literal 4134 zcmc(idsNbA7{}S)yRS@h+F530%}l1^rHPuld4;k}H1mRhctJr0FW{w-OVPB_rfF%~ zDu;@ADer{3Cbng27rW?=Hg90HwoD1=vOf4>G7yR;0U7R$0+0bE5Cc88_@nDl&dau-p8RN) zo&zx*m&^Cdsolq^-p8r&%dOpexXL5(1pF1?p~9VBpaouKsdEzxeKOCftZG0E3S4d- ztoi2##_wv!#9>#!@k>EPf&)bzfhXDme`*gZYTsYb4F9v6efEFE=g_%;V@)6fN+1S$ zAi2M=b(?$OyLxer<%Cs;h!uT=Ga`KXZ=q$q#PTcn)7}30jkx@JTpk~HgpbRELR%=~ z_z>-%-w;~bMLcr_U)Bp^pa+tm>cu?y;TO7Zx1(dU#s6qSMAcv<_XZHfy%Ej5L8%@h zpYIPY76cb{0wFLKcW4b|oSI@m_|JcU3`HddZjs!Z5miIMB?1F8TTL$}#>QXj=;*Ir zZRr^he!ic=yBk|Sn%FYI?iOeDhz|;97?;LK6@A2VkrG%CEmJNcl#4(hzHu}|I0H(D zy2VMY6V!%L3hy4QyzM?R$U_T;dU{d*I6M}M$6~@#@}hZnsf}aF0&(H3`DTes_*iyP zA}zlCB))z)rsifWPmW;#sxVY>@q2f8^G4&$}&6C;Jo_0P_%*qx2D&!C4vYy%b%eRSwhPc>_Q2JJQj(_B#~0dWYf)?*R5T7X^v7nGIC=>&arAK-t>@G38TXLvpHdBj09E3tN=ZZumnSZ8` zOBHeu8<4&z7?v{HXX2X1z9Xj_>gqxZ>kSMv2hLg(B>r>{y>&YC>Rhc@es4iB@mw|{ zRWwh}XLLSDX&D2Ut>bD~Z4XuyO^`Y_t^EOid=8ZUdM*d0##wn*|1)~qOvHr&BWo8; z3rh=ZdRbh{WU}z#;cIiJ?n^7jo|lbCbFckP4Z= zS}D7KE~V>HeCwoNF7IO<{iQ8v>g`@Z6yE*#mPtn2baKZGQy^h>is`Kr5!@ki)d2az zbrl23S_@oQOsu+2{$((sc^qUwDY;Y3XrBhjnEFv`KZ-{Fjp7qsLu~pPTGKeS;m_EH zk=TY&fWp5^Jo`IAd2Lbxh1PhTSa~&?Hw@=tmC^|4(Hh76a_iP?Fnyzir5`t;y@QJ{ zM{#dORo?`ntKpI~5M0_7bn@~dg2h5JvqHt|px_cAT(Ut%Z3TK^Wxeneu+)6n+G1}6 z+?Bz3fLPf_tPsIHj33->a(I3@JXi`}PPK0~*Ebu+6$K)=5T^{~)It$bA_N&?CHV9N z9B;M>j9*s%?a8k!9nl1q54*xYw`Nb~S+B(7p7eY#`cZdUHky=T6GXLLVIabunB+#y zf>6(dd{4$Pkiq3tgN#$e55{(GZ#%z##?H+LONhgSGhp0JpzX%T+JBGH<`c4=s~0wu X0?}9k4MU=1NeO5#->)rf-lhE?^!`x= literal 0 HcmV?d00001 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_WIDTHT <= 128 +#define total_resistance_str_x 1 +#define tolerance_str_x 1 +#define resistance_val_x 1 +#define r_to_c_out_str_x 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 + #if LCD_HEIGHT <= 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 - -#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 - #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 */