public void FromCache(Halo2.CacheFile c, cache_file_sound_group snd) { var icti = c.TagIndexManager as InternalCacheTagIndex; var ugh_ = icti[icti.SoundGestaltTagIndex].TagDefinition as sound_cache_file_gestalt_group; Reconstruct(ugh_, snd); }
void Reconstruct(sound_cache_file_gestalt_group gestalt, cache_file_sound_group snd) { int index; this.Flags.Value = snd.Flags.Value; this.Class.Value = snd.SoundClass.Value; this.SampleRate.Value = snd.SampleRate.Value; this.Encoding.Value = snd.Encoding.Value; this.Compression.Value = snd.Compression.Value; index = snd.PlaybackIndex.Value; if (index != -1) { this.Playback.Value = gestalt.Playbacks[index].Playback.Value.Clone(this) as sound_playback_parameters_struct; } index = snd.ScaleIndex.Value; if (index != -1) { this.Scale.Value = gestalt.Scales[index].Scale.Value.Clone(this) as sound_scale_modifiers_struct; } index = snd.PromotionIndex.Value; if (index != -1) { this.Promotion.Value = gestalt.Promotions[index].Promotion.Value.Clone(this) as sound_promotion_parameters_struct; } index = snd.FirstPitchRangeIndex.Value; int count = snd.PitchRangeIndex.Value; if (index != -1) { this.PitchRanges.Resize(count); for (int x = 0; x < count; x++) { this.PitchRanges[x].Reconstruct(gestalt, gestalt.PitchRanges[index + x]); } } index = snd.CustomPlaybackIndex.Value; if (index != -1) { sound_platform_sound_playback_block param; this.PlatformParameters.Add(out param); param.PlaybackDefinition.Value = gestalt.CustomPlaybacks[index].PlaybackDefinition.Value.Clone(this) as simple_platform_sound_playback_struct; } index = snd.ExtraInfoIndex.Value; if (index != -1) { ExtraInfo.AddElement(gestalt.ExtraInfos[index].Clone(this) as sound_extra_info_block); } //snd.MaximumPlayTime.Value? }
void Reconstruct(sound_cache_file_gestalt_group gestalt, cache_file_sound_group snd) { int index; this.Flags.Value = snd.Flags.Value; this.Class.Value = snd.SoundClass.Value; this.SampleRate.Value = snd.SampleRate.Value; this.Encoding.Value = snd.Encoding.Value; this.Compression.Value = snd.Compression.Value; index = snd.PlaybackIndex.Value; if(index != -1) this.Playback.Value = gestalt.Playbacks[index].Playback.Value.Clone(this) as sound_playback_parameters_struct; index = snd.ScaleIndex.Value; if (index != -1) this.Scale.Value = gestalt.Scales[index].Scale.Value.Clone(this) as sound_scale_modifiers_struct; index = snd.PromotionIndex.Value; if (index != -1) this.Promotion.Value = gestalt.Promotions[index].Promotion.Value.Clone(this) as sound_promotion_parameters_struct; index = snd.FirstPitchRangeIndex.Value; int count = snd.PitchRangeIndex.Value; if (index != -1) { this.PitchRanges.Resize(count); for (int x = 0; x < count; x++) this.PitchRanges[x].Reconstruct(gestalt, gestalt.PitchRanges[index + x]); } index = snd.CustomPlaybackIndex.Value; if (index != -1) { sound_platform_sound_playback_block param; this.PlatformParameters.Add(out param); param.PlaybackDefinition.Value = gestalt.CustomPlaybacks[index].PlaybackDefinition.Value.Clone(this) as simple_platform_sound_playback_struct; } index = snd.ExtraInfoIndex.Value; if (index != -1) ExtraInfo.AddElement(gestalt.ExtraInfos[index].Clone(this) as sound_extra_info_block); //snd.MaximumPlayTime.Value? }