diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2005-10-07 23:01:31 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2005-10-07 23:01:31 +0000 |
| commit | a0b439c1692434256c23975cd8098c4f5ae6cbdb (patch) | |
| tree | 15da41b79224dd31017bf02bb66d90408ac389f9 /apps/plugins | |
| parent | 7d0b7e9378fe7ee11fa9b8643851616972a8d83f (diff) | |
| download | rockbox-a0b439c1692434256c23975cd8098c4f5ae6cbdb.zip rockbox-a0b439c1692434256c23975cd8098c4f5ae6cbdb.tar.gz rockbox-a0b439c1692434256c23975cd8098c4f5ae6cbdb.tar.bz2 rockbox-a0b439c1692434256c23975cd8098c4f5ae6cbdb.tar.xz | |
Patch #1239950 by Dave Hooper: Rotate cube while paused.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7596 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/cube.c | 76 |
1 files changed, 72 insertions, 4 deletions
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index e69ef46..2360269 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -497,17 +497,19 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) xa += xs; if (xa > 359) xa -= 360; - if (xa < 0) + else if (xa < 0) xa += 360; + ya += ys; if (ya > 359) ya -= 360; - if (ya < 0) + else if (ya < 0) ya += 360; + za += zs; if (za > 359) za -= 360; - if (za < 0) + else if (za < 0) za += 360; redraw = true; } @@ -516,39 +518,105 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) switch (button) { case CUBE_X_INC: - if (xs < 10) + case (CUBE_X_INC|BUTTON_REPEAT): + if( !paused ) + { + if( xs < 10) xs++; + } + else + { + xa++; + if( xa > 359 ) + xa -= 360; + } t_disp = DISP_TIME; + redraw = true; break; case CUBE_X_DEC: + case (CUBE_X_DEC|BUTTON_REPEAT): + if( !paused ) + { if (xs > -10) xs--; + } + else + { + xa--; + if( xa < 0 ) + xa += 360; + } t_disp = DISP_TIME; + redraw = true; break; case CUBE_Y_INC: + case (CUBE_Y_INC|BUTTON_REPEAT): + if( !paused ) + { if (ys < 10) ys++; + } + else + { + ya++; + if( ya > 359 ) + ya -= 360; + } t_disp = DISP_TIME; + redraw = true; break; case CUBE_Y_DEC: + case (CUBE_Y_DEC|BUTTON_REPEAT): + if( !paused ) + { if (ys > -10) ys--; + } + else + { + ya--; + if( ya < 0 ) + ya += 360; + } t_disp = DISP_TIME; + redraw = true; break; case CUBE_Z_INC: + case (CUBE_Z_INC|BUTTON_REPEAT): + if( !paused ) + { if (zs < 10) zs++; + } + else + { + za++; + if( za > 359 ) + za -= 360; + } t_disp = DISP_TIME; + redraw = true; break; case CUBE_Z_DEC: + case (CUBE_Z_DEC|BUTTON_REPEAT): + if( !paused ) + { if (zs > -10) zs--; + } + else + { + za--; + if( za < 0 ) + za += 360; + } t_disp = DISP_TIME; + redraw = true; break; case CUBE_MODE: |