Skip to content

Commit

Permalink
Explicitly define size of a type for structs and enums, fix for #1
Browse files Browse the repository at this point in the history
  • Loading branch information
M0n7y5 committed May 4, 2020
1 parent ed7402e commit 0fe15bc
Show file tree
Hide file tree
Showing 40 changed files with 76 additions and 75 deletions.
2 changes: 1 addition & 1 deletion src/Enums/AndroidButton.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Android buttons
public enum AndroidButton : int
public enum AndroidButton : int32
{
KEY_BACK = 4,
KEY_MENU = 82,
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/BlendMode.bf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace raylib_beef.Enums
{
public enum BlendMode : int
public enum BlendMode : int32
{
BLEND_ALPHA = 0, // Blend textures considering alpha (default)
BLEND_ADDITIVE, // Blend textures adding colors
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/CameraMode.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Camera system modes
public enum CameraMode : int
public enum CameraMode : int32
{
CAMERA_CUSTOM = 0,
CAMERA_FREE,
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/CameraType.bf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace raylib_beef.Enums
{
public enum CameraType : int
public enum CameraType : int32
{
CAMERA_PERSPECTIVE = 0,
CAMERA_ORTHOGRAPHIC
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/ConfigFlag.bf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace raylib_beef.Enums
{
public enum ConfigFlag : int
public enum ConfigFlag : int32
{
FLAG_RESERVED = 1, // Reserved
FLAG_FULLSCREEN_MODE = 2, // Set to run program in fullscreen
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/CubemapLayoutType.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Cubemap layout type
public enum CubemapLayoutType : int
public enum CubemapLayoutType : int32
{
CUBEMAP_AUTO_DETECT = 0, // Automatically detect layout type
CUBEMAP_LINE_VERTICAL, // Layout is defined by a vertical line with faces
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/FontType.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Font type, defines generation method
public enum FontType : int
public enum FontType : int32
{
FONT_DEFAULT = 0, // Default font generation, anti-aliased
FONT_BITMAP, // Bitmap font generation, no anti-aliasing
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/GamepadAxis.bf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace raylib_beef.Enums
{
public enum GamepadAxis : int
public enum GamepadAxis : int32
{
// This is here just for error checking
GAMEPAD_AXIS_UNKNOWN = 0,
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/GamepadButton.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Gamepad Buttons
public enum GamepadButton : int
public enum GamepadButton : int32
{
// This is here just for error checking
GAMEPAD_BUTTON_UNKNOWN = 0,
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/GamepadNumber.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Gamepad number
public enum GamepadNumber : int
public enum GamepadNumber : int32
{
GAMEPAD_PLAYER1 = 0,
GAMEPAD_PLAYER2 = 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/GestureType.bf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace raylib_beef.Enums
{
// Gestures type
// NOTE: It could be used as flags to enable only some gestures
public enum GestureType : int
public enum GestureType : int32
{
GESTURE_NONE = 0,
GESTURE_TAP = 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/KeyboardKey.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Keyboard keys
public enum KeyboardKey : int
public enum KeyboardKey : int32
{
// Alphanumeric keys
KEY_APOSTROPHE = 39,
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/MaterialMapType.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Material map type
public enum MaterialMapType : int
public enum MaterialMapType : int32
{
MAP_ALBEDO = 0, // MAP_DIFFUSE
MAP_METALNESS = 1, // MAP_SPECULAR
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/MouseButton.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Mouse buttons
public enum MouseButton : int
public enum MouseButton : int32
{
MOUSE_LEFT_BUTTON = 0,
MOUSE_RIGHT_BUTTON = 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/NPatchType.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Type of n-patch
public enum NPatchType : int
public enum NPatchType : int32
{
NPT_9PATCH = 0, // Npatch defined by 3x3 tiles
NPT_3PATCH_VERTICAL, // Npatch defined by 1x3 tiles
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/PhysicsShapeType.bf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace raylib_beef.Enums
{
public enum PhysicsShapeType
public enum PhysicsShapeType : int32
{
PHYSICS_CIRCLE,
PHYSICS_POLYGON
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/PixelFormat.bf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace raylib_beef.Enums
{
// Pixel formats
// NOTE: Support depends on OpenGL version and platform
public enum PixelFormat : int
public enum PixelFormat : int32
{
UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha)
UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels)
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/ShaderLocationIndex.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Shader location point type
public enum ShaderLocationIndex : int
public enum ShaderLocationIndex : int32
{
LOC_VERTEX_POSITION = 0,
LOC_VERTEX_TEXCOORD01,
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/ShaderUniformDataType.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Shader uniform data types
public enum ShaderUniformDataType : int
public enum ShaderUniformDataType : int32
{
UNIFORM_FLOAT = 0,
UNIFORM_VEC2,
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/TextureFilterMode.bf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace raylib_beef.Enums
// Texture parameters: filter mode
// NOTE 1: Filtering considers mipmaps if available in the texture
// NOTE 2: Filter is accordingly set for minification and magnification
public enum TextureFilterMode : int
public enum TextureFilterMode : int32
{
FILTER_POINT = 0, // No filter, just pixel aproximation
FILTER_BILINEAR, // Linear filtering
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/TextureWrapMode.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Texture parameters: wrap mode
public enum TextureWrapMode : int
public enum TextureWrapMode : int32
{
WRAP_REPEAT = 0, // Repeats texture in tiled mode
WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/TraceLogType.bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace raylib_beef.Enums
{
// Trace log type
public enum TraceLogType : int
public enum TraceLogType : int32
{
LOG_ALL = 0, // Display all logs
LOG_TRACE,
Expand Down
8 changes: 4 additions & 4 deletions src/Extensions/SubText.bf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace System
/*namespace System
{
/*extension String
extension String
{
public String SubText(String input, int position, int length)
{
return new String(input)
.Substring(position, Math.Min(length, input.Length)).DecodedChars;
}
}*/
}
}
}*/
6 changes: 3 additions & 3 deletions src/Types/AudioStream.bf
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace raylib_beef.Types
[CRepr]
public struct AudioStream
{
public uint sampleRate; // Frequency (samples per second)
public uint sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
public uint channels; // Number of channels (1-mono, 2-stereo)
public uint32 sampleRate; // Frequency (samples per second)
public uint32 sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
public uint32 channels; // Number of channels (1-mono, 2-stereo)

// audioBuffer refers to a rAudioBuffer *
public void* audioBuffer; // Pointer to internal data used by the audio system
Expand Down
2 changes: 1 addition & 1 deletion src/Types/BoneInfo.bf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ namespace raylib_beef.Types
public struct BoneInfo
{
public char8[32] name; // Bone name
public int parent; // Bone parent
public int32 parent; // Bone parent
}
}
8 changes: 4 additions & 4 deletions src/Types/CharInfo.bf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ namespace raylib_beef.Types
[CRepr]
public struct CharInfo
{
public int value;// Character value (Unicode)
public int offsetX;// Character offset X when drawing
public int offsetY;// Character offset Y when drawing
public int advanceX;// Character advance position X
public int32 value;// Character value (Unicode)
public int32 offsetX;// Character offset X when drawing
public int32 offsetY;// Character offset Y when drawing
public int32 advanceX;// Character advance position X
public Image image;// Character image data
}
}
4 changes: 2 additions & 2 deletions src/Types/Font.bf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ namespace raylib_beef.Types
[CRepr]
public struct Font
{
public int baseSize;// Base size (default chars height)
public int charsCount;// Number of characters
public int32 baseSize;// Base size (default chars height)
public int32 charsCount;// Number of characters
public Texture2D texture;// Font texture

// recs refers to a Rectangle *
Expand Down
8 changes: 4 additions & 4 deletions src/Types/Image.bf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace raylib_beef.Types
{
// data refers to a void *
public void* data;// Image raw data
public int width;// Image base width
public int height;// Image base height
public int mipmaps;// Mipmap levels, 1 by default
public int format;// Data format (PixelFormat type)
public int32 width;// Image base width
public int32 height;// Image base height
public int32 mipmaps;// Mipmap levels, 1 by default
public int32 format;// Data format (PixelFormat type)
}
}
10 changes: 5 additions & 5 deletions src/Types/Mesh.bf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ namespace raylib_beef.Types
[CRepr]
public struct Mesh
{
public int vertexCount;// Number of vertices stored in arrays
public int triangleCount;// Number of triangles stored (indexed or not)
public int32 vertexCount;// Number of vertices stored in arrays
public int32 triangleCount;// Number of triangles stored (indexed or not)

// Default vertex data
// vertices refers to a float *
Expand Down Expand Up @@ -35,15 +35,15 @@ namespace raylib_beef.Types
public float* animNormals;// Animated normals (after bones transformations)

// vertices refers to a int *
public int* boneIds;// Vertex bone ids, up to 4 bones influence by vertex (skinning)
public int32* boneIds;// Vertex bone ids, up to 4 bones influence by vertex (skinning)

// boneWeights refers to a float *
public float* boneWeights;// Vertex bone weight, up to 4 bones influence by vertex (skinning)

// OpenGL identifiers
public uint vaoId;// OpenGL Vertex Array Object id
public uint32 vaoId;// OpenGL Vertex Array Object id

// vboId refers to a uint[]
public int* vboId;// OpenGL Vertex Buffer Objects id (default vertex data)
public int32* vboId;// OpenGL Vertex Buffer Objects id (default vertex data)
}
}
8 changes: 4 additions & 4 deletions src/Types/Model.bf
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ namespace raylib_beef.Types
public struct Model
{
public Matrix transform;// Local transform matrix
public int meshCount;// Number of meshes
public int32 meshCount;// Number of meshes

// meshes refers to a Mesh *
public Mesh* meshes;// Meshes array
public int materialCount;// Number of materials
public int32 materialCount;// Number of materials

// materials refers to a Material *
public Material* materials;// Materials array refers to a Material *

// meshMaterial refers to a int *
public int* meshMaterial;// Mesh material number
public int boneCount;// Number of bones
public int32* meshMaterial;// Mesh material number
public int32 boneCount;// Number of bones

// bones refers to a BoneInfo *
public BoneInfo* bones;// Bones information (skeleton)
Expand Down
4 changes: 2 additions & 2 deletions src/Types/ModelAnimation.bf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ namespace raylib_beef.Types
[CRepr]
public struct ModelAnimation
{
public int boneCount; // Number of bones
public int32 boneCount; // Number of bones

// bones refers to a BoneInfo *
public BoneInfo* bones; // Bones information (skeleton)
public int frameCount; // Number of animation frames
public int32 frameCount; // Number of animation frames

// framePoses refers to a Transform **
public Transform** framePoses; // Poses array by frame
Expand Down
6 changes: 3 additions & 3 deletions src/Types/Music.bf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ namespace raylib_beef.Types
[CRepr]
public struct Music
{
public int ctxType;// Type of music context (audio filetype)
public int32 ctxType;// Type of music context (audio filetype)

// ctxData refers to a void *
public void* ctxData;// Audio context data, depends on type

public uint sampleCount;// Total number of samples
public uint loopCount;// Loops count (times music will play), 0 means infinite loop
public uint32 sampleCount;// Total number of samples
public uint32 loopCount;// Loops count (times music will play), 0 means infinite loop

public AudioStream stream;// Audio stream
}
Expand Down
10 changes: 5 additions & 5 deletions src/Types/NPatchInfo.bf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ namespace raylib_beef.Types
public struct NPatchInfo
{
public Rectangle sourceRec;// Region in the texture
public int left;// left border offset
public int top;// top border offset
public int right;// right border offset
public int bottom;// bottom border offset
public int type;// layout of the n-patch: 3x3, 1x3 or 3x1
public int32 left;// left border offset
public int32 top;// top border offset
public int32 right;// right border offset
public int32 bottom;// bottom border offset
public int32 type;// layout of the n-patch: 3x3, 1x3 or 3x1
}
}
2 changes: 1 addition & 1 deletion src/Types/PhysicsManifoldData.bf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace raylib_beef.Types
[CRepr]
public struct PhysicsManifoldData
{
public uint id;// Reference unique identifier
public uint32 id;// Reference unique identifier
public PhysicsBodyData* bodyA;// Manifold first physics body reference
public PhysicsBodyData* bodyB;// Manifold second physics body reference
public float penetration;// Depth of penetration from collision
Expand Down
2 changes: 1 addition & 1 deletion src/Types/RayHitInfo.bf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace raylib_beef.Types
[CRepr]
public struct RayHitInfo
{
public bool hit;// Did the ray hit something?
public int32 hit;// Did the ray hit something?
public float distance;// Distance to nearest hit
public Vector3 position;// Position of nearest hit
public Vector3 normal;// Surface normal of hit
Expand Down
Loading

0 comments on commit 0fe15bc

Please sign in to comment.