+2005-06-06
+ * fixed bug with exploding bomb using R'n'D graphics in EM engine
+
+2005-06-05
+ * enhanced tape autoplay to accept "autoplay <set> [<nr> ...]" format
+
2005-05-31
* uploaded pre-release (test) version 3.2.0-2 binary and source code
-#define COMPILE_DATE_STRING "[2005-06-04 02:53]"
+#define COMPILE_DATE_STRING "[2005-06-05 23:57]"
#define MAX_ELEM_X 4
#define MAX_ELEM_Y 10
-extern int element_shift;
-extern int editor_element[];
-extern int elements_in_list;
-
void CreateLevelEditorGadgets();
void FreeLevelEditorGadgets();
void UnmapLevelEditorGadgets();
for (i = 0; i < tape->length; i++)
{
- if (i >= MAX_TAPELEN)
+ if (i >= MAX_TAPE_LEN)
break;
for (j = 0; j < MAX_PLAYERS; j++)
for (i = 0; i < tape->length; i++)
{
- if (i >= MAX_TAPELEN)
+ if (i >= MAX_TAPE_LEN)
break;
printf("%03d: ", i);
EL_PENGUIN,
EL_PIG,
EL_DRAGON,
-#if 0 /* USE_GRAVITY_BUGFIX */
+
+#if 0 /* USE_GRAVITY_BUGFIX_OLD */
EL_PLAYER_IS_LEAVING, /* needed for gravity + "block last field" */
#endif
+
-1
};
}
else if (strncmp(command, "autoplay ", 9) == 0)
{
- char *str_copy = getStringCopy(&command[9]);
- char *str_ptr = strchr(str_copy, ' ');
+ char *str_ptr = getStringCopy(&command[9]); /* read command parameters */
+
+ while (*str_ptr != '\0') /* continue parsing string */
+ {
+ /* cut leading whitespace from string, replace it by string terminator */
+ while (*str_ptr == ' ' || *str_ptr == '\t')
+ *str_ptr++ = '\0';
+
+ if (*str_ptr == '\0') /* end of string reached */
+ break;
+
+ if (global.autoplay_leveldir == NULL) /* read level set string */
+ {
+ global.autoplay_leveldir = str_ptr;
+ global.autoplay_all = TRUE; /* default: play all tapes */
+
+ for (i = 0; i < MAX_TAPES_PER_SET; i++)
+ global.autoplay_level[i] = FALSE;
+ }
+ else /* read level number string */
+ {
+ int level_nr = atoi(str_ptr); /* get level_nr value */
- global.autoplay_leveldir = str_copy;
- global.autoplay_level_nr = -1;
+ if (level_nr >= 0 && level_nr < MAX_TAPES_PER_SET)
+ global.autoplay_level[level_nr] = TRUE;
- if (str_ptr != NULL)
+ global.autoplay_all = FALSE;
+ }
+
+ /* advance string pointer to the next whitespace (or end of string) */
+ while (*str_ptr != ' ' && *str_ptr != '\t' && *str_ptr != '\0')
+ str_ptr++;
+ }
+
+#if 0
+ printf("level set == '%s'\n", global.autoplay_leveldir);
+
+ if (global.autoplay_all)
+ printf("play all levels\n");
+ else
{
- *str_ptr++ = '\0'; /* terminate leveldir string */
- global.autoplay_level_nr = atoi(str_ptr); /* get level_nr value */
+ printf("play the following levels:");
+
+ for (i = 0; i < MAX_TAPES_PER_SET; i++)
+ if (global.autoplay_level[i])
+ printf(" %03d", i);
+
+ printf("\n");
}
+#endif
+
}
else if (strncmp(command, "convert ", 8) == 0)
{
global.convert_leveldir = str_copy;
global.convert_level_nr = -1;
- if (str_ptr != NULL)
+ if (str_ptr != NULL) /* level number follows */
{
*str_ptr++ = '\0'; /* terminate leveldir string */
global.convert_level_nr = atoi(str_ptr); /* get level_nr value */
" \"print helptext.conf\" print default helptext config\n"
" \"dump level FILE\" dump level data from FILE\n"
" \"dump tape FILE\" dump tape data from FILE\n"
- " \"autoplay LEVELDIR [NR]\" play level tapes for LEVELDIR\n"
+ " \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n"
" \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n"
"\n",
program.command_basename);
#define MAX_LEVEL_NAME_LEN 32
#define MAX_LEVEL_AUTHOR_LEN 32
#define MAX_ELEMENT_NAME_LEN 32
-#define MAX_TAPELEN (1000 * FRAMES_PER_SECOND) /* max.time x fps */
+#define MAX_TAPE_LEN (1000 * FRAMES_PER_SECOND) /* max.time x fps */
+#define MAX_TAPES_PER_SET 1024
#define MAX_SCORE_ENTRIES 100
#define MAX_NUM_AMOEBA 100
#define MAX_INVENTORY_SIZE 1000
{
byte action[MAX_PLAYERS];
byte delay;
- } pos[MAX_TAPELEN];
+ } pos[MAX_TAPE_LEN];
boolean no_valid_file; /* set when tape file missing or invalid */
};
struct GlobalInfo
{
char *autoplay_leveldir;
- int autoplay_level_nr;
+ int autoplay_level[MAX_TAPES_PER_SET];
+ boolean autoplay_all;
char *convert_leveldir;
int convert_level_nr;
return;
#endif
- if (tape.counter >= MAX_TAPELEN - 1)
+ if (tape.counter >= MAX_TAPE_LEN - 1)
{
TapeStopRecording();
return;
* tape autoplay functions
* ------------------------------------------------------------------------- */
-#define MAX_NUM_AUTOPLAY_LEVELS 1000
-
void AutoPlayTape()
{
static LevelDirTree *autoplay_leveldir = NULL;
static int autoplay_level_nr = -1;
static int num_levels_played = 0;
static int num_levels_solved = 0;
- static boolean levels_failed[MAX_NUM_AUTOPLAY_LEVELS];
+ static int num_tape_missing = 0;
+ static boolean level_failed[MAX_TAPES_PER_SET];
+ static boolean tape_missing[MAX_TAPES_PER_SET];
int i;
if (autoplay_initialized)
printf("%s.\n", tape.auto_play_level_solved ? "solved" : "NOT SOLVED");
num_levels_played++;
+
if (tape.auto_play_level_solved)
num_levels_solved++;
- else if (level_nr >= 0 && level_nr < MAX_NUM_AUTOPLAY_LEVELS)
- levels_failed[level_nr] = TRUE;
+ else if (level_nr >= 0 && level_nr < MAX_TAPES_PER_SET)
+ level_failed[level_nr] = TRUE;
}
else
{
leveldir_current = autoplay_leveldir;
- if (global.autoplay_level_nr != -1)
- {
- autoplay_leveldir->first_level = global.autoplay_level_nr;
- autoplay_leveldir->last_level = global.autoplay_level_nr;
- }
+ if (autoplay_leveldir->first_level < 0)
+ autoplay_leveldir->first_level = 0;
+ if (autoplay_leveldir->last_level >= MAX_TAPES_PER_SET)
+ autoplay_leveldir->last_level = MAX_TAPES_PER_SET - 1;
autoplay_level_nr = autoplay_leveldir->first_level;
printf_line("=", 79);
printf("\n");
- for (i = 0; i < MAX_NUM_AUTOPLAY_LEVELS; i++)
- levels_failed[i] = FALSE;
+ for (i = 0; i < MAX_TAPES_PER_SET; i++)
+ {
+ level_failed[i] = FALSE;
+ tape_missing[i] = FALSE;
+ }
autoplay_initialized = TRUE;
}
{
level_nr = autoplay_level_nr++;
+ if (!global.autoplay_all && !global.autoplay_level[level_nr])
+ continue;
+
TapeErase();
printf("Level %03d: ", level_nr);
if (TAPE_IS_EMPTY(tape))
#endif
{
+ num_tape_missing++;
+ if (level_nr >= 0 && level_nr < MAX_TAPES_PER_SET)
+ tape_missing[level_nr] = TRUE;
+
printf("(no tape)\n");
continue;
}
if (num_levels_played != num_levels_solved)
{
printf(", FAILED:");
- for (i = 0; i < MAX_NUM_AUTOPLAY_LEVELS; i++)
- if (levels_failed[i])
+ for (i = 0; i < MAX_TAPES_PER_SET; i++)
+ if (level_failed[i])
+ printf(" %03d", i);
+ }
+
+ if (num_tape_missing > 0)
+ {
+ printf(", NO TAPE:");
+ for (i = 0; i < MAX_TAPES_PER_SET; i++)
+ if (tape_missing[i])
printf(" %03d", i);
}
},
{
Ybomb_eat, FALSE, FALSE,
- EL_BOMB, ACTION_SMASHED_BY_ROCK, -1
+ EL_BOMB, ACTION_ACTIVATING, -1
},
{
Xballoon, TRUE, FALSE,