diff --git a/source/common/filesystem/filesystem.cpp b/source/common/filesystem/filesystem.cpp index dae98edf5..563ace705 100644 --- a/source/common/filesystem/filesystem.cpp +++ b/source/common/filesystem/filesystem.cpp @@ -63,12 +63,14 @@ struct FileSystem::LumpRecord int rfnum; int Namespace; int resourceId; + int flags; void SetFromLump(int filenum, FResourceLump* lmp) { lump = lmp; rfnum = filenum; linkedTexture = nullptr; + flags = 0; if (lump->Flags & LUMPF_SHORTNAME) { @@ -487,7 +489,7 @@ int FileSystem::CheckNumForName (const char *name, int space) // from a Zip return that. WADs don't know these namespaces and single lumps must // work as well. if (space > ns_specialzipdirectory && lump.Namespace == ns_global && - !(lump.lump->Flags & LUMPF_FULLPATH)) break; + !((lump.lump->Flags ^lump.flags) & LUMPF_FULLPATH)) break; } i = NextLumpIndex[i]; } @@ -796,7 +798,7 @@ int FileSystem::GetFileFlags (int lump) return 0; } - return FileInfo[lump].lump->Flags; + return FileInfo[lump].lump->Flags ^ FileInfo[lump].flags; } //========================================================================== @@ -1532,11 +1534,19 @@ bool FileSystem::CreatePathlessCopy(const char *name, int id, int /*flags*/) auto oldlump = FileInfo[lump]; int slash = oldlump.longName.LastIndexOf('/'); - if (slash == -1) return true; // already is pathless. + // Note: already pathless entries must be duplica + + if (slash == -1) + { + FileInfo[lump].flags = LUMPF_FULLPATH; + return true; // already is pathless. + } + // just create a new reference to the original data with a different name. oldlump.longName = oldlump.longName.Mid(slash + 1); oldlump.resourceId = id; + oldlump.flags = LUMPF_FULLPATH; FileInfo.Push(oldlump); return true; } diff --git a/source/core/inputstate.h b/source/core/inputstate.h index 01996f41a..dd457046e 100644 --- a/source/core/inputstate.h +++ b/source/core/inputstate.h @@ -126,3 +126,14 @@ inline void resetForcedSyncInput() { gamesetinput = false; } + +inline bool specialKeyEvent(event_t* ev) +{ + if (ev->type == EV_KeyDown || ev->type == EV_KeyUp) + { + int key = ev->data1; + if (key == KEY_VOLUMEDOWN || key == KEY_VOLUMEUP || (key > KEY_LASTJOYBUTTON && key < KEY_PAD_LTHUMB_RIGHT)) return true; + } + return false; +} + diff --git a/source/core/movie/movieplayer.cpp b/source/core/movie/movieplayer.cpp index 10e3e52c2..80b6fca7b 100644 --- a/source/core/movie/movieplayer.cpp +++ b/source/core/movie/movieplayer.cpp @@ -137,7 +137,7 @@ public: if (sound == -1) soundEngine->StopAllChannels(); else if (SoundEnabled()) - soundEngine->StartSound(SOURCE_None, nullptr, nullptr, CHAN_AUTO, CHANF_NONE, sound, 1.f, ATTN_NONE); + soundEngine->StartSound(SOURCE_None, nullptr, nullptr, CHAN_AUTO, nostopsound? CHANF_UI : CHANF_NONE, sound, 1.f, ATTN_NONE); } } if (!nostopsound && curframe == numframes && soundEngine->GetSoundPlayingInfo(SOURCE_None, nullptr, -1)) return true; diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index 02cdd3ede..f2417dc5b 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -59,7 +59,7 @@ IMPLEMENT_CLASS(DImageScreen, true, false) bool DSkippableScreenJob::OnEvent(event_t* evt) { - if (evt->type == EV_KeyDown) + if (evt->type == EV_KeyDown && !specialKeyEvent(evt)) { state = skipped; Skipped(); @@ -225,6 +225,7 @@ public: } if (jobs[index].job->state != DScreenJob::running) return false; + return jobs[index].job->OnEvent(ev); } diff --git a/source/games/duke/src/2d_d.cpp b/source/games/duke/src/2d_d.cpp index 5d54e6589..ffe873c59 100644 --- a/source/games/duke/src/2d_d.cpp +++ b/source/games/duke/src/2d_d.cpp @@ -859,7 +859,7 @@ public: bool OnEvent(event_t* ev) override { - if (ev->type == EV_KeyDown) + if (ev->type == EV_KeyDown && !specialKeyEvent(ev)) { if ((displaystate & printStatsAll) != printStatsAll) { diff --git a/source/games/duke/src/2d_r.cpp b/source/games/duke/src/2d_r.cpp index e89880d22..817d03a4d 100644 --- a/source/games/duke/src/2d_r.cpp +++ b/source/games/duke/src/2d_r.cpp @@ -401,7 +401,7 @@ public: bool OnEvent(event_t* ev) override { - if (ev->type == EV_KeyDown) + if (ev->type == EV_KeyDown && !specialKeyEvent(ev)) { if ((displaystate & printStatsAll) != printStatsAll) { diff --git a/source/games/exhumed/src/2d.cpp b/source/games/exhumed/src/2d.cpp index 43661c7cd..03a3f9533 100644 --- a/source/games/exhumed/src/2d.cpp +++ b/source/games/exhumed/src/2d.cpp @@ -809,7 +809,7 @@ public: } return true; } - state = skipped; + if (!specialKeyEvent(ev)) state = skipped; return true; } return false; @@ -1164,7 +1164,7 @@ private: bool OnEvent(event_t* ev) { - if (ev->type == EV_KeyDown) skiprequest = true; + if (ev->type == EV_KeyDown && !specialKeyEvent(ev)) skiprequest = true; return true; } @@ -1279,7 +1279,7 @@ public: bool OnEvent(event_t* ev) { - if (ev->type == EV_KeyDown) skiprequest = true; + if (ev->type == EV_KeyDown && !specialKeyEvent(ev)) skiprequest = true; return true; } diff --git a/source/games/sw/src/2d.cpp b/source/games/sw/src/2d.cpp index ce85b1bbf..9c982f0c6 100644 --- a/source/games/sw/src/2d.cpp +++ b/source/games/sw/src/2d.cpp @@ -389,7 +389,7 @@ private: bool OnEvent(event_t* ev) override { - if (ev->type == EV_KeyDown) + if (ev->type == EV_KeyDown && !specialKeyEvent(ev)) { if (State >= s_BonusRest && State < &s_BonusRest[countof(s_BonusRest)]) { diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index f17f427a1..147fb0f7d 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -6891,6 +6891,12 @@ MoveSkipSavePos(void) } } } + + // back up all sprite angles. + for (int i = 0; i < MAXSPRITES; i++) + { + sprite[i].backupang(); + } }