1
0
Fork 0
forked from len0rd/rockbox

Fixed button_get() problems

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1439 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2002-07-24 19:42:46 +00:00
parent 5ddd384e3d
commit 09fe394c3f

View file

@ -328,25 +328,30 @@ void game_loop(void)
{
while(1)
{
int b=0;
int count = 0;
while(count * 300 < level_speeds[level])
{
b = button_get(false);
if ( b & BUTTON_OFF )
return; /* get out of here */
switch(button_get(false))
{
case BUTTON_OFF:
return;
if ( b & BUTTON_UP )
case BUTTON_UP:
move_block(0,-3,0);
break;
if ( b & BUTTON_DOWN )
case BUTTON_DOWN:
move_block(0,3,0);
break;
if ( b & BUTTON_RIGHT )
case BUTTON_RIGHT:
move_block(0,0,1);
break;
if ( b & BUTTON_LEFT )
case BUTTON_LEFT:
move_down();
break;
}
count++;
sleep(HZ/10);