mirror of
https://github.com/simtactics/niotso.git
synced 2025-03-22 10:52:20 +00:00
Shaved off about 5MB from freetype. It's far larger than any other library I'm pulling in.
This commit is contained in:
parent
10827bf2df
commit
cb40cbd867
5 changed files with 40 additions and 24 deletions
|
@ -17,10 +17,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "FileHandler.hpp"
|
#include "FileHandler.hpp"
|
||||||
#include "libmpg123/mpg123.h"
|
|
||||||
#include "utk/read_utk.h"
|
|
||||||
#include "wav/read_wav.h"
|
#include "wav/read_wav.h"
|
||||||
#include "xa/read_xa.h"
|
#include "xa/read_xa.h"
|
||||||
|
#include "utk/read_utk.h"
|
||||||
|
#include "libmpg123/mpg123.h"
|
||||||
|
|
||||||
namespace File {
|
namespace File {
|
||||||
|
|
||||||
|
@ -159,7 +159,8 @@ static uint8_t * ReadUTK(Sound_t * Sound, const uint8_t * InData, size_t FileSiz
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t * ReadMP3(Sound_t * Sound, const uint8_t * InData, size_t FileSize){
|
static uint8_t * ReadMP3(Sound_t * Sound, const uint8_t * InData, size_t FileSize){
|
||||||
if(mpg123_init() != MPG123_OK){
|
mpg123_handle *mh;
|
||||||
|
if(mpg123_init() != MPG123_OK || (mh = mpg123_new(NULL, NULL)) == NULL){
|
||||||
mpg123_exit();
|
mpg123_exit();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -170,9 +171,7 @@ static uint8_t * ReadMP3(Sound_t * Sound, const uint8_t * InData, size_t FileSiz
|
||||||
size_t OutSize;
|
size_t OutSize;
|
||||||
uint8_t * OutData;
|
uint8_t * OutData;
|
||||||
|
|
||||||
mpg123_handle *mh = mpg123_new(NULL, NULL);
|
if(mpg123_format_none(mh) != MPG123_OK ||
|
||||||
if(mh == NULL ||
|
|
||||||
mpg123_format_none(mh) != MPG123_OK ||
|
|
||||||
mpg123_format(mh, 44100, MPG123_MONO | MPG123_STEREO, MPG123_ENC_SIGNED_16) != MPG123_OK ||
|
mpg123_format(mh, 44100, MPG123_MONO | MPG123_STEREO, MPG123_ENC_SIGNED_16) != MPG123_OK ||
|
||||||
mpg123_open_feed(mh) != MPG123_OK ||
|
mpg123_open_feed(mh) != MPG123_OK ||
|
||||||
mpg123_feed(mh, InData, FileSize) != MPG123_OK ||
|
mpg123_feed(mh, InData, FileSize) != MPG123_OK ||
|
||||||
|
|
|
@ -29,7 +29,7 @@ enum ImageType {
|
||||||
FIMG_BMP,
|
FIMG_BMP,
|
||||||
FIMG_JPEG,
|
FIMG_JPEG,
|
||||||
FIMG_PNG,
|
FIMG_PNG,
|
||||||
FIMG_TGA,
|
FIMG_TGACUR,
|
||||||
FIMG_COUNT
|
FIMG_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
0
Libraries/FileHandler/TODO
Normal file
0
Libraries/FileHandler/TODO
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
FileHandler - General-purpose file handling library for Niotso
|
||||||
|
spr2.c - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||||
|
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
Loading…
Add table
Reference in a new issue