Make Tremor optional

This commit is contained in:
twinaphex 2012-11-15 21:49:55 +01:00
parent 23ee14a57c
commit d36536750b
3 changed files with 13 additions and 2 deletions

View File

@ -3,6 +3,7 @@ FRONTEND_SUPPORTS_RGB565 = 1
MEDNAFEN_DIR := mednafen
MEDNAFEN_LIBRETRO_DIR := mednafen-libretro
NEED_TREMOR = 0
ifeq ($(platform),)
platform = unix
@ -207,11 +208,14 @@ CDROM_SOURCES += $(MEDNAFEN_DIR)/cdrom/CDAccess.cpp \
$(MEDNAFEN_DIR)/cdrom/l-ec.cpp \
$(MEDNAFEN_DIR)/cdrom/cdromif.cpp \
$(MEDNAFEN_DIR)/cdrom/cd_crc32.cpp
TREMOR_SRC := $(wildcard $(MEDNAFEN_DIR)/tremor/*.c)
FLAGS += -DNEED_CD
endif
ifeq ($(NEED_TREMOR), 1)
TREMOR_SRC := $(wildcard $(MEDNAFEN_DIR)/tremor/*.c)
FLAGS += -DNEED_TREMOR
endif
MEDNAFEN_SOURCES := $(MEDNAFEN_DIR)/mednafen.cpp \
$(MEDNAFEN_DIR)/error.cpp \

View File

@ -491,6 +491,7 @@ void CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
//fstat(fileno(TmpTrack.fp), &stat_buf);
//TmpTrack.sectors = stat_buf.st_size; // / 2048;
}
#ifdef NEED_TREMOR
else if(!strcasecmp(args[1], "OGG") || !strcasecmp(args[1], "VORBIS") || !strcasecmp(args[1], "WAVE") || !strcasecmp(args[1], "WAV") || !strcasecmp(args[1], "PCM")
|| !strcasecmp(args[1], "MPC") || !strcasecmp(args[1], "MP+"))
{
@ -500,6 +501,7 @@ void CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
throw(MDFN_Error(0, _("Unsupported audio track file format: %s\n"), args[0]));
}
}
#endif
else
{
throw(MDFN_Error(0, _("Unsupported track format: %s\n"), args[1]));

View File

@ -76,6 +76,8 @@ int64 AudioReader::FrameCount(void)
**
*/
#ifdef NEED_TREMOR
class OggVorbisReader : public AudioReader
{
public:
@ -175,6 +177,7 @@ int64 OggVorbisReader::FrameCount(void)
{
return(ov_pcm_total(&ovfile, -1));
}
#endif
/*
**
@ -190,6 +193,7 @@ int64 OggVorbisReader::FrameCount(void)
AudioReader *AR_Open(Stream *fp)
{
#ifdef NEED_TREMOR
try
{
return new OggVorbisReader(fp);
@ -197,6 +201,7 @@ AudioReader *AR_Open(Stream *fp)
catch(int i)
{
}
#endif
return(NULL);
}