Reset virtual offset when no custom resolution is set

This commit is contained in:
David Vogel 2022-07-29 16:30:43 +02:00
parent 9af974cb10
commit 6ab8903c9b

View File

@ -180,18 +180,20 @@ function Modification.RequiredChanges()
config["backbuffer_height"] = config["window_h"]
magic["VIRTUAL_RESOLUTION_X"] = tostring(Vec2(ModSettingGet("noita-mapcap.virtual-resolution")).x)
magic["VIRTUAL_RESOLUTION_Y"] = tostring(Vec2(ModSettingGet("noita-mapcap.virtual-resolution")).y)
else
-- Only reset some stuff that is independent to the users chosen resolution.
config["internal_size_w"] = "1280"
config["internal_size_h"] = "720"
magic["VIRTUAL_RESOLUTION_X"] = "427"
magic["VIRTUAL_RESOLUTION_Y"] = "242"
end
-- Set virtual offset to prevent/reduce not correctly drawn pixels at the window border.
magic["GRID_RENDER_BORDER"] = "3" -- This will widen the right side of the virtual rectangle. It also shifts the world coordinates to the right.
magic["VIRTUAL_RESOLUTION_OFFSET_X"] = "-3"
magic["VIRTUAL_RESOLUTION_OFFSET_Y"] = "0"
else
-- Reset some values if there is no custom resolution requested.
config["internal_size_w"] = "1280"
config["internal_size_h"] = "720"
magic["VIRTUAL_RESOLUTION_X"] = "427"
magic["VIRTUAL_RESOLUTION_Y"] = "242"
magic["GRID_RENDER_BORDER"] = "2"
magic["VIRTUAL_RESOLUTION_OFFSET_X"] = "-1"
magic["VIRTUAL_RESOLUTION_OFFSET_Y"] = "-1"
end
-- Always expect a fullscreen mode of 0 (windowed).
-- Capturing will not work in fullscreen.