Skip to content

Commit

Permalink
Fix ExportImageToMemory and formatting issues (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdill authored May 25, 2024
1 parent 502a583 commit 5949934
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Raylib-cs/interop/Raylib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ int count

/// <summary>Unload random values sequence</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadRandomSequence(int *sequence);
public static extern void UnloadRandomSequence(int* sequence);

/// <summary>Takes a screenshot of current screen (saved a .png)</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -1195,23 +1195,23 @@ Color color

/// <summary>Draw spline: Linear, minimum 2 points</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color);
public static extern void DrawSplineLinear(Vector2* points, int pointCount, float thick, Color color);

/// <summary>Draw spline: B-Spline, minimum 4 points</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSplineBasis(Vector2 *points, int pointCount, float thick, Color color);
public static extern void DrawSplineBasis(Vector2* points, int pointCount, float thick, Color color);

/// <summary>Draw spline: Catmull-Rom, minimum 4 points</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSplineCatmullRom(Vector2 *points, int pointCount, float thick, Color color);
public static extern void DrawSplineCatmullRom(Vector2* points, int pointCount, float thick, Color color);

/// <summary>Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Color color);
public static extern void DrawSplineBezierQuadratic(Vector2* points, int pointCount, float thick, Color color);

/// <summary>Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSplineBezierCubic(Vector2 *points, int pointCount, float thick, Color color);
public static extern void DrawSplineBezierCubic(Vector2* points, int pointCount, float thick, Color color);

/// <summary>Draw spline segment: Linear, 2 points</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -1368,7 +1368,7 @@ int headerSize

/// <summary>Export image to memory buffer</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern char* ExportImageToMemory(Image image, sbyte* fileType, int *fileSize);
public static extern byte* ExportImageToMemory(Image image, sbyte* fileType, int* fileSize);

/// <summary>Export image as code file defining an array of bytes</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -1519,7 +1519,7 @@ Color color

/// <summary>Rotate image by input angle in degrees (-359 to 359)</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageRotate(Image *image, int degrees);
public static extern void ImageRotate(Image* image, int degrees);

/// <summary>Rotate image clockwise 90deg</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
Expand Down
10 changes: 8 additions & 2 deletions Raylib-cs/types/Rectangle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public Rectangle(Vector2 position, Vector2 size)

public Vector2 Position
{
readonly get { return new Vector2(X,Y); }
readonly get
{
return new Vector2(X, Y);
}
set
{
X = value.X;
Expand All @@ -58,7 +61,10 @@ public Vector2 Position

public Vector2 Size
{
readonly get { return new Vector2(Width,Height); }
readonly get
{
return new Vector2(Width, Height);
}
set
{
Width = value.X;
Expand Down

0 comments on commit 5949934

Please sign in to comment.