Browse Source

Reviewed some structs to reduce size and padding

Also updated raylib Wiki about struct sizes in 32bit and 64bit
pull/1381/head
raysan5 4 years ago
parent
commit
d7853127db
1 changed files with 11 additions and 14 deletions
  1. +11
    -14
      src/raylib.h

+ 11
- 14
src/raylib.h View File

@ -367,9 +367,8 @@ typedef struct Model {
Matrix transform; // Local transform matrix Matrix transform; // Local transform matrix
int meshCount; // Number of meshes int meshCount; // Number of meshes
Mesh *meshes; // Meshes array
int materialCount; // Number of materials int materialCount; // Number of materials
Mesh *meshes; // Meshes array
Material *materials; // Materials array Material *materials; // Materials array
int *meshMaterial; // Mesh material number int *meshMaterial; // Mesh material number
@ -382,9 +381,8 @@ typedef struct Model {
// Model animation // Model animation
typedef struct ModelAnimation { typedef struct ModelAnimation {
int boneCount; // Number of bones int boneCount; // Number of bones
BoneInfo *bones; // Bones information (skeleton)
int frameCount; // Number of animation frames int frameCount; // Number of animation frames
BoneInfo *bones; // Bones information (skeleton)
Transform **framePoses; // Poses array by frame Transform **framePoses; // Poses array by frame
} ModelAnimation; } ModelAnimation;
@ -422,29 +420,28 @@ typedef struct rAudioBuffer rAudioBuffer;
// Audio stream type // Audio stream type
// NOTE: Useful to create custom audio streams not bound to a specific file // NOTE: Useful to create custom audio streams not bound to a specific file
typedef struct AudioStream { 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 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; } AudioStream;
// Sound source type // Sound source type
typedef struct Sound { typedef struct Sound {
unsigned int sampleCount; // Total number of samples
AudioStream stream; // Audio stream AudioStream stream; // Audio stream
unsigned int sampleCount; // Total number of samples
} Sound; } Sound;
// Music stream type (audio file streaming from memory) // Music stream type (audio file streaming from memory)
// NOTE: Anything longer than ~10 seconds should be streamed // NOTE: Anything longer than ~10 seconds should be streamed
typedef struct Music { 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 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; } Music;
// Head-Mounted-Display device parameters // Head-Mounted-Display device parameters

Loading…
Cancel
Save