modified:   src/CMakeLists.txt
	modified:   src/Makefile
	modified:   src/Makefile.d/detect.mk
	modified:   src/r_picformats.h
	modified:   src/sdl/mixer_sound.c
This commit is contained in:
litten 1up 2021-11-14 15:55:33 -06:00
commit dbd1e61e7c
5 changed files with 34 additions and 30 deletions

View File

@ -60,7 +60,7 @@ if(${SRB2_CONFIG_HAVE_GME})
endif()
if(${GME_FOUND})
set(SRB2_HAVE_GME ON)
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_LIBGME)
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_GME)
else()
message(WARNING "You have specified that GME is available but it was not found.")
endif()

View File

@ -376,7 +376,7 @@ ifdef Echo_name
@printf '%-20.20s\r' $$<
endif
endif
$(.)$(cc) -MM -MF $$@ -MT $(objdir)/$$(*F).o $(2) $$<
$(.)$(cc) -MM -MF $$@ -MT $(objdir)/$$*.o $(2) $$<
endef
$(eval $(call _recipe,c))

View File

@ -71,13 +71,17 @@ latest_gcc_version:=10.2
# manually set. And don't bother if this is a clean only
# run.
ifeq (,$(call Wildvar,GCC% destructive))
version:=$(shell $(CC) --version)
# can't use $(CC) --version here since that uses argv[0] to display the name
# also gcc outputs the information to stderr, so I had to do 2>&1
# this program really doesn't like identifying itself
version:=$(shell $(CC) -v 2>&1)
# check if this is in fact GCC
ifneq (,$(or $(findstring gcc,$(version)),\
$(findstring GCC,$(version))))
ifneq (,$(findstring gcc version,$(version)))
version:=$(shell $(CC) -dumpversion)
# in stark contrast to the name, gcc will give me a nicely formatted version number for free
version:=$(shell $(CC) -dumpfullversion)
# Turn version into words of major, minor
v:=$(subst ., ,$(version))

View File

@ -116,9 +116,9 @@ void *Picture_PNGConvert(
size_t insize, size_t *outsize,
pictureflags_t flags);
boolean Picture_PNGDimensions(UINT8 *png, INT32 *width, INT32 *height, INT16 *topoffset, INT16 *leftoffset, size_t size);
#endif
#define PICTURE_PNG_USELOOKUP
#endif
// SpriteInfo
extern spriteinfo_t spriteinfo[NUMSPRITES];

View File

@ -9,7 +9,7 @@
/// \file
/// \brief SDL Mixer interface for sound
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
#ifdef HAVE_ZLIB
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
@ -27,7 +27,7 @@
#include <zlib.h>
#endif // HAVE_ZLIB
#endif // HAVE_LIBGME
#endif // HAVE_GME
#include "../doomdef.h"
#include "../doomstat.h" // menuactive
@ -73,11 +73,11 @@
#define MUS_MODPLUG MUS_MODPLUG_UNUSED
#endif
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
#include "gme/gme.h"
#define GME_TREBLE 5.0f
#define GME_BASS 1.0f
#endif // HAVE_LIBGME
#endif // HAVE_GME
static UINT16 BUFFERSIZE = 2048;
static UINT16 SAMPLERATE = 44100;
@ -110,7 +110,7 @@ static INT32 fading_id;
static void (*fading_callback)(void);
static boolean fading_nocleanup;
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
static Music_Emu *gme;
static UINT16 current_track;
#endif
@ -220,7 +220,7 @@ static void var_cleanup(void)
internal_volume = 100;
}
#if defined (HAVE_LIBGME) && defined (HAVE_ZLIB)
#if defined (HAVE_GME) && defined (HAVE_ZLIB)
static const char* get_zlib_error(int zErr)
{
switch (zErr)
@ -318,7 +318,7 @@ void I_ShutdownSound(void)
SDL_QuitSubSystem(SDL_INIT_AUDIO);
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if (gme)
gme_delete(gme);
#endif
@ -453,7 +453,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
void *lump;
Mix_Chunk *chunk;
SDL_RWops *rw;
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
Music_Emu *emu;
gme_info_t *info;
#endif
@ -473,7 +473,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
}
// Not a doom sound? Try something else.
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
// VGZ format
if (((UINT8 *)lump)[0] == 0x1F
&& ((UINT8 *)lump)[1] == 0x8B)
@ -729,7 +729,7 @@ static UINT32 music_fade(UINT32 interval, void *param)
}
}
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
static void mix_gme(void *udata, Uint8 *stream, int len)
{
int i;
@ -797,7 +797,7 @@ void I_ShutdownMusic(void)
musictype_t I_SongType(void)
{
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if (gme)
return MU_GME;
else
@ -828,7 +828,7 @@ musictype_t I_SongType(void)
boolean I_SongPlaying(void)
{
return (
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
(I_SongType() == MU_GME && gme) ||
#endif
#ifdef HAVE_OPENMPT
@ -851,7 +851,7 @@ boolean I_SetSongSpeed(float speed)
{
if (speed > 250.0f)
speed = 250.0f; //limit speed up to 250x
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if (gme)
{
SDL_LockAudio();
@ -893,7 +893,7 @@ UINT32 I_GetSongLength(void)
{
INT32 length;
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if (gme)
{
gme_info_t *info;
@ -963,7 +963,7 @@ boolean I_SetSongLoopPoint(UINT32 looppoint)
UINT32 I_GetSongLoopPoint(void)
{
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if (gme)
{
INT32 looppoint;
@ -992,7 +992,7 @@ UINT32 I_GetSongLoopPoint(void)
boolean I_SetSongPosition(UINT32 position)
{
UINT32 length;
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if (gme)
{
// this is unstable, so fail silently
@ -1055,7 +1055,7 @@ boolean I_SetSongPosition(UINT32 position)
UINT32 I_GetSongPosition(void)
{
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if (gme)
{
INT32 position = gme_tell(gme);
@ -1124,7 +1124,7 @@ boolean I_LoadSong(char *data, size_t len)
SDL_RWops *rw;
if (music
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
|| gme
#endif
#ifdef HAVE_OPENMPT
@ -1136,7 +1136,7 @@ boolean I_LoadSong(char *data, size_t len)
// always do this whether or not a music already exists
var_cleanup();
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if ((UINT8)data[0] == 0x1F
&& (UINT8)data[1] == 0x8B)
{
@ -1271,7 +1271,7 @@ void I_UnloadSong(void)
{
I_StopSong();
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if (gme)
{
gme_delete(gme);
@ -1294,7 +1294,7 @@ void I_UnloadSong(void)
boolean I_PlaySong(boolean looping)
{
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if (gme)
{
gme_equalizer_t eq = {GME_TREBLE, GME_BASS, 0,0,0,0,0,0,0,0};
@ -1360,7 +1360,7 @@ void I_StopSong(void)
if (!fading_nocleanup)
I_StopFadingSong();
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
if (gme)
{
Mix_HookMusic(NULL, NULL);
@ -1433,7 +1433,7 @@ void I_SetMusicVolume(UINT8 volume)
boolean I_SetSongTrack(int track)
{
#ifdef HAVE_LIBGME
#ifdef HAVE_GME
// If the specified track is within the number of tracks playing, then change it
if (gme)
{