summaryrefslogtreecommitdiff
path: root/apps/plugins/spacerocks.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/spacerocks.c')
-rwxr-xr-xapps/plugins/spacerocks.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index 53dbc30a87..384fbd4e8d 100755
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -158,6 +158,20 @@ static struct plugin_api* rb; /* global api struct pointer */
158#define CENTER_LCD_X (LCD_WIDTH/2) 158#define CENTER_LCD_X (LCD_WIDTH/2)
159#define CENTER_LCD_Y (LCD_HEIGHT/2) 159#define CENTER_LCD_Y (LCD_HEIGHT/2)
160 160
161#ifdef HAVE_LCD_COLOR
162#define COL_MISSILE LCD_RGBPACK(200,0,0)
163#define COL_PLAYER LCD_RGBPACK(200,200,200)
164#define COL_STARS LCD_WHITE
165#define COL_ASTEROID LCD_RGBPACK(150,95,0)
166#define COL_TEXT LCD_RGBPACK(200,200,255)
167#define COL_ENEMY LCD_RGBPACK(50,220,50)
168#define SET_FG rb->lcd_set_foreground
169#define SET_BG rb->lcd_set_background
170#else
171#define SET_FG(x)
172#define SET_BG(x)
173#endif
174
161enum asteroid_type 175enum asteroid_type
162{ 176{
163 SMALL = 1, 177 SMALL = 1,
@@ -548,6 +562,8 @@ void draw_and_move_enemy(void)
548{ 562{
549 int enemy_x, enemy_y; 563 int enemy_x, enemy_y;
550 struct Point *point; 564 struct Point *point;
565
566 SET_FG(COL_ENEMY);
551 567
552 if(enemy_on_screen) 568 if(enemy_on_screen)
553 { 569 {
@@ -920,6 +936,9 @@ void draw_and_move_missiles(void)
920 936
921 struct Missile* missile; 937 struct Missile* missile;
922 missile = missiles_array; 938 missile = missiles_array;
939
940 SET_FG(COL_MISSILE);
941
923 n = MAX_NUM_MISSILES; 942 n = MAX_NUM_MISSILES;
924 while(--n) 943 while(--n)
925 { 944 {
@@ -999,6 +1018,8 @@ void draw_lives(void)
999 int px = (LCD_WIDTH - num_lives*4 - 1); 1018 int px = (LCD_WIDTH - num_lives*4 - 1);
1000 int py = (LCD_HEIGHT-4); 1019 int py = (LCD_HEIGHT-4);
1001 1020
1021 SET_FG(COL_PLAYER);
1022
1002 n = num_lives; 1023 n = num_lives;
1003 while(--n) 1024 while(--n)
1004 { 1025 {
@@ -1199,6 +1220,7 @@ void draw_and_move_ship(void)
1199{ 1220{
1200 int nxoffset = ship.position.x/SCALE; 1221 int nxoffset = ship.position.x/SCALE;
1201 int nyoffset = ship.position.y/SCALE; 1222 int nyoffset = ship.position.y/SCALE;
1223 SET_FG(COL_PLAYER);
1202 if(!ship.explode_countdown) 1224 if(!ship.explode_countdown)
1203 { 1225 {
1204 if(!ship.waiting_for_space) 1226 if(!ship.waiting_for_space)
@@ -1271,6 +1293,8 @@ void drawstars()
1271 int n = NUM_STARS; 1293 int n = NUM_STARS;
1272 1294
1273 p = stars; 1295 p = stars;
1296 SET_FG(COL_STARS);
1297
1274 while(--n) 1298 while(--n)
1275 { 1299 {
1276 rb->lcd_drawpixel(p->x , p->y); 1300 rb->lcd_drawpixel(p->x , p->y);
@@ -1287,7 +1311,9 @@ void draw_and_move_asteroids(void)
1287 struct Asteroid* asteroid; 1311 struct Asteroid* asteroid;
1288 1312
1289 asteroid = asteroids_array; 1313 asteroid = asteroids_array;
1290 n = MAX_NUM_ASTEROIDS; 1314 SET_FG(COL_ASTEROID);
1315
1316 n = MAX_NUM_ASTEROIDS;
1291 while(--n) 1317 while(--n)
1292 { 1318 {
1293 if(game_state != PAUSE_MODE) 1319 if(game_state != PAUSE_MODE)
@@ -1396,6 +1422,8 @@ enum plugin_status start_game(void)
1396 1422
1397 /*create stars once, and once only:*/ 1423 /*create stars once, and once only:*/
1398 create_stars(); 1424 create_stars();
1425
1426 SET_BG(LCD_BLACK);
1399 1427
1400 while(true) 1428 while(true)
1401 { 1429 {
@@ -1408,6 +1436,7 @@ enum plugin_status start_game(void)
1408 { 1436 {
1409 end = *rb->current_tick + (CYCLETIME * HZ) / 1000; 1437 end = *rb->current_tick + (CYCLETIME * HZ) / 1000;
1410 rb->lcd_clear_display(); 1438 rb->lcd_clear_display();
1439 SET_FG(COL_TEXT);
1411 switch(game_state) 1440 switch(game_state)
1412 { 1441 {
1413 case(ATTRACT_MODE): 1442 case(ATTRACT_MODE):