mirror of
				https://github.com/raysan5/raylib.git
				synced 2025-10-26 12:27:01 +00:00 
			
		
		
		
	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()
This commit is contained in:
		
							
								
								
									
										13
									
								
								src/raudio.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/raudio.c
									
									
									
									
									
								
							| @@ -1079,9 +1079,10 @@ void WaveCrop(Wave *wave, int initSample, int finalSample) | ||||
|     else TRACELOG(LOG_WARNING, "WAVE: Crop range out of bounds"); | ||||
| } | ||||
|  | ||||
| // Get samples data from wave as a floats array | ||||
| // NOTE: Returned sample values are normalized to range [-1..1] | ||||
| float *GetWaveData(Wave wave) | ||||
| // Load samples data from wave as a floats array | ||||
| // NOTE 1: Returned sample values are normalized to range [-1..1] | ||||
| // NOTE 2: Sample data allocated should be freed with UnloadWaveSamples() | ||||
| float *LoadWaveSamples(Wave wave) | ||||
| { | ||||
|     float *samples = (float *)RL_MALLOC(wave.sampleCount*sizeof(float)); | ||||
|  | ||||
| @@ -1097,6 +1098,12 @@ float *GetWaveData(Wave wave) | ||||
|     return samples; | ||||
| } | ||||
|  | ||||
| // Unload samples data loaded with LoadWaveSamples() | ||||
| void UnloadWaveSamples(float *samples) | ||||
| { | ||||
|     RL_FREE(samples); | ||||
| } | ||||
|  | ||||
| //---------------------------------------------------------------------------------- | ||||
| // Module Functions Definition - Music loading and stream playing (.OGG) | ||||
| //---------------------------------------------------------------------------------- | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ray
					Ray