diff options
Diffstat (limited to 'apps/plugins/pong.c')
-rw-r--r-- | apps/plugins/pong.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 5e6f308663..37d71155ee 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c | |||
@@ -288,7 +288,7 @@ struct pong { | |||
288 | struct player player[2]; | 288 | struct player player[2]; |
289 | }; | 289 | }; |
290 | 290 | ||
291 | void singlepad(int x, int y, int set) | 291 | static void singlepad(int x, int y, int set) |
292 | { | 292 | { |
293 | if(set) { | 293 | if(set) { |
294 | rb->lcd_fillrect(x, y, PAD_WIDTH, PAD_HEIGHT); | 294 | rb->lcd_fillrect(x, y, PAD_WIDTH, PAD_HEIGHT); |
@@ -300,7 +300,7 @@ void singlepad(int x, int y, int set) | |||
300 | } | 300 | } |
301 | } | 301 | } |
302 | 302 | ||
303 | void pad(struct pong *p, int pad) | 303 | static void pad(struct pong *p, int pad) |
304 | { | 304 | { |
305 | struct player *player = &p->player[pad]; | 305 | struct player *player = &p->player[pad]; |
306 | /* clear existing pad */ | 306 | /* clear existing pad */ |
@@ -313,7 +313,7 @@ void pad(struct pong *p, int pad) | |||
313 | player->e_pad = player->w_pad; | 313 | player->e_pad = player->w_pad; |
314 | } | 314 | } |
315 | 315 | ||
316 | bool wallcollide(struct pong *p, int pad) | 316 | static bool wallcollide(struct pong *p, int pad) |
317 | { | 317 | { |
318 | /* we have already checked for pad-collision, just check if this hits | 318 | /* we have already checked for pad-collision, just check if this hits |
319 | the wall */ | 319 | the wall */ |
@@ -332,7 +332,7 @@ bool wallcollide(struct pong *p, int pad) | |||
332 | /* returns true if the ball has hit a pad, and then the info variable | 332 | /* returns true if the ball has hit a pad, and then the info variable |
333 | will have extra angle info */ | 333 | will have extra angle info */ |
334 | 334 | ||
335 | bool padcollide(struct pong *p, int pad, int *info) | 335 | static bool padcollide(struct pong *p, int pad, int *info) |
336 | { | 336 | { |
337 | struct player *player = &p->player[pad]; | 337 | struct player *player = &p->player[pad]; |
338 | int x = p->ball.x/RES; | 338 | int x = p->ball.x/RES; |
@@ -366,7 +366,7 @@ bool padcollide(struct pong *p, int pad, int *info) | |||
366 | return false; /* nah */ | 366 | return false; /* nah */ |
367 | } | 367 | } |
368 | 368 | ||
369 | void bounce(struct pong *p, int pad, int info) | 369 | static void bounce(struct pong *p, int pad, int info) |
370 | { | 370 | { |
371 | p->ball.speedx = -p->ball.speedx; | 371 | p->ball.speedx = -p->ball.speedx; |
372 | 372 | ||
@@ -410,7 +410,7 @@ void bounce(struct pong *p, int pad, int info) | |||
410 | #endif | 410 | #endif |
411 | } | 411 | } |
412 | 412 | ||
413 | void score(struct pong *p, int pad) | 413 | static void score(struct pong *p, int pad) |
414 | { | 414 | { |
415 | if(pad) | 415 | if(pad) |
416 | rb->splash(HZ/4, "right scores!"); | 416 | rb->splash(HZ/4, "right scores!"); |
@@ -436,7 +436,7 @@ void score(struct pong *p, int pad) | |||
436 | p->player[1].e_pad = -1; | 436 | p->player[1].e_pad = -1; |
437 | } | 437 | } |
438 | 438 | ||
439 | void ball(struct pong *p) | 439 | static void ball(struct pong *p) |
440 | { | 440 | { |
441 | int oldx = p->ball.x/RES; | 441 | int oldx = p->ball.x/RES; |
442 | int oldy = p->ball.y/RES; | 442 | int oldy = p->ball.y/RES; |
@@ -487,7 +487,7 @@ void ball(struct pong *p) | |||
487 | rb->lcd_fillrect(newx, newy, BALL_WIDTH, BALL_HEIGHT); | 487 | rb->lcd_fillrect(newx, newy, BALL_WIDTH, BALL_HEIGHT); |
488 | } | 488 | } |
489 | 489 | ||
490 | void padmove(int *pos, int dir) | 490 | static void padmove(int *pos, int dir) |
491 | { | 491 | { |
492 | *pos += dir; | 492 | *pos += dir; |
493 | if(*pos > (LCD_HEIGHT-PAD_HEIGHT)) | 493 | if(*pos > (LCD_HEIGHT-PAD_HEIGHT)) |
@@ -496,7 +496,7 @@ void padmove(int *pos, int dir) | |||
496 | *pos = 0; | 496 | *pos = 0; |
497 | } | 497 | } |
498 | 498 | ||
499 | void key_pad(struct pong *p, int pad, int up, int down) | 499 | static void key_pad(struct pong *p, int pad, int up, int down) |
500 | { | 500 | { |
501 | struct player *player = &p->player[pad]; | 501 | struct player *player = &p->player[pad]; |
502 | if(player->iscpu) { | 502 | if(player->iscpu) { |
@@ -526,7 +526,7 @@ void key_pad(struct pong *p, int pad, int up, int down) | |||
526 | } | 526 | } |
527 | } | 527 | } |
528 | 528 | ||
529 | int keys(struct pong *p) | 529 | static int keys(struct pong *p) |
530 | { | 530 | { |
531 | int key; | 531 | int key; |
532 | #ifdef PONG_PAUSE | 532 | #ifdef PONG_PAUSE |
@@ -609,7 +609,7 @@ int keys(struct pong *p) | |||
609 | return 1; /* return 0 to exit game */ | 609 | return 1; /* return 0 to exit game */ |
610 | } | 610 | } |
611 | 611 | ||
612 | void showscore(struct pong *p) | 612 | static void showscore(struct pong *p) |
613 | { | 613 | { |
614 | static char buffer[20]; | 614 | static char buffer[20]; |
615 | int w; | 615 | int w; |
@@ -620,7 +620,7 @@ void showscore(struct pong *p) | |||
620 | rb->lcd_putsxy( (LCD_WIDTH / 2) - (w / 2), 0, (unsigned char *)buffer); | 620 | rb->lcd_putsxy( (LCD_WIDTH / 2) - (w / 2), 0, (unsigned char *)buffer); |
621 | } | 621 | } |
622 | 622 | ||
623 | void blink_demo(void) | 623 | static void blink_demo(void) |
624 | { | 624 | { |
625 | static char buffer[30]; | 625 | static char buffer[30]; |
626 | int w; | 626 | int w; |