Merge branch 'master' of github.com:chocolate-doom/chocolate-doom

This commit is contained in:
Fabian Greffrath 2023-10-21 13:33:59 +02:00
commit f3f17cdacc
10 changed files with 60 additions and 22 deletions

23
.github/workflows/cppcheck.yml vendored Normal file
View file

@ -0,0 +1,23 @@
name: cppcheck
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- master
jobs:
cppcheck:
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install cppcheck
- uses: actions/checkout@v2
- name: Run cppcheck
env:
ANALYZE: true
run: $GITHUB_WORKSPACE/.travis.sh

View file

@ -40,19 +40,3 @@ jobs:
env:
CC: ${{ matrix.compiler }}
run: $GITHUB_WORKSPACE/.travis.sh
cppcheck:
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install cppcheck
- uses: actions/checkout@v2
with:
submodules: true
- name: Run cppcheck
env:
ANALYZE: true
run: $GITHUB_WORKSPACE/.travis.sh

View file

@ -1439,7 +1439,6 @@ void D_DoomMain (void)
int p;
char file[256];
char demolumpname[9] = {0};
int numiwadlumps;
// [crispy] unconditionally initialize DEH tables
DEH_Init();
@ -1663,7 +1662,6 @@ void D_DoomMain (void)
DEH_printf("W_Init: Init WADfiles.\n");
D_AddFile(iwadfile);
numiwadlumps = numlumps;
W_CheckCorrectIWAD(doom);
@ -2019,6 +2017,12 @@ void D_DoomMain (void)
if (!M_ParmExists("-nodehlump") && !M_ParmExists("-nodeh"))
{
int i, loaded = 0;
int numiwadlumps = numlumps;
while (!W_IsIWADLump(lumpinfo[numiwadlumps - 1]))
{
numiwadlumps--;
}
for (i = numiwadlumps; i < numlumps; ++i)
{

View file

@ -1650,9 +1650,13 @@ void P_SpawnSpecials (void)
P_SpawnDoorRaiseIn5Mins (sector, i);
break;
case 17:
P_SpawnFireFlicker(sector);
break;
case 17:
// first introduced in official v1.4 beta
if (gameversion > exe_doom_1_2)
{
P_SpawnFireFlicker(sector);
}
break;
}
}

View file

@ -55,6 +55,7 @@ float fsynth_reverb_damp = 0.4f;
float fsynth_reverb_level = 0.15f;
float fsynth_reverb_roomsize = 0.6f;
float fsynth_reverb_width = 4.0f;
float fsynth_gain = 1.0f;
static fluid_synth_t *synth = NULL;
static fluid_settings_t *settings = NULL;
@ -119,6 +120,15 @@ static boolean I_FL_InitMusic(void)
fsynth_chorus_speed);
}
if (fsynth_gain < 0.0f)
{
fsynth_gain = 0.0f;
}
if (fsynth_gain > 10.0f)
{
fsynth_gain = 10.0f;
}
synth = new_fluid_synth(settings);
if (synth == NULL)
@ -154,7 +164,7 @@ static void I_FL_SetMusicVolume(int volume)
}
// FluidSynth's default is 0.2. Make 1.0 the maximum.
// 0 -- 0.2 -- 10.0
fluid_synth_set_gain(synth, (float) volume / 127);
fluid_synth_set_gain(synth, ((float) volume / 127) * fsynth_gain);
}
static void I_FL_PauseSong(void)

View file

@ -573,6 +573,7 @@ void I_BindSoundVariables(void)
M_BindFloatVariable("fsynth_reverb_level", &fsynth_reverb_level);
M_BindFloatVariable("fsynth_reverb_roomsize", &fsynth_reverb_roomsize);
M_BindFloatVariable("fsynth_reverb_width", &fsynth_reverb_width);
M_BindFloatVariable("fsynth_gain", &fsynth_gain);
M_BindStringVariable("fsynth_sf_path", &fsynth_sf_path);
#endif // HAVE_FLUIDSYNTH

View file

@ -296,6 +296,7 @@ extern float fsynth_reverb_damp;
extern float fsynth_reverb_level;
extern float fsynth_reverb_roomsize;
extern float fsynth_reverb_width;
extern float fsynth_gain;
#endif // HAVE_FLUIDSYNTH
#endif

View file

@ -1095,6 +1095,13 @@ static default_t extra_defaults_list[] =
CONFIG_VARIABLE_FLOAT(fsynth_reverb_width),
//!
// Fine tune the FluidSynth output level. Default is 1.0,
// range is 0.0 - 10.0.
//
CONFIG_VARIABLE_FLOAT(fsynth_gain),
//!
// Full path to a soundfont file to use with FluidSynth MIDI playback.
//

View file

@ -106,6 +106,7 @@ float fsynth_reverb_damp = 0.4f;
float fsynth_reverb_level = 0.15f;
float fsynth_reverb_roomsize = 0.6f;
float fsynth_reverb_width = 4.0f;
float fsynth_gain = 1.0f;
#endif // HAVE_FLUIDSYNTH
// DOS specific variables: these are unused but should be maintained
@ -379,6 +380,7 @@ void BindSoundVariables(void)
M_BindFloatVariable("fsynth_reverb_level", &fsynth_reverb_level);
M_BindFloatVariable("fsynth_reverb_roomsize", &fsynth_reverb_roomsize);
M_BindFloatVariable("fsynth_reverb_width", &fsynth_reverb_width);
M_BindFloatVariable("fsynth_gain", &fsynth_gain);
M_BindStringVariable("fsynth_sf_path", &fsynth_sf_path);
#endif // HAVE_FLUIDSYNTH

View file

@ -404,6 +404,7 @@ txt_spincontrol_t *TXT_NewSpinControl(int *value, int min, int max)
spincontrol->min.i = min;
spincontrol->max.i = max;
spincontrol->step.i = 1;
SetBuffer(spincontrol);
return spincontrol;
}
@ -418,6 +419,7 @@ txt_spincontrol_t *TXT_NewFloatSpinControl(float *value, float min, float max)
spincontrol->min.f = min;
spincontrol->max.f = max;
spincontrol->step.f = 0.1f;
SetBuffer(spincontrol);
return spincontrol;
}