#define CONF_CONTENTS_ELEMENT(b,c,x,y) ((b[CONF_CONTENT_BYTE_POS(c,x,y)]<< 8)|\
(b[CONF_CONTENT_BYTE_POS(c,x,y) + 1]))
+#if 0
+static void LoadLevel_InitPlayfield(struct LevelInfo *, char *);
+#endif
+
static struct LevelInfo li;
static struct
for (x = 0; x < EM_MAX_CAVE_WIDTH; x++)
level_em->cave[x][y] = ZBORDER;
+#if 1
+
+#if 0
+#if 1
+ LoadLevel_InitPlayfield();
+#else
+ lev_fieldx = lev->width; /* !!! also in LoadLevel_InitPlayfield() !!! */
+ lev_fieldy = lev->height; /* !!! also in LoadLevel_InitPlayfield() !!! */
+ SetBorderElement(); /* !!! also in LoadLevel_InitPlayfield() !!! */
+#endif
+#endif
+
+#if 0
+ printf("::: BorderElement == %d\n", BorderElement);
+#endif
+
+ if (BorderElement == EL_STEELWALL)
+ {
+ for (y = 0; y < lev->height + 2; y++)
+ for (x = 0; x < lev->width + 2; x++)
+ level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_STEELWALL);
+ }
+
+ /* then copy the real level contents from level file into the playfield */
+ for (y = 0; y < lev->height; y++) for (x = 0; x < lev->width; x++)
+ {
+ int new_element = map_element_RND_to_EM(level->field[x][y]);
+ int offset = (BorderElement == EL_STEELWALL ? 1 : 0);
+ int xx = x + 1 + offset;
+ int yy = y + 1 + offset;
+
+ if (level->field[x][y] == EL_AMOEBA_DEAD)
+ new_element = map_element_RND_to_EM(EL_AMOEBA_WET);
+
+ level_em->cave[xx][yy] = new_element;
+ }
+
+#else
+
/* then copy the real level contents from level file into the playfield */
for (y = 0; y < lev->height; y++) for (x = 0; x < lev->width; x++)
{
level_em->cave[x + 1][y + 1] = new_element;
}
+#endif
+
#if 1
for (i = 0; i < MAX_PLAYERS; i++)
{
#if 1
-
if (ELEM_IS_PLAYER(level->field[x][y]))
{
int player_nr = GET_PLAYER_NR(level->field[x][y]);
+ int offset = (BorderElement == EL_STEELWALL ? 1 : 0);
+ int xx = x + 1 + offset;
+ int yy = y + 1 + offset;
- ply[player_nr]->x_initial = x + 1;
- ply[player_nr]->y_initial = y + 1;
+ ply[player_nr]->x_initial = xx;
+ ply[player_nr]->y_initial = yy;
- level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_EMPTY);
+ level_em->cave[xx][yy] = map_element_RND_to_EM(EL_EMPTY);
}
#else
#endif
}
+
+ if (BorderElement == EL_STEELWALL)
+ {
+#if 1
+ lev->width += 2;
+ lev->height += 2;
+#endif
+ }
}
void CopyNativeLevel_EM_to_RND(struct LevelInfo *level)
if (level->game_engine_type == GAME_ENGINE_TYPE_UNKNOWN)
level->game_engine_type = GAME_ENGINE_TYPE_RND;
+#if 1
+ if (level_file_info->type != LEVEL_FILE_TYPE_RND)
+ CopyNativeLevel_Native_to_RND(level);
+#else
if (level_file_info->type == LEVEL_FILE_TYPE_RND)
CopyNativeLevel_RND_to_Native(level);
else
CopyNativeLevel_Native_to_RND(level);
+#endif
}
void LoadLevelFromFilename(struct LevelInfo *level, char *filename)
SetBorderElement();
}
+static void LoadLevel_InitNativeEngines(struct LevelInfo *level,char *filename)
+{
+ struct LevelFileInfo *level_file_info = &level->file_info;
+
+#if 1
+ if (level_file_info->type == LEVEL_FILE_TYPE_RND)
+ CopyNativeLevel_RND_to_Native(level);
+#else
+ if (level_file_info->type == LEVEL_FILE_TYPE_RND)
+ CopyNativeLevel_RND_to_Native(level);
+ else
+ CopyNativeLevel_Native_to_RND(level);
+#endif
+}
+
void LoadLevelTemplate(int nr)
{
char *filename;
LoadLevel_InitVersion(&level, filename);
LoadLevel_InitElements(&level, filename);
LoadLevel_InitPlayfield(&level, filename);
+
+ LoadLevel_InitNativeEngines(&level, filename);
}
static void SaveLevel_VERS(FILE *file, struct LevelInfo *level)
void DumpTape(struct TapeInfo *tape)
{
+ int tape_frame_counter;
int i, j;
if (tape->no_valid_file)
printf("Level series identifier: '%s'\n", tape->level_identifier);
printf_line("-", 79);
+ tape_frame_counter = 0;
+
for (i = 0; i < tape->length; i++)
{
if (i >= MAX_TAPE_LEN)
break;
- printf("%03d: ", i);
+ printf("%04d: ", i);
for (j = 0; j < MAX_PLAYERS; j++)
{
}
}
- printf("(%03d)\n", tape->pos[i].delay);
+ printf("(%03d) ", tape->pos[i].delay);
+ printf("[%05d]\n", tape_frame_counter);
+
+ tape_frame_counter += tape->pos[i].delay;
}
printf_line("-", 79);
#define SETUP_TOKEN_TIME_LIMIT 14
#define SETUP_TOKEN_FULLSCREEN 15
#define SETUP_TOKEN_ASK_ON_ESCAPE 16
-#define SETUP_TOKEN_GRAPHICS_SET 17
-#define SETUP_TOKEN_SOUNDS_SET 18
-#define SETUP_TOKEN_MUSIC_SET 19
-#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 20
-#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 21
-#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 22
+#define SETUP_TOKEN_QUICK_SWITCH 17
+#define SETUP_TOKEN_GRAPHICS_SET 18
+#define SETUP_TOKEN_SOUNDS_SET 19
+#define SETUP_TOKEN_MUSIC_SET 20
+#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 21
+#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 22
+#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 23
-#define NUM_GLOBAL_SETUP_TOKENS 23
+#define NUM_GLOBAL_SETUP_TOKENS 24
/* editor setup */
#define SETUP_TOKEN_EDITOR_EL_BOULDERDASH 0
{ TYPE_SWITCH, &si.time_limit, "time_limit" },
{ TYPE_SWITCH, &si.fullscreen, "fullscreen" },
{ TYPE_SWITCH, &si.ask_on_escape, "ask_on_escape" },
+ { TYPE_SWITCH, &si.quick_switch, "quick_player_switch" },
{ TYPE_STRING, &si.graphics_set, "graphics_set" },
{ TYPE_STRING, &si.sounds_set, "sounds_set" },
{ TYPE_STRING, &si.music_set, "music_set" },
si->time_limit = TRUE;
si->fullscreen = FALSE;
si->ask_on_escape = TRUE;
+ si->quick_switch = FALSE;
si->graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR);
si->sounds_set = getStringCopy(SND_CLASSIC_SUBDIR);
#if 0
for (i = 0; i < num_list_entries; i++)
- printf("::: %d, %d, %d => %d\n",
+ printf("::: '%s': %d, %d, %d => %d\n",
+ EL_NAME(helpanim_info[i].element),
helpanim_info[i].element,
helpanim_info[i].action,
helpanim_info[i].direction,