Пример #1
0
 private protected static void ParseAsset <T>(BinaryReader reader, T result)
     where T : BaseSingleSound
 {
     result.Volume             = reader.ReadPercentage();
     result.VolumeShift        = reader.ReadPercentage();
     result.PerFileVolumeShift = reader.ReadPercentage();
     result.MinVolume          = reader.ReadPercentage();
     result.PlayPercent        = reader.ReadPercentage();
     result.Limit         = reader.ReadInt32();
     result.Priority      = reader.ReadInt32AsEnum <AudioPriority>();
     result.Type          = reader.ReadUInt32AsEnumFlags <AudioTypeFlags>();
     result.Control       = reader.ReadUInt32AsEnumFlags <AudioControlFlags>();
     result.MinRange      = reader.ReadSingle();
     result.MaxRange      = reader.ReadSingle();
     result.LowPassCutoff = reader.ReadPercentage();
     result.ZoomedInOffscreenVolumePercent    = reader.ReadPercentage();
     result.ZoomedInOffscreenMinVolumePercent = reader.ReadPercentage();
     result.ZoomedInOffscreenOcclusionPercent = reader.ReadPercentage();
     result.ReverbEffectLevel       = reader.ReadPercentage();
     result.DryLevel                = reader.ReadPercentage();
     result.SubmixSlider            = reader.ReadOptionalValueAtOffset(() => reader.ReadUInt32AsEnum <AudioVolumeSlider>());
     result.PitchShift              = reader.ReadOptionalValueAtOffset(() => reader.ReadFloatRange());
     result.PerFilePitchShift       = reader.ReadOptionalValueAtOffset(() => reader.ReadFloatRange());
     result.Delay                   = reader.ReadOptionalValueAtOffset(() => reader.ReadIntRange());
     result.VolumeSliderMultipliers = reader.ReadListAtOffset(() => VolumeSliderMultiplier.ParseAsset(reader));
 }
Пример #2
0
        internal static AudioSettings ParseAsset(BinaryReader reader, Asset asset)
        {
            var result = new AudioSettings();

            result.SetNameAndInstanceId(asset);

            var streamBufferSizePerChannel = reader.ReadUInt32();
            var maxRequestsPerStream       = reader.ReadUInt32();

            result.ForceResetTime     = reader.ReadTime();
            result.EmergencyResetTime = reader.ReadTime();
            result.MinOcclusion       = reader.ReadPercentage();
            var delayPriorToPlayingToReadSoundFile = reader.ReadSingle();
            var readAheadTime  = reader.ReadSingle();
            var queueAheadTime = reader.ReadSingle();
            var longTime       = reader.ReadSingle();

            result.AudioFootprintInBytes = reader.ReadInt32();

            result.DefaultSoundVolume        = reader.ReadPercentage();
            result.DefaultVoiceVolume        = reader.ReadPercentage();
            result.DefaultMusicVolume        = reader.ReadPercentage();
            result.DefaultMovieVolume        = reader.ReadPercentage();
            result.DefaultAmbientVolume      = reader.ReadPercentage();
            result.AutomaticSubtitleDuration = reader.ReadTime();
            result.AutomaticSubtitleLines    = reader.ReadInt32();
            var panRadiusScaleValue = reader.ReadSingle();
            var panSize             = reader.ReadSingle();

            result.MinSampleVolume = reader.ReadSingle();
            result.PositionDeltaForReverbRecheck = reader.ReadSingle();
            result.TimeToFadeAudio = reader.ReadTime();
            result.AmbientStreamHysteresisVolume = reader.ReadInt32();
            var volumeMultiplierFor2DSounds = reader.ReadSingle();

            result.VoiceMoveToCampMaxCampnessAtStartPoint = reader.ReadInt32();
            result.VoiceMoveToCampMinCampnessAtEndPoint   = reader.ReadInt32();
            result.MinDelayBetweenEnterStateVoice         = reader.ReadTime();
            var timeSinceLastAttackForVoiceRetreatToCastle      = reader.ReadSingle();
            var distanceToLookForEnemiesForVoiceRetreatToCastle = reader.ReadSingle();
            var postPostGameMusicWait = reader.ReadSingle();

            result.AutomaticSubtitleWindowColor = reader.ReadColorRgbaF();
            result.AutomaticSubtitleTextColor   = reader.ReadColorRgbaF();

            result.VolumeSliderMultipliersForMovie = reader.ReadArrayAtOffset(() => VolumeSliderMultiplier.ParseAsset(reader));

            result.TacticalMicSettings    = MicrophoneSettings.ParseAsset(reader);
            result.LivingWorldMicSettings = MicrophoneSettings.ParseAsset(reader);
            result.ShellMicSettings       = MicrophoneSettings.ParseAsset(reader);

            result.VolumeCompressionSettings = VolumeCompressionSettings.ParseAsset(reader);

            result.SuppressOcclusion = reader.ReadBooleanChecked();
            var playEnemySightedEventsOnlyFromNearbyUnits = reader.ReadBooleanChecked();

            return(result);
        }