Support rRES data loading

This commit is contained in:
raysan5 2017-01-07 18:12:59 +01:00
parent 658c280669
commit fbda9c4180

View File

@ -219,6 +219,17 @@ Wave LoadWave(const char *fileName)
if (strcmp(GetExtension(fileName), "wav") == 0) wave = LoadWAV(fileName); if (strcmp(GetExtension(fileName), "wav") == 0) wave = LoadWAV(fileName);
else if (strcmp(GetExtension(fileName), "ogg") == 0) wave = LoadOGG(fileName); else if (strcmp(GetExtension(fileName), "ogg") == 0) wave = LoadOGG(fileName);
else if (strcmp(GetExtension(fileName), "flac") == 0) wave = LoadFLAC(fileName); else if (strcmp(GetExtension(fileName), "flac") == 0) wave = LoadFLAC(fileName);
else if (strcmp(GetExtension(fileName),"rres") == 0)
{
RRESData rres = LoadResource(fileName);
// NOTE: Parameters for RRES_WAVE type are: sampleCount, sampleRate, sampleSize, channels
if (rres.type == RRES_WAVE) wave = LoadWaveEx(rres.data, rres.param1, rres.param2, rres.param3, rres.param4);
else TraceLog(WARNING, "[%s] Resource file does not contain wave data", fileName);
UnloadResource(rres);
}
else TraceLog(WARNING, "[%s] File extension not recognized, it can't be loaded", fileName); else TraceLog(WARNING, "[%s] File extension not recognized, it can't be loaded", fileName);
return wave; return wave;