Fix bug with LoadFileData and LoadFontData
- Changed return of LoadFileData from byte[] to IntPtr as it cannot Marshal as a byte[]. - Adding missing dataSize argument to LoadFontData.
This commit is contained in:
parent
c1f25cc135
commit
05a1133e4a
1 changed files with 3 additions and 2 deletions
|
|
@ -1185,8 +1185,9 @@ namespace Raylib_cs
|
||||||
// Files management functions
|
// Files management functions
|
||||||
|
|
||||||
// Load file data as byte array (read)
|
// Load file data as byte array (read)
|
||||||
|
// IntPtr refers to unsigned char *
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern byte[] LoadFileData(string fileName, ref int bytesRead);
|
public static extern IntPtr LoadFileData(string fileName, ref int bytesRead);
|
||||||
|
|
||||||
// Save data to file from byte array (write)
|
// Save data to file from byte array (write)
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
|
@ -2090,7 +2091,7 @@ namespace Raylib_cs
|
||||||
// fileData refers to const unsigned char *
|
// fileData refers to const unsigned char *
|
||||||
// IntPtr refers to CharInfo *
|
// IntPtr refers to CharInfo *
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr LoadFontData(IntPtr fileData, int fontSize, int[] fontChars, int charsCount, FontType type);
|
public static extern IntPtr LoadFontData(IntPtr fileData, int dataSize, int fontSize, int[] fontChars, int charsCount, FontType type);
|
||||||
|
|
||||||
// Generate image font atlas using chars info
|
// Generate image font atlas using chars info
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue