diff options
Diffstat (limited to 'apps/plugins/chopper.c')
-rw-r--r-- | apps/plugins/chopper.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index 70763a1b67..78cc292147 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c @@ -523,19 +523,18 @@ static void chopAddBlock(int x,int y,int sx,int sy, int indexOverride) static void chopAddParticle(int x,int y,int sx,int sy) { - int i=0; - - while(mParticles[i].bIsActive && i < NUMBER_OF_PARTICLES) - i++; - - if(i==NUMBER_OF_PARTICLES) - return; - - mParticles[i].bIsActive = 1; - mParticles[i].iWorldX = x; - mParticles[i].iWorldY = y; - mParticles[i].iSpeedX = sx; - mParticles[i].iSpeedY = sy; + for(int i = 0; i < NUMBER_OF_PARTICLES; ++i) + { + if(!mParticles[i].bIsActive) + { + mParticles[i].bIsActive = 1; + mParticles[i].iWorldX = x; + mParticles[i].iWorldY = y; + mParticles[i].iSpeedX = sx; + mParticles[i].iSpeedY = sy; + return; + } + } } static void chopGenerateBlockIfNeeded(void) @@ -785,7 +784,7 @@ static int chopMenu(int menunum) res = -1; break; case 2: - rb->set_option("Level", &iLevelMode, INT, levels, 2, NULL); + rb->set_option("Level", &iLevelMode, RB_INT, levels, 2, NULL); break; case 3: playback_control(NULL); @@ -1084,10 +1083,10 @@ enum plugin_status plugin_start(const void* parameter) rb->lcd_set_foreground(LCD_WHITE); #endif -#ifdef HAVE_BACKLIGHT + /* Turn off backlight timeout */ backlight_ignore_timeout(); -#endif + rb->srand( *rb->current_tick ); @@ -1099,10 +1098,10 @@ enum plugin_status plugin_start(const void* parameter) configfile_save(CFG_FILE, config, 1, 0); rb->lcd_setfont(FONT_UI); -#ifdef HAVE_BACKLIGHT + /* Turn on backlight timeout (revert to settings) */ backlight_use_settings(); -#endif + return ret; } |