Skip to content

Commit e280c01

Browse files
mkalkbrennerfreezy
authored andcommitted
forward libzedmd logging, libzedmd 0.9.3
1 parent a0380c5 commit e280c01

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

LibDmd/Costura32/zedmd.dll

512 Bytes
Binary file not shown.

LibDmd/Costura64/zedmd64.dll

512 Bytes
Binary file not shown.

LibDmd/Output/ZeDMD/ZeDMDBase.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public abstract class ZeDMDBase
2727
protected ColoredFrame _lastFrame = null;
2828
private GCHandle handle;
2929

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

3535
protected void Init()
@@ -114,15 +114,21 @@ public void ClearColor()
114114
protected static extern IntPtr ZeDMD_GetInstance();
115115

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

119119
#if PLATFORM_X64
120120
[DllImport("zedmd64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
121121
#else
122122
[DllImport("zedmd.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
123123
#endif
124-
protected static extern void ZeDMD_SetLogCallback(IntPtr pZeDMD, ZeDMD_LogCallback callback, IntPtr userData);
124+
protected static extern void ZeDMD_SetLogCallback(IntPtr pZeDMD, ZeDMD_LogCallback callback, IntPtr pUserData);
125125

126+
#if PLATFORM_X64
127+
[DllImport("zedmd64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
128+
#else
129+
[DllImport("zedmd.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
130+
#endif
131+
protected static extern IntPtr ZeDMD_FormatLogMessage(IntPtr format, IntPtr args, IntPtr pUserData);
126132

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

0 commit comments

Comments
 (0)