# uncomment if system has no joystick include file
# JOYSTICK = -DNO_JOYSTICK
-# choose if more than one global score file entry for one player is allowed
-# (default: MANY_PER_NAME)
-# uncomment to install game in multi-user environment
-# SCORE_ENTRIES = ONE_PER_NAME
-# uncomment to install game in single-user environment (default)
-# SCORE_ENTRIES = MANY_PER_NAME
-
# path for cross-compiling (only needed for non-native Windows build)
CROSS_PATH_WIN32 = /usr/local/cross-tools/i386-mingw32msvc
CONFIG_RW_GAME_DIR = -DRW_GAME_DIR="\"$(RW_GAME_DIR)\""
endif
-ifdef SCORE_ENTRIES # number of score entries per player
-CONFIG_SCORE_ENTRIES = -D$(SCORE_ENTRIES)
-endif
-
-CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
-CONFIG_GAME = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES)
+CONFIG = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR) $(JOYSTICK)
-CONFIG = $(CONFIG_GAME) $(JOYSTICK)
DEBUG = -DDEBUG -g
+
# PROFILING = $(PROFILING_FLAGS)
# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
{
int k, l;
int position = -1;
+ boolean one_score_entry_per_name = !program.many_scores_per_name;
LoadScore(level_nr);
{
int m = MAX_SCORE_ENTRIES - 1;
-#ifdef ONE_PER_NAME
- for (l = k; l < MAX_SCORE_ENTRIES; l++)
- if (strEqual(setup.player_name, highscore[l].Name))
- m = l;
- if (m == k) /* player's new highscore overwrites his old one */
- goto put_into_list;
-#endif
+ if (one_score_entry_per_name)
+ {
+ for (l = k; l < MAX_SCORE_ENTRIES; l++)
+ if (strEqual(setup.player_name, highscore[l].Name))
+ m = l;
+
+ if (m == k) /* player's new highscore overwrites his old one */
+ goto put_into_list;
+ }
for (l = m; l > k; l--)
{
}
}
-#ifdef ONE_PER_NAME
put_into_list:
-#endif
+
strncpy(highscore[k].Name, setup.player_name, MAX_PLAYER_NAME_LEN);
highscore[k].Name[MAX_PLAYER_NAME_LEN] = '\0';
highscore[k].Score = local_player->score_final;
position = k;
+
break;
}
-
-#ifdef ONE_PER_NAME
- else if (!strncmp(setup.player_name, highscore[k].Name,
+ else if (one_score_entry_per_name &&
+ !strncmp(setup.player_name, highscore[k].Name,
MAX_PLAYER_NAME_LEN))
break; /* player already there with a higher score */
-#endif
-
}
if (position >= 0)