Skip to content

Commit

Permalink
forward libzedmd logging, libzedmd 0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner authored and freezy committed Feb 10, 2025
1 parent a0380c5 commit e280c01
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Binary file modified LibDmd/Costura32/zedmd.dll
Binary file not shown.
Binary file modified LibDmd/Costura64/zedmd64.dll
Binary file not shown.
14 changes: 10 additions & 4 deletions LibDmd/Output/ZeDMD/ZeDMDBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public abstract class ZeDMDBase
protected ColoredFrame _lastFrame = null;
private GCHandle handle;

protected static void LogHandler(string format, IntPtr args, IntPtr userData)
protected void LogHandler(IntPtr format, IntPtr args, IntPtr pUserData)
{
Logger.Info(format);
Logger.Info("libzedmd: " + Marshal.PtrToStringAnsi(ZeDMD_FormatLogMessage(format, args, pUserData)));
}

protected void Init()
Expand Down Expand Up @@ -114,15 +114,21 @@ public void ClearColor()
protected static extern IntPtr ZeDMD_GetInstance();

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
protected delegate void ZeDMD_LogCallback(string format, IntPtr args, IntPtr userData);
protected delegate void ZeDMD_LogCallback(IntPtr format, IntPtr args, IntPtr pUserData);

#if PLATFORM_X64
[DllImport("zedmd64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
#else
[DllImport("zedmd.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
#endif
protected static extern void ZeDMD_SetLogCallback(IntPtr pZeDMD, ZeDMD_LogCallback callback, IntPtr userData);
protected static extern void ZeDMD_SetLogCallback(IntPtr pZeDMD, ZeDMD_LogCallback callback, IntPtr pUserData);

#if PLATFORM_X64
[DllImport("zedmd64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
#else
[DllImport("zedmd.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
#endif
protected static extern IntPtr ZeDMD_FormatLogMessage(IntPtr format, IntPtr args, IntPtr pUserData);

#if PLATFORM_X64
[DllImport("zedmd64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
Expand Down

0 comments on commit e280c01

Please sign in to comment.