private void SerializeChrAnimationTerminator(ref int frameIndex) { if (frameIndex < 256) { ChrAnimation.SerializeChrAnimationTerminator(this, ref frameIndex); } }
private void SerializeLevelChrAnimation(ref int frameIndex, LevelIndex index) { // LevelIndex.None = title screen ChrAnimationLevelData data = (index == LevelIndex.None) ? TitleChrAnimationTable : Levels[index].ChrAnimation; // Level's default animation will use next available frame entry ChrUsage.MMC3_SetBgLoopStart(index, (byte)frameIndex); // Write frame data to chr animation table ChrAnimation.SerializeChrAnimation(this, data, ref frameIndex); }
private void LoadChrAnimationTable() { if (Format.HasChrAnimationTable) { this.ChrAnimationTableMissing = !HasChrAnimationIndicator(); ChrAnimationData = ChrAnimation.DeserializeChrAnimation(this, null); // If the ROM does not have a CHR animation table, or we some how magically end up missing chr animation data for a level, default animation tables will be created foreach (LevelIndex level in new LevelIndex[] { LevelIndex.None, LevelIndex.Brinstar, LevelIndex.Norfair, LevelIndex.Tourian, LevelIndex.Kraid, LevelIndex.Ridley }) { ChrAnimationLevelData levelData; if (ChrAnimationTableMissing || !ChrAnimationData.TryGetValue(level, out levelData)) { ChrAnimationData[level] = CreateDefaultAnimationsForLevel(level); } } } }