Merge branch 'master' into newrenderer

This commit is contained in:
Christoph Oelckers 2021-04-20 20:46:06 +02:00
commit f51872db25
9 changed files with 39 additions and 11 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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;
}

View File

@ -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)])
{

View File

@ -6891,6 +6891,12 @@ MoveSkipSavePos(void)
}
}
}
// back up all sprite angles.
for (int i = 0; i < MAXSPRITES; i++)
{
sprite[i].backupang();
}
}