forked from len0rd/rockbox
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
This commit is contained in:
parent
61394b725b
commit
e12c1c0a62
1 changed files with 5 additions and 3 deletions
|
@ -165,7 +165,10 @@ Still To do:
|
||||||
|
|
||||||
#if LCD_HEIGHT <= 64
|
#if LCD_HEIGHT <= 64
|
||||||
#define CYCLETIME 100
|
#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
|
#define SIZE 2
|
||||||
#else
|
#else
|
||||||
#define CYCLETIME 60
|
#define CYCLETIME 60
|
||||||
|
@ -657,8 +660,6 @@ static void chopDrawScene(void)
|
||||||
#elif LCD_DEPTH == 2
|
#elif LCD_DEPTH == 2
|
||||||
rb->lcd_set_background(LCD_WHITE);
|
rb->lcd_set_background(LCD_WHITE);
|
||||||
#endif
|
#endif
|
||||||
rb->lcd_clear_display();
|
|
||||||
|
|
||||||
chopDrawTheWorld();
|
chopDrawTheWorld();
|
||||||
chopDrawPlayer(iPlayerPosX - iCameraPosX, iPlayerPosY);
|
chopDrawPlayer(iPlayerPosX - iCameraPosX, iPlayerPosY);
|
||||||
|
|
||||||
|
@ -801,6 +802,7 @@ static int chopGameLoop(void)
|
||||||
mParticles[i].iWorldY += mParticles[i].iSpeedY;
|
mParticles[i].iWorldY += mParticles[i].iSpeedY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rb->lcd_clear_display();
|
||||||
/* Redraw the main window: */
|
/* Redraw the main window: */
|
||||||
chopDrawScene();
|
chopDrawScene();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue