diff options
author | Marianne Arnold <pixelma@rockbox.org> | 2009-04-07 17:56:16 +0000 |
---|---|---|
committer | Marianne Arnold <pixelma@rockbox.org> | 2009-04-07 17:56:16 +0000 |
commit | 8b13d87ec3055559ea33ea2b40225ed0cfa00788 (patch) | |
tree | 42d4b87e503c8807542d8fb120522d88de4a5c34 | |
parent | 070ee525acdf22d445eb5f5f41371f5922b675ca (diff) | |
download | rockbox-8b13d87ec3055559ea33ea2b40225ed0cfa00788.tar.gz rockbox-8b13d87ec3055559ea33ea2b40225ed0cfa00788.zip |
Invadrox - some bitmap related changes in preparation of porting it to more screen resolutions, should not be visible to the user: (1) Use single bitmaps (or strips where possible) instead of one big bitmap each, so instructions and defines how to take the bitmap apart aren't needed. It's more flexible and makes it possible to (2) get some width/height variables directly from the bitmaps. (3) Use background images for static items. Both reduces the number of hardcoded values noticeably. (4) Make the 'fire_sprite' an external bitmap too - with help of Jens -. (5) Rename 'TINY_GRAPHICS' to 'SMALL_GRAPHICS' to have this name available for even smaller images (which is planned).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20646 a1c6a512-1295-4272-9138-f99709370657
38 files changed, 127 insertions, 196 deletions
diff --git a/apps/plugins/bitmaps/mono/SOURCES b/apps/plugins/bitmaps/mono/SOURCES index a109405bc9..63ac5adf74 100644 --- a/apps/plugins/bitmaps/mono/SOURCES +++ b/apps/plugins/bitmaps/mono/SOURCES | |||
@@ -37,6 +37,15 @@ flipit_cursor.16x13x1.bmp | |||
37 | #endif | 37 | #endif |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | /* Invadrox, not on monochrome targets yet */ | ||
41 | #if LCD_DEPTH > 1 | ||
42 | #if LCD_WIDTH >= 220 | ||
43 | invadrox_fire.8x8x1.bmp | ||
44 | #elif LCD_WIDTH >= 160 | ||
45 | invadrox_fire.6x6x1.bmp | ||
46 | #endif | ||
47 | #endif | ||
48 | |||
40 | #if CONFIG_CODEC == SWCODEC | 49 | #if CONFIG_CODEC == SWCODEC |
41 | /* MPEGplayer */ | 50 | /* MPEGplayer */ |
42 | mpegplayer_status_icons_8x8x1.bmp | 51 | mpegplayer_status_icons_8x8x1.bmp |
diff --git a/apps/plugins/bitmaps/mono/invadrox_fire.6x6x1.bmp b/apps/plugins/bitmaps/mono/invadrox_fire.6x6x1.bmp new file mode 100644 index 0000000000..8fac78d84e --- /dev/null +++ b/apps/plugins/bitmaps/mono/invadrox_fire.6x6x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/invadrox_fire.8x8x1.bmp b/apps/plugins/bitmaps/mono/invadrox_fire.8x8x1.bmp new file mode 100644 index 0000000000..76216bac9d --- /dev/null +++ b/apps/plugins/bitmaps/mono/invadrox_fire.8x8x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 357480afc6..92521d7e04 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES | |||
@@ -256,30 +256,51 @@ flipit_tokens.16x26x1.bmp | |||
256 | #endif | 256 | #endif |
257 | 257 | ||
258 | /* Invadrox */ | 258 | /* Invadrox */ |
259 | #if (LCD_WIDTH == 320) && (LCD_HEIGHT == 240) | 259 | #if defined HAVE_LCD_COLOR |
260 | invadrox.320x240x16.bmp | 260 | #if LCD_WIDTH >= 220 |
261 | invadrox_left.320x240x16.bmp | 261 | invadrox_aliens.24x24x16.bmp |
262 | invadrox_right.320x240x16.bmp | 262 | invadrox_alien_explode.13x7x16.bmp |
263 | #elif (LCD_WIDTH == 220) && (LCD_HEIGHT == 176) | 263 | invadrox_ships.16x24x16.bmp |
264 | /* Use iPod Video character bitmap */ | 264 | invadrox_bombs.9x42x16.bmp |
265 | invadrox.320x240x16.bmp | 265 | invadrox_shield.22x16x16.bmp |
266 | #elif (LCD_WIDTH == 240) && (LCD_HEIGHT == 320) | 266 | invadrox_ufo.16x7x16.bmp |
267 | /* Use iPod Video character bitmap */ | 267 | invadrox_ufo_explode.21x8x16.bmp |
268 | invadrox.320x240x16.bmp | 268 | invadrox_numbers.50x7x16.bmp |
269 | invadrox_logo.240x320x16.bmp | 269 | #if LCD_WIDTH == 320 |
270 | #elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 132) | 270 | invadrox_background.320x240x16.bmp |
271 | invadrox.176x132x16.bmp | 271 | #elif LCD_WIDTH == 240 |
272 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && (LCD_DEPTH >= 8) | 272 | invadrox_background.240x320x16.bmp |
273 | /* Use iPod Nano character bitmap */ | 273 | #elif LCD_WIDTH == 220 |
274 | invadrox.176x132x16.bmp | 274 | invadrox_background.220x176x16.bmp |
275 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && (LCD_DEPTH == 2) | ||
276 | /* Grayscale */ | ||
277 | invadrox.160x128x2.bmp | ||
278 | #elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 220) | ||
279 | /* Use iPod Nano character bitmap */ | ||
280 | invadrox.176x132x16.bmp | ||
281 | invadrox_logo.176x220x16.bmp | ||
282 | #endif | 275 | #endif |
276 | #elif LCD_WIDTH >= 160 | ||
277 | invadrox_aliens.16x15x16.bmp | ||
278 | invadrox_alien_explode.10x5x16.bmp | ||
279 | invadrox_ships.10x15x16.bmp | ||
280 | invadrox_bombs.9x30x16.bmp | ||
281 | invadrox_shield.15x10x16.bmp | ||
282 | invadrox_ufo.11x5x16.bmp | ||
283 | invadrox_ufo_explode.14x5x16.bmp | ||
284 | invadrox_numbers.40x5x16.bmp | ||
285 | #if LCD_WIDTH == 176 && LCD_HEIGHT == 220 | ||
286 | invadrox_background.176x220x16.bmp | ||
287 | #elif LCD_WIDTH == 176 && LCD_HEIGHT == 132 | ||
288 | invadrox_background.176x132x16.bmp | ||
289 | #elif LCD_WIDTH == 160 && LCD_HEIGHT == 128 | ||
290 | invadrox_background.160x128x16.bmp | ||
291 | #endif | ||
292 | #endif /* LCD_WIDTH */ | ||
293 | #elif LCD_DEPTH == 2 /* Greyscale */ | ||
294 | invadrox_aliens.16x15x16.bmp | ||
295 | invadrox_alien_explode.10x5x16.bmp | ||
296 | invadrox_ships.10x15x2.bmp | ||
297 | invadrox_bombs.9x30x16.bmp | ||
298 | invadrox_shield.15x10x2.bmp | ||
299 | invadrox_ufo.11x5x2.bmp | ||
300 | invadrox_ufo_explode.14x5x2.bmp | ||
301 | invadrox_numbers.40x5x16.bmp | ||
302 | invadrox_background.160x128x16.bmp | ||
303 | #endif /* colour depth */ | ||
283 | 304 | ||
284 | /* Jewels */ | 305 | /* Jewels */ |
285 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | 306 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) |
diff --git a/apps/plugins/bitmaps/native/invadrox.160x128x2.bmp b/apps/plugins/bitmaps/native/invadrox.160x128x2.bmp deleted file mode 100644 index 4834c39c16..0000000000 --- a/apps/plugins/bitmaps/native/invadrox.160x128x2.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox.176x132x16.bmp b/apps/plugins/bitmaps/native/invadrox.176x132x16.bmp deleted file mode 100644 index 1c9631baa4..0000000000 --- a/apps/plugins/bitmaps/native/invadrox.176x132x16.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox.320x240x16.bmp b/apps/plugins/bitmaps/native/invadrox.320x240x16.bmp deleted file mode 100644 index 73fd916878..0000000000 --- a/apps/plugins/bitmaps/native/invadrox.320x240x16.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_alien_explode.10x5x16.bmp b/apps/plugins/bitmaps/native/invadrox_alien_explode.10x5x16.bmp new file mode 100644 index 0000000000..74d984ff55 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_alien_explode.10x5x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_alien_explode.13x7x16.bmp b/apps/plugins/bitmaps/native/invadrox_alien_explode.13x7x16.bmp new file mode 100644 index 0000000000..36beffb682 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_alien_explode.13x7x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_aliens.16x15x16.bmp b/apps/plugins/bitmaps/native/invadrox_aliens.16x15x16.bmp new file mode 100644 index 0000000000..3d335be642 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_aliens.16x15x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_aliens.24x24x16.bmp b/apps/plugins/bitmaps/native/invadrox_aliens.24x24x16.bmp new file mode 100644 index 0000000000..d4232c033f --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_aliens.24x24x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_background.160x128x16.bmp b/apps/plugins/bitmaps/native/invadrox_background.160x128x16.bmp new file mode 100644 index 0000000000..24833bdce1 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_background.160x128x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_background.176x132x16.bmp b/apps/plugins/bitmaps/native/invadrox_background.176x132x16.bmp new file mode 100644 index 0000000000..4a61deb37d --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_background.176x132x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_background.176x220x16.bmp b/apps/plugins/bitmaps/native/invadrox_background.176x220x16.bmp new file mode 100644 index 0000000000..3edeeef463 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_background.176x220x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_background.220x176x16.bmp b/apps/plugins/bitmaps/native/invadrox_background.220x176x16.bmp new file mode 100644 index 0000000000..d9a9b6965d --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_background.220x176x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_background.240x320x16.bmp b/apps/plugins/bitmaps/native/invadrox_background.240x320x16.bmp new file mode 100644 index 0000000000..6a6c2418e7 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_background.240x320x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_background.320x240x16.bmp b/apps/plugins/bitmaps/native/invadrox_background.320x240x16.bmp new file mode 100644 index 0000000000..0bc47ea035 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_background.320x240x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_bombs.9x30x16.bmp b/apps/plugins/bitmaps/native/invadrox_bombs.9x30x16.bmp new file mode 100644 index 0000000000..4cb561e561 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_bombs.9x30x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_bombs.9x42x16.bmp b/apps/plugins/bitmaps/native/invadrox_bombs.9x42x16.bmp new file mode 100644 index 0000000000..8eeb565ee2 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_bombs.9x42x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_left.320x240x16.bmp b/apps/plugins/bitmaps/native/invadrox_left.320x240x16.bmp deleted file mode 100644 index 8111e4762c..0000000000 --- a/apps/plugins/bitmaps/native/invadrox_left.320x240x16.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_logo.176x220x16.bmp b/apps/plugins/bitmaps/native/invadrox_logo.176x220x16.bmp deleted file mode 100644 index 687102ad7a..0000000000 --- a/apps/plugins/bitmaps/native/invadrox_logo.176x220x16.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_logo.240x320x16.bmp b/apps/plugins/bitmaps/native/invadrox_logo.240x320x16.bmp deleted file mode 100644 index 72b0534056..0000000000 --- a/apps/plugins/bitmaps/native/invadrox_logo.240x320x16.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_numbers.40x5x16.bmp b/apps/plugins/bitmaps/native/invadrox_numbers.40x5x16.bmp new file mode 100644 index 0000000000..47ec462136 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_numbers.40x5x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_numbers.50x7x16.bmp b/apps/plugins/bitmaps/native/invadrox_numbers.50x7x16.bmp new file mode 100644 index 0000000000..5245f60e37 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_numbers.50x7x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_right.320x240x16.bmp b/apps/plugins/bitmaps/native/invadrox_right.320x240x16.bmp deleted file mode 100644 index ceb21053ed..0000000000 --- a/apps/plugins/bitmaps/native/invadrox_right.320x240x16.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_shield.15x10x16.bmp b/apps/plugins/bitmaps/native/invadrox_shield.15x10x16.bmp new file mode 100644 index 0000000000..03d93db849 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_shield.15x10x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_shield.15x10x2.bmp b/apps/plugins/bitmaps/native/invadrox_shield.15x10x2.bmp new file mode 100644 index 0000000000..9ca3ed70c9 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_shield.15x10x2.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_shield.22x16x16.bmp b/apps/plugins/bitmaps/native/invadrox_shield.22x16x16.bmp new file mode 100644 index 0000000000..6ea8d4083e --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_shield.22x16x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_ships.10x15x16.bmp b/apps/plugins/bitmaps/native/invadrox_ships.10x15x16.bmp new file mode 100644 index 0000000000..5e8cb62ba7 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_ships.10x15x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_ships.10x15x2.bmp b/apps/plugins/bitmaps/native/invadrox_ships.10x15x2.bmp new file mode 100644 index 0000000000..c17313d472 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_ships.10x15x2.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_ships.16x24x16.bmp b/apps/plugins/bitmaps/native/invadrox_ships.16x24x16.bmp new file mode 100644 index 0000000000..54cd36a98b --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_ships.16x24x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_ufo.11x5x16.bmp b/apps/plugins/bitmaps/native/invadrox_ufo.11x5x16.bmp new file mode 100644 index 0000000000..aa94c5842e --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_ufo.11x5x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_ufo.11x5x2.bmp b/apps/plugins/bitmaps/native/invadrox_ufo.11x5x2.bmp new file mode 100644 index 0000000000..a1561db66d --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_ufo.11x5x2.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_ufo.16x7x16.bmp b/apps/plugins/bitmaps/native/invadrox_ufo.16x7x16.bmp new file mode 100644 index 0000000000..2ec749a6b5 --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_ufo.16x7x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_ufo_explode.14x5x16.bmp b/apps/plugins/bitmaps/native/invadrox_ufo_explode.14x5x16.bmp new file mode 100644 index 0000000000..ef048fb85b --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_ufo_explode.14x5x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_ufo_explode.14x5x2.bmp b/apps/plugins/bitmaps/native/invadrox_ufo_explode.14x5x2.bmp new file mode 100644 index 0000000000..4a81a79f3d --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_ufo_explode.14x5x2.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/invadrox_ufo_explode.21x8x16.bmp b/apps/plugins/bitmaps/native/invadrox_ufo_explode.21x8x16.bmp new file mode 100644 index 0000000000..1f68fb329f --- /dev/null +++ b/apps/plugins/bitmaps/native/invadrox_ufo_explode.21x8x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c index 718cb032cc..0d9473ffb7 100644 --- a/apps/plugins/invadrox.c +++ b/apps/plugins/invadrox.c | |||
@@ -166,7 +166,7 @@ PLUGIN_HEADER | |||
166 | #define UFO_Y (SCORENUM_Y + FONT_HEIGHT + ALIEN_HEIGHT) | 166 | #define UFO_Y (SCORENUM_Y + FONT_HEIGHT + ALIEN_HEIGHT) |
167 | #define PLAYFIELD_Y (LCD_HEIGHT - SHIP_HEIGHT - 2) | 167 | #define PLAYFIELD_Y (LCD_HEIGHT - SHIP_HEIGHT - 2) |
168 | #define PLAYFIELD_WIDTH (LCD_WIDTH - 2 * PLAYFIELD_X) | 168 | #define PLAYFIELD_WIDTH (LCD_WIDTH - 2 * PLAYFIELD_X) |
169 | #define LEVEL_X (LCD_WIDTH - PLAYFIELD_X - LIVES_X - LEVEL_WIDTH - 2 * NUMBERS_WIDTH - 3 * NUM_SPACING) | 169 | #define LEVEL_X (LCD_WIDTH - PLAYFIELD_X - LIVES_X - 2 * NUMBERS_WIDTH - 3 * NUM_SPACING) |
170 | #define SHIP_MIN_X (PLAYFIELD_X + PLAYFIELD_WIDTH / 5 - SHIELD_WIDTH / 2 - SHIP_WIDTH) | 170 | #define SHIP_MIN_X (PLAYFIELD_X + PLAYFIELD_WIDTH / 5 - SHIELD_WIDTH / 2 - SHIP_WIDTH) |
171 | #define SHIP_MAX_X (PLAYFIELD_X + 4 * PLAYFIELD_WIDTH / 5 + SHIELD_WIDTH / 2) | 171 | #define SHIP_MAX_X (PLAYFIELD_X + 4 * PLAYFIELD_WIDTH / 5 + SHIELD_WIDTH / 2) |
172 | /* SCORE_Y = 0 for most targets. Gigabeat redefines it later. */ | 172 | /* SCORE_Y = 0 for most targets. Gigabeat redefines it later. */ |
@@ -211,7 +211,6 @@ PLUGIN_HEADER | |||
211 | #define ALIEN_START_Y (UFO_Y + 3 * ALIEN_HEIGHT) | 211 | #define ALIEN_START_Y (UFO_Y + 3 * ALIEN_HEIGHT) |
212 | #define SCORENUM_X (PLAYFIELD_X + NUMBERS_WIDTH) | 212 | #define SCORENUM_X (PLAYFIELD_X + NUMBERS_WIDTH) |
213 | #define SCORENUM_Y SCORE_Y + (2 * (FONT_HEIGHT + 1) + 1) | 213 | #define SCORENUM_Y SCORE_Y + (2 * (FONT_HEIGHT + 1) + 1) |
214 | #define HISCORE_X (LCD_WIDTH - PLAYFIELD_X - HISCORE_WIDTH) | ||
215 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING) | 214 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING) |
216 | #define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT) | 215 | #define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT) |
217 | #define LIVES_X 10 | 216 | #define LIVES_X 10 |
@@ -248,7 +247,7 @@ PLUGIN_HEADER | |||
248 | * Lives and Level goes inside bottom border | 247 | * Lives and Level goes inside bottom border |
249 | */ | 248 | */ |
250 | 249 | ||
251 | #define TINY_GRAPHICS | 250 | #define SMALL_GRAPHICS |
252 | #define PLAYFIELD_X 0 | 251 | #define PLAYFIELD_X 0 |
253 | #define SHIP_Y (PLAYFIELD_Y - 2 * SHIP_HEIGHT) | 252 | #define SHIP_Y (PLAYFIELD_Y - 2 * SHIP_HEIGHT) |
254 | #define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT) | 253 | #define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT) |
@@ -258,7 +257,6 @@ PLUGIN_HEADER | |||
258 | #define SCORE_Y 70 | 257 | #define SCORE_Y 70 |
259 | #define SCORENUM_X (PLAYFIELD_X + NUMBERS_WIDTH) | 258 | #define SCORENUM_X (PLAYFIELD_X + NUMBERS_WIDTH) |
260 | #define SCORENUM_Y (SCORE_Y + 2 * FONT_HEIGHT) | 259 | #define SCORENUM_Y (SCORE_Y + 2 * FONT_HEIGHT) |
261 | #define HISCORE_X (LCD_WIDTH - PLAYFIELD_X - HISCORE_WIDTH) | ||
262 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING) | 260 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING) |
263 | #define LIVES_X 8 | 261 | #define LIVES_X 8 |
264 | #define MAX_X 75 | 262 | #define MAX_X 75 |
@@ -306,14 +304,13 @@ PLUGIN_HEADER | |||
306 | * Lives and Level goes inside bottom border | 304 | * Lives and Level goes inside bottom border |
307 | */ | 305 | */ |
308 | 306 | ||
309 | #define TINY_GRAPHICS | 307 | #define SMALL_GRAPHICS |
310 | #define PLAYFIELD_X 0 | 308 | #define PLAYFIELD_X 0 |
311 | #define SHIP_Y (PLAYFIELD_Y - 2 * SHIP_HEIGHT) | 309 | #define SHIP_Y (PLAYFIELD_Y - 2 * SHIP_HEIGHT) |
312 | #define ALIEN_START_Y (UFO_Y + 12) | 310 | #define ALIEN_START_Y (UFO_Y + 12) |
313 | #define SCORENUM_X (PLAYFIELD_X + SCORE_WIDTH + NUMBERS_WIDTH + NUM_SPACING) | 311 | #define SCORENUM_X (PLAYFIELD_X + 6 * NUMBERS_WIDTH + 5 * NUM_SPACING) |
314 | #define SCORENUM_Y SCORE_Y | 312 | #define SCORENUM_Y SCORE_Y |
315 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING) | 313 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING) |
316 | #define HISCORE_X (HISCORENUM_X - NUMBERS_WIDTH - NUM_SPACING - HISCORE_WIDTH) | ||
317 | #define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT) | 314 | #define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT) |
318 | #define LIVES_X 8 | 315 | #define LIVES_X 8 |
319 | #define MAX_X 75 | 316 | #define MAX_X 75 |
@@ -321,8 +318,8 @@ PLUGIN_HEADER | |||
321 | 318 | ||
322 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) | 319 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) |
323 | 320 | ||
324 | /* iAudio X5, iRiver H10 20Gb, iPod 3g/4g: 160x128x16 | 321 | /* iAudio X5, iRiver H10 20Gb, iPod 3g/4g, H100, M5: 160x128 |
325 | * ====================================== | 322 | * ========================================================= |
326 | * X: No padding. No border -> 160p playfield. | 323 | * X: No padding. No border -> 160p playfield. |
327 | * | 324 | * |
328 | * LIVES_X 0 | 325 | * LIVES_X 0 |
@@ -360,14 +357,13 @@ PLUGIN_HEADER | |||
360 | * Lives and Level goes inside bottom border | 357 | * Lives and Level goes inside bottom border |
361 | */ | 358 | */ |
362 | 359 | ||
363 | #define TINY_GRAPHICS | 360 | #define SMALL_GRAPHICS |
364 | #define PLAYFIELD_X 0 | 361 | #define PLAYFIELD_X 0 |
365 | #define SHIP_Y (PLAYFIELD_Y - 2 * SHIP_HEIGHT) | 362 | #define SHIP_Y (PLAYFIELD_Y - 2 * SHIP_HEIGHT) |
366 | #define ALIEN_START_Y (UFO_Y + 10) | 363 | #define ALIEN_START_Y (UFO_Y + 10) |
367 | #define SCORENUM_X (PLAYFIELD_X + SCORE_WIDTH + NUMBERS_WIDTH + NUM_SPACING) | 364 | #define SCORENUM_X (PLAYFIELD_X + 6 * NUMBERS_WIDTH + 5 * NUM_SPACING) |
368 | #define SCORENUM_Y SCORE_Y | 365 | #define SCORENUM_Y SCORE_Y |
369 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING) | 366 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING) |
370 | #define HISCORE_X (HISCORENUM_X - NUMBERS_WIDTH - NUM_SPACING - HISCORE_WIDTH) | ||
371 | #define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT) | 367 | #define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT) |
372 | #define LIVES_X 0 | 368 | #define LIVES_X 0 |
373 | #define MAX_X 75 | 369 | #define MAX_X 75 |
@@ -410,7 +406,6 @@ PLUGIN_HEADER | |||
410 | #define SCORE_Y 80 | 406 | #define SCORE_Y 80 |
411 | #define SCORENUM_X (PLAYFIELD_X + NUMBERS_WIDTH) | 407 | #define SCORENUM_X (PLAYFIELD_X + NUMBERS_WIDTH) |
412 | #define SCORENUM_Y SCORE_Y + (2 * (FONT_HEIGHT + 1) + 1) | 408 | #define SCORENUM_Y SCORE_Y + (2 * (FONT_HEIGHT + 1) + 1) |
413 | #define HISCORE_X (LCD_WIDTH - PLAYFIELD_X - HISCORE_WIDTH) | ||
414 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING) | 409 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING) |
415 | #define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT) | 410 | #define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT) |
416 | #define LIVES_X 10 | 411 | #define LIVES_X 10 |
@@ -447,125 +442,72 @@ PLUGIN_HEADER | |||
447 | #define SHIP_Y (PLAYFIELD_Y - 2 * SHIP_HEIGHT) | 442 | #define SHIP_Y (PLAYFIELD_Y - 2 * SHIP_HEIGHT) |
448 | #define ALIEN_START_Y (UFO_Y + 10) | 443 | #define ALIEN_START_Y (UFO_Y + 10) |
449 | #define SCORENUM_Y SCORE_Y | 444 | #define SCORENUM_Y SCORE_Y |
450 | #define SCORENUM_X (PLAYFIELD_X + SCORE_WIDTH + NUMBERS_WIDTH + NUM_SPACING) | 445 | #define SCORENUM_X (PLAYFIELD_X + 6 * NUMBERS_WIDTH + 6 * NUM_SPACING) |
451 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING) | 446 | #define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING) |
452 | #define HISCORE_X (HISCORENUM_X - NUMBERS_WIDTH - NUM_SPACING - HISCORE_WIDTH) | ||
453 | #define SHIELD_Y (PLAYFIELD_Y - 5 * SHIP_HEIGHT) | 447 | #define SHIELD_Y (PLAYFIELD_Y - 5 * SHIP_HEIGHT) |
454 | #define LIVES_X 8 | 448 | #define LIVES_X 8 |
455 | #define MAX_X 95 | 449 | #define MAX_X 95 |
456 | #define MAX_Y 15 | 450 | #define MAX_Y 15 |
457 | 451 | ||
452 | |||
458 | #else | 453 | #else |
459 | #error INVADROX: Unsupported LCD type | 454 | #error INVADROX: Unsupported LCD type |
460 | #endif | 455 | #endif |
461 | 456 | ||
457 | /* bitmaps */ | ||
458 | #include "pluginbitmaps/invadrox_background.h" | ||
459 | |||
460 | /* get dimensions for later use from the bitmaps */ | ||
461 | #include "pluginbitmaps/invadrox_aliens.h" | ||
462 | #include "pluginbitmaps/invadrox_ships.h" | ||
463 | #include "pluginbitmaps/invadrox_bombs.h" | ||
464 | #include "pluginbitmaps/invadrox_alien_explode.h" | ||
465 | #include "pluginbitmaps/invadrox_shield.h" | ||
466 | #include "pluginbitmaps/invadrox_ufo.h" | ||
467 | #include "pluginbitmaps/invadrox_ufo_explode.h" | ||
468 | #include "pluginbitmaps/invadrox_numbers.h" | ||
469 | #include "pluginbitmaps/invadrox_fire.h" | ||
470 | #define ALIEN_WIDTH (BMPWIDTH_invadrox_aliens/2) | ||
471 | #define ALIEN_HEIGHT (BMPHEIGHT_invadrox_aliens/3) | ||
472 | #define SHIP_WIDTH BMPWIDTH_invadrox_ships | ||
473 | #define SHIP_HEIGHT (BMPHEIGHT_invadrox_ships/3) | ||
474 | #define BOMB_WIDTH (BMPWIDTH_invadrox_bombs/3) | ||
475 | #define BOMB_HEIGHT (BMPHEIGHT_invadrox_bombs/6) | ||
476 | #define ALIEN_EXPLODE_WIDTH BMPWIDTH_invadrox_alien_explode | ||
477 | #define ALIEN_EXPLODE_HEIGHT BMPHEIGHT_invadrox_alien_explode | ||
478 | #define SHIELD_WIDTH BMPWIDTH_invadrox_shield | ||
479 | #define SHIELD_HEIGHT BMPHEIGHT_invadrox_shield | ||
480 | #define UFO_WIDTH BMPWIDTH_invadrox_ufo | ||
481 | #define UFO_HEIGHT BMPHEIGHT_invadrox_ufo | ||
482 | #define UFO_EXPLODE_WIDTH BMPWIDTH_invadrox_ufo_explode | ||
483 | #define UFO_EXPLODE_HEIGHT BMPHEIGHT_invadrox_ufo_explode | ||
484 | #define NUMBERS_WIDTH (BMPWIDTH_invadrox_numbers/10) | ||
485 | #define FONT_HEIGHT BMPHEIGHT_invadrox_numbers | ||
486 | #define FIRE_WIDTH BMPWIDTH_invadrox_fire | ||
487 | #define FIRE_HEIGHT BMPHEIGHT_invadrox_fire | ||
462 | 488 | ||
463 | /* Defines common to each "graphic type" */ | 489 | /* Defines common to each "graphic type" */ |
464 | #ifdef ARCADISH_GRAPHICS | 490 | #ifdef ARCADISH_GRAPHICS |
465 | 491 | ||
466 | #define STRIDE 71 | ||
467 | #define SHIP_SRC_X 24 | ||
468 | #define SHIP_WIDTH 16 | ||
469 | #define SHIP_HEIGHT 8 | ||
470 | #define SHOT_HEIGHT 5 | 492 | #define SHOT_HEIGHT 5 |
471 | #define ALIEN_WIDTH 12 | ||
472 | #define ALIEN_EXPLODE_SRC_X 52 | ||
473 | #define ALIEN_EXPLODE_SRC_Y 39 | ||
474 | #define ALIEN_EXPLODE_WIDTH 13 | ||
475 | #define ALIEN_EXPLODE_HEIGHT 7 | ||
476 | #define ALIEN_HEIGHT 8 | ||
477 | #define ALIEN_SPACING 4 | 493 | #define ALIEN_SPACING 4 |
478 | #define ALIEN_SPEED 2 | 494 | #define ALIEN_SPEED 2 |
479 | #define UFO_SRC_X 40 | ||
480 | #define UFO_WIDTH 16 | ||
481 | #define UFO_HEIGHT 7 | ||
482 | #define UFO_EXPLODE_WIDTH 21 | ||
483 | #define UFO_EXPLODE_HEIGHT 8 | ||
484 | #define UFO_SPEED 1 | 495 | #define UFO_SPEED 1 |
485 | #define FONT_HEIGHT 7 | ||
486 | #define LEVEL_SRC_Y 24 | ||
487 | #define LEVEL_WIDTH 37 | ||
488 | #define SCORE_SRC_X 24 | ||
489 | #define SCORE_SRC_Y 31 | ||
490 | #define SCORE_WIDTH 37 | ||
491 | #define HISCORE_WIDTH 61 | ||
492 | #define NUM_SPACING 3 | 496 | #define NUM_SPACING 3 |
493 | #define NUMBERS_SRC_Y 38 | ||
494 | #define NUMBERS_WIDTH 5 | ||
495 | #define SHIELD_SRC_X 40 | ||
496 | #define SHIELD_SRC_Y 15 | ||
497 | #define SHIELD_WIDTH 22 | ||
498 | #define SHIELD_HEIGHT 16 | ||
499 | #define FIRE_WIDTH 8 | ||
500 | #define FIRE_HEIGHT 8 | ||
501 | #define FIRE_SPEED 8 | 497 | #define FIRE_SPEED 8 |
502 | #define BOMB_SRC_X 62 | ||
503 | #define BOMB_WIDTH 3 | ||
504 | #define BOMB_HEIGHT 7 | ||
505 | #define BOMB_SPEED 3 | 498 | #define BOMB_SPEED 3 |
506 | #define ALIENS 11 | 499 | #define ALIENS 11 |
507 | unsigned char fire_sprite[FIRE_HEIGHT] = { | ||
508 | (1 << 7) | (0 << 6) | (0 << 5) | (0 << 4) | (1 << 3) | (0 << 2) | (0 << 1) | 1, | ||
509 | (0 << 7) | (0 << 6) | (1 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (1 << 1) | 0, | ||
510 | (0 << 7) | (1 << 6) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | 0, | ||
511 | (1 << 7) | (1 << 6) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | 1, | ||
512 | (0 << 7) | (1 << 6) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | 1, | ||
513 | (0 << 7) | (1 << 6) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | 0, | ||
514 | (0 << 7) | (0 << 6) | (1 << 5) | (0 << 4) | (0 << 3) | (1 << 2) | (0 << 1) | 0, | ||
515 | (1 << 7) | (0 << 6) | (0 << 5) | (1 << 4) | (0 << 3) | (0 << 2) | (0 << 1) | 1 | ||
516 | }; | ||
517 | 500 | ||
518 | #elif defined TINY_GRAPHICS | 501 | #elif defined SMALL_GRAPHICS |
519 | 502 | ||
520 | #define STRIDE 53 | ||
521 | #define SHIP_SRC_X 16 | ||
522 | #define SHIP_WIDTH 10 | ||
523 | #define SHIP_HEIGHT 5 | ||
524 | #define SHOT_HEIGHT 4 | 503 | #define SHOT_HEIGHT 4 |
525 | #define ALIEN_WIDTH 8 | ||
526 | #define ALIEN_HEIGHT 5 | ||
527 | #define ALIEN_EXPLODE_SRC_X 40 | ||
528 | #define ALIEN_EXPLODE_SRC_Y 26 | ||
529 | #define ALIEN_EXPLODE_WIDTH 10 | ||
530 | #define ALIEN_EXPLODE_HEIGHT 5 | ||
531 | #define ALIEN_SPACING 3 | 504 | #define ALIEN_SPACING 3 |
532 | #define ALIEN_SPEED 2 | 505 | #define ALIEN_SPEED 2 |
533 | #define UFO_SRC_X 26 | ||
534 | #define UFO_WIDTH 11 | ||
535 | #define UFO_HEIGHT 5 | ||
536 | #define UFO_EXPLODE_WIDTH 14 | ||
537 | #define UFO_EXPLODE_HEIGHT 5 | ||
538 | #define UFO_SPEED 1 | 506 | #define UFO_SPEED 1 |
539 | #define FONT_HEIGHT 5 | ||
540 | #define LEVEL_SRC_Y 15 | ||
541 | #define LEVEL_WIDTH 29 | ||
542 | #define NUMBERS_WIDTH 4 | ||
543 | #define NUM_SPACING 2 | 507 | #define NUM_SPACING 2 |
544 | #define SCORE_SRC_X 17 | ||
545 | #define SCORE_SRC_Y 20 | ||
546 | #define SCORE_WIDTH 28 | ||
547 | #define HISCORE_WIDTH 45 | ||
548 | #define NUMBERS_SRC_Y 25 | ||
549 | #define SHIELD_SRC_X 29 | ||
550 | #define SHIELD_SRC_Y 10 | ||
551 | #define SHIELD_WIDTH 15 | ||
552 | #define SHIELD_HEIGHT 10 | ||
553 | #define FIRE_WIDTH 6 | ||
554 | #define FIRE_HEIGHT 6 | ||
555 | #define FIRE_SPEED 6 | 508 | #define FIRE_SPEED 6 |
556 | #define BOMB_SRC_X 44 | ||
557 | #define BOMB_WIDTH 3 | ||
558 | #define BOMB_HEIGHT 5 | ||
559 | #define BOMB_SPEED 2 | 509 | #define BOMB_SPEED 2 |
560 | #define ALIENS 11 | 510 | #define ALIENS 11 |
561 | unsigned char fire_sprite[FIRE_HEIGHT] = { | ||
562 | (1 << 5) | (0 << 4) | (0 << 3) | (1 << 2) | (0 << 1) | 1, | ||
563 | (0 << 5) | (1 << 4) | (0 << 3) | (0 << 2) | (0 << 1) | 0, | ||
564 | (0 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | 0, | ||
565 | (0 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | 1, | ||
566 | (0 << 5) | (1 << 4) | (0 << 3) | (0 << 2) | (1 << 1) | 0, | ||
567 | (1 << 5) | (0 << 4) | (1 << 3) | (0 << 2) | (0 << 1) | 1 | ||
568 | }; | ||
569 | 511 | ||
570 | #else | 512 | #else |
571 | #error Graphic type not defined | 513 | #error Graphic type not defined |
@@ -643,19 +585,6 @@ fb_data screen_green, screen_white; | |||
643 | /* For optimization, precalculate startoffset of each scanline */ | 585 | /* For optimization, precalculate startoffset of each scanline */ |
644 | unsigned int ytab[LCD_HEIGHT]; | 586 | unsigned int ytab[LCD_HEIGHT]; |
645 | 587 | ||
646 | /* external bitmaps */ | ||
647 | extern const fb_data invadrox[]; | ||
648 | #if (LCD_WIDTH == 320) && (LCD_HEIGHT == 240) | ||
649 | /* iPod Video only */ | ||
650 | extern const fb_data invadrox_left[]; | ||
651 | extern const fb_data invadrox_right[]; | ||
652 | #endif | ||
653 | #if ((LCD_WIDTH == 240) && (LCD_HEIGHT == 320)) || ((LCD_WIDTH == 176) && (LCD_HEIGHT == 220)) | ||
654 | /* Gigabeat F, Sansa e200 */ | ||
655 | extern const fb_data invadrox_logo[]; | ||
656 | #endif | ||
657 | |||
658 | |||
659 | int lives = 2; | 588 | int lives = 2; |
660 | int score = 0; | 589 | int score = 0; |
661 | int scores[3] = { 30, 20, 10 }; | 590 | int scores[3] = { 30, 20, 10 }; |
@@ -716,8 +645,9 @@ void draw_number(int x, int y, int num, int digits) | |||
716 | for (i = digits - 1; i >= 0; i--) { | 645 | for (i = digits - 1; i >= 0; i--) { |
717 | d = num % 10; | 646 | d = num % 10; |
718 | num = num / 10; | 647 | num = num / 10; |
719 | rb->lcd_bitmap_part(invadrox, d * NUMBERS_WIDTH, NUMBERS_SRC_Y, | 648 | rb->lcd_bitmap_part(invadrox_numbers, d * NUMBERS_WIDTH, 0, |
720 | STRIDE, x + i * (NUMBERS_WIDTH + NUM_SPACING), y, | 649 | BMPWIDTH_invadrox_numbers, |
650 | x + i * (NUMBERS_WIDTH + NUM_SPACING), y, | ||
721 | NUMBERS_WIDTH, FONT_HEIGHT); | 651 | NUMBERS_WIDTH, FONT_HEIGHT); |
722 | } | 652 | } |
723 | /* Update lcd */ | 653 | /* Update lcd */ |
@@ -737,10 +667,7 @@ inline void draw_score(void) | |||
737 | 667 | ||
738 | void draw_level(void) | 668 | void draw_level(void) |
739 | { | 669 | { |
740 | rb->lcd_bitmap_part(invadrox, 0, LEVEL_SRC_Y, | 670 | draw_number(LEVEL_X + 2 * NUM_SPACING, PLAYFIELD_Y + 2, level, 2); |
741 | STRIDE, LEVEL_X, PLAYFIELD_Y + 2, | ||
742 | LEVEL_WIDTH, FONT_HEIGHT); | ||
743 | draw_number(LEVEL_X + LEVEL_WIDTH + 2 * NUM_SPACING, PLAYFIELD_Y + 2, level, 2); | ||
744 | } | 671 | } |
745 | 672 | ||
746 | 673 | ||
@@ -748,18 +675,18 @@ void draw_lives(void) | |||
748 | { | 675 | { |
749 | int i; | 676 | int i; |
750 | /* Lives num */ | 677 | /* Lives num */ |
751 | rb->lcd_bitmap_part(invadrox, lives * NUMBERS_WIDTH, NUMBERS_SRC_Y, | 678 | rb->lcd_bitmap_part(invadrox_numbers, lives * NUMBERS_WIDTH, 0, |
752 | STRIDE, PLAYFIELD_X + LIVES_X, PLAYFIELD_Y + 2, | 679 | BMPWIDTH_invadrox_numbers, PLAYFIELD_X + LIVES_X, PLAYFIELD_Y + 2, |
753 | NUMBERS_WIDTH, FONT_HEIGHT); | 680 | NUMBERS_WIDTH, FONT_HEIGHT); |
754 | 681 | ||
755 | /* Ships */ | 682 | /* Ships */ |
756 | for (i = 0; i < (lives - 1); i++) { | 683 | for (i = 0; i < (lives - 1); i++) { |
757 | rb->lcd_bitmap_part(invadrox, SHIP_SRC_X, 0, STRIDE, | 684 | rb->lcd_bitmap_part(invadrox_ships, 0, 0, BMPWIDTH_invadrox_ships, |
758 | PLAYFIELD_X + LIVES_X + SHIP_WIDTH + i * (SHIP_WIDTH + NUM_SPACING), | 685 | PLAYFIELD_X + LIVES_X + SHIP_WIDTH + i * (SHIP_WIDTH + NUM_SPACING), |
759 | PLAYFIELD_Y + 1, SHIP_WIDTH, SHIP_HEIGHT); | 686 | PLAYFIELD_Y + 1, SHIP_WIDTH, SHIP_HEIGHT); |
760 | } | 687 | } |
761 | 688 | ||
762 | /* Erase ship to the righ (if less than MAX_LIVES) */ | 689 | /* Erase ship to the right (if less than MAX_LIVES) */ |
763 | if (lives < MAX_LIVES) { | 690 | if (lives < MAX_LIVES) { |
764 | rb->lcd_fillrect(PLAYFIELD_X + LIVES_X + SHIP_WIDTH + i * (SHIP_WIDTH + NUM_SPACING), | 691 | rb->lcd_fillrect(PLAYFIELD_X + LIVES_X + SHIP_WIDTH + i * (SHIP_WIDTH + NUM_SPACING), |
765 | PLAYFIELD_Y + 1, SHIP_WIDTH, SHIP_HEIGHT); | 692 | PLAYFIELD_Y + 1, SHIP_WIDTH, SHIP_HEIGHT); |
@@ -775,8 +702,8 @@ inline void draw_aliens(void) | |||
775 | int i; | 702 | int i; |
776 | 703 | ||
777 | for (i = 0; i < 5 * ALIENS; i++) { | 704 | for (i = 0; i < 5 * ALIENS; i++) { |
778 | rb->lcd_bitmap_part(invadrox, aliens[i].x & 1 ? ALIEN_WIDTH : 0, aliens[i].type * ALIEN_HEIGHT, | 705 | rb->lcd_bitmap_part(invadrox_aliens, aliens[i].x & 1 ? ALIEN_WIDTH : 0, aliens[i].type * ALIEN_HEIGHT, |
779 | STRIDE, PLAYFIELD_X + LIVES_X + aliens[i].x * ALIEN_SPEED, | 706 | BMPWIDTH_invadrox_aliens, PLAYFIELD_X + LIVES_X + aliens[i].x * ALIEN_SPEED, |
780 | ALIEN_START_Y + aliens[i].y * ALIEN_HEIGHT, | 707 | ALIEN_START_Y + aliens[i].y * ALIEN_HEIGHT, |
781 | ALIEN_WIDTH, ALIEN_HEIGHT); | 708 | ALIEN_WIDTH, ALIEN_HEIGHT); |
782 | } | 709 | } |
@@ -912,9 +839,9 @@ bool move_aliens(void) | |||
912 | /* Draw alien at new pos */ | 839 | /* Draw alien at new pos */ |
913 | x = PLAYFIELD_X + LIVES_X + aliens[curr_alien].x * ALIEN_SPEED; | 840 | x = PLAYFIELD_X + LIVES_X + aliens[curr_alien].x * ALIEN_SPEED; |
914 | y = ALIEN_START_Y + aliens[curr_alien].y * ALIEN_HEIGHT; | 841 | y = ALIEN_START_Y + aliens[curr_alien].y * ALIEN_HEIGHT; |
915 | rb->lcd_bitmap_part(invadrox, | 842 | rb->lcd_bitmap_part(invadrox_aliens, |
916 | aliens[curr_alien].x & 1 ? ALIEN_WIDTH : 0, aliens[curr_alien].type * ALIEN_HEIGHT, | 843 | aliens[curr_alien].x & 1 ? ALIEN_WIDTH : 0, aliens[curr_alien].type * ALIEN_HEIGHT, |
917 | STRIDE, x, y, ALIEN_WIDTH, ALIEN_HEIGHT); | 844 | BMPWIDTH_invadrox_aliens, x, y, ALIEN_WIDTH, ALIEN_HEIGHT); |
918 | 845 | ||
919 | if (!next_alien()) { | 846 | if (!next_alien()) { |
920 | /* Round finished. Set curr_alien to first alive from bottom. */ | 847 | /* Round finished. Set curr_alien to first alive from bottom. */ |
@@ -941,8 +868,8 @@ inline void draw_ship(void) | |||
941 | } | 868 | } |
942 | 869 | ||
943 | /* Draw ship */ | 870 | /* Draw ship */ |
944 | rb->lcd_bitmap_part(invadrox, SHIP_SRC_X, ship_frame * SHIP_HEIGHT, | 871 | rb->lcd_bitmap_part(invadrox_ships, 0, ship_frame * SHIP_HEIGHT, |
945 | STRIDE, ship_x, SHIP_Y, SHIP_WIDTH, SHIP_HEIGHT); | 872 | BMPWIDTH_invadrox_ships, ship_x, SHIP_Y, SHIP_WIDTH, SHIP_HEIGHT); |
946 | if (ship_hit) { | 873 | if (ship_hit) { |
947 | /* Alternate between frame 1 and 2 during hit */ | 874 | /* Alternate between frame 1 and 2 during hit */ |
948 | ship_frame_counter++; | 875 | ship_frame_counter++; |
@@ -962,22 +889,15 @@ inline void draw_ship(void) | |||
962 | 889 | ||
963 | inline void fire_alpha(int xc, int yc, fb_data color) | 890 | inline void fire_alpha(int xc, int yc, fb_data color) |
964 | { | 891 | { |
965 | int x, y; | 892 | int oldmode = rb->lcd_get_drawmode(); |
966 | unsigned char mask; | ||
967 | 893 | ||
968 | rb->lcd_set_foreground(color); | 894 | rb->lcd_set_foreground(color); |
969 | 895 | rb->lcd_set_drawmode(DRMODE_FG); | |
970 | for (y = 0; y < FIRE_HEIGHT; y++) { | 896 | |
971 | mask = 1 << (FIRE_WIDTH - 1); | 897 | rb->lcd_mono_bitmap(invadrox_fire, xc - (FIRE_WIDTH/2), yc, FIRE_WIDTH, FIRE_HEIGHT); |
972 | for (x = -(FIRE_WIDTH / 2); x < (FIRE_WIDTH / 2); x++) { | ||
973 | if (fire_sprite[y] & mask) { | ||
974 | rb->lcd_drawpixel(xc + x, yc + y); | ||
975 | } | ||
976 | mask >>= 1; | ||
977 | } | ||
978 | } | ||
979 | 898 | ||
980 | rb->lcd_set_foreground(LCD_BLACK); | 899 | rb->lcd_set_foreground(LCD_BLACK); |
900 | rb->lcd_set_drawmode(oldmode); | ||
981 | } | 901 | } |
982 | 902 | ||
983 | 903 | ||
@@ -1041,8 +961,8 @@ void move_fire(void) | |||
1041 | fire_target = TARGET_UFO; | 961 | fire_target = TARGET_UFO; |
1042 | /* Center explosion */ | 962 | /* Center explosion */ |
1043 | ufo_x -= (UFO_EXPLODE_WIDTH - UFO_WIDTH) / 2; | 963 | ufo_x -= (UFO_EXPLODE_WIDTH - UFO_WIDTH) / 2; |
1044 | rb->lcd_bitmap_part(invadrox, UFO_SRC_X, UFO_HEIGHT, | 964 | rb->lcd_bitmap(invadrox_ufo_explode, ufo_x, UFO_Y - 1, |
1045 | STRIDE, ufo_x, UFO_Y - 1, UFO_EXPLODE_WIDTH, UFO_EXPLODE_HEIGHT); | 965 | UFO_EXPLODE_WIDTH, UFO_EXPLODE_HEIGHT); |
1046 | return; | 966 | return; |
1047 | } | 967 | } |
1048 | } | 968 | } |
@@ -1125,8 +1045,8 @@ void move_fire(void) | |||
1125 | 1045 | ||
1126 | /* Paralyze aliens S_EXPLODE frames */ | 1046 | /* Paralyze aliens S_EXPLODE frames */ |
1127 | aliens_paralyzed = S_EXPLODE; | 1047 | aliens_paralyzed = S_EXPLODE; |
1128 | rb->lcd_bitmap_part(invadrox, ALIEN_EXPLODE_SRC_X, ALIEN_EXPLODE_SRC_Y, | 1048 | rb->lcd_bitmap(invadrox_alien_explode, |
1129 | STRIDE, PLAYFIELD_X + LIVES_X + aliens[i].x * ALIEN_SPEED, | 1049 | PLAYFIELD_X + LIVES_X + aliens[i].x * ALIEN_SPEED, |
1130 | ALIEN_START_Y + aliens[i].y * ALIEN_HEIGHT, | 1050 | ALIEN_START_Y + aliens[i].y * ALIEN_HEIGHT, |
1131 | ALIEN_EXPLODE_WIDTH, ALIEN_EXPLODE_HEIGHT); | 1051 | ALIEN_EXPLODE_WIDTH, ALIEN_EXPLODE_HEIGHT); |
1132 | /* Since alien is 1 pixel taller than explosion sprite, erase bottom line */ | 1052 | /* Since alien is 1 pixel taller than explosion sprite, erase bottom line */ |
@@ -1187,9 +1107,9 @@ inline int random_bomber(void) | |||
1187 | 1107 | ||
1188 | inline void draw_bomb(int i) | 1108 | inline void draw_bomb(int i) |
1189 | { | 1109 | { |
1190 | rb->lcd_bitmap_part(invadrox, BOMB_SRC_X + bombs[i].type * BOMB_WIDTH, | 1110 | rb->lcd_bitmap_part(invadrox_bombs, bombs[i].type * BOMB_WIDTH, |
1191 | bombs[i].frame * (BOMB_HEIGHT + 1), | 1111 | bombs[i].frame * BOMB_HEIGHT, |
1192 | STRIDE, bombs[i].x, bombs[i].y, | 1112 | BMPWIDTH_invadrox_bombs, bombs[i].x, bombs[i].y, |
1193 | BOMB_WIDTH, BOMB_HEIGHT); | 1113 | BOMB_WIDTH, BOMB_HEIGHT); |
1194 | /* Advance frame */ | 1114 | /* Advance frame */ |
1195 | bombs[i].frame++; | 1115 | bombs[i].frame++; |
@@ -1288,8 +1208,9 @@ void move_bombs(void) | |||
1288 | ship_frame_counter = 0; | 1208 | ship_frame_counter = 0; |
1289 | bombs[i].state = S_EXPLODE * 4; | 1209 | bombs[i].state = S_EXPLODE * 4; |
1290 | bombs[i].target = TARGET_SHIP; | 1210 | bombs[i].target = TARGET_SHIP; |
1291 | rb->lcd_bitmap_part(invadrox, SHIP_SRC_X, 1 * SHIP_HEIGHT, STRIDE, | 1211 | rb->lcd_bitmap_part(invadrox_ships, 0, 1 * SHIP_HEIGHT, |
1292 | ship_x, SHIP_Y, SHIP_WIDTH, SHIP_HEIGHT); | 1212 | BMPWIDTH_invadrox_ships, ship_x, SHIP_Y, |
1213 | SHIP_WIDTH, SHIP_HEIGHT); | ||
1293 | break; | 1214 | break; |
1294 | } | 1215 | } |
1295 | /* Shield hit */ | 1216 | /* Shield hit */ |
@@ -1399,8 +1320,7 @@ void move_ufo(void) | |||
1399 | break; | 1320 | break; |
1400 | } | 1321 | } |
1401 | /* Draw new pos */ | 1322 | /* Draw new pos */ |
1402 | rb->lcd_bitmap_part(invadrox, UFO_SRC_X, 0, | 1323 | rb->lcd_bitmap(invadrox_ufo, ufo_x, UFO_Y, UFO_WIDTH, UFO_HEIGHT); |
1403 | STRIDE, ufo_x, UFO_Y, UFO_WIDTH, UFO_HEIGHT); | ||
1404 | break; | 1324 | break; |
1405 | 1325 | ||
1406 | case S_SHOWSCORE: | 1326 | case S_SHOWSCORE: |
@@ -1438,20 +1358,7 @@ void move_ufo(void) | |||
1438 | void draw_background(void) | 1358 | void draw_background(void) |
1439 | { | 1359 | { |
1440 | 1360 | ||
1441 | #if (LCD_WIDTH == 320) && (LCD_HEIGHT == 240) | 1361 | rb->lcd_bitmap(invadrox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); |
1442 | /* Erase background to black */ | ||
1443 | rb->lcd_fillrect(PLAYFIELD_X, 0, PLAYFIELD_WIDTH, LCD_HEIGHT); | ||
1444 | /* Left and right bitmaps */ | ||
1445 | rb->lcd_bitmap(invadrox_left, 0, 0, PLAYFIELD_X, LCD_HEIGHT); | ||
1446 | rb->lcd_bitmap(invadrox_right, LCD_WIDTH - PLAYFIELD_X, 0, PLAYFIELD_X, LCD_HEIGHT); | ||
1447 | #else | ||
1448 | rb->lcd_fillrect(0, 0, LCD_WIDTH, LCD_HEIGHT); | ||
1449 | #endif | ||
1450 | |||
1451 | #if ((LCD_WIDTH == 240) && (LCD_HEIGHT == 320)) || ((LCD_WIDTH == 176) && (LCD_HEIGHT == 220)) | ||
1452 | rb->lcd_bitmap(invadrox_logo, 0, 0, LCD_WIDTH, SCORE_Y); | ||
1453 | #endif | ||
1454 | |||
1455 | rb->lcd_update(); | 1362 | rb->lcd_update(); |
1456 | } | 1363 | } |
1457 | 1364 | ||
@@ -1468,12 +1375,6 @@ void new_level(void) | |||
1468 | draw_lives(); | 1375 | draw_lives(); |
1469 | 1376 | ||
1470 | /* Score */ | 1377 | /* Score */ |
1471 | rb->lcd_bitmap_part(invadrox, SCORE_SRC_X, SCORE_SRC_Y, | ||
1472 | STRIDE, PLAYFIELD_X, SCORE_Y, SCORE_WIDTH, FONT_HEIGHT); | ||
1473 | /* Hi-score */ | ||
1474 | rb->lcd_bitmap_part(invadrox, 0, SCORE_SRC_Y, | ||
1475 | STRIDE, HISCORE_X, SCORE_Y, | ||
1476 | HISCORE_WIDTH, FONT_HEIGHT); | ||
1477 | draw_score(); | 1378 | draw_score(); |
1478 | draw_number(HISCORENUM_X, SCORENUM_Y, hiscore.score, 4); | 1379 | draw_number(HISCORENUM_X, SCORENUM_Y, hiscore.score, 4); |
1479 | 1380 | ||
@@ -1539,7 +1440,7 @@ void new_level(void) | |||
1539 | 1440 | ||
1540 | /* 4 shields */ | 1441 | /* 4 shields */ |
1541 | for (i = 1; i <= 4; i++) { | 1442 | for (i = 1; i <= 4; i++) { |
1542 | rb->lcd_bitmap_part(invadrox, SHIELD_SRC_X, SHIELD_SRC_Y, STRIDE, | 1443 | rb->lcd_bitmap(invadrox_shield, |
1543 | PLAYFIELD_X + i * PLAYFIELD_WIDTH / 5 - SHIELD_WIDTH / 2, | 1444 | PLAYFIELD_X + i * PLAYFIELD_WIDTH / 5 - SHIELD_WIDTH / 2, |
1544 | SHIELD_Y, SHIELD_WIDTH, SHIELD_HEIGHT); | 1445 | SHIELD_Y, SHIELD_WIDTH, SHIELD_HEIGHT); |
1545 | } | 1446 | } |