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 47bf2830d8
commit 1707848d31
11 changed files with 12154 additions and 7832 deletions
File diff suppressed because it is too large Load Diff
-1702
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -0,0 +1,3 @@
#define STB_IMAGE_IMPLEMENTATION
#define STBI_ONLY_PNG
#include "stb_image.h"
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2
View File
@@ -0,0 +1,2 @@
#define STB_VORBIS_HEADER_ONLY
#include "stb_vorbis.c"
+1 -5
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;
+3 -1
View File
@@ -1,6 +1,8 @@
#ifndef __WAV_H__
#define __WAV_H__
#include <stdio.h>
#include "../types.h"
typedef struct {
@@ -32,7 +34,7 @@ typedef struct {
Data data;
} WAV;
WAV* wav_read(const char* file);
WAV* wav_read(FILE* fd);
void wav_free(WAV* wav);
#endif