diff options
| author | Ray <[email protected]> | 2020-12-18 21:03:08 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2020-12-18 21:03:08 +0100 |
| commit | e07bc372a1109cc782b940162c2aedb5defc0ba8 (patch) | |
| tree | caeddf2d949ec325720149c61c9aaaeb901d2a92 /src/raylib.h | |
| parent | 5dd142beb62f7848eb857505250fb9978601bc6e (diff) | |
| download | raylib-e07bc372a1109cc782b940162c2aedb5defc0ba8.tar.gz raylib-e07bc372a1109cc782b940162c2aedb5defc0ba8.zip | |
WARNING: RENAMED several functions for consistency #1440
This is a BREAKING CHANGE!
To address the linked issue, several functions have been renamed and couterpart functions have been created to free loaded memory:
- RENAMED: GetImageData() -> LoadImageColors()
- RENAMED: GetImagePalette() -> LoadImagePalette()
- RENAMED: GetWaveData() -> LoadWaveSamples()
- ADDED: UnloadImageColors()
- ADDED: UnloadImagePalette()
- ADDED: UnloadWaveSamples()
Diffstat (limited to 'src/raylib.h')
| -rw-r--r-- | src/raylib.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/raylib.h b/src/raylib.h index fe0ce04c..a86913f7 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -156,6 +156,7 @@ #define FormatText TextFormat #define LoadText LoadFileText #define GetExtension GetFileExtension +#define GetImageData LoadImageColors //#define Fade(c, a) ColorAlpha(c, a) //---------------------------------------------------------------------------------- @@ -964,7 +965,7 @@ RLAPI float GetFrameTime(void); // Returns tim RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow() // Misc. functions -RLAPI void SetConfigFlags(unsigned int flags); // Setup window configuration flags (view FLAGS) +RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level @@ -1176,9 +1177,10 @@ RLAPI void ImageColorGrayscale(Image *image); RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color - -RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array -RLAPI Color *GetImagePalette(Image image, int maxPaletteSize, int *extractCount); // Get color palette from image to maximum size (memory should be freed) +RLAPI Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) +RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorsCount); // Load colors palette from image as a Color array (RGBA - 32bit) +RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() +RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle // Image drawing functions @@ -1473,7 +1475,9 @@ RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pit RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range -RLAPI float *GetWaveData(Wave wave); // Get samples data from wave as a floats array +//RLAPI float *GetWaveData(Wave wave); // Get samples data from wave as a floats array +RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a floats array +RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() // Music management functions RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file |
