summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-09-14 15:36:50 +0200
committerraysan5 <[email protected]>2020-09-14 15:36:50 +0200
commitd7853127db242527f7e2c721640daef74d405381 (patch)
treefec28e07ab201c60f8c7edda60a91b3611986b44 /src
parentddba31d4236ea3c1a39d0d83f1e92961a2463d7f (diff)
downloadraylib-d7853127db242527f7e2c721640daef74d405381.tar.gz
raylib-d7853127db242527f7e2c721640daef74d405381.zip
Reviewed some structs to reduce size and padding
Also updated raylib Wiki about struct sizes in 32bit and 64bit
Diffstat (limited to 'src')
-rw-r--r--src/raylib.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 3546e57d..57f7fe77 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -367,9 +367,8 @@ typedef struct Model {
Matrix transform; // Local transform matrix
int meshCount; // Number of meshes
- Mesh *meshes; // Meshes array
-
int materialCount; // Number of materials
+ Mesh *meshes; // Meshes array
Material *materials; // Materials array
int *meshMaterial; // Mesh material number
@@ -382,9 +381,8 @@ typedef struct Model {
// Model animation
typedef struct ModelAnimation {
int boneCount; // Number of bones
- BoneInfo *bones; // Bones information (skeleton)
-
int frameCount; // Number of animation frames
+ BoneInfo *bones; // Bones information (skeleton)
Transform **framePoses; // Poses array by frame
} ModelAnimation;
@@ -422,29 +420,28 @@ typedef struct rAudioBuffer rAudioBuffer;
// Audio stream type
// NOTE: Useful to create custom audio streams not bound to a specific file
typedef struct AudioStream {
- unsigned int sampleRate; // Frequency (samples per second)
- unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
- unsigned int channels; // Number of channels (1-mono, 2-stereo)
-
rAudioBuffer *buffer; // Pointer to internal data used by the audio system
+
+ unsigned int sampleRate; // Frequency (samples per second)
+ unsigned short sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
+ unsigned short channels; // Number of channels (1-mono, 2-stereo)
} AudioStream;
// Sound source type
typedef struct Sound {
- unsigned int sampleCount; // Total number of samples
AudioStream stream; // Audio stream
+ unsigned int sampleCount; // Total number of samples
} Sound;
// Music stream type (audio file streaming from memory)
// NOTE: Anything longer than ~10 seconds should be streamed
typedef struct Music {
- int ctxType; // Type of music context (audio filetype)
- void *ctxData; // Audio context data, depends on type
-
- bool looping; // Music looping enable
+ AudioStream stream; // Audio stream
unsigned int sampleCount; // Total number of samples
+ bool looping; // Music looping enable
- AudioStream stream; // Audio stream
+ int ctxType; // Type of music context (audio filetype)
+ void *ctxData; // Audio context data, depends on type
} Music;
// Head-Mounted-Display device parameters