int content_array[MAX_ELEMENT_CONTENTS][3][3];
element = getMappedElement(getFile16BitBE(file));
num_contents = getFile8Bit(file);
int content_array[MAX_ELEMENT_CONTENTS][3][3];
element = getMappedElement(getFile16BitBE(file));
num_contents = getFile8Bit(file);
else /* check for pre-2.0 file format with cookie string */
{
strcpy(cookie, chunk_name);
else /* check for pre-2.0 file format with cookie string */
{
strcpy(cookie, chunk_name);
/* check "magic bytes" for correct file format */
if (!strPrefix(magic_bytes, "DC2"))
/* check "magic bytes" for correct file format */
if (!strPrefix(magic_bytes, "DC2"))
/* if level file is invalid, restore level structure to default values */
if (level->no_valid_file)
/* if level file is invalid, restore level structure to default values */
if (level->no_valid_file)
if (level->game_engine_type == GAME_ENGINE_TYPE_UNKNOWN)
level->game_engine_type = GAME_ENGINE_TYPE_RND;
if (level->game_engine_type == GAME_ENGINE_TYPE_UNKNOWN)
level->game_engine_type = GAME_ENGINE_TYPE_RND;
else /* check for pre-2.0 file format with cookie string */
{
strcpy(cookie, chunk_name);
else /* check for pre-2.0 file format with cookie string */
{
strcpy(cookie, chunk_name);
- fscanf(file, "%d", &highscore[i].Score);
- fgets(line, MAX_LINE_LEN, file);
+ if (fscanf(file, "%d", &highscore[i].Score) == EOF)
+ Error(ERR_WARN, "fscanf() failed; %s", strerror(errno));
+ if (fgets(line, MAX_LINE_LEN, file) == NULL)
+ line[0] = '\0';
#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 30
#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 31
#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 32
#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 30
#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 31
#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 32
{ TYPE_SWITCH3,&si.override_level_graphics, "override_level_graphics" },
{ TYPE_SWITCH3,&si.override_level_sounds, "override_level_sounds" },
{ TYPE_SWITCH3,&si.override_level_music, "override_level_music" },
{ TYPE_SWITCH3,&si.override_level_graphics, "override_level_graphics" },
{ TYPE_SWITCH3,&si.override_level_sounds, "override_level_sounds" },
{ TYPE_SWITCH3,&si.override_level_music, "override_level_music" },
+ { TYPE_INTEGER,&si.volume_simple, "volume_simple" },
+ { TYPE_INTEGER,&si.volume_loops, "volume_loops" },
+ { TYPE_INTEGER,&si.volume_music, "volume_music" },
si->editor.el_boulderdash = TRUE;
si->editor.el_emerald_mine = TRUE;
si->editor.el_emerald_mine_club = TRUE;
si->editor.el_boulderdash = TRUE;
si->editor.el_emerald_mine = TRUE;
si->editor.el_emerald_mine_club = TRUE;
fprintf(file, "\n");
fprintf(file, "%s\n", getSetupLine(global_setup_tokens, "", i));
fprintf(file, "\n");
fprintf(file, "%s\n", getSetupLine(global_setup_tokens, "", i));