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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3
source/pc/stb_image.c Normal file
View File

@@ -0,0 +1,3 @@
#define STB_IMAGE_IMPLEMENTATION
#define STBI_ONLY_PNG
#include "stb_image.h"

6614
source/pc/stb_image.h Normal file

File diff suppressed because it is too large Load Diff

5462
source/pc/stb_vorbis.c Normal file

File diff suppressed because it is too large Load Diff

2
source/pc/stb_vorbis.h Normal file
View File

@@ -0,0 +1,2 @@
#define STB_VORBIS_HEADER_ONLY
#include "stb_vorbis.c"

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;

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