Skip to content

Commit

Permalink
Merge branch 'master' of github.com:chocolate-doom/chocolate-doom
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiangreffrath committed Oct 21, 2023
2 parents fe4dcd3 + bd7be22 commit f3f17cd
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 22 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 0 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 6 additions & 2 deletions src/doom/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -1663,7 +1662,6 @@ void D_DoomMain (void)

DEH_printf("W_Init: Init WADfiles.\n");
D_AddFile(iwadfile);
numiwadlumps = numlumps;

W_CheckCorrectIWAD(doom);

Expand Down Expand Up @@ -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)
{
Expand Down
10 changes: 7 additions & 3 deletions src/doom/p_spec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
12 changes: 11 additions & 1 deletion src/i_flmusic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/i_sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/i_sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions src/m_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
2 changes: 2 additions & 0 deletions src/setup/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions textscreen/txt_spinctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit f3f17cd

Please sign in to comment.