mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-28 08:16:18 -04:00
A few chopper changes. Changed colorscheme from blue on backdrop to green on black (on color LCDs), more like original. Removed useless 'help' menu entry for now. Show actual button name in game over screen (i.e. 'select' or 'play') instead of just 'action'. A bit of code cleanup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12327 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e3e58b9a07
commit
ce31c6fef9
1 changed files with 159 additions and 151 deletions
|
|
@ -43,31 +43,38 @@ PLUGIN_HEADER
|
||||||
|
|
||||||
#define QUIT BUTTON_MENU
|
#define QUIT BUTTON_MENU
|
||||||
#define ACTION BUTTON_SELECT
|
#define ACTION BUTTON_SELECT
|
||||||
|
#define ACTIONTEXT "SELECT"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD /* grayscale at the moment */
|
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD /* grayscale at the moment */
|
||||||
|
|
||||||
#define QUIT BUTTON_POWER
|
#define QUIT BUTTON_POWER
|
||||||
#define ACTION BUTTON_SELECT
|
#define ACTION BUTTON_SELECT
|
||||||
|
#define ACTIONTEXT "SELECT"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
|
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
|
||||||
#define QUIT BUTTON_POWER
|
#define QUIT BUTTON_POWER
|
||||||
#define ACTION BUTTON_RIGHT
|
#define ACTION BUTTON_RIGHT
|
||||||
|
#define ACTIONTEXT "RIGHT"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SANSA_E200_PAD
|
#elif CONFIG_KEYPAD == SANSA_E200_PAD
|
||||||
#define QUIT BUTTON_POWER
|
#define QUIT BUTTON_POWER
|
||||||
#define ACTION BUTTON_SELECT
|
#define ACTION BUTTON_SELECT
|
||||||
|
#define ACTIONTEXT "SELECT"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == GIGABEAT_PAD
|
#elif CONFIG_KEYPAD == GIGABEAT_PAD
|
||||||
#define QUIT BUTTON_MENU
|
#define QUIT BUTTON_MENU
|
||||||
#define ACTION BUTTON_SELECT
|
#define ACTION BUTTON_SELECT
|
||||||
|
#define ACTIONTEXT "SELECT"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == RECORDER_PAD
|
#elif CONFIG_KEYPAD == RECORDER_PAD
|
||||||
#define QUIT BUTTON_OFF
|
#define QUIT BUTTON_OFF
|
||||||
#define ACTION BUTTON_PLAY
|
#define ACTION BUTTON_PLAY
|
||||||
|
#define ACTIONTEXT "PLAY"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == ONDIO_PAD
|
#elif CONFIG_KEYPAD == ONDIO_PAD
|
||||||
#define QUIT BUTTON_MENU
|
#define QUIT BUTTON_MENU
|
||||||
#define ACTION BUTTON_RIGHT
|
#define ACTION BUTTON_RIGHT
|
||||||
|
#define ACTIONTEXT "RIGHT"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error Unsupported keypad
|
#error Unsupported keypad
|
||||||
|
|
@ -157,7 +164,6 @@ static void chopRenderTerrain(struct CTerrain *ter);
|
||||||
void chopper_load(bool newgame);
|
void chopper_load(bool newgame);
|
||||||
void cleanup_chopper(void);
|
void cleanup_chopper(void);
|
||||||
|
|
||||||
|
|
||||||
static void chopDrawPlayer(int x,int y) /* These are SCREEN coords, not world! */
|
static void chopDrawPlayer(int x,int y) /* These are SCREEN coords, not world! */
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -178,14 +184,14 @@ static void chopDrawPlayer(int x,int y) /* These are SCREEN coords, not world! *
|
||||||
rb->lcd_fillrect(x+10, y, 1, 3);
|
rb->lcd_fillrect(x+10, y, 1, 3);
|
||||||
|
|
||||||
#if LCD_DEPTH > 2
|
#if LCD_DEPTH > 2
|
||||||
rb->lcd_set_foreground(LCD_RGBPACK(30,30,30));
|
rb->lcd_set_foreground(LCD_RGBPACK(40,40,100));
|
||||||
#elif LCD_DEPTH == 2
|
#elif LCD_DEPTH == 2
|
||||||
rb->lcd_set_foreground(LCD_BLACK);
|
rb->lcd_set_foreground(LCD_BLACK);
|
||||||
#endif
|
#endif
|
||||||
rb->lcd_drawline(x, y+iRotorOffset, x+20, y-iRotorOffset);
|
rb->lcd_drawline(x, y+iRotorOffset, x+20, y-iRotorOffset);
|
||||||
|
|
||||||
#if LCD_DEPTH > 2
|
#if LCD_DEPTH > 2
|
||||||
rb->lcd_set_foreground(LCD_RGBPACK(10,10,10));
|
rb->lcd_set_foreground(LCD_RGBPACK(20,20,50));
|
||||||
#elif LCD_DEPTH == 2
|
#elif LCD_DEPTH == 2
|
||||||
rb->lcd_set_foreground(LCD_BLACK);
|
rb->lcd_set_foreground(LCD_BLACK);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -193,8 +199,6 @@ static void chopDrawPlayer(int x,int y) /* These are SCREEN coords, not world! *
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void chopClearTerrain(struct CTerrain *ter)
|
static void chopClearTerrain(struct CTerrain *ter)
|
||||||
{
|
{
|
||||||
ter->iNodesCount = -1;
|
ter->iNodesCount = -1;
|
||||||
|
|
@ -206,7 +210,6 @@ int iR(int low,int high)
|
||||||
return low+rb->rand()%(high-low+1);
|
return low+rb->rand()%(high-low+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void chopCopyTerrain(struct CTerrain *src, struct CTerrain *dest,
|
static void chopCopyTerrain(struct CTerrain *src, struct CTerrain *dest,
|
||||||
int xOffset,int yOffset)
|
int xOffset,int yOffset)
|
||||||
{
|
{
|
||||||
|
|
@ -225,7 +228,6 @@ static void chopCopyTerrain(struct CTerrain *src, struct CTerrain *dest,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void chopAddTerrainNode(struct CTerrain *ter, int x, int y)
|
static void chopAddTerrainNode(struct CTerrain *ter, int x, int y)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
@ -247,7 +249,6 @@ static void chopAddTerrainNode(struct CTerrain *ter, int x, int y)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void chopTerrainNodeDeleteAndShift(struct CTerrain *ter,int nodeIndex)
|
static void chopTerrainNodeDeleteAndShift(struct CTerrain *ter,int nodeIndex)
|
||||||
{
|
{
|
||||||
int i=nodeIndex;
|
int i=nodeIndex;
|
||||||
|
|
@ -334,7 +335,6 @@ int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int chopPointInTerrain(struct CTerrain *ter, int pX, int pY, int iTestType)
|
int chopPointInTerrain(struct CTerrain *ter, int pX, int pY, int iTestType)
|
||||||
{
|
{
|
||||||
int h = chopTerrainHeightAtPoint(ter, pX);
|
int h = chopTerrainHeightAtPoint(ter, pX);
|
||||||
|
|
@ -345,7 +345,6 @@ int chopPointInTerrain(struct CTerrain *ter, int pX, int pY, int iTestType)
|
||||||
return (pY < h);
|
return (pY < h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void chopAddBlock(int x,int y,int sx,int sy, int indexOverride)
|
static void chopAddBlock(int x,int y,int sx,int sy, int indexOverride)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
@ -485,15 +484,15 @@ static void chopKillPlayer(void)
|
||||||
if (iPlayerAlive == 0) {
|
if (iPlayerAlive == 0) {
|
||||||
rb->lcd_set_drawmode(DRMODE_FG);
|
rb->lcd_set_drawmode(DRMODE_FG);
|
||||||
#if LCD_DEPTH >= 2
|
#if LCD_DEPTH >= 2
|
||||||
rb->lcd_set_foreground(LCD_BLACK);
|
rb->lcd_set_foreground(LCD_WHITE);
|
||||||
#endif
|
#endif
|
||||||
checkHighScore();
|
checkHighScore();
|
||||||
|
|
||||||
rb->lcd_getstringsize("Game Over", &w, NULL);
|
rb->lcd_getstringsize("Game Over", &w, NULL);
|
||||||
rb->lcd_putsxy(LCD_WIDTH/2 - w/2 ,LCD_HEIGHT/2 - 20, "Game Over");
|
rb->lcd_putsxy(LCD_WIDTH/2 - w/2 ,LCD_HEIGHT/2 - 20, "Game Over");
|
||||||
rb->lcd_getstringsize("Press action to continue", &w, NULL);
|
rb->lcd_getstringsize("Press " ACTIONTEXT " to continue", &w, NULL);
|
||||||
rb->lcd_putsxy(LCD_WIDTH/2 - w/2 ,LCD_HEIGHT/2,
|
rb->lcd_putsxy(LCD_WIDTH/2 - w/2 ,LCD_HEIGHT/2,
|
||||||
"Press action to continue");
|
"Press " ACTIONTEXT " to continue");
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
||||||
rb->lcd_set_drawmode(DRMODE_SOLID);
|
rb->lcd_set_drawmode(DRMODE_SOLID);
|
||||||
|
|
@ -526,7 +525,6 @@ static void chopKillPlayer(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void chopDrawTheWorld(void)
|
static void chopDrawTheWorld(void)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
@ -564,14 +562,13 @@ static void chopDrawTheWorld(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void chopDrawParticle(struct CParticle *mParticle)
|
static void chopDrawParticle(struct CParticle *mParticle)
|
||||||
{
|
{
|
||||||
|
|
||||||
int iPosX = (mParticle->iWorldX - iCameraPosX);
|
int iPosX = (mParticle->iWorldX - iCameraPosX);
|
||||||
int iPosY = (mParticle->iWorldY);
|
int iPosY = (mParticle->iWorldY);
|
||||||
#if LCD_DEPTH > 2
|
#if LCD_DEPTH > 2
|
||||||
rb->lcd_set_foreground(LCD_RGBPACK(150,150,150));
|
rb->lcd_set_foreground(LCD_RGBPACK(192,192,192));
|
||||||
#elif LCD_DEPTH == 2
|
#elif LCD_DEPTH == 2
|
||||||
rb->lcd_set_foreground(LCD_LIGHTGRAY);
|
rb->lcd_set_foreground(LCD_LIGHTGRAY);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -584,7 +581,7 @@ static void chopDrawScene(void)
|
||||||
char s[30];
|
char s[30];
|
||||||
int w;
|
int w;
|
||||||
#if LCD_DEPTH > 2
|
#if LCD_DEPTH > 2
|
||||||
rb->lcd_set_background(LCD_RGBPACK(145,197,255));
|
rb->lcd_set_background(LCD_BLACK);
|
||||||
#elif LCD_DEPTH == 2
|
#elif LCD_DEPTH == 2
|
||||||
rb->lcd_set_background(LCD_WHITE);
|
rb->lcd_set_background(LCD_WHITE);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -596,7 +593,7 @@ static void chopDrawScene(void)
|
||||||
score = -20 + iPlayerPosX/3;
|
score = -20 + iPlayerPosX/3;
|
||||||
rb->lcd_set_drawmode(DRMODE_FG);
|
rb->lcd_set_drawmode(DRMODE_FG);
|
||||||
#if LCD_DEPTH > 2
|
#if LCD_DEPTH > 2
|
||||||
rb->lcd_set_foreground(LCD_RGBPACK(20,20,20));
|
rb->lcd_set_foreground(LCD_BLACK);
|
||||||
#elif LCD_DEPTH == 2
|
#elif LCD_DEPTH == 2
|
||||||
rb->lcd_set_foreground(LCD_WHITE);
|
rb->lcd_set_foreground(LCD_WHITE);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -621,7 +618,6 @@ static int chopMenu(int menunum)
|
||||||
{ "Start New Game", NULL },
|
{ "Start New Game", NULL },
|
||||||
{ "Resume Game", NULL },
|
{ "Resume Game", NULL },
|
||||||
{ "Level", NULL },
|
{ "Level", NULL },
|
||||||
{ "Help", NULL },
|
|
||||||
{ "Quit", NULL },
|
{ "Quit", NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -630,6 +626,13 @@ static int chopMenu(int menunum)
|
||||||
{ "Steep", -1 },
|
{ "Steep", -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if HAVE_LCD_COLOR
|
||||||
|
rb->lcd_set_foreground(LCD_WHITE);
|
||||||
|
rb->lcd_set_background(LCD_BLACK);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
rb->lcd_clear_display();
|
||||||
|
|
||||||
m = rb->menu_init(items, sizeof(items) / sizeof(*items),
|
m = rb->menu_init(items, sizeof(items) / sizeof(*items),
|
||||||
NULL, NULL, NULL, NULL);
|
NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
|
@ -654,9 +657,6 @@ static int chopMenu(int menunum)
|
||||||
rb->set_option("Level", &iLevelMode, INT, levels, 2, NULL);
|
rb->set_option("Level", &iLevelMode, INT, levels, 2, NULL);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
rb->splash(HZ, true, "NOT AVAILABLE");
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
menu_quit=true;
|
menu_quit=true;
|
||||||
res = PLUGIN_OK;
|
res = PLUGIN_OK;
|
||||||
break;
|
break;
|
||||||
|
|
@ -817,7 +817,7 @@ static void chopDrawBlock(struct CBlock *mBlock)
|
||||||
int iPosX = (mBlock->iWorldX - iCameraPosX);
|
int iPosX = (mBlock->iWorldX - iCameraPosX);
|
||||||
int iPosY = (mBlock->iWorldY);
|
int iPosY = (mBlock->iWorldY);
|
||||||
#if LCD_DEPTH > 2
|
#if LCD_DEPTH > 2
|
||||||
rb->lcd_set_foreground(LCD_RGBPACK(30,30,30));
|
rb->lcd_set_foreground(LCD_RGBPACK(100,255,100));
|
||||||
#elif LCD_DEPTH == 2
|
#elif LCD_DEPTH == 2
|
||||||
rb->lcd_set_foreground(LCD_BLACK);
|
rb->lcd_set_foreground(LCD_BLACK);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -848,7 +848,7 @@ static void chopRenderTerrain(struct CTerrain *ter)
|
||||||
int x2 = ter->mNodes[i].x - iCameraPosX;
|
int x2 = ter->mNodes[i].x - iCameraPosX;
|
||||||
int y2 = ter->mNodes[i].y;
|
int y2 = ter->mNodes[i].y;
|
||||||
#if LCD_DEPTH > 2
|
#if LCD_DEPTH > 2
|
||||||
rb->lcd_set_foreground(LCD_RGBPACK(50,100,250));
|
rb->lcd_set_foreground(LCD_RGBPACK(100,255,100));
|
||||||
#elif LCD_DEPTH == 2
|
#elif LCD_DEPTH == 2
|
||||||
rb->lcd_set_foreground(LCD_DARKGRAY);
|
rb->lcd_set_foreground(LCD_DARKGRAY);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -922,6 +922,14 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
rb->lcd_setfont(FONT_SYSFIXED);
|
rb->lcd_setfont(FONT_SYSFIXED);
|
||||||
|
#if LCD_DEPTH > 1
|
||||||
|
rb->lcd_set_backdrop(NULL);
|
||||||
|
#endif
|
||||||
|
#if HAVE_LCD_COLOR
|
||||||
|
rb->lcd_set_background(LCD_BLACK);
|
||||||
|
rb->lcd_set_foreground(LCD_WHITE);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Permanently enable the backlight (unless the user has turned it off) */
|
/* Permanently enable the backlight (unless the user has turned it off) */
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
if (rb->global_settings->backlight_timeout > 0)
|
||||||
rb->backlight_set_timeout(1);
|
rb->backlight_set_timeout(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue