From 0dfb0d84272fe410d5e4d48abed51efc267424ed Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 7 Dec 2018 10:20:18 +0200 Subject: [PATCH 01/18] - fixed broken Z coordinate in Actor.Vec3Angle() native call --- src/scripting/vmthunks_actors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripting/vmthunks_actors.cpp b/src/scripting/vmthunks_actors.cpp index 97e5066fb..2823d9263 100644 --- a/src/scripting/vmthunks_actors.cpp +++ b/src/scripting/vmthunks_actors.cpp @@ -475,7 +475,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, Vec2To, Vec2To) ACTION_RETURN_VEC2(self->Vec2To(t)); } -static void Vec3Angle(AActor *self, double length, double angle, double z, bool absolute, DVector2 *result) +static void Vec3Angle(AActor *self, double length, double angle, double z, bool absolute, DVector3 *result) { *result = self->Vec3Angle(length, angle, z, absolute); } From f17a90ef6911472623fa7e5699f55299af3490b2 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Fri, 7 Dec 2018 19:30:00 +0100 Subject: [PATCH 02/18] - implement xor swap for vec registers --- asmjit/asmjit/x86/x86regalloc.cpp | 41 ++++++++++++++++++++++++++----- asmjit/asmjit/x86/x86regalloc_p.h | 32 ++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/asmjit/asmjit/x86/x86regalloc.cpp b/asmjit/asmjit/x86/x86regalloc.cpp index d0b3d58be..b6ede2858 100644 --- a/asmjit/asmjit/x86/x86regalloc.cpp +++ b/asmjit/asmjit/x86/x86regalloc.cpp @@ -271,6 +271,22 @@ Error X86RAPass::emitSwapGp(VirtReg* dstReg, VirtReg* srcReg, uint32_t dstPhysId return kErrorOk; } +Error X86RAPass::emitSwapVec(VirtReg* dstReg, VirtReg* srcReg, uint32_t dstPhysId, uint32_t srcPhysId, const char* reason) noexcept { + ASMJIT_ASSERT(dstPhysId != Globals::kInvalidRegId); + ASMJIT_ASSERT(srcPhysId != Globals::kInvalidRegId); + ASMJIT_ASSERT(dstPhysId != srcPhysId); + + X86Reg a = X86Reg::fromSignature(dstReg->getSignature(), dstPhysId); + X86Reg b = X86Reg::fromSignature(srcReg->getSignature(), srcPhysId); + + ASMJIT_PROPAGATE(cc()->emit(X86Inst::kIdXorps, a, b)); + if (_emitComments) + cc()->getCursor()->setInlineComment(cc()->_cbDataZone.sformat("[%s] %s, %s", reason, dstReg->getName(), srcReg->getName())); + ASMJIT_PROPAGATE(cc()->emit(X86Inst::kIdXorps, b, a)); + ASMJIT_PROPAGATE(cc()->emit(X86Inst::kIdXorps, a, b)); + return kErrorOk; +} + Error X86RAPass::emitImmToReg(uint32_t dstTypeId, uint32_t dstPhysId, const Imm* src) noexcept { ASMJIT_ASSERT(dstPhysId != Globals::kInvalidRegId); @@ -778,6 +794,9 @@ _MoveOrLoad: if (C == X86Reg::kKindGp) { self->swapGp(dVReg, sVd); } + else if (C == X86Reg::kKindVec) { + self->swapVec(dVReg, sVd); + } else { self->spill(dVReg); self->move(sVd, physId); @@ -932,10 +951,13 @@ static ASMJIT_INLINE void X86RAPass_intersectStateVars(X86RAPass* self, X86RASta didWork = true; continue; } - else if (C == X86Reg::kKindGp) { + else if (C == X86Reg::kKindGp || C == X86Reg::kKindVec) { if (aCell.getState() == VirtReg::kStateReg) { if (dVReg->getPhysId() != Globals::kInvalidRegId && aVReg->getPhysId() != Globals::kInvalidRegId) { - self->swapGp(dVReg, aVReg); + if (C == X86Reg::kKindGp) + self->swapGp(dVReg, aVReg); + else + self->swapVec(dVReg, aVReg); didWork = true; continue; @@ -2787,9 +2809,13 @@ ASMJIT_INLINE void X86VarAlloc::alloc() { // allocation tasks by a single 'xchg' instruction, swapping // two registers required by the instruction/node or one register // required with another non-required. - if (C == X86Reg::kKindGp && aPhysId != Globals::kInvalidRegId) { + // Uses xor swap for Vec registers. + if ((C == X86Reg::kKindGp || C == X86Reg::kKindVec) && aPhysId != Globals::kInvalidRegId) { TiedReg* bTied = bVReg->_tied; - _context->swapGp(aVReg, bVReg); + if (C == X86Reg::kKindGp) + _context->swapGp(aVReg, bVReg); + else + _context->swapVec(aVReg, bVReg); aTied->flags |= TiedReg::kRDone; addTiedDone(C); @@ -3341,8 +3367,11 @@ ASMJIT_INLINE void X86CallAlloc::alloc() { // allocation tasks by a single 'xchg' instruction, swapping // two registers required by the instruction/node or one register // required with another non-required. - if (C == X86Reg::kKindGp && sPhysId != Globals::kInvalidRegId) { - _context->swapGp(aVReg, bVReg); + if ((C == X86Reg::kKindGp || C == X86Reg::kKindVec) && sPhysId != Globals::kInvalidRegId) { + if (C == X86Reg::kKindGp) + _context->swapGp(aVReg, bVReg); + else + _context->swapVec(aVReg, bVReg); aTied->flags |= TiedReg::kRDone; addTiedDone(C); diff --git a/asmjit/asmjit/x86/x86regalloc_p.h b/asmjit/asmjit/x86/x86regalloc_p.h index ac9aad2f0..739b5f3e8 100644 --- a/asmjit/asmjit/x86/x86regalloc_p.h +++ b/asmjit/asmjit/x86/x86regalloc_p.h @@ -327,6 +327,7 @@ public: Error emitLoad(VirtReg* vreg, uint32_t id, const char* reason); Error emitSave(VirtReg* vreg, uint32_t id, const char* reason); Error emitSwapGp(VirtReg* aVReg, VirtReg* bVReg, uint32_t aId, uint32_t bId, const char* reason) noexcept; + Error emitSwapVec(VirtReg* aVReg, VirtReg* bVReg, uint32_t aId, uint32_t bId, const char* reason) noexcept; Error emitImmToReg(uint32_t dstTypeId, uint32_t dstPhysId, const Imm* src) noexcept; Error emitImmToStack(uint32_t dstTypeId, const X86Mem* dst, const Imm* src) noexcept; @@ -515,6 +516,37 @@ public: ASMJIT_X86_CHECK_STATE } + //! Swap two registers + //! + //! Xor swap on Vec registers. + ASMJIT_INLINE void swapVec(VirtReg* aVReg, VirtReg* bVReg) { + ASMJIT_ASSERT(aVReg != bVReg); + + ASMJIT_ASSERT(aVReg->getKind() == X86Reg::kKindVec); + ASMJIT_ASSERT(aVReg->getState() == VirtReg::kStateReg); + ASMJIT_ASSERT(aVReg->getPhysId() != Globals::kInvalidRegId); + + ASMJIT_ASSERT(bVReg->getKind() == X86Reg::kKindVec); + ASMJIT_ASSERT(bVReg->getState() == VirtReg::kStateReg); + ASMJIT_ASSERT(bVReg->getPhysId() != Globals::kInvalidRegId); + + uint32_t aIndex = aVReg->getPhysId(); + uint32_t bIndex = bVReg->getPhysId(); + + emitSwapVec(aVReg, bVReg, aIndex, bIndex, "Swap"); + + aVReg->setPhysId(bIndex); + bVReg->setPhysId(aIndex); + + _x86State.getListByKind(X86Reg::kKindVec)[aIndex] = bVReg; + _x86State.getListByKind(X86Reg::kKindVec)[bIndex] = aVReg; + + uint32_t m = aVReg->isModified() ^ bVReg->isModified(); + _x86State._modified.xor_(X86Reg::kKindVec, (m << aIndex) | (m << bIndex)); + + ASMJIT_X86_CHECK_STATE + } + // -------------------------------------------------------------------------- // [Alloc / Spill] // -------------------------------------------------------------------------- From e70138a26680bafe21871aebc7a99391bc4a3cc4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 7 Dec 2018 20:15:02 +0100 Subject: [PATCH 03/18] - fixed crash with FraggleScript in Nimrod MAP02. --- src/fragglescript/t_variable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fragglescript/t_variable.cpp b/src/fragglescript/t_variable.cpp index 6ece4f22a..d38e62120 100644 --- a/src/fragglescript/t_variable.cpp +++ b/src/fragglescript/t_variable.cpp @@ -148,7 +148,7 @@ AActor* actorvalue(const svalue_t &svalue) return NULL; } // Inventory items in the player's inventory have to be considered non-present. - if (svalue.value.mobj == NULL || !svalue.value.mobj->IsMapActor()) + if (SpawnedThings[intval] == nullptr || !SpawnedThings[intval]->IsMapActor()) { return NULL; } From 92b722e0eee7dcc10f228154dfbcf48ee549bce9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 8 Dec 2018 11:56:31 +0100 Subject: [PATCH 04/18] - don't put mutexes into static local variables. Their initialization semantics are not safe for synchronization objects. --- src/polyrenderer/poly_renderthread.cpp | 6 ++---- src/swrenderer/r_renderthread.cpp | 6 ++---- src/swrenderer/r_swcolormaps.cpp | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/polyrenderer/poly_renderthread.cpp b/src/polyrenderer/poly_renderthread.cpp index 7febb4bb7..22900c17a 100644 --- a/src/polyrenderer/poly_renderthread.cpp +++ b/src/polyrenderer/poly_renderthread.cpp @@ -74,6 +74,7 @@ void PolyRenderThread::FlushDrawQueue() } } +static std::mutex loadmutex; void PolyRenderThread::PrepareTexture(FTexture *texture, FRenderStyle style) { if (texture == nullptr) @@ -87,8 +88,6 @@ void PolyRenderThread::PrepareTexture(FTexture *texture, FRenderStyle style) // It is critical that this function is called before any direct // calls to GetPixels for this to work. - static std::mutex loadmutex; - std::unique_lock lock(loadmutex); texture->GetPixels(style); @@ -101,10 +100,9 @@ void PolyRenderThread::PrepareTexture(FTexture *texture, FRenderStyle style) } } +static std::mutex polyobjmutex; void PolyRenderThread::PreparePolyObject(subsector_t *sub) { - static std::mutex polyobjmutex; - std::unique_lock lock(polyobjmutex); if (sub->BSP == nullptr || sub->BSP->bDirty) diff --git a/src/swrenderer/r_renderthread.cpp b/src/swrenderer/r_renderthread.cpp index 986879618..90a0792ea 100644 --- a/src/swrenderer/r_renderthread.cpp +++ b/src/swrenderer/r_renderthread.cpp @@ -89,6 +89,7 @@ namespace swrenderer return pal_drawers.get(); } + static std::mutex loadmutex; void RenderThread::PrepareTexture(FTexture *texture, FRenderStyle style) { if (texture == nullptr) @@ -102,8 +103,6 @@ namespace swrenderer // It is critical that this function is called before any direct // calls to GetPixels for this to work. - static std::mutex loadmutex; - std::unique_lock lock(loadmutex); texture->GetPixels(style); @@ -116,10 +115,9 @@ namespace swrenderer } } + static std::mutex polyobjmutex; void RenderThread::PreparePolyObject(subsector_t *sub) { - static std::mutex polyobjmutex; - std::unique_lock lock(polyobjmutex); if (sub->BSP == nullptr || sub->BSP->bDirty) diff --git a/src/swrenderer/r_swcolormaps.cpp b/src/swrenderer/r_swcolormaps.cpp index 13c66706b..d5b374ad1 100644 --- a/src/swrenderer/r_swcolormaps.cpp +++ b/src/swrenderer/r_swcolormaps.cpp @@ -70,12 +70,12 @@ TArray SpecialSWColormaps; // Colored Lighting Stuffs // //========================================================================== +static std::mutex buildmapmutex; static FDynamicColormap *CreateSpecialLights (PalEntry color, PalEntry fade, int desaturate) { // GetSpecialLights is called by the scene worker threads. // If we didn't find the colormap, search again, but this time one thread at a time - static std::mutex buildmapmutex; std::unique_lock lock(buildmapmutex); // If this colormap has already been created, just return it From 888af3d684c38009aacd911e28791c4c05b92b56 Mon Sep 17 00:00:00 2001 From: Player701 Date: Sat, 8 Dec 2018 13:53:13 +0300 Subject: [PATCH 05/18] - Added Plutonia 2 MAP10 and MAP11 to the "rebuildnodes" compatibility list. --- wadsrc/static/compatibility.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index e61374965..030cea322 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -173,6 +173,8 @@ AF40D0E49BD1B76D4B1AADD8212ADC46 // MAP01 (the wad that shall not be named =P) 5FAA25F5A6AAB3409CAE0AF87F910341 // DOOM.wad e1m6 94893A0DC429A22ADC4B3A73DA537E16 // DOOM2.WAD map25 D5F64E02679A81B82006AF34A6A8EAC3 // plutonia.wad map32 +BA4860C7A2F5D705DB32A1A38DB77EC4 // pl2.wad map10 +EDA5CE7C462BD171BF8110AC56B67857 // pl2.wad map11 { rebuildnodes } From 670d975a337242049808eae7e17684c174769d89 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 8 Dec 2018 23:31:55 +0100 Subject: [PATCH 06/18] - moved argsCache out of JitCompiler::CreateFuncSignature --- src/scripting/vm/jit_call.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripting/vm/jit_call.cpp b/src/scripting/vm/jit_call.cpp index f51fd1c39..137203017 100644 --- a/src/scripting/vm/jit_call.cpp +++ b/src/scripting/vm/jit_call.cpp @@ -543,6 +543,8 @@ void JitCompiler::EmitNativeCall(VMNativeFunction *target) ParamOpcodes.Clear(); } +static std::map>> argsCache; + asmjit::FuncSignature JitCompiler::CreateFuncSignature() { using namespace asmjit; @@ -657,7 +659,6 @@ asmjit::FuncSignature JitCompiler::CreateFuncSignature() } // FuncSignature only keeps a pointer to its args array. Store a copy of each args array variant. - static std::map>> argsCache; std::unique_ptr> &cachedArgs = argsCache[key]; if (!cachedArgs) cachedArgs.reset(new TArray(args)); From f6bb33787bbb1742a5fed068bb0c07f1874cdde2 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 9 Dec 2018 10:13:43 +0200 Subject: [PATCH 07/18] - fixed Actor.A_StopSound() native call Wrong function overload was selected by compiler https://forum.zdoom.org/viewtopic.php?t=62820 --- src/scripting/vmthunks_actors.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scripting/vmthunks_actors.cpp b/src/scripting/vmthunks_actors.cpp index 2823d9263..a067a296e 100644 --- a/src/scripting/vmthunks_actors.cpp +++ b/src/scripting/vmthunks_actors.cpp @@ -128,7 +128,12 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, GetPointer, COPY_AAPTR) // //========================================================================== -DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_StopSound, S_StopSound) +static void NativeStopSound(AActor *actor, int slot) +{ + S_StopSound(actor, slot); +} + +DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_StopSound, NativeStopSound) { PARAM_SELF_PROLOGUE(AActor); PARAM_INT(slot); From 40f77e5dac41b158bbb0a96f43bdbca4925dab1a Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 9 Dec 2018 13:00:36 +0200 Subject: [PATCH 08/18] - removed erroneous assertion https://forum.zdoom.org/viewtopic.php?t=62815 --- src/v_text.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/v_text.cpp b/src/v_text.cpp index 9f6e41161..e9a78bee4 100644 --- a/src/v_text.cpp +++ b/src/v_text.cpp @@ -219,8 +219,6 @@ void DFrameBuffer::DrawTextCommon(FFont *font, int normalcolor, double x, double int kerning; FTexture *pic; - assert(string[0] != '$'); - if (parms.celly == 0) parms.celly = font->GetHeight() + 1; parms.celly *= parms.scaley; From f0ce453d47c7f747d6a2c129f66e96932cfccca1 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 9 Dec 2018 17:36:43 +0100 Subject: [PATCH 09/18] - workaround pointer truncation bug in asmjit --- src/scripting/vm/jit_flow.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/scripting/vm/jit_flow.cpp b/src/scripting/vm/jit_flow.cpp index 08e7b0660..0ca8bf437 100644 --- a/src/scripting/vm/jit_flow.cpp +++ b/src/scripting/vm/jit_flow.cpp @@ -169,16 +169,28 @@ void JitCompiler::EmitRET() if (cc.is64Bit()) { if (regtype & REGT_KONST) - cc.mov(x86::qword_ptr(location), asmjit::imm_ptr(konsta[regnum].v)); + { + auto ptr = newTempIntPtr(); + cc.mov(ptr, asmjit::imm_ptr(konsta[regnum].v)); + cc.mov(x86::qword_ptr(location), ptr); + } else + { cc.mov(x86::qword_ptr(location), regA[regnum]); + } } else { if (regtype & REGT_KONST) - cc.mov(x86::dword_ptr(location), asmjit::imm_ptr(konsta[regnum].v)); + { + auto ptr = newTempIntPtr(); + cc.mov(ptr, asmjit::imm_ptr(konsta[regnum].v)); + cc.mov(x86::dword_ptr(location), ptr); + } else + { cc.mov(x86::dword_ptr(location), regA[regnum]); + } } break; } From 8a4b8cc2ca3f77cd40a61ef58ba4e6483b9abbaf Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 10 Dec 2018 10:36:40 +0200 Subject: [PATCH 10/18] - server CVARs can be changed only by settings controller Initially, settings controller flag was false by default It was not touched during construction and destruction of player_t instances though Now, with all members initialized in class definition, this flag must be saved and restored manually https://forum.zdoom.org/viewtopic.php?t=62830 --- src/d_player.h | 2 +- src/g_game.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d_player.h b/src/d_player.h index 4eb207fa9..4acae8ac8 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -453,7 +453,7 @@ public: TObjPtr MUSINFOactor = nullptr; // For MUSINFO purposes int8_t MUSINFOtics = 0; - bool settings_controller = true; // Player can control game settings. + bool settings_controller = false; // Player can control game settings. int8_t crouching = 0; int8_t crouchdir = 0; diff --git a/src/g_game.cpp b/src/g_game.cpp index b0c09d993..56ccd46b2 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1285,6 +1285,7 @@ void G_PlayerReborn (int player) log = p->LogText; chasecam = p->cheats & CF_CHASECAM; Bot = p->Bot; //Added by MC: + const bool settings_controller = p->settings_controller; // Reset player structure to its defaults p->~player_t(); @@ -1303,6 +1304,7 @@ void G_PlayerReborn (int player) p->LogText = log; p->cheats |= chasecam; p->Bot = Bot; //Added by MC: + p->settings_controller = settings_controller; p->oldbuttons = ~0, p->attackdown = true; p->usedown = true; // don't do anything immediately p->original_oldbuttons = ~0; From 6362415054bd3092ed01938be7dbb74fb85df1b4 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 10 Dec 2018 11:26:46 +0200 Subject: [PATCH 11/18] - fixed return value of native call to dynamic array's Reserve() https://forum.zdoom.org/viewtopic.php?t=62841 --- src/scripting/backend/dynarrays.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripting/backend/dynarrays.cpp b/src/scripting/backend/dynarrays.cpp index 15b016166..147ab89f8 100644 --- a/src/scripting/backend/dynarrays.cpp +++ b/src/scripting/backend/dynarrays.cpp @@ -121,9 +121,9 @@ template void ArrayResize(T *self, int amount) } } -template void ArrayReserve(T *self, int amount) +template unsigned int ArrayReserve(T *self, int amount) { - self->Reserve(amount); + return self->Reserve(amount); } template int ArrayMax(T *self) From cbb5f8a0dc7c3b7facfb348672d09310b41bd289 Mon Sep 17 00:00:00 2001 From: drfrag666 Date: Thu, 6 Dec 2018 14:50:03 +0100 Subject: [PATCH 12/18] - Fixed: the vid_rendermode CVAR could get wrong values. --- src/v_video.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/v_video.cpp b/src/v_video.cpp index b9efcf6a1..658e70fe9 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -93,6 +93,11 @@ CUSTOM_CVAR(Int, vid_maxfps, 200, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CUSTOM_CVAR(Int, vid_rendermode, 4, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) { + if (self < 0 || self > 4) + { + self = 4; + } + if (usergame) { // [SP] Update pitch limits to the netgame/gamesim. From 28516c2defb94f62593a43f573f64fc3b6594532 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 10 Dec 2018 14:25:29 -0500 Subject: [PATCH 13/18] - split gl_texture_hqresize into two variables - one for mode, one for multiplier. --- src/gameconfigfile.cpp | 89 ++++++++++++++++++ src/r_videoscale.cpp | 2 +- src/textures/hires/hqresize.cpp | 108 +++++++++++----------- src/version.h | 2 +- wadsrc/static/language.enu | 33 ++----- wadsrc/static/menudef.txt | 66 +++++-------- wadsrc/static/zscript/menu/optionmenu.txt | 42 +-------- 7 files changed, 179 insertions(+), 163 deletions(-) diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp index 2979420f9..3bd34fd15 100644 --- a/src/gameconfigfile.cpp +++ b/src/gameconfigfile.cpp @@ -60,6 +60,8 @@ EXTERN_CVAR (Color, am_fdwallcolor) EXTERN_CVAR (Color, am_cdwallcolor) EXTERN_CVAR (Float, spc_amp) EXTERN_CVAR (Bool, wi_percents) +EXTERN_CVAR (Int, gl_texture_hqresizemode) +EXTERN_CVAR (Int, gl_texture_hqresizemult) FGameConfigFile::FGameConfigFile () { @@ -395,6 +397,93 @@ void FGameConfigFile::DoGlobalSetup () FBaseCVar *var = FindCVar("snd_hrtf", NULL); if (var != NULL) var->ResetToDefault(); } + if (last < 216) + { + FBaseCVar *var = FindCVar("gl_texture_hqresize", NULL); + if (var != NULL) + { + auto v = var->GetGenericRep(CVAR_Int); + switch (v.Int) + { + case 1: + gl_texture_hqresizemode = 1; gl_texture_hqresizemult = 2; + break; + case 2: + gl_texture_hqresizemode = 1; gl_texture_hqresizemult = 3; + break; + case 3: + gl_texture_hqresizemode = 1; gl_texture_hqresizemult = 4; + break; + case 4: + gl_texture_hqresizemode = 2; gl_texture_hqresizemult = 2; + break; + case 5: + gl_texture_hqresizemode = 2; gl_texture_hqresizemult = 3; + break; + case 6: + gl_texture_hqresizemode = 2; gl_texture_hqresizemult = 4; + break; + case 7: + gl_texture_hqresizemode = 3; gl_texture_hqresizemult = 2; + break; + case 8: + gl_texture_hqresizemode = 3; gl_texture_hqresizemult = 3; + break; + case 9: + gl_texture_hqresizemode = 3; gl_texture_hqresizemult = 4; + break; + case 10: + gl_texture_hqresizemode = 4; gl_texture_hqresizemult = 2; + break; + case 11: + gl_texture_hqresizemode = 4; gl_texture_hqresizemult = 3; + break; + case 12: + gl_texture_hqresizemode = 4; gl_texture_hqresizemult = 4; + break; + case 18: + gl_texture_hqresizemode = 4; gl_texture_hqresizemult = 5; + break; + case 19: + gl_texture_hqresizemode = 4; gl_texture_hqresizemult = 6; + break; + case 13: + gl_texture_hqresizemode = 5; gl_texture_hqresizemult = 2; + break; + case 14: + gl_texture_hqresizemode = 5; gl_texture_hqresizemult = 3; + break; + case 15: + gl_texture_hqresizemode = 5; gl_texture_hqresizemult = 4; + break; + case 16: + gl_texture_hqresizemode = 5; gl_texture_hqresizemult = 5; + break; + case 17: + gl_texture_hqresizemode = 5; gl_texture_hqresizemult = 6; + break; + case 20: + gl_texture_hqresizemode = 6; gl_texture_hqresizemult = 2; + break; + case 21: + gl_texture_hqresizemode = 6; gl_texture_hqresizemult = 3; + break; + case 22: + gl_texture_hqresizemode = 6; gl_texture_hqresizemult = 4; + break; + case 23: + gl_texture_hqresizemode = 6; gl_texture_hqresizemult = 5; + break; + case 24: + gl_texture_hqresizemode = 6; gl_texture_hqresizemult = 6; + break; + case 0: + default: + gl_texture_hqresizemode = 0; gl_texture_hqresizemult = 1; + break; + } + } + } } } } diff --git a/src/r_videoscale.cpp b/src/r_videoscale.cpp index 9918def62..95f788135 100644 --- a/src/r_videoscale.cpp +++ b/src/r_videoscale.cpp @@ -78,7 +78,7 @@ namespace } void R_ShowCurrentScaling(); -CUSTOM_CVAR(Float, vid_scalefactor, 1.0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Float, vid_scalefactor, 1.0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) { setsizeneeded = true; if (self < 0.05 || self > 2.0) diff --git a/src/textures/hires/hqresize.cpp b/src/textures/hires/hqresize.cpp index 01f310ed2..7512be703 100644 --- a/src/textures/hires/hqresize.cpp +++ b/src/textures/hires/hqresize.cpp @@ -45,18 +45,22 @@ #include "parallel_for.h" #include "hwrenderer/textures/hw_material.h" -CUSTOM_CVAR(Int, gl_texture_hqresize, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) +EXTERN_CVAR(Int, gl_texture_hqresizemult) +CUSTOM_CVAR(Int, gl_texture_hqresizemode, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) { - if (self < 0 || self > 24) - { + if (self < 0 || self > 6) self = 0; - } - #ifndef HAVE_MMX - // This is to allow the menu option to work properly so that these filters can be skipped while cycling through them. - if (self == 7) self = 10; - if (self == 8) self = 10; - if (self == 9) self = 6; - #endif + if ((gl_texture_hqresizemult > 4) && (self < 4) && (self > 0)) + gl_texture_hqresizemult = 4; + FMaterial::FlushAll(); +} + +CUSTOM_CVAR(Int, gl_texture_hqresizemult, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) +{ + if (self < 1 || self > 6) + self = 1; + if ((self > 4) && (gl_texture_hqresizemode < 4) && (gl_texture_hqresizemode > 0)) + self = 4; FMaterial::FlushAll(); } @@ -385,64 +389,60 @@ unsigned char *FTexture::CreateUpsampledTextureBuffer (unsigned char *inputBuffe if (inputBuffer) { - int type = gl_texture_hqresize; + int type = gl_texture_hqresizemode; + int mult = gl_texture_hqresizemult; outWidth = inWidth; outHeight = inHeight; #ifdef HAVE_MMX // hqNx MMX does not preserve the alpha channel so fall back to C-version for such textures - if (hasAlpha && type > 6 && type <= 9) + if (hasAlpha && type == 3) { - type -= 3; + type = 2; } #endif + if (mult < 2) + type = 0; switch (type) { case 1: - return scaleNxHelper( &scale2x, 2, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + switch(mult) + { + case 2: + return scaleNxHelper( &scale2x, 2, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + case 3: + return scaleNxHelper( &scale3x, 3, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + default: + return scaleNxHelper( &scale4x, 4, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + } case 2: - return scaleNxHelper( &scale3x, 3, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - case 3: - return scaleNxHelper( &scale4x, 4, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - case 4: - return hqNxHelper( &hq2x_32, 2, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - case 5: - return hqNxHelper( &hq3x_32, 3, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - case 6: - return hqNxHelper( &hq4x_32, 4, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + switch(mult) + { + case 2: + return hqNxHelper( &hq2x_32, 2, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + case 3: + return hqNxHelper( &hq3x_32, 3, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + default: + return hqNxHelper( &hq4x_32, 4, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + } #ifdef HAVE_MMX - case 7: - return hqNxAsmHelper( &HQnX_asm::hq2x_32, 2, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - case 8: - return hqNxAsmHelper( &HQnX_asm::hq3x_32, 3, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - case 9: - return hqNxAsmHelper( &HQnX_asm::hq4x_32, 4, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + case 3: + switch(mult) + { + case 2: + return hqNxAsmHelper( &HQnX_asm::hq2x_32, 2, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + case 3: + return hqNxAsmHelper( &HQnX_asm::hq3x_32, 3, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + default: + return hqNxAsmHelper( &HQnX_asm::hq4x_32, 4, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + } #endif - case 10: - case 11: - case 12: - return xbrzHelper(xbrz::scale, type - 8, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - - case 13: - case 14: - case 15: - case 16: - case 17: - return xbrzHelper(xbrzOldScale, type - 11, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - - case 18: - case 19: - return xbrzHelper(xbrz::scale, type - 13, inputBuffer, inWidth, inHeight, outWidth, outHeight); - case 20: - return normalNxHelper( &normalNx, 2, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - case 21: - return normalNxHelper( &normalNx, 3, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - case 22: - return normalNxHelper( &normalNx, 4, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - case 23: - return normalNxHelper( &normalNx, 5, inputBuffer, inWidth, inHeight, outWidth, outHeight ); - case 24: - return normalNxHelper( &normalNx, 6, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + case 4: + return xbrzHelper(xbrz::scale, mult, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + case 5: + return xbrzHelper(xbrzOldScale, mult, inputBuffer, inWidth, inHeight, outWidth, outHeight ); + case 6: + return normalNxHelper( &normalNx, mult, inputBuffer, inWidth, inHeight, outWidth, outHeight ); } } return inputBuffer; diff --git a/src/version.h b/src/version.h index 7ee00c950..7cd576e3a 100644 --- a/src/version.h +++ b/src/version.h @@ -68,7 +68,7 @@ const char *GetVersionString(); // Version stored in the ini's [LastRun] section. // Bump it if you made some configuration change that you want to // be able to migrate in FGameConfigFile::DoGlobalSetup(). -#define LASTRUNVERSION "215" +#define LASTRUNVERSION "216" // Protocol version used in demos. // Bump it if you change existing DEM_ commands or add new ones. diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 2b49fe55f..81b7d17f2 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2783,7 +2783,8 @@ GLTEXMNU_ANISOTROPIC = "Anisotropic filter"; GLTEXMNU_TEXFORMAT = "Texture Format"; GLTEXMNU_ENABLEHIRES = "Enable hires textures"; GLTEXMNU_HQRESIZE = "High Quality Resize mode"; -GLTEXMNU_HQRESIZEWARN = "This mode requires %d times more video memory"; +GLTEXMNU_HQRESIZEMULT = "High Quality Resize multiplier"; +GLTEXMNU_HQRESIZEWARN = "This mode requires %d times more video memory"; GLTEXMNU_RESIZETEX = "Resize textures"; GLTEXMNU_RESIZESPR = "Resize sprites"; GLTEXMNU_RESIZEFNT = "Resize fonts"; @@ -2881,30 +2882,12 @@ OPTVAL_YAXIS = "Y Axis"; OPTVAL_XYAXIS = "X/Y Axis"; OPTVAL_SQUARE = "Square"; OPTVAL_ROUND = "Round"; -OPTVAL_SCALE2X = "Scale2x"; -OPTVAL_SCALE3X = "Scale3x"; -OPTVAL_SCALE4X = "Scale4x"; -OPTVAL_NORMAL2X = "Normal2x"; -OPTVAL_NORMAL3X = "Normal3x"; -OPTVAL_NORMAL4X = "Normal4x"; -OPTVAL_NORMAL5X = "Normal5x"; -OPTVAL_NORMAL6X = "Normal6x"; -OPTVAL_HQ2X = "hq2x"; -OPTVAL_HQ3X = "hq3x"; -OPTVAL_HQ4X = "hq4x"; -OPTVAL_HQ2XMMX = "hq2x MMX"; -OPTVAL_HQ3XMMX = "hq3x MMX"; -OPTVAL_HQ4XMMX = "hq4x MMX"; -OPTVAL_2XBRZ = "2xBRZ"; -OPTVAL_3XBRZ = "3xBRZ"; -OPTVAL_4XBRZ = "4xBRZ"; -OPTVAL_5XBRZ = "5xBRZ"; -OPTVAL_6XBRZ = "6xBRZ"; -OPTVAL_OLD_2XBRZ = "Old 2xBRZ"; -OPTVAL_OLD_3XBRZ = "Old 3xBRZ"; -OPTVAL_OLD_4XBRZ = "Old 4xBRZ"; -OPTVAL_OLD_5XBRZ = "Old 5xBRZ"; -OPTVAL_OLD_6XBRZ = "Old 6xBRZ"; +OPTVAL_SCALENX = "ScaleNx"; +OPTVAL_NORMALNX = "NormalNx"; +OPTVAL_HQNX = "hqNx"; +OPTVAL_HQNXMMX = "hqNx MMX"; +OPTVAL_NXBRZ = "xBRZ"; +OPTVAL_OLD_NXBRZ = "Old xBRZ"; OPTVAL_RADIAL = "Radial"; OPTVAL_PIXELFUZZ = "Pixel fuzz"; OPTVAL_SMOOTHFUZZ = "Smooth fuzz"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 965f23d0c..4026e2bc0 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -2151,51 +2151,32 @@ OptionValue "Particles" OptionValue "HqResizeModes" { 0, "$OPTVAL_OFF" - 1, "$OPTVAL_SCALE2X" - 2, "$OPTVAL_SCALE3X" - 3, "$OPTVAL_SCALE4X" - 4, "$OPTVAL_HQ2X" - 5, "$OPTVAL_HQ3X" - 6, "$OPTVAL_HQ4X" - 7, "$OPTVAL_HQ2XMMX" - 8, "$OPTVAL_HQ3XMMX" - 9, "$OPTVAL_HQ4XMMX" - 10, "$OPTVAL_2XBRZ" - 11, "$OPTVAL_3XBRZ" - 12, "$OPTVAL_4XBRZ" - 18, "$OPTVAL_5XBRZ" - 19, "$OPTVAL_6XBRZ" - 13, "$OPTVAL_OLD_2XBRZ" - 14, "$OPTVAL_OLD_3XBRZ" - 15, "$OPTVAL_OLD_4XBRZ" - 16, "$OPTVAL_OLD_5XBRZ" - 17, "$OPTVAL_OLD_6XBRZ" - 20, "$OPTVAL_NORMAL2X" - 21, "$OPTVAL_NORMAL3X" - 22, "$OPTVAL_NORMAL4X" - 23, "$OPTVAL_NORMAL5X" - 24, "$OPTVAL_NORMAL6X" + 1, "$OPTVAL_SCALENX" + 2, "$OPTVAL_HQNX" + 3, "$OPTVAL_HQNXMMX" + 4, "$OPTVAL_NXBRZ" + 5, "$OPTVAL_OLD_NXBRZ" + 6, "$OPTVAL_NORMALNX" +} + +OptionValue "HqResizeMultipliers" +{ + 1, "$OPTVAL_OFF" + 2, "2x" + 3, "3x" + 4, "4x" + 5, "5x" + 6, "6x" } OptionValue "HqResizeModesNoMMX" { 0, "$OPTVAL_OFF" - 1, "$OPTVAL_SCALE2X" - 2, "$OPTVAL_SCALE3X" - 3, "$OPTVAL_SCALE4X" - 4, "$OPTVAL_HQ2X" - 5, "$OPTVAL_HQ3X" - 6, "$OPTVAL_HQ4X" - 10, "$OPTVAL_2XBRZ" - 11, "$OPTVAL_3XBRZ" - 12, "$OPTVAL_4XBRZ" - 18, "$OPTVAL_5XBRZ" - 19, "$OPTVAL_6XBRZ" - 13, "$OPTVAL_OLD_2XBRZ" - 14, "$OPTVAL_OLD_3XBRZ" - 15, "$OPTVAL_OLD_4XBRZ" - 16, "$OPTVAL_OLD_5XBRZ" - 17, "$OPTVAL_OLD_6XBRZ" + 1, "$OPTVAL_SCALENX" + 2, "$OPTVAL_HQNX" + 4, "$OPTVAL_NXBRZ" + 5, "$OPTVAL_OLD_NXBRZ" + 6, "$OPTVAL_NORMALNX" } OptionValue "FogMode" @@ -2262,12 +2243,13 @@ OptionMenu "GLTextureGLOptions" protected ifOption(MMX) { - Option "$GLTEXMNU_HQRESIZE", gl_texture_hqresize, "HqResizeModes" + Option "$GLTEXMNU_HQRESIZE", gl_texture_hqresizemode, "HqResizeModes" } else { - Option "$GLTEXMNU_HQRESIZE", gl_texture_hqresize, "HqResizeModesNoMMX" + Option "$GLTEXMNU_HQRESIZE", gl_texture_hqresizemode, "HqResizeModesNoMMX" } + Option "$GLTEXMNU_HQRESIZEMULT", gl_texture_hqresizemult, "HqResizeMultipliers" StaticText "!HQRESIZE_WARNING!" Option "$GLTEXMNU_RESIZETEX", gl_texture_hqresize_textures, "OnOff" diff --git a/wadsrc/static/zscript/menu/optionmenu.txt b/wadsrc/static/zscript/menu/optionmenu.txt index f73035ab0..10bd91140 100644 --- a/wadsrc/static/zscript/menu/optionmenu.txt +++ b/wadsrc/static/zscript/menu/optionmenu.txt @@ -579,47 +579,9 @@ class GLTextureGLOptions : OptionMenu { string message; - if (gl_texture_hqresize > 0) + if (gl_texture_hqresizemult > 1 && gl_texture_hqresizemode > 0) { - int multiplier; - - switch (gl_texture_hqresize) - { - case 1: - case 4: - case 7: - case 10: - case 13: - case 20: - multiplier = 4; - break; - case 2: - case 5: - case 8: - case 11: - case 14: - case 21: - multiplier = 9; - break; - case 3: - case 6: - case 9: - case 12: - case 15: - case 22: - multiplier = 16; - break; - case 16: - case 18: - case 23: - multiplier = 25; - break; - case 17: - case 19: - case 24: - multiplier = 36; - break; - } + int multiplier = gl_texture_hqresizemult * gl_texture_hqresizemult; string localized = StringTable.Localize("$GLTEXMNU_HQRESIZEWARN"); message = String.Format(localized, multiplier); From ad8f48483634e27faaecfcfbf9f1c86a95a6a95f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 11 Dec 2018 00:21:37 +0100 Subject: [PATCH 14/18] - fixed: The JIT compiler crashed on missing ArgFlags. For ad-hoc Dehacked state functions no ArgFlags are created, in this case they can just be assumed to not be relevant here, because none of these function produces reference arguments. --- src/scripting/vm/jit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripting/vm/jit.cpp b/src/scripting/vm/jit.cpp index 6aacc4bf1..319130aa4 100644 --- a/src/scripting/vm/jit.cpp +++ b/src/scripting/vm/jit.cpp @@ -268,7 +268,7 @@ void JitCompiler::SetupSimpleFrame() for (unsigned int i = 0; i < sfunc->Proto->ArgumentTypes.Size(); i++) { const PType *type = sfunc->Proto->ArgumentTypes[i]; - if (sfunc->ArgFlags[i] & (VARF_Out | VARF_Ref)) + if (sfunc->ArgFlags.Size() && sfunc->ArgFlags[i] & (VARF_Out | VARF_Ref)) { cc.mov(regA[rega++], x86::ptr(args, argsPos++ * sizeof(VMValue) + offsetof(VMValue, a))); } From abd6729d39ccff59fed9b151196183517f0346ef Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 11 Dec 2018 00:35:22 +0100 Subject: [PATCH 15/18] - fixed deprecation warnings for member functions not checking the version. --- src/scripting/backend/codegen.cpp | 6 +++--- src/scripting/thingdef.cpp | 4 ++-- src/scripting/thingdef.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 0eecab9a9..db87134dd 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -7600,7 +7600,7 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx) if (ctx.Class != nullptr) { - PFunction *afd = FindClassMemberFunction(ctx.Class, ctx.Class, MethodName, ScriptPosition, &error); + PFunction *afd = FindClassMemberFunction(ctx.Class, ctx.Class, MethodName, ScriptPosition, &error, ctx.Version); if (afd != nullptr) { @@ -8002,7 +8002,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx) if (novirtual) { bool error; - PFunction *afd = FindClassMemberFunction(ccls, ctx.Class, MethodName, ScriptPosition, &error); + PFunction *afd = FindClassMemberFunction(ccls, ctx.Class, MethodName, ScriptPosition, &error, ctx.Version); if ((nullptr != afd) && (afd->Variants[0].Flags & VARF_Method) && (afd->Variants[0].Flags & VARF_Virtual)) { staticonly = false; @@ -8309,7 +8309,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx) isresolved: bool error = false; - PFunction *afd = FindClassMemberFunction(cls, ctx.Class, MethodName, ScriptPosition, &error); + PFunction *afd = FindClassMemberFunction(cls, ctx.Class, MethodName, ScriptPosition, &error, ctx.Version); if (error) { delete this; diff --git a/src/scripting/thingdef.cpp b/src/scripting/thingdef.cpp index 928f645a8..439bf8ce8 100644 --- a/src/scripting/thingdef.cpp +++ b/src/scripting/thingdef.cpp @@ -236,7 +236,7 @@ PFunction *CreateAnonymousFunction(PContainerType *containingclass, PType *retur // //========================================================================== -PFunction *FindClassMemberFunction(PContainerType *selfcls, PContainerType *funccls, FName name, FScriptPosition &sc, bool *error) +PFunction *FindClassMemberFunction(PContainerType *selfcls, PContainerType *funccls, FName name, FScriptPosition &sc, bool *error, const VersionInfo &version) { // Skip ACS_NamedExecuteWithResult. Anything calling this should use the builtin instead. if (name == NAME_ACS_NamedExecuteWithResult) return nullptr; @@ -263,7 +263,7 @@ PFunction *FindClassMemberFunction(PContainerType *selfcls, PContainerType *func { sc.Message(MSG_ERROR, "%s is declared protected and not accessible", symbol->SymbolName.GetChars()); } - else if (funcsym->Variants[0].Flags & VARF_Deprecated) + else if ((funcsym->Variants[0].Flags & VARF_Deprecated) && funcsym->mVersion <= version) { sc.Message(MSG_WARNING, "Call to deprecated function %s", symbol->SymbolName.GetChars()); } diff --git a/src/scripting/thingdef.h b/src/scripting/thingdef.h index 844e38957..6e6737282 100644 --- a/src/scripting/thingdef.h +++ b/src/scripting/thingdef.h @@ -204,7 +204,7 @@ class FxVMFunctionCall *ParseAction(FScanner &sc, FState state, FString statestr FName CheckCastKludges(FName in); void SetImplicitArgs(TArray *args, TArray *argflags, TArray *argnames, PContainerType *cls, uint32_t funcflags, int useflags); PFunction *CreateAnonymousFunction(PContainerType *containingclass, PType *returntype, int flags); -PFunction *FindClassMemberFunction(PContainerType *cls, PContainerType *funccls, FName name, FScriptPosition &sc, bool *error); +PFunction *FindClassMemberFunction(PContainerType *cls, PContainerType *funccls, FName name, FScriptPosition &sc, bool *error, const VersionInfo &version); void CreateDamageFunction(PNamespace *ns, const VersionInfo &ver, PClassActor *info, AActor *defaults, FxExpression *id, bool fromDecorate, int lumpnum); //========================================================================== From f6aa16947ac5f15a66c057603aa841dc0b8e3ad1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 11 Dec 2018 00:35:53 +0100 Subject: [PATCH 16/18] - re-added PlayerInfo.BringUpWeapon. --- wadsrc/static/zscript/shared/player.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index 391ae38a6..9a06f78b4 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -2431,6 +2431,11 @@ struct PlayerInfo native play // self is what internally is known as player_t mo.DropWeapon(); } } + + deprecated("3.7") void BringUpWeapon() + { + if (mo) mo.BringUpWeapon(); + } bool IsTotallyFrozen() { From 8b46be768695674a04c0a66a1e580ef8b06c7c07 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 11 Dec 2018 10:46:56 +0200 Subject: [PATCH 17/18] - print VM stack trace on startup abort exception https://forum.zdoom.org/viewtopic.php?t=62650 --- src/posix/cocoa/i_main_except.cpp | 21 +++++++++++++++++---- src/posix/sdl/i_main.cpp | 24 ++++++++++++++++++++---- src/win32/i_main.cpp | 6 ++++++ 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/posix/cocoa/i_main_except.cpp b/src/posix/cocoa/i_main_except.cpp index a61eca2cc..afb0ba7e4 100644 --- a/src/posix/cocoa/i_main_except.cpp +++ b/src/posix/cocoa/i_main_except.cpp @@ -32,9 +32,11 @@ */ // Workaround for GCC Objective-C++ with C++ exceptions bug. -#include "doomerrors.h" #include +#include "doomerrors.h" +#include "vm.h" + // Import some functions from i_main.mm void call_terms(); void Mac_I_FatalError(const char* const message); @@ -50,10 +52,21 @@ void OriginalMainExcept(int argc, char** argv) { const char* const message = error.what(); - if (NULL != message) + if (strcmp(message, "NoRunExit")) { - if (strcmp(message, "NoRunExit")) fprintf(stderr, "%s\n", message); - Mac_I_FatalError(message); + if (CVMAbortException::stacktrace.IsNotEmpty()) + { + Printf("%s", CVMAbortException::stacktrace.GetChars()); + } + + if (batchrun) + { + Printf("%s\n", message); + } + else + { + Mac_I_FatalError(message); + } } exit(-1); diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp index 0c2389294..3d7912fc8 100644 --- a/src/posix/sdl/i_main.cpp +++ b/src/posix/sdl/i_main.cpp @@ -52,6 +52,7 @@ #include "cmdlib.h" #include "r_utility.h" #include "doomstat.h" +#include "vm.h" // MACROS ------------------------------------------------------------------ @@ -261,16 +262,31 @@ int main (int argc, char **argv) catch (std::exception &error) { I_ShutdownJoysticks(); - if (error.what () && strcmp(error.what(), "NoRunExit")) - fprintf (stderr, "%s\n", error.what ()); + const char *const message = error.what(); + + if (strcmp(message, "NoRunExit")) + { + if (CVMAbortException::stacktrace.IsNotEmpty()) + { + Printf("%s", CVMAbortException::stacktrace.GetChars()); + } + + if (batchrun) + { + Printf("%s\n", message); + } + else + { #ifdef __APPLE__ - Mac_I_FatalError(error.what()); + Mac_I_FatalError(message); #endif // __APPLE__ #ifdef __linux__ - Linux_I_FatalError(error.what()); + Linux_I_FatalError(message); #endif // __linux__ + } + } exit (-1); } diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index 6a75a597a..4bd3aed66 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -71,6 +71,7 @@ #include "r_utility.h" #include "g_levellocals.h" #include "s_sound.h" +#include "vm.h" #include "stats.h" #include "st_start.h" @@ -1057,6 +1058,11 @@ void DoMain (HINSTANCE hInstance) auto msg = error.what(); if (strcmp(msg, "NoRunExit")) { + if (CVMAbortException::stacktrace.IsNotEmpty()) + { + Printf("%s", CVMAbortException::stacktrace.GetChars()); + } + if (!batchrun) { ShowErrorPane(msg); From eb8614fc716818d0603c92eafbac7be62008d92d Mon Sep 17 00:00:00 2001 From: Player701 Date: Tue, 11 Dec 2018 17:07:21 +0300 Subject: [PATCH 18/18] - Force node rebuild for Plutonia 2 MAP25 to fix BSP glitches --- wadsrc/static/compatibility.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 030cea322..03d8b3223 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -175,6 +175,7 @@ AF40D0E49BD1B76D4B1AADD8212ADC46 // MAP01 (the wad that shall not be named =P) D5F64E02679A81B82006AF34A6A8EAC3 // plutonia.wad map32 BA4860C7A2F5D705DB32A1A38DB77EC4 // pl2.wad map10 EDA5CE7C462BD171BF8110AC56B67857 // pl2.wad map11 +A9A9A728E689266939C1B71655F320CA // pl2.wad map25 { rebuildnodes }