#define TAPE_CHUNK_VERS_SIZE 8 /* size of file version chunk */
#define TAPE_CHUNK_HEAD_SIZE 20 /* size of tape file header */
-#define TAPE_CHUNK_HEAD_UNUSED 3 /* unused tape header bytes */
+#define TAPE_CHUNK_HEAD_UNUSED 2 /* unused tape header bytes */
#define LEVEL_CHUNK_CNT3_SIZE(x) (LEVEL_CHUNK_CNT3_HEADER + (x))
#define LEVEL_CHUNK_CUS3_SIZE(x) (2 + (x) * LEVEL_CPART_CUS3_SIZE)
},
{
- EL_MM_FUSE, -1,
+ EL_MM_FUSE_ACTIVE, -1,
TYPE_INTEGER, CONF_VALUE_16_BIT(1),
- &li.mm_time_fuse, 0
+ &li.mm_time_fuse, 25
+ },
+ {
+ EL_MM_BOMB, -1,
+ TYPE_INTEGER, CONF_VALUE_16_BIT(1),
+ &li.mm_time_bomb, 75
+ },
+ {
+ EL_MM_GRAY_BALL, -1,
+ TYPE_INTEGER, CONF_VALUE_16_BIT(1),
+ &li.mm_time_ball, 75
+ },
+ {
+ EL_MM_STEEL_BLOCK, -1,
+ TYPE_INTEGER, CONF_VALUE_16_BIT(1),
+ &li.mm_time_block, 75
+ },
+ {
+ EL_MM_LIGHTBALL, -1,
+ TYPE_INTEGER, CONF_VALUE_16_BIT(1),
+ &li.score[SC_ELEM_BONUS], 10
},
/* ---------- unused values ----------------------------------------------- */
{
EL_UNKNOWN, SAVE_CONF_NEVER,
TYPE_INTEGER, CONF_VALUE_16_BIT(1),
- &li.score[SC_UNKNOWN_14], 10
- },
- {
- EL_UNKNOWN, SAVE_CONF_NEVER,
- TYPE_INTEGER, CONF_VALUE_16_BIT(2),
&li.score[SC_UNKNOWN_15], 10
},
struct LevelInfo_MM *level_mm = level->native_mm_level;
int x, y;
- level_mm->file_version = level->file_version;
- level_mm->game_version = level->game_version;
- level_mm->encoding_16bit_field = level->encoding_16bit_field;
-
level_mm->fieldx = MIN(level->fieldx, MM_MAX_PLAYFIELD_WIDTH);
level_mm->fieldy = MIN(level->fieldy, MM_MAX_PLAYFIELD_HEIGHT);
strcpy(level_mm->name, level->name);
strcpy(level_mm->author, level->author);
+ level_mm->score[SC_EMERALD] = level->score[SC_EMERALD];
level_mm->score[SC_PACMAN] = level->score[SC_PACMAN];
- level_mm->score[SC_KEY] = level->score[SC_PACMAN];
+ level_mm->score[SC_KEY] = level->score[SC_KEY];
level_mm->score[SC_TIME_BONUS] = level->score[SC_TIME_BONUS];
+ level_mm->score[SC_ELEM_BONUS] = level->score[SC_ELEM_BONUS];
level_mm->amoeba_speed = level->amoeba_speed;
- level_mm->time_fuse = level->mm_time_fuse;
+ level_mm->time_fuse = level->mm_time_fuse;
+ level_mm->time_bomb = level->mm_time_bomb;
+ level_mm->time_ball = level->mm_time_ball;
+ level_mm->time_block = level->mm_time_block;
for (x = 0; x < level->fieldx; x++)
for (y = 0; y < level->fieldy; y++)
struct LevelInfo_MM *level_mm = level->native_mm_level;
int x, y;
- level->file_version = level_mm->file_version;
- level->game_version = level_mm->game_version;
- level->encoding_16bit_field = level_mm->encoding_16bit_field;
-
level->fieldx = MIN(level_mm->fieldx, MAX_LEV_FIELDX);
level->fieldy = MIN(level_mm->fieldy, MAX_LEV_FIELDY);
if (!strEqual(level_mm->author, ANONYMOUS_NAME))
strcpy(level->author, level_mm->author);
+ level->score[SC_EMERALD] = level_mm->score[SC_EMERALD];
level->score[SC_PACMAN] = level_mm->score[SC_PACMAN];
- level->score[SC_KEY] = level_mm->score[SC_PACMAN];
+ level->score[SC_KEY] = level_mm->score[SC_KEY];
level->score[SC_TIME_BONUS] = level_mm->score[SC_TIME_BONUS];
+ level->score[SC_ELEM_BONUS] = level_mm->score[SC_ELEM_BONUS];
- level->amoeba_speed = level_mm->amoeba_speed;
- level->mm_time_fuse = level_mm->time_fuse;
+ level->amoeba_speed = level_mm->amoeba_speed;
+ level->mm_time_fuse = level_mm->time_fuse;
+ level->mm_time_bomb = level_mm->time_bomb;
+ level->mm_time_ball = level_mm->time_ball;
+ level->mm_time_block = level_mm->time_block;
for (x = 0; x < level->fieldx; x++)
for (y = 0; y < level->fieldy; y++)
}
}
+ tape->use_mouse = (getFile8Bit(file) == 1 ? TRUE : FALSE);
+
ReadUnusedBytesFromFile(file, TAPE_CHUNK_HEAD_UNUSED);
engine_version = getFileVersion(file);
static int LoadTape_BODY(File *file, int chunk_size, struct TapeInfo *tape)
{
int i, j;
- int chunk_size_expected =
- (tape->num_participating_players + 1) * tape->length;
+ int tape_pos_size =
+ (tape->use_mouse ? 3 : tape->num_participating_players) + 1;
+ int chunk_size_expected = tape_pos_size * tape->length;
if (chunk_size_expected != chunk_size)
{
break;
}
- for (j = 0; j < MAX_PLAYERS; j++)
+ if (tape->use_mouse)
{
- tape->pos[i].action[j] = MV_NONE;
+ tape->pos[i].action[TAPE_ACTION_LX] = getFile8Bit(file);
+ tape->pos[i].action[TAPE_ACTION_LY] = getFile8Bit(file);
+ tape->pos[i].action[TAPE_ACTION_BUTTON] = getFile8Bit(file);
- if (tape->player_participates[j])
- tape->pos[i].action[j] = getFile8Bit(file);
+ tape->pos[i].action[TAPE_ACTION_UNUSED] = 0;
+ }
+ else
+ {
+ for (j = 0; j < MAX_PLAYERS; j++)
+ {
+ tape->pos[i].action[j] = MV_NONE;
+
+ if (tape->player_participates[j])
+ tape->pos[i].action[j] = getFile8Bit(file);
+ }
}
tape->pos[i].delay = getFile8Bit(file);
}
if (i != tape->length)
- chunk_size = (tape->num_participating_players + 1) * i;
+ chunk_size = tape_pos_size * i;
return chunk_size;
}
putFile8Bit(file, store_participating_players);
+ putFile8Bit(file, (tape->use_mouse ? 1 : 0));
+
/* unused bytes not at the end here for 4-byte alignment of engine_version */
WriteUnusedBytesToFile(file, TAPE_CHUNK_HEAD_UNUSED);
for (i = 0; i < tape->length; i++)
{
- for (j = 0; j < MAX_PLAYERS; j++)
- if (tape->player_participates[j])
- putFile8Bit(file, tape->pos[i].action[j]);
+ if (tape->use_mouse)
+ {
+ putFile8Bit(file, tape->pos[i].action[TAPE_ACTION_LX]);
+ putFile8Bit(file, tape->pos[i].action[TAPE_ACTION_LY]);
+ putFile8Bit(file, tape->pos[i].action[TAPE_ACTION_BUTTON]);
+ }
+ else
+ {
+ for (j = 0; j < MAX_PLAYERS; j++)
+ if (tape->player_participates[j])
+ putFile8Bit(file, tape->pos[i].action[j]);
+ }
putFile8Bit(file, tape->pos[i].delay);
}
char *filename = getTapeFilename(nr);
FILE *file;
int num_participating_players = 0;
+ int tape_pos_size;
int info_chunk_size;
int body_chunk_size;
int i;
if (tape.player_participates[i])
num_participating_players++;
+ tape_pos_size = (tape.use_mouse ? 3 : num_participating_players) + 1;
+
info_chunk_size = 2 + (strlen(tape.level_identifier) + 1) + 2;
- body_chunk_size = (num_participating_players + 1) * tape.length;
+ body_chunk_size = tape_pos_size * tape.length;
putFileChunkBE(file, "RND1", CHUNK_SIZE_UNDEFINED);
putFileChunkBE(file, "TAPE", CHUNK_SIZE_NONE);