From 478e1284fbea70f39e59ec88cc93923463e97c0b Mon Sep 17 00:00:00 2001 From: David Vogel Date: Sat, 30 Dec 2023 13:34:13 +0100 Subject: [PATCH] Add code that stops grid updates in regular build This is not exposed to the end user yet, as it is buggy. --- files/capture.lua | 2 +- files/modification.lua | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/files/capture.lua b/files/capture.lua index 5f050ba..edd86d2 100644 --- a/files/capture.lua +++ b/files/capture.lua @@ -378,7 +378,7 @@ function Capture:StartCapturingLive(outputPixelScale) self.MapCapturingCtx:Run(nil, handleDo, handleEnd, mapCapturingCtxErrHandler) end ----Gathers all entities on the screen (around x, y within radius), serializes them, appends them into entityFile and modifies those entities. +---Gathers all entities on the screen (around x, y within radius), serializes them, appends them into entityFile and/or modifies those entities. ---@param file file*|nil ---@param modify boolean ---@param x number diff --git a/files/modification.lua b/files/modification.lua index 32fe106..1ecc6fa 100644 --- a/files/modification.lua +++ b/files/modification.lua @@ -309,6 +309,11 @@ function Modification.RequiredChanges() magic["DEBUG_PAUSE_BOX2D"] = ModSettingGet("noita-mapcap.disable-physics") and "1" or "0" magic["DEBUG_DISABLE_POSTFX_DITHERING"] = ModSettingGet("noita-mapcap.disable-postfx") and "1" or "0" + -- These magic numbers stop any grid updates (pixel physics), even in the release build. + -- But any Box2D objects glitch, therefore the mod option (disable-physics) is disabled and hidden in the non dev build. + magic["GRID_MAX_UPDATES_PER_FRAME"] = ModSettingGet("noita-mapcap.disable-physics") and "0" or "128" + magic["GRID_MIN_UPDATES_PER_FRAME"] = ModSettingGet("noita-mapcap.disable-physics") and "1" or "40" + if ModSettingGet("noita-mapcap.disable-postfx") then patches.PostFinalConst = { ENABLE_REFRACTION = false,