プラグイン本体を分離プロジェクト参照へ移行
このコミットが含まれているのは:
4ファイル変更
+42
-6
検索条件に一致するファイルはありません
@@ -95,11 +95,13 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Compat\AviUtlCompatMap.xml" />
|
||||
<ProjectReference Include="..\LuaScript.Kernel\LuaScript.Kernel.csproj" />
|
||||
<ProjectReference Include="..\LuaScript.Compat\LuaScript.Compat.csproj" />
|
||||
<ProjectReference Include="..\LuaScript.Runtime\LuaScript.Runtime.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MoonSharp" Version="2.0.0" />
|
||||
<PackageReference Include="MoonSharp" Version="2.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -117,7 +119,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(CI)' != 'true'">
|
||||
<Exec Command="mkdir "$(YMM4DirPath)user\plugin\$(ProjectName)" > NUL 2>&1
copy "$(TargetPath)" "$(YMM4DirPath)user\plugin\$(ProjectName)\"
xcopy /E /I /Y "$(TargetDir)native" "$(YMM4DirPath)user\plugin\$(ProjectName)\native"" />
|
||||
<Exec Command="mkdir "$(YMM4DirPath)user\plugin\$(ProjectName)" > NUL 2>&1
copy "$(TargetDir)LuaScript*.dll" "$(YMM4DirPath)user\plugin\$(ProjectName)\"
xcopy /E /I /Y "$(TargetDir)native" "$(YMM4DirPath)user\plugin\$(ProjectName)\native"" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
@@ -66,7 +66,7 @@ namespace LuaScript
|
||||
private static string NativeDirectory =>
|
||||
Path.Combine(Path.GetDirectoryName(typeof(LuaScriptEffectProcessor).Assembly.Location) ?? AppContext.BaseDirectory, "native");
|
||||
|
||||
private readonly LuaScriptEngine _engine = new();
|
||||
private readonly LuaScriptEngine _engine = new(static () => new MediaSourceLoader());
|
||||
private readonly SemaphoreSlim _pixelLoaderSemaphore = new(1, 1);
|
||||
private AviUtlScriptContext _context = new();
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
namespace LuaScript
|
||||
{
|
||||
internal sealed class MediaSourceLoader : IMediaSourceLoader
|
||||
{
|
||||
private TextRenderer? _textRenderer;
|
||||
private ImageDecoder? _imageDecoder;
|
||||
private MovieDecoder? _movieDecoder;
|
||||
|
||||
public byte[] RenderText(string text, string fontFamily, double fontSize, bool bold, bool italic, int colorRgb, out int width, out int height)
|
||||
{
|
||||
_textRenderer ??= new TextRenderer();
|
||||
return _textRenderer.Render(text, fontFamily, fontSize, bold, italic, colorRgb, out width, out height);
|
||||
}
|
||||
|
||||
public byte[] DecodeImage(string path, out int width, out int height)
|
||||
{
|
||||
_imageDecoder ??= new ImageDecoder();
|
||||
return _imageDecoder.Decode(path, out width, out height);
|
||||
}
|
||||
|
||||
public byte[] DecodeMovie(string path, double time, out int width, out int height)
|
||||
{
|
||||
_movieDecoder ??= new MovieDecoder();
|
||||
return _movieDecoder.Decode(path, time, out width, out height);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_textRenderer?.Dispose();
|
||||
_imageDecoder?.Dispose();
|
||||
_movieDecoder?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ using YukkuriMovieMaker.Project.Items;
|
||||
|
||||
namespace LuaScript
|
||||
{
|
||||
internal sealed class SceneObjectResolver
|
||||
internal sealed class SceneObjectResolver : ISceneObjectResolver
|
||||
{
|
||||
internal readonly record struct Entry(string Tag, int Frame, int Length, int Layer, VisualItem Item);
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace LuaScript
|
||||
_fps = fps;
|
||||
}
|
||||
|
||||
internal bool TryResolve(string tag, int timelineFrame, out SceneObjectInfo info)
|
||||
public bool TryResolve(string tag, int timelineFrame, out SceneObjectInfo info)
|
||||
{
|
||||
int fallback = -1;
|
||||
for (int i = 0; i < _entries.Length; i++)
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする