diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-07-12 11:56:38 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-07-12 11:56:38 +0000 |
commit | e12c1c0a62a9ffd3456146f16a497ee3e9d5e089 (patch) | |
tree | ad803d240fcb1ca3023ad90686c1e6513727ac1a /apps/plugins/chopper.c | |
parent | 61394b725bfa6ace86a293c4a98dcb44e76c2ee3 (diff) | |
download | rockbox-e12c1c0a62a9ffd3456146f16a497ee3e9d5e089.tar.gz rockbox-e12c1c0a62a9ffd3456146f16a497ee3e9d5e089.zip |
Optimize chopper a bit by making a often used macro an inline function(which means its parameter expressions are evaluated before expanding) and removing a unecessary display clear.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21802 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/chopper.c')
-rw-r--r-- | apps/plugins/chopper.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index 54a1ae0bfe..2c1132aacd 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c @@ -165,7 +165,10 @@ Still To do: #if LCD_HEIGHT <= 64 #define CYCLETIME 100 -#define SCALE(x) ((x)==1 ? (x) : ((x) >> 1)) +static inline int SCALE(int x) +{ + return x == 1 ? x : x >> 1; +} #define SIZE 2 #else #define CYCLETIME 60 @@ -657,8 +660,6 @@ static void chopDrawScene(void) #elif LCD_DEPTH == 2 rb->lcd_set_background(LCD_WHITE); #endif - rb->lcd_clear_display(); - chopDrawTheWorld(); chopDrawPlayer(iPlayerPosX - iCameraPosX, iPlayerPosY); @@ -801,6 +802,7 @@ static int chopGameLoop(void) mParticles[i].iWorldY += mParticles[i].iSpeedY; } + rb->lcd_clear_display(); /* Redraw the main window: */ chopDrawScene(); |