From c2680b8b9b05318ec7874883adddcaaf4fdd4d47 Mon Sep 17 00:00:00 2001 From: Michael Day Date: Sat, 23 Sep 2023 18:32:22 -0400 Subject: [PATCH 1/5] textscreen: Set buffer when init-ing spincontrol This fixes a bug where if a spincontrol is the first widget in a window, its value gets reset to 0 every time that window is opened. --- textscreen/txt_spinctrl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/textscreen/txt_spinctrl.c b/textscreen/txt_spinctrl.c index 465e4e4a0e..2a93e96eec 100644 --- a/textscreen/txt_spinctrl.c +++ b/textscreen/txt_spinctrl.c @@ -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; } From c2ebe7d986d8420fa9d5b1eba7a715e0eb40fefd Mon Sep 17 00:00:00 2001 From: tpoppins Date: Sat, 7 Oct 2023 20:18:50 -0400 Subject: [PATCH 2/5] Disable sector special 17 in gameversion 1.2 (#1554) * Disable sector special 17 in gameversion 1.2 The first vanilla exec to support sector special 17 (random flicker) was the official v1.4 beta. Disabling it for -gameversion 1.2 solves the desync on DEMO1 of CHURCH.WAD. Fixes #1529. * Whitespace --------- Co-authored-by: Turo Lamminen --- src/doom/p_spec.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/doom/p_spec.c b/src/doom/p_spec.c index 3e8d35bd3e..029f797f62 100644 --- a/src/doom/p_spec.c +++ b/src/doom/p_spec.c @@ -1466,9 +1466,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; } } From 7f25bf6fbd0b6917912db86d5e321886375247aa Mon Sep 17 00:00:00 2001 From: Michael Francis <4574480+mfrancis95@users.noreply.github.com> Date: Sat, 7 Oct 2023 08:17:52 -0400 Subject: [PATCH 3/5] Move cppcheck into its own workflow --- .github/workflows/cppcheck.yml | 23 +++++++++++++++++++++++ .github/workflows/main.yml | 16 ---------------- 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/cppcheck.yml diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml new file mode 100644 index 0000000000..2cc8f1b504 --- /dev/null +++ b/.github/workflows/cppcheck.yml @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bfdc1e0f2a..9a7b640c74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,19 +37,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 From 7d44fa1959d7d9058edbeead1bb2baaf23b0d102 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Fri, 20 Oct 2023 12:42:07 +0200 Subject: [PATCH 4/5] evaluate `numiwadlumps` after `DoMerge()` has been called (#1630) If a merged PWAD contains sprites, these get mangled into the IWAD sprites, changing the value of `numlumps` and thus invalidating the value of `numiwadlumps` determined earlier. Also, this variable is only used in one occasion, so only evaluate it as needed. This approach makes sure `numiwadlumps` points past the index of the last IWAD lump in the linear `lumpinfo[]` array. Fixes https://github.com/fabiangreffrath/crispy-doom/issues/1101 --- src/doom/d_main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/doom/d_main.c b/src/doom/d_main.c index 0bab43c15a..d2e0c6356e 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -1294,7 +1294,6 @@ void D_DoomMain (void) int p; char file[256]; char demolumpname[9]; - int numiwadlumps; I_AtExit(D_Endoom, false); @@ -1504,7 +1503,6 @@ void D_DoomMain (void) DEH_printf("W_Init: Init WADfiles.\n"); D_AddFile(iwadfile); - numiwadlumps = numlumps; W_CheckCorrectIWAD(doom); @@ -1706,6 +1704,12 @@ void D_DoomMain (void) if (M_ParmExists("-dehlump")) { int i, loaded = 0; + int numiwadlumps = numlumps; + + while (!W_IsIWADLump(lumpinfo[numiwadlumps - 1])) + { + numiwadlumps--; + } for (i = numiwadlumps; i < numlumps; ++i) { From bd7be2212c4c0520cd6e5721a0d0cae32eb09c24 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Fri, 20 Oct 2023 16:45:43 +0200 Subject: [PATCH 5/5] add a fsynth_gain config key to fine tune the FluidSynth output level (#1631) * add a fsynth_gain config key to fine tune the FluidSynth output level Fixes #https://github.com/fabiangreffrath/crispy-doom/issues/1087 * lower fsynth_gain to 0.0f --- src/i_flmusic.c | 12 +++++++++++- src/i_sound.c | 1 + src/i_sound.h | 1 + src/m_config.c | 7 +++++++ src/setup/sound.c | 2 ++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/i_flmusic.c b/src/i_flmusic.c index 7ea7653d2f..1ea9999b74 100644 --- a/src/i_flmusic.c +++ b/src/i_flmusic.c @@ -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) diff --git a/src/i_sound.c b/src/i_sound.c index a892b86a37..9070966281 100644 --- a/src/i_sound.c +++ b/src/i_sound.c @@ -525,6 +525,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 diff --git a/src/i_sound.h b/src/i_sound.h index 7674a6b7c8..21dc8cb166 100644 --- a/src/i_sound.h +++ b/src/i_sound.h @@ -293,6 +293,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 diff --git a/src/m_config.c b/src/m_config.c index 7c3e0e8add..c5ddcbbf31 100644 --- a/src/m_config.c +++ b/src/m_config.c @@ -1021,6 +1021,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. // diff --git a/src/setup/sound.c b/src/setup/sound.c index 77d9c16215..6f5de1f714 100644 --- a/src/setup/sound.c +++ b/src/setup/sound.c @@ -103,6 +103,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 @@ -376,6 +377,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