Replace lodepng by stb_image; add Vorbis banner sound import

This commit is contained in:
Dorian Wouters
2016-01-24 14:59:14 +01:00
parent a345ddaeed
commit 61a1e31ce7
11 changed files with 12154 additions and 7832 deletions

View File

@@ -1,6 +1,5 @@
#include "wav.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -18,8 +17,7 @@ bool wav_find_chunk(FILE* fd, const char* magic) {
return true;
}
WAV* wav_read(const char* file) {
FILE* fd = fopen(file, "r");
WAV* wav_read(FILE* fd) {
if(!fd) {
printf("ERROR: Could not open WAV file: %s\n", strerror(errno));
return NULL;
@@ -52,8 +50,6 @@ WAV* wav_read(const char* file) {
data.data = (u8*) malloc(data.chunkSize);
fread(data.data, 1, data.chunkSize, fd);
fclose(fd);
WAV* wav = (WAV*) malloc(sizeof(WAV));
wav->riff = riff;
wav->format = format;