Replace lodepng by stb_image; add Vorbis banner sound import
This commit is contained in:
File diff suppressed because it is too large
Load Diff
1702
source/pc/lodepng.h
1702
source/pc/lodepng.h
File diff suppressed because it is too large
Load Diff
3
source/pc/stb_image.c
Normal file
3
source/pc/stb_image.c
Normal 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
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
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
2
source/pc/stb_vorbis.h
Normal file
@@ -0,0 +1,2 @@
|
||||
#define STB_VORBIS_HEADER_ONLY
|
||||
#include "stb_vorbis.c"
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user