accept patch FS#4761 - putting the player on hold will now pause games. this should be

fitted to pong and rockblox as well. credit Lukas Sabota for the initial work, and, my very
own first commit!


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10365 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Shachar Liberman 2006-07-30 03:10:09 +00:00
parent 4ccacd4004
commit 5360df96ef
9 changed files with 49 additions and 0 deletions

View File

@ -1740,6 +1740,12 @@ int game_loop(void)
int move_button,button;
int button_right,button_left;
button=rb->button_get(false);
#ifdef HAS_BUTTON_HOLD
if (rb->button_hold())
button = QUIT;
#endif
move_button=rb->button_status();
button_right=((move_button & RIGHT) || (SCROLL_FWD(button)));

View File

@ -2368,6 +2368,12 @@ static int bubbles_handlebuttons(struct game_context* bb, bool animblock,
long start;
button = rb->button_get_w_tmo(timeout);
#ifdef HAS_BUTTON_HOLD
if (rb->button_hold())
button = BUBBLES_START;
#endif
switch(button){
case (BUBBLES_LEFT|BUTTON_REPEAT):
if(bb->angle > MIN_ANGLE) bb->angle -= 4;

View File

@ -283,6 +283,11 @@ static int gameProc( void )
/* Check the button status */
status = rb->button_status();
#ifdef HAS_BUTTON_HOLD
if (rb->button_hold())
status = PACMAN_MENU;
#endif
if ((status & PACMAN_MENU) == PACMAN_MENU
#ifdef PACMAN_RC_MENU
|| status == PACMAN_RC_MENU

View File

@ -267,6 +267,12 @@ void game (void) {
rb->sleep(HZ/level);
button=rb->button_get(false);
#ifdef HAS_BUTTON_HOLD
if (rb->button_hold())
button = SNAKE_PLAYPAUSE;
#endif
switch (button) {
case SNAKE_UP:
if (dir!=2) dir=0;

View File

@ -1113,6 +1113,12 @@ void game (void)
rb->sleep(HZ/speed);
button = rb->button_get(false);
#ifdef HAS_BUTTON_HOLD
if (rb->button_hold())
button = SNAKE2_PLAYPAUSE;
#endif
switch (button)
{
case SNAKE2_UP:

View File

@ -1525,6 +1525,12 @@ enum plugin_status start_game(void)
rb->lcd_update();
button = rb->button_get(false);
#ifdef HAS_BUTTON_HOLD
if (rb->button_hold())
game_state = PAUSE_MODE;
#endif
switch(button)
{
case(AST_PAUSE):

View File

@ -1479,6 +1479,11 @@ static int run(void)
int i;
long cycle_duration=0;
#ifdef HAS_BUTTON_HOLD
if (rb->button_hold())
paused = true;
#endif
switch (button) {
case BTN_STARTPAUSE:
paused = !paused;

View File

@ -766,6 +766,14 @@ static int xobox_loop (void)
while (!quit) {
end = *rb->current_tick + (CYCLETIME * HZ) / 1000;
#ifdef HAS_BUTTON_HOLD
if (rb->button_hold()) {
pause = true;
rb->splash (HZ, true, "PAUSED");
}
#endif
button = rb->button_get_w_tmo (true);
switch (button) {
case UP:

View File

@ -217,3 +217,4 @@ Paul Louden
Rainer Sinsch
Plácido Revilla
Michael Sevakis
Lukas Sabota