port srb2classics sdl audio system
still needs a little work reimplementing everything we got from: https://codeberg.org/srb2classic/srb2classic/pulls/177
This commit is contained in:
1 parent
59f194cb9d
commit
e9685ef3e8
7 files changed
+1761
-27
No files matched your search
+6
-14
@@ -32,7 +32,10 @@ endif
|
||||
NOMIXER=1
|
||||
|
||||
ifdef NOMIXER
|
||||
sources+=sdl/dummy_sound.c
|
||||
#sources+=sdl/dummy_sound.c
|
||||
sources+=sdl/sdl_sound.c
|
||||
SNDFILE_PKGCONFIG?=sndfile
|
||||
$(eval $(call Use_pkg_config,SNDFILE))
|
||||
else
|
||||
opts+=-DHAVE_MIXER
|
||||
sources+=sdl/mixer_sound.c
|
||||
@@ -47,19 +50,8 @@ opts+=-DHAVE_THREADS
|
||||
sources+=sdl/i_threads.c
|
||||
endif
|
||||
|
||||
ifdef SDL_PKGCONFIG
|
||||
$(eval $(call Use_pkg_config,SDL3))
|
||||
else
|
||||
#FIXME: this is def not correct
|
||||
SDL_CFLAGS := -I/usr/local/include/SDL3
|
||||
SDL_LDFLAGS := -L/usr/local/lib -lSDL3
|
||||
#SDL_CONFIG?=$(call Prefix,sdl2-config)
|
||||
#SDL_CFLAGS?=$(shell $(SDL_CONFIG) --cflags)
|
||||
#SDL_LDFLAGS?=$(shell $(SDL_CONFIG) \
|
||||
$(if $(STATIC),--static-libs,--libs))
|
||||
|
||||
$(eval $(call Propogate_flags,SDL))
|
||||
endif
|
||||
SDL_PKGCONFIG?=sdl3
|
||||
$(eval $(call Use_pkg_config,SDL))
|
||||
|
||||
ifdef MINGW
|
||||
ifndef NOSDLMAIN
|
||||
|
||||
+1
-1
@@ -1264,7 +1264,7 @@ static void IdentifyVersion(void)
|
||||
if (AddIWAD("extra3.kart", srb2waddir))
|
||||
found_extra3_kart = true;
|
||||
|
||||
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
|
||||
#if defined (HAVE_SDL)
|
||||
#define MUSICTEST(str) \
|
||||
musicpath = va(pandf, srb2waddir, str);\
|
||||
handle = W_OpenWadFile(&musicpath, false); \
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@
|
||||
// but I can't stand that gibberish. D:
|
||||
#define SOUND_DUMMY 0
|
||||
#define SOUND_MIXER 1
|
||||
#define SOUND_SDL 2
|
||||
|
||||
#ifndef SOUND
|
||||
#ifdef HAVE_SDL
|
||||
@@ -27,7 +28,7 @@
|
||||
#ifdef HAVE_MIXER
|
||||
#define SOUND SOUND_MIXER
|
||||
#else
|
||||
#define SOUND SOUND_DUMMY
|
||||
#define SOUND SOUND_SDL
|
||||
#endif
|
||||
#else
|
||||
#define SOUND SOUND_DUMMY
|
||||
|
||||
+6
-1
@@ -3986,7 +3986,12 @@ DoneSection2:
|
||||
|
||||
player->tossdelay = 3;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Event - Final Lap
|
||||
// Still works for GME, but disabled for consistency
|
||||
if (G_RaceGametype() && player->laps >= (UINT8)(cv_numlaps.value - 1))
|
||||
S_SpeedMusic(1.2f);
|
||||
#endif
|
||||
if (player->laps >= (unsigned)cv_numlaps.value)
|
||||
{
|
||||
if (P_IsLocalPlayer(player))
|
||||
|
||||
+8
-10
@@ -1642,7 +1642,7 @@ UINT32 S_GetMusicPosition(void)
|
||||
static lumpnum_t S_GetMusicLumpNum(const char *mname)
|
||||
{
|
||||
if (S_MusicExists(mname, false, true)) // check non midis first
|
||||
return W_GetNumForName(va("o_%s", mname));
|
||||
return W_GetNumForName(va("O_%s", mname));
|
||||
|
||||
if (S_MusicExists(mname, true, false))
|
||||
{
|
||||
@@ -1650,7 +1650,7 @@ static lumpnum_t S_GetMusicLumpNum(const char *mname)
|
||||
CONS_Alert(CONS_ERROR, "A MIDI music lump %.6s was found,\nbut SRB2Kart does not support MIDI output.\nWe apologise for the inconvenience.\n", mname);
|
||||
return LUMPERROR;
|
||||
#else
|
||||
return W_GetNumForName(va("d_%s", mname));
|
||||
return W_GetNumForName(va("D_%s", mname));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2272,16 +2272,15 @@ static void GameSounds_OnChange(void)
|
||||
if (M_CheckParm("-nosound") || M_CheckParm("-noaudio"))
|
||||
return;
|
||||
|
||||
if (sound_disabled && cv_gamesounds.value)
|
||||
sound_disabled = !cv_gamesounds.value;
|
||||
if (sound_disabled)
|
||||
{
|
||||
sound_disabled = false;
|
||||
I_StartupSound(); // will return early if initialised
|
||||
S_InitSfxChannels(cv_soundvolume.value);
|
||||
S_StartSound(NULL, sfx_strpst);
|
||||
}
|
||||
else if (!sound_disabled && !cv_gamesounds.value)
|
||||
else
|
||||
{
|
||||
sound_disabled = true;
|
||||
S_StopSounds();
|
||||
}
|
||||
}
|
||||
@@ -2306,9 +2305,9 @@ void GameMusic_OnChange(void)
|
||||
if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio"))
|
||||
return;
|
||||
|
||||
if (music_disabled && cv_gamedigimusic.value)
|
||||
music_disabled = !cv_gamedigimusic.value;
|
||||
if (music_disabled)
|
||||
{
|
||||
music_disabled = false;
|
||||
I_StartupSound(); // will return early if initialised
|
||||
I_InitMusic();
|
||||
|
||||
@@ -2319,9 +2318,8 @@ void GameMusic_OnChange(void)
|
||||
else
|
||||
S_ChangeMusicInternal("titles", looptitle);
|
||||
}
|
||||
else if (!music_disabled && !cv_gamedigimusic.value)
|
||||
else
|
||||
{
|
||||
music_disabled = true;
|
||||
S_StopMusic();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,3 +5,4 @@ i_video.c
|
||||
dosstr.c
|
||||
endtxt.c
|
||||
hwsym_sdl.c
|
||||
sdl_sound.c
|
||||
+1737
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user