Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.3.0",
"commands": [
"csharpier"
],
"rollForward": false
}
}
}
6 changes: 6 additions & 0 deletions .csharpierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# only format our own code
Cafe-Shader-Studio/

# Build artifacts
**/bin/
**/obj/
30 changes: 30 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# autonormalize, and checkout as native
* text=auto

# these will break with crlf
*.sh text eol=lf
*.nix text eol=lf
*.lock text eol=lf

# These are binaries
*.dll binary
*.exe binary
*.pdb binary
*.so binary
*.dylib binary
*.zip binary
*.dds binary
*.png binary
*.jpg binary
*.jpeg binary
*.bmp binary
*.tif binary
*.ico binary
*.ttf binary
*.otf binary
*.wav binary
*.ogg binary
*.bin binary
*.bfres binary
*.szs binary
*.sarc binary
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Restore
run: dotnet restore PlayerViewer/PlayerViewer.csproj

- name: Publish
run: >
dotnet publish PlayerViewer/PlayerViewer.csproj
-c Release
-r win-x64
--self-contained true
-p:PublishSingleFile=true
-o publish

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: PlayerViewer-win-x64
path: publish
if-no-files-found: error
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
bin/
obj/
# nix
result
result-*
.direnv/
# dotnet publish output / local nuget cache
publish/
.nuget/
.vs/
.vscode/
.cursor/
Expand Down
14 changes: 6 additions & 8 deletions Cafe-Shader-Studio/AGraphicsLibrary/AGraphicsLibrary.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Platforms>AnyCPU;x86</Platforms>
</PropertyGroup>

Expand All @@ -22,23 +22,21 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="System.Drawing.Common" Version="8.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GLFrameworkEngine\GLFrameworkEngine.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="AampLibraryCSharp">
<HintPath>..\CafeShaderStudio\Lib\AampLibraryCSharp.dll</HintPath>
</Reference>
<Reference Include="BfresLibrary">
<HintPath>..\BfresEditor\Lib\BfresLibrary.dll</HintPath>
</Reference>
<Reference Include="OpenTK">
<HintPath>..\CafeShaderStudio\Lib\OpenTK.dll</HintPath>
</Reference>
<PackageReference Include="OpenTK" Version="3.1.0" />
<Reference Include="Syroot.BinaryData">
<HintPath>..\CafeShaderStudio\Lib\Syroot.BinaryData.dll</HintPath>
</Reference>
Expand All @@ -49,5 +47,5 @@
<HintPath>..\CafeShaderStudio\Lib\Toolbox.Core.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ public override void ReloadRenderState(BfresMeshAsset mesh)
mesh.Pass = Pass.TRANSPARENT;

//Materials that sample the game framebuffer (gsys_enable_color_buffer=1)
//must render in the transparent pass so the pipeline can capture the
//must render in the transparent pass so the pipeline can capture the
//framebuffer between passes.
bool usesFramebuffer =
(mat.ShaderOptions.TryGetValue("gsys_enable_color_buffer", out string ecb) && ecb == "1");
Expand Down Expand Up @@ -967,9 +967,9 @@ public static void InitTextures()
if (WhiteTexture != null)
return;

WhiteTexture = GLTexture2D.FromBitmap(Resources.white);
BlackTexture = GLTexture2D.FromBitmap(Resources.black);
WhiteArrayTexture = GLTexture2DArray.FromBitmap(Resources.white);
WhiteTexture = GLTexture2D.FromRgba(new byte[] { 255, 255, 255, 255 }, 1, 1);
BlackTexture = GLTexture2D.FromRgba(new byte[] { 0, 0, 0, 255 }, 1, 1);
WhiteArrayTexture = GLTexture2DArray.FromRgba(new byte[] { 255, 255, 255, 255 }, 1, 1);
CubemapTexture = GLTextureCube.FromDDS(new DDS(new MemoryStream(Resources.CubemapLightmap)));
BrdfTexture = GLTexture2D.FromGeneric(new DDS(new MemoryStream(Resources.brdf)), new ImageParameters());
FlipTextureY(BrdfTexture);
Expand Down
14 changes: 6 additions & 8 deletions Cafe-Shader-Studio/BfresEditor/BfresEditor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Platforms>AnyCPU;x64;x86</Platforms>
<AssemblyName>BfresEditor</AssemblyName>
</PropertyGroup>
Expand Down Expand Up @@ -30,8 +30,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<!-- Cold in PlayerViewer; PrivateAssets stops SDC flowing to its output (CSS refs it directly). -->
<PackageReference Include="System.Drawing.Common" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="System.Resources.Extensions" Version="6.0.0-preview.1.21102.12" />
<!-- Managed zstd (ZSTB.cs); replaces ZstdNet + its libzstd native. Flows to consumers. -->
<PackageReference Include="ZstdSharp.Port" Version="0.8.8" />
</ItemGroup>

<ItemGroup>
Expand All @@ -54,9 +57,7 @@
<Reference Include="LZ4.Frame">
<HintPath>..\CafeShaderStudio\Lib\LZ4.Frame.dll</HintPath>
</Reference>
<Reference Include="OpenTK">
<HintPath>..\CafeShaderStudio\Lib\OpenTK.dll</HintPath>
</Reference>
<PackageReference Include="OpenTK" Version="3.1.0" />
<Reference Include="Ryujinx.Common">
<HintPath>..\CafeShaderStudio\Lib\Ryujinx.Common.dll</HintPath>
</Reference>
Expand All @@ -78,9 +79,6 @@
<Reference Include="TrackStudioLibrary">
<HintPath>..\CafeShaderStudio\Lib\TrackStudioLibrary.dll</HintPath>
</Reference>
<Reference Include="ZstdNet">
<HintPath>..\CafeShaderStudio\Lib\ZstdNet.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
Expand Down
Binary file removed Cafe-Shader-Studio/BfresEditor/Lib/BfresLibrary.pdb
Binary file not shown.
Binary file removed Cafe-Shader-Studio/BfresEditor/Lib/BfshaLibrary.pdb
Binary file not shown.
12 changes: 6 additions & 6 deletions Cafe-Shader-Studio/BfresEditor/Zstb/ZSTB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ public Stream Compress(Stream stream)

public static byte[] SDecompress(byte[] b)
{
using (var decompressor = new ZstdNet.Decompressor())
using (var decompressor = new ZstdSharp.Decompressor())
{
return decompressor.Unwrap(b);
return decompressor.Unwrap(b).ToArray();
}
}
public static byte[] SDecompress(byte[] b, int MaxDecompressedSize)
{
using (var decompressor = new ZstdNet.Decompressor())
using (var decompressor = new ZstdSharp.Decompressor())
{
return decompressor.Unwrap(b, MaxDecompressedSize);
return decompressor.Unwrap(b, MaxDecompressedSize).ToArray();
}
}
public static byte[] SCompress(byte[] b)
{
using (var compressor = new ZstdNet.Compressor())
using (var compressor = new ZstdSharp.Compressor())
{
return compressor.Wrap(b);
return compressor.Wrap(b).ToArray();
}
}
}
Expand Down
18 changes: 5 additions & 13 deletions Cafe-Shader-Studio/CafeShaderStudio/CafeShaderStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>

<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>
Expand Down Expand Up @@ -38,9 +38,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>Lib\ImGui.NET.dll</HintPath>
</Reference>
<Reference Include="OpenTK">
<HintPath>Lib\OpenTK.dll</HintPath>
</Reference>
<PackageReference Include="OpenTK" Version="3.1.0" />
<Reference Include="OpenTK.GLControl">
<HintPath>Lib\OpenTK.GLControl.dll</HintPath>
</Reference>
Expand All @@ -56,9 +54,6 @@
<Reference Include="TrackStudioLibrary">
<HintPath>Lib\TrackStudioLibrary.dll</HintPath>
</Reference>
<Reference Include="ZstdNet">
<HintPath>Lib\ZstdNet.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -272,6 +267,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<!-- The shared libs keep SDC private (PrivateAssets), so the app that actually runs the
GDI paths must reference it directly to ship System.Drawing.Common. -->
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AGraphicsLibrary\AGraphicsLibrary.csproj">
Expand Down Expand Up @@ -419,12 +417,6 @@
<None Update="tinyfiledialogs.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="x64\libzstd.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="x86\libzstd.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Plugins\" />
Expand Down
Binary file not shown.
Binary file removed Cafe-Shader-Studio/CafeShaderStudio/Lib/ByamlExt.pdb
Binary file not shown.
Binary file not shown.
Binary file removed Cafe-Shader-Studio/CafeShaderStudio/Lib/OpenTK.dll
Binary file not shown.
Binary file removed Cafe-Shader-Studio/CafeShaderStudio/Lib/OpenTK.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Cafe-Shader-Studio/CafeShaderStudio/cimgui32.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Cafe-Shader-Studio/CafeShaderStudio/x64/libzstd.dll
Binary file not shown.
Binary file not shown.
Binary file removed Cafe-Shader-Studio/CafeShaderStudio/x86/libzstd.dll
Binary file not shown.
16 changes: 6 additions & 10 deletions Cafe-Shader-Studio/CafeStudio.UI/CafeStudio.UI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Platforms>AnyCPU;x86</Platforms>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expand All @@ -23,38 +23,34 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="System.Drawing.Common" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AGraphicsLibrary\AGraphicsLibrary.csproj" />
<ProjectReference Include="..\GLFrameworkEngine\GLFrameworkEngine.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="CurveEditorLibrary">
<HintPath>..\CafeShaderStudio\Lib\CurveEditorLibrary.dll</HintPath>
</Reference>
<Reference Include="ImGui.NET">
<HintPath>..\CafeShaderStudio\Lib\ImGui.NET.dll</HintPath>
</Reference>
<Reference Include="OpenTK">
<HintPath>..\CafeShaderStudio\Lib\OpenTK.dll</HintPath>
</Reference>
<PackageReference Include="OpenTK" Version="3.1.0" />
<Reference Include="Syroot.BinaryData">
<HintPath>..\CafeShaderStudio\Lib\Syroot.BinaryData.dll</HintPath>
</Reference>
<Reference Include="Syroot.Maths">
<HintPath>..\CafeShaderStudio\Lib\Syroot.Maths.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="Toolbox.Core">
<HintPath>..\CafeShaderStudio\Lib\Toolbox.Core.dll</HintPath>
</Reference>
<Reference Include="TrackStudioLibrary">
<HintPath>..\CafeShaderStudio\Lib\TrackStudioLibrary.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
</Project>
15 changes: 7 additions & 8 deletions Cafe-Shader-Studio/GLFrameworkEngine/GLFrameworkEngine.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>

Expand All @@ -22,16 +22,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="System.Drawing.Common" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
</ItemGroup>

<ItemGroup>
<Reference Include="OpenTK">
<HintPath>..\CafeShaderStudio\Lib\OpenTK.dll</HintPath>
</Reference>
<PackageReference Include="OpenTK" Version="3.1.0" />
<Reference Include="Toolbox.Core">
<HintPath>..\CafeShaderStudio\Lib\Toolbox.Core.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

</Project>
Loading