diff options
| author | raysan5 <[email protected]> | 2016-12-27 17:37:35 +0100 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2016-12-27 17:37:35 +0100 |
| commit | e7464d5fc376783912da9086a4bf49d2d5759135 (patch) | |
| tree | 4146e30a8e3c143b4c5ff541e045bc915a8d1d5e /src/audio.c | |
| parent | 3c91dc099dcee1457207c15c30da61c1b279c554 (diff) | |
| download | raylib-e7464d5fc376783912da9086a4bf49d2d5759135.tar.gz raylib-e7464d5fc376783912da9086a4bf49d2d5759135.zip | |
Review some formatting and naming
- Renamed WritePNG() to SavePNG() for consistency with other file
loading functions
- Renamed WriteBitmap() to SaveBMP() for consistency with other file
loading functions
- Redesigned SaveBMP() to use stb_image_write
Diffstat (limited to 'src/audio.c')
| -rw-r--r-- | src/audio.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/audio.c b/src/audio.c index 3a4ca3df..944d1b9d 100644 --- a/src/audio.c +++ b/src/audio.c @@ -985,7 +985,7 @@ static Wave LoadWAV(const char *fileName) char chunkID[4]; int chunkSize; char format[4]; - } WavRiffHeader; + } WAVRiffHeader; typedef struct { char subChunkID[4]; @@ -996,16 +996,16 @@ static Wave LoadWAV(const char *fileName) int byteRate; short blockAlign; short bitsPerSample; - } WavFormat; + } WAVFormat; typedef struct { char subChunkID[4]; int subChunkSize; - } WavData; + } WAVData; - WavRiffHeader wavRiffHeader; - WavFormat wavFormat; - WavData wavData; + WAVRiffHeader wavRiffHeader; + WAVFormat wavFormat; + WAVData wavData; Wave wave = { 0 }; FILE *wavFile; @@ -1020,7 +1020,7 @@ static Wave LoadWAV(const char *fileName) else { // Read in the first chunk into the struct - fread(&wavRiffHeader, sizeof(WavRiffHeader), 1, wavFile); + fread(&wavRiffHeader, sizeof(WAVRiffHeader), 1, wavFile); // Check for RIFF and WAVE tags if (strncmp(wavRiffHeader.chunkID, "RIFF", 4) || @@ -1031,7 +1031,7 @@ static Wave LoadWAV(const char *fileName) else { // Read in the 2nd chunk for the wave info - fread(&wavFormat, sizeof(WavFormat), 1, wavFile); + fread(&wavFormat, sizeof(WAVFormat), 1, wavFile); // Check for fmt tag if ((wavFormat.subChunkID[0] != 'f') || (wavFormat.subChunkID[1] != 'm') || @@ -1045,7 +1045,7 @@ static Wave LoadWAV(const char *fileName) if (wavFormat.subChunkSize > 16) fseek(wavFile, sizeof(short), SEEK_CUR); // Read in the the last byte of data before the sound file - fread(&wavData, sizeof(WavData), 1, wavFile); + fread(&wavData, sizeof(WAVData), 1, wavFile); // Check for data tag if ((wavData.subChunkID[0] != 'd') || (wavData.subChunkID[1] != 'a') || |
