demo->data[demo->length++] = ((demo_repeat % 16 - 1) << 4) | demo_action;
}
- demo->data[demo->length++] = 0xff;
-
demo->is_available = TRUE;
}
return;
tape.level_nr = demo->level_nr; /* (currently not used) */
- tape.length = demo->length - 1; /* without "end of demo" byte */
+ tape.length = demo->length;
tape.random_seed = level_sp->header.DemoRandomSeed;
TapeSetDateFromEpochSeconds(getFileTimestampEpochSeconds(filename));
- for (i = 0; i < demo->length - 1; i++)
+ for (i = 0; i < demo->length; i++)
{
int demo_action = demo->data[i] & 0x0f;
int demo_repeat = (demo->data[i] & 0xf0) >> 4;
native_sp_level.demo.data[i] = getFile8Bit(file);
if (native_sp_level.demo.data[i] == 0xff) /* "end of demo" byte */
- {
- i++;
-
break;
- }
}
native_sp_level.demo.length = i;
for (i = 0; i < native_sp_level.demo.length; i++)
putFile8Bit(file, native_sp_level.demo.data[i]);
+
+ putFile8Bit(file, 0xff); /* "end of demo" byte */
}
fclose(file);