Skip to content

Commit

Permalink
Make CentrED run on linux and macos (#20)
Browse files Browse the repository at this point in the history
* Load zlib.dll only for windows

* include imgui libs for linux and osx
  • Loading branch information
kaczy93 committed Nov 26, 2023
1 parent 4202cd1 commit 1381e1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CentrED/CentrED.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

<ItemGroup>
<Content Include="..\external\ImGui.NET\deps\cimgui\win-x64\cimgui.dll" CopyToOutputDirectory="PreserveNewest"/>
<Content Include="..\external\ImGui.NET\deps\cimgui\linux-x64\cimgui.so" CopyToOutputDirectory="PreserveNewest"/>
<Content Include="..\external\ImGui.NET\deps\cimgui\osx\cimgui.dylib" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion CentrED/CentrEDGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ protected override void Initialize()

_gdm.ApplyChanges();

NativeLibrary.Load(Path.Combine(AppContext.BaseDirectory, "x64", "zlib.dll"));
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
NativeLibrary.Load(Path.Combine(AppContext.BaseDirectory, "x64", "zlib.dll"));
}
Log.Start(LogTypes.All);
MapManager = new MapManager(_gdm.GraphicsDevice);
UIManager = new UIManager(_gdm.GraphicsDevice);
Expand Down

0 comments on commit 1381e1f

Please sign in to comment.