mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
use same variable/macro name for highscore among plugins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24941 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c3abab85ac
commit
3f8d4a5a0f
8 changed files with 61 additions and 60 deletions
|
@ -29,7 +29,7 @@
|
|||
PLUGIN_HEADER
|
||||
|
||||
/* save files */
|
||||
#define HIGH_SCORE PLUGIN_GAMES_DIR "/blackjack.score"
|
||||
#define SCORE_FILE PLUGIN_GAMES_DIR "/blackjack.score"
|
||||
#define SAVE_FILE PLUGIN_GAMES_DIR "/blackjack.save"
|
||||
#define NUM_SCORES 5
|
||||
|
||||
|
@ -491,7 +491,7 @@ typedef struct game_context {
|
|||
|
||||
static bool resume = false;
|
||||
static bool resume_file = false;
|
||||
static struct highscore highest[NUM_SCORES];
|
||||
static struct highscore highscores[NUM_SCORES];
|
||||
|
||||
/*****************************************************************************
|
||||
* blackjack_init() initializes blackjack data structures.
|
||||
|
@ -1200,7 +1200,7 @@ static unsigned int blackjack_menu(void) {
|
|||
resume = false;
|
||||
break;
|
||||
case 2:
|
||||
highscore_show(NUM_SCORES, highest, NUM_SCORES, false);
|
||||
highscore_show(-1, highscores, NUM_SCORES, false);
|
||||
break;
|
||||
case 3:
|
||||
if(blackjack_help())
|
||||
|
@ -1488,7 +1488,7 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
#endif
|
||||
|
||||
/* load high scores */
|
||||
highscore_load(HIGH_SCORE,highest,NUM_SCORES);
|
||||
highscore_load(SCORE_FILE, highscores, NUM_SCORES);
|
||||
resume = blackjack_loadgame(&bj);
|
||||
resume_file = resume;
|
||||
|
||||
|
@ -1504,16 +1504,18 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
if(!resume && bj.player_money > 10) {
|
||||
/* There is no level, so store -1 to blank column */
|
||||
int position = highscore_update(bj.player_money, -1, "",
|
||||
highest, NUM_SCORES);
|
||||
if (position==0)
|
||||
rb->splash(HZ*2, "New High Score");
|
||||
highscores, NUM_SCORES);
|
||||
if (position != -1)
|
||||
highscore_show(position, highest, NUM_SCORES, false);
|
||||
{
|
||||
if (position==0)
|
||||
rb->splash(HZ*2, "New High Score");
|
||||
highscore_show(position, highscores, NUM_SCORES, false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case BJ_USB:
|
||||
highscore_save(HIGH_SCORE,highest,NUM_SCORES);
|
||||
highscore_save(SCORE_FILE, highscores, NUM_SCORES);
|
||||
return PLUGIN_USB_CONNECTED;
|
||||
|
||||
case BJ_QUIT:
|
||||
|
@ -1529,6 +1531,6 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
break;
|
||||
}
|
||||
}
|
||||
highscore_save(HIGH_SCORE,highest,NUM_SCORES);
|
||||
highscore_save(SCORE_FILE, highscores, NUM_SCORES);
|
||||
return PLUGIN_OK;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue