SHA256
Fix Audio Mixer Cleanup Issue
This commit is contained in:
3 files changed
+13
-78
No files matched your search
@@ -105,25 +105,8 @@
|
|||||||
<None Remove="Bundle\OSX\shaders" />
|
<None Remove="Bundle\OSX\shaders" />
|
||||||
<EmbeddedResource Include="Bundle\OSX\shaders" />
|
<EmbeddedResource Include="Bundle\OSX\shaders" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="obfuscar.xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FFmpeg.AutoGen" Version="8.1.0" />
|
<PackageReference Include="FFmpeg.AutoGen" Version="8.1.0" />
|
||||||
<PackageReference Include="Obfuscar" Version="2.2.49">
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
|
||||||
<GeneratePathProperty>true</GeneratePathProperty>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="Obfuscate" AfterTargets="AfterBuild" Condition="'$(Configuration)'=='Release'">
|
|
||||||
<Exec Command=""$(Obfuscar)" obfuscar.xml" EnvironmentVariables="ADOFAI_PATH=$(ADOFAI_PATH)" />
|
|
||||||
<Copy SourceFiles="$(TargetDir)obfuscated\$(TargetName).dll" DestinationFolder="$(TargetDir)" OverwriteReadOnlyFiles="true" />
|
|
||||||
<Copy SourceFiles="$(TargetDir)obfuscated\$(TargetName).pdb" DestinationFolder="$(TargetDir)" OverwriteReadOnlyFiles="true" Condition="Exists('$(TargetDir)obfuscated\$(TargetName).pdb')" />
|
|
||||||
<Message Text="Obfuscating project and replacing original binaries..." Importance="high" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
+13
-12
@@ -327,8 +327,15 @@ namespace ADOFAIRenderer.Util
|
|||||||
for (int s = 0; s < samplesNeeded; s++)
|
for (int s = 0; s < samplesNeeded; s++)
|
||||||
{
|
{
|
||||||
double sampleTime = frameStartTime + (double)s / _targetSampleRate;
|
double sampleTime = frameStartTime + (double)s / _targetSampleRate;
|
||||||
double elapsed = sampleTime - ev.StartTime;
|
|
||||||
|
|
||||||
|
// If it is a looping sound and has reached or exceeded its end time, stop playing.
|
||||||
|
if (ev.EndTime >= 0 && sampleTime >= ev.EndTime)
|
||||||
|
{
|
||||||
|
isSoundFinished = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
double elapsed = sampleTime - ev.StartTime;
|
||||||
if (elapsed < 0) continue; // Sound hasn't started yet
|
if (elapsed < 0) continue; // Sound hasn't started yet
|
||||||
|
|
||||||
double soundTime = elapsed * ev.Pitch;
|
double soundTime = elapsed * ev.Pitch;
|
||||||
@@ -340,15 +347,9 @@ namespace ADOFAIRenderer.Util
|
|||||||
isSoundFinished = true;
|
isSoundFinished = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else // Looping
|
|
||||||
{
|
// Looping
|
||||||
if (sampleTime >= ev.EndTime)
|
soundTime %= clipData.Duration;
|
||||||
{
|
|
||||||
isSoundFinished = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
soundTime %= clipData.Duration;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Linear interpolation for pitch shifting in the mixer loop
|
// Linear interpolation for pitch shifting in the mixer loop
|
||||||
@@ -368,8 +369,8 @@ namespace ADOFAIRenderer.Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up finished one-shot sounds
|
// Clean up finished sound events (both one-shot and looping)
|
||||||
if (isSoundFinished && ev.EndTime < 0)
|
if (isSoundFinished)
|
||||||
{
|
{
|
||||||
ActiveEvents.RemoveAt(i);
|
ActiveEvents.RemoveAt(i);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Obfuscator>
|
|
||||||
<Var name="InPath" value="./bin/Release/netstandard2.1" />
|
|
||||||
<Var name="OutPath" value="./bin/Release/netstandard2.1/obfuscated" />
|
|
||||||
|
|
||||||
<Var name="KeepPublicApi" value="false" />
|
|
||||||
<Var name="HidePrivateApi" value="true" />
|
|
||||||
<Var name="RenameProperties" value="true" />
|
|
||||||
<Var name="RenameEvents" value="true" />
|
|
||||||
<Var name="RenameFields" value="true" />
|
|
||||||
<Var name="UseUnicodeNames" value="false" />
|
|
||||||
<Var name="EmbedManifests" value="true" />
|
|
||||||
|
|
||||||
<Var name="Use=rename" value="true" />
|
|
||||||
<Var name="Use=controlflow" value="true" />
|
|
||||||
|
|
||||||
<!-- Environment variable passed from MSBuild -->
|
|
||||||
<Var name="ADOFAI_PATH" value="%ADOFAI_PATH%" />
|
|
||||||
|
|
||||||
<!-- Dependency search paths -->
|
|
||||||
<AssemblySearchPath path="$(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed" />
|
|
||||||
<AssemblySearchPath path="$(ADOFAI_PATH)\MelonLoader\net35" />
|
|
||||||
<AssemblySearchPath path="$(InPath)" />
|
|
||||||
|
|
||||||
<Module file="$(InPath)\ADOFAIRenderer.dll">
|
|
||||||
<!-- MelonLoader Entrypoint -->
|
|
||||||
<SkipType name="ADOFAIRenderer.RenderMod" />
|
|
||||||
|
|
||||||
<!-- Harmony 패치 메서드 중 매개변수 주입(__instance, __result 등)을 사용하는 필수 메서드만 보존하고, 매개변수가 없는 나머지 메서드와 클래스명은 난독화 -->
|
|
||||||
<SkipMethod type="ADOFAIRenderer.Patch.*" rx=".*" />
|
|
||||||
|
|
||||||
<!-- Skip Unity MonoBehaviour lifecycle methods -->
|
|
||||||
<SkipMethod type="ADOFAIRenderer.Core.*" rx="^(?:Awake|Start|Update|LateUpdate|OnDestroy)$" />
|
|
||||||
<SkipMethod type="ADOFAIRenderer.UI.*" rx="^(?:Awake|Start|Update|LateUpdate|OnDestroy)$" />
|
|
||||||
<SkipMethod type="ADOFAIRenderer.Util.*" rx="^(?:Awake|Start|Update|LateUpdate|OnDestroy)$" />
|
|
||||||
|
|
||||||
<!-- Skip Enums bound to UI dropdowns -->
|
|
||||||
<SkipType name="ADOFAIRenderer.Util.FFmpeg.Codec" skipFields="true" />
|
|
||||||
<SkipType name="ADOFAIRenderer.Util.FFmpeg.RateControlMode" skipFields="true" />
|
|
||||||
|
|
||||||
<!-- Skip UI-associated types (MonoBehaviours loaded from scene/prefabs or bound to UI Toolkit dataSource) -->
|
|
||||||
<SkipType name="ADOFAIRenderer.UI.RenderConfigUIManager" skipFields="true" />
|
|
||||||
|
|
||||||
<!-- Skip Preset & Config types for JSON serialization -->
|
|
||||||
<SkipType name="ADOFAIRenderer.Data.RenderPreset" skipFields="true" skipProperties="true" />
|
|
||||||
<SkipType name="ADOFAIRenderer.Data.RenderConfig" skipFields="true" skipProperties="true" />
|
|
||||||
<SkipType name="ADOFAIRenderer.Data.EncodingConfig" skipFields="true" skipProperties="true" />
|
|
||||||
</Module>
|
|
||||||
</Obfuscator>
|
|
||||||
Reference in new issue
Block a user