summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-07-23 04:33:10 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-07-23 04:33:10 +0000
commit8902404318ca02b68b6851892515ba417169fa6c (patch)
tree31b8ff08fa5b47fbe3691a5e7fe6de3ff5531bf5
parent1fde0dd8e4524a60e72419bcb732e8a96d94c3e5 (diff)
downloadrockbox-8902404318ca02b68b6851892515ba417169fa6c.tar.gz
rockbox-8902404318ca02b68b6851892515ba417169fa6c.tar.bz2
rockbox-8902404318ca02b68b6851892515ba417169fa6c.zip
Superdom: Add support for 640x480 and 480x640 screens, simplify screen defines.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22009 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/bitmaps/native/superdom_boarditems.480x640x16.bmpbin0 -> 11718 bytes
-rw-r--r--apps/plugins/bitmaps/native/superdom_boarditems.640x480x16.bmpbin0 -> 14454 bytes
-rw-r--r--apps/plugins/superdom.c50
3 files changed, 17 insertions, 33 deletions
diff --git a/apps/plugins/bitmaps/native/superdom_boarditems.480x640x16.bmp b/apps/plugins/bitmaps/native/superdom_boarditems.480x640x16.bmp
new file mode 100644
index 0000000000..bc5175cbbd
--- /dev/null
+++ b/apps/plugins/bitmaps/native/superdom_boarditems.480x640x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/superdom_boarditems.640x480x16.bmp b/apps/plugins/bitmaps/native/superdom_boarditems.640x480x16.bmp
new file mode 100644
index 0000000000..1b4471c48a
--- /dev/null
+++ b/apps/plugins/bitmaps/native/superdom_boarditems.640x480x16.bmp
Binary files differ
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c
index 1a44bad518..3e1e23785a 100644
--- a/apps/plugins/superdom.c
+++ b/apps/plugins/superdom.c
@@ -21,6 +21,7 @@
#include "plugin.h"
#include "lib/playback_control.h"
#include "lib/display_text.h"
+#include "pluginbitmaps/superdom_boarditems.h"
PLUGIN_HEADER
extern const fb_data superdom_boarditems[];
@@ -47,40 +48,23 @@ char buf[255];
#endif
-#if LCD_WIDTH == 220 && LCD_HEIGHT == 176
-#define NUM_BOX_HEIGHT 25
-#define NUM_BOX_WIDTH 30
-#define STRIDE 14
-#define ICON_HEIGHT 7
-#define ICON_WIDTH 7
-
-#elif (LCD_WIDTH == 160 && LCD_HEIGHT == 128) || \
- (LCD_WIDTH == 176 && LCD_HEIGHT == 132) || \
- (LCD_WIDTH == 176 && LCD_HEIGHT == 220)
-#define NUM_BOX_HEIGHT 20
-#define NUM_BOX_WIDTH 24
-#define STRIDE 8
-#define ICON_HEIGHT 4
-#define ICON_WIDTH 4
-
-#elif (LCD_WIDTH == 320 && LCD_HEIGHT == 240)
-#define NUM_BOX_HEIGHT 25
-#define NUM_BOX_WIDTH 30
-#define STRIDE 20
-#define ICON_HEIGHT 10
-#define ICON_WIDTH 10
-
-#elif (LCD_WIDTH == 240 && (LCD_HEIGHT == 320 || LCD_HEIGHT == 400))
-#define NUM_BOX_HEIGHT 25
-#define NUM_BOX_WIDTH 30
-#define STRIDE 18
-#define ICON_HEIGHT 9
-#define ICON_WIDTH 9
+/* NUM_BOX HEIGHT and WIDTH are used for the number pad in the game. The height
+ * calculation includes spacing for the text placed above and below the number
+ * pad (it divides by 6 instead of just 4). The width calculation gives extra
+ * spacing on the sides of the pad too (divides by 5 instead of 3).
+ */
+#define NUM_BOX_HEIGHT (LCD_HEIGHT/6)
+#define NUM_BOX_WIDTH (LCD_WIDTH/5)
-#endif
+#define NUM_MARGIN_X (LCD_WIDTH-3*NUM_BOX_WIDTH)/2
+#define NUM_MARGIN_Y (LCD_HEIGHT-4*NUM_BOX_HEIGHT)/2
-#define NUM_MARGIN_X (LCD_WIDTH-3*NUM_BOX_WIDTH)/2
-#define NUM_MARGIN_Y (LCD_HEIGHT-4*NUM_BOX_HEIGHT)/2
+/* These parameters define the piece image dimensions, Stride is the total width
+ * of the bitmap.
+ */
+#define STRIDE BMPWIDTH_superdom_boarditems
+#define ICON_HEIGHT (BMPHEIGHT_superdom_boarditems/6)
+#define ICON_WIDTH (BMPWIDTH_superdom_boarditems/2)
#if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \
(CONFIG_KEYPAD == IPOD_1G2G_PAD)
@@ -155,7 +139,7 @@ char buf[255];
#define SUPERDOM_RIGHT BUTTON_RIGHT
#define SUPERDOM_CANCEL BUTTON_BACK
-#elif CONFIG_KEYPAD == ONDAVX747_PAD
+#elif (CONFIG_KEYPAD == ONDAVX747_PAD) || (CONFIG_KEYPAD == MROBE500_PAD)
#define SUPERDOM_CANCEL BUTTON_POWER
#endif