From e9ce699042878b58c155acfc089cda2cb9ff785b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 1 Oct 2016 12:17:15 +0300 Subject: [PATCH 1/4] Fixed compilation with GCC or Clang --- src/s_advsound.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index c1c19aabf..0db9365c2 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -361,11 +361,11 @@ static bool S_CheckSound(sfxinfo_t *startsfx, sfxinfo_t *sfx, TArraySounds[i]]; if (rsfx == startsfx) { - Printf(TEXTCOLOR_RED "recursive sound $random found for %s:\n", startsfx->name); + Printf(TEXTCOLOR_RED "recursive sound $random found for %s:\n", startsfx->name.GetChars()); success = false; for (unsigned i = 1; i %s\n", chain[i]->name); + Printf(TEXTCOLOR_ORANGE " -> %s\n", chain[i]->name.GetChars()); } } else @@ -379,11 +379,11 @@ static bool S_CheckSound(sfxinfo_t *startsfx, sfxinfo_t *sfx, TArraylink]; if (me == startsfx) { - Printf(TEXTCOLOR_RED "recursive sound $alias found for %s:\n", startsfx->name); + Printf(TEXTCOLOR_RED "recursive sound $alias found for %s:\n", startsfx->name.GetChars()); success = false; for (unsigned i = 1; i %s\n", chain[i]->name); + Printf(TEXTCOLOR_ORANGE " -> %s\n", chain[i]->name.GetChars()); } chain.Resize(siz); } @@ -413,7 +413,7 @@ void S_CheckIntegrity() if (broken[i]) { auto &sfx = S_sfx[i]; - Printf(TEXTCOLOR_RED "Sound %s has been disabled\n", sfx.name); + Printf(TEXTCOLOR_RED "Sound %s has been disabled\n", sfx.name.GetChars()); sfx.bRandomHeader = false; sfx.link = 0; // link to the empty sound. } From 099bfed806bb3b72824ac6ae8015df99ce90b392 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 1 Oct 2016 12:27:24 +0300 Subject: [PATCH 2/4] Fixed endianness issue with precaching of MUS files --- src/sound/music_mus_midiout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sound/music_mus_midiout.cpp b/src/sound/music_mus_midiout.cpp index 17426a798..58b86201a 100644 --- a/src/sound/music_mus_midiout.cpp +++ b/src/sound/music_mus_midiout.cpp @@ -211,11 +211,11 @@ bool MUSSong2::CheckDone() void MUSSong2::Precache() { - TArray work(MusHeader->NumInstruments); + TArray work(LittleShort(MusHeader->NumInstruments)); const BYTE *used = (BYTE *)MusHeader + sizeof(MUSHeader) / sizeof(BYTE); int i, k; - for (i = k = 0; i < MusHeader->NumInstruments; ++i) + for (i = k = 0; i < LittleShort(MusHeader->NumInstruments); ++i) { BYTE instr = used[k++]; WORD val; From 7720359f4cf22266bb4b9bb09b1d956322197819 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 1 Oct 2016 12:08:07 +0200 Subject: [PATCH 3/4] - fixed: AActor::Masacre must restore the flag if it cannot kill the monster. --- src/p_mobj.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 400b41798..90a800fa7 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1323,6 +1323,9 @@ bool AActor::Massacre () if (health > 0) { + auto f = flags; + auto f2 = flags2; + flags |= MF_SHOOTABLE; flags2 &= ~(MF2_DORMANT|MF2_INVULNERABLE); do @@ -1331,6 +1334,12 @@ bool AActor::Massacre () P_DamageMobj (this, NULL, NULL, TELEFRAG_DAMAGE, NAME_Massacre); } while (health != prevhealth && health > 0); //abort if the actor wasn't hurt. + if (health > 0) + { + // restore flags if this did not kill the monster. + flags = f; + flags2 = f2; + } return health <= 0; } return false; From cfa6b817b5b3af2c8590aadd133732971c146be0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 1 Oct 2016 21:34:13 +0200 Subject: [PATCH 4/4] - made bloom and tonemap settings game specific and save all related CVARs. As was pointed out: "That said, there is one minor problem - different game artstyles can constitute whether Bloom is turned on, which tonemap is used, etc. For example, when playing Doom, I like having my bloom on, but if I am going to start playing the Adventures of Square, the art style and bloom don't mix, in my opinion. For this, I have to remember to switch my bloom settings every time I switch IWad" --- src/gl/renderer/gl_postprocess.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index 7ce8be0ad..03bea6d72 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -69,24 +69,24 @@ // CVARs // //========================================================================== -CVAR(Bool, gl_bloom, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); -CUSTOM_CVAR(Float, gl_bloom_amount, 1.4f, 0) +CVAR(Bool, gl_bloom, false, CVAR_ARCHIVE); +CUSTOM_CVAR(Float, gl_bloom_amount, 1.4f, CVAR_ARCHIVE) { if (self < 0.1f) self = 0.1f; } -CVAR(Float, gl_exposure_scale, 1.3f, 0) -CVAR(Float, gl_exposure_min, 0.35f, 0) -CVAR(Float, gl_exposure_base, 0.35f, 0) -CVAR(Float, gl_exposure_speed, 0.05f, 0) +CVAR(Float, gl_exposure_scale, 1.3f, CVAR_ARCHIVE) +CVAR(Float, gl_exposure_min, 0.35f, CVAR_ARCHIVE) +CVAR(Float, gl_exposure_base, 0.35f, CVAR_ARCHIVE) +CVAR(Float, gl_exposure_speed, 0.05f, CVAR_ARCHIVE) -CUSTOM_CVAR(Int, gl_tonemap, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Int, gl_tonemap, 0, CVAR_ARCHIVE) { if (self < 0 || self > 5) self = 0; } -CUSTOM_CVAR(Int, gl_bloom_kernel_size, 7, 0) +CUSTOM_CVAR(Int, gl_bloom_kernel_size, 7, CVAR_ARCHIVE) { if (self < 3 || self > 15 || self % 2 == 0) self = 7; @@ -94,9 +94,9 @@ CUSTOM_CVAR(Int, gl_bloom_kernel_size, 7, 0) CVAR(Bool, gl_lens, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -CVAR(Float, gl_lens_k, -0.12f, 0) -CVAR(Float, gl_lens_kcube, 0.1f, 0) -CVAR(Float, gl_lens_chromatic, 1.12f, 0) +CVAR(Float, gl_lens_k, -0.12f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CVAR(Float, gl_lens_kcube, 0.1f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CVAR(Float, gl_lens_chromatic, 1.12f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) EXTERN_CVAR(Float, vid_brightness) EXTERN_CVAR(Float, vid_contrast)