From bc492a0b7fe7e7137bd6dfc1e108469630128a46 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 9 Jan 2017 16:52:15 +0200 Subject: [PATCH 1/8] Autoaim is now updated when adjusting slider with mouse Fixes #208 Autoaim slider in Player Setup does not save if changed with cursor --- src/menu/playermenu.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/menu/playermenu.cpp b/src/menu/playermenu.cpp index 9f5196367..ea22fdd71 100644 --- a/src/menu/playermenu.cpp +++ b/src/menu/playermenu.cpp @@ -1108,6 +1108,9 @@ bool DPlayerMenu::MouseEvent(int type, int x, int y) SendNewColor (RPART(color), GPART(color), v); } break; + case NAME_Autoaim: + AutoaimChanged(li); + break; } } return res; From cc8c20adf8608521dba7d38668cbdaf3628777d5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Jan 2017 20:53:37 +0100 Subject: [PATCH 2/8] - fixed: non-existent partner segs were not properly initialized. --- src/p_setup.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index ad713fab9..82a2adc9c 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -930,7 +930,8 @@ void P_LoadGLZSegs (FileReaderBase &data, int type) { seg[-1].v2 = seg->v1; } - seg->PartnerSeg = &segs[partner]; + + seg->PartnerSeg = partner == 0xffffffffu? nullptr : &segs[partner]; if (line != 0xFFFFFFFF) { line_t *ldef; From 5396e8d07d74a41829ac01ac9efc09797435a91e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Jan 2017 21:26:19 +0100 Subject: [PATCH 3/8] - fixed: The Windows CreateFramebuffer methods need to check the desired screen size for an actual resolution when switching to fullscreen. --- src/win32/win32gliface.cpp | 5 +++++ src/win32/win32video.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index aa4755e48..c4b5b7b43 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -352,6 +352,11 @@ DFrameBuffer *Win32GLVideo::CreateFrameBuffer(int width, int height, bool fs, DF { Win32GLFrameBuffer *fb; + if (fs) + { + I_ClosestResolution(&width, &height, 32); + } + m_DisplayWidth = width; m_DisplayHeight = height; m_DisplayBits = 32; diff --git a/src/win32/win32video.cpp b/src/win32/win32video.cpp index 0d91ed1d0..015a344e0 100644 --- a/src/win32/win32video.cpp +++ b/src/win32/win32video.cpp @@ -641,6 +641,11 @@ DFrameBuffer *Win32Video::CreateFrameBuffer (int width, int height, bool fullscr PalEntry flashColor; int flashAmount; + if (fullscreen) + { + I_ClosestResolution(&width, &height, D3D ? 32 : 8); + } + LOG4 ("CreateFB %d %d %d %p\n", width, height, fullscreen, old); if (old != NULL) From 815a44001463f7a988e571006f670132c7cdd569 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Mon, 28 Nov 2016 00:25:43 +0100 Subject: [PATCH 4/8] - Fixed the wrong handling of empty command line argument. --- src/c_dispatch.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index d112634d6..296697ee7 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -1040,7 +1040,11 @@ FString BuildString (int argc, FString *argv) for (arg = 0; arg < argc; arg++) { - if (strchr(argv[arg], '"')) + if (argv[arg][0] == '\0') + { // It's an empty argument, we need to convert it to '""' + buf << "\"\" "; + } + else if (strchr(argv[arg], '"')) { // If it contains one or more quotes, we need to escape them. buf << '"'; long substr_start = 0, quotepos; From 26170419f428649208c1d28f78d8fe442361f5be Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Jan 2017 23:23:26 +0100 Subject: [PATCH 5/8] - fixed: The stair builder code tried to access a member of a null pointer after finding no more stair sectors. --- src/p_floor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 48c73f131..d81ec8bf4 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -663,9 +663,8 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line, sec = tsec; continue; } - + newsecnum = tsec->Index(); } - newsecnum = tsec->sectornum; } else { From 96788850d37baca9325d47235fa4146537eea8c0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Jan 2017 00:38:08 +0100 Subject: [PATCH 6/8] - added a workaround for a crashing condition in FThinkerIterator. It can actually happen that the thinker chain gets broken if an actor being iterated happens to destroy the immediately following actor in the chain as well. In that case both actors lose their chain links and the iterator cannot advance any further, the only solution to avoid a crash is to terminate the iteration of the current list. --- src/dthinker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dthinker.cpp b/src/dthinker.cpp index fd20a4e79..11ba54dbc 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -675,6 +675,9 @@ DThinker *FThinkerIterator::Next (bool exact) { return thinker; } + // This can actually happen when a Destroy call on 'thinker' happens to destroy 'm_CurrThinker'. + // In that case there is no chance to recover, we have to terminate the iteration of this list. + if (m_CurrThinker == nullptr) break; } } if ((m_SearchingFresh = !m_SearchingFresh)) From 46179936ec8c2c035fe80a5e0212e101e783a698 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Jan 2017 01:00:06 +0100 Subject: [PATCH 7/8] - added global per-mod precaching lists, to be defined in MAPINFO's Gameinfo section. --- src/gi.cpp | 3 +++ src/gi.h | 5 +++++ src/p_setup.cpp | 10 ++++++++++ src/s_sound.cpp | 4 ++++ 4 files changed, 22 insertions(+) diff --git a/src/gi.cpp b/src/gi.cpp index 9d45d2724..c82128889 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -307,6 +307,9 @@ void FMapInfoParser::ParseGameInfo() GAMEINFOKEY_STRINGARRAY(finalePages, "finalePage", 8, true) GAMEINFOKEY_STRINGARRAY(infoPages, "addinfoPage", 8, false) GAMEINFOKEY_STRINGARRAY(infoPages, "infoPage", 8, true) + GAMEINFOKEY_STRINGARRAY(PrecachedClasses, "precacheclasses", 0, false) + GAMEINFOKEY_STRINGARRAY(PrecachedTextures, "precachetextures", 0, false) + GAMEINFOKEY_STRINGARRAY(PrecachedSounds, "precachesounds", 0, false) GAMEINFOKEY_STRING(PauseSign, "pausesign") GAMEINFOKEY_STRING(quitSound, "quitSound") GAMEINFOKEY_STRING(BorderFlat, "borderFlat") diff --git a/src/gi.h b/src/gi.h index c5b8f79cf..d9e81bcf1 100644 --- a/src/gi.h +++ b/src/gi.h @@ -36,6 +36,7 @@ #include "basictypes.h" #include "zstring.h" +#include "s_sound.h" // Flags are not user configurable and only depend on the standard IWADs #define GI_MAPxx 0x00000001 @@ -120,6 +121,10 @@ struct gameinfo_t TArray DefaultWeaponSlots[10]; TArray PlayerClasses; + TArray PrecachedClasses; + TArray PrecachedTextures; + TArray PrecachedSounds; + FString titleMusic; int titleOrder; float titleTime; diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 82a2adc9c..8c8476be0 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3360,6 +3360,11 @@ static void P_PrecacheLevel() actorhitlist[actor->GetClass()] = true; } + for (auto n : gameinfo.PrecachedClasses) + { + PClassActor *cls = PClass::FindActor(n); + if (cls != NULL) actorhitlist[cls] = true; + } for (unsigned i = 0; i < level.info->PrecacheClasses.Size(); i++) { // level.info can only store names, no class pointers. @@ -3396,6 +3401,11 @@ static void P_PrecacheLevel() hitlist[sky2texture.GetIndex()] |= FTextureManager::HIT_Sky; } + for (auto n : gameinfo.PrecachedTextures) + { + FTextureID tex = TexMan.CheckForTexture(n, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst); + if (tex.Exists()) hitlist[tex.GetIndex()] |= FTextureManager::HIT_Wall; + } for (unsigned i = 0; i < level.info->PrecacheTextures.Size(); i++) { FTextureID tex = TexMan.CheckForTexture(level.info->PrecacheTextures[i], FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst); diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 3888ee3dc..3a9ae5ea1 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -481,6 +481,10 @@ void S_PrecacheLevel () { actor->MarkPrecacheSounds(); } + for (auto i : gameinfo.PrecachedSounds) + { + level.info->PrecacheSounds[i].MarkUsed(); + } // Precache all extra sounds requested by this map. for (i = 0; i < level.info->PrecacheSounds.Size(); ++i) { From d9efeb206d872e4c5c958e3ba12c1a656fb8f5ae Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 10 Jan 2017 17:16:18 +0200 Subject: [PATCH 8/8] Fixed crash on loading GL nodes See http://mantis.zdoom.org/view.php?id=21 --- src/p_setup.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 8c8476be0..614ed92bd 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1003,9 +1003,10 @@ void LoadZNodes(FileReaderBase &data, int glnodes) line.v1 = line.v1 - &level.vertexes[0] + &newvertarray[0]; line.v2 = line.v2 - &level.vertexes[0] + &newvertarray[0]; } - level.vertexes = std::move(newvertarray); } + level.vertexes = std::move(newvertarray); + // Read the subsectors DWORD numSubs, currSeg;