1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

lowered stress map resolution to 2x2 tiles per pixle #229

This commit is contained in:
Valansch 2018-10-15 23:40:36 +02:00
parent 67b43f34d4
commit 1f9850839f
4 changed files with 10 additions and 4 deletions

View File

@ -25,6 +25,7 @@ local Config = {
}, },
cheats = { cheats = {
manual_mining_speed_modifier = 1000, manual_mining_speed_modifier = 1000,
character_inventory_slots_bonus = 1000,
}, },
}, },
DiggyHole = { DiggyHole = {

View File

@ -78,9 +78,9 @@ end
@param position Position {x, y} @param position Position {x, y}
]] ]]
function Debug.print_grid_value(value, surface, position) function Debug.print_grid_value(value, surface, position)
local r = max(1, value) local r = max(1, value) / 4
local g = 1 - abs(value) local g = 1 - abs(value) / 4
local b = min(1, value) local b = min(1, value) / 4
if (r > 0) then if (r > 0) then
r = 0 r = 0

View File

@ -43,7 +43,7 @@ local stress_map_check_stress_in_threshold
local support_beam_entities local support_beam_entities
local on_surface_created local on_surface_created
local stress_threshold_causing_collapse = 0.91 local stress_threshold_causing_collapse = 3.64
local deconstruction_alert_message_shown = {} local deconstruction_alert_message_shown = {}
local stress_map_storage = {} local stress_map_storage = {}
@ -402,6 +402,8 @@ end
@return number sum of old fraction + new fraction @return number sum of old fraction + new fraction
]] ]]
function add_fraction(stress_map, x, y, fraction) function add_fraction(stress_map, x, y, fraction)
x = 2 * floor(x / 2)
y = 2 * floor(y / 2)
local quadrant = 1 local quadrant = 1
if x < 0 then if x < 0 then
quadrant = quadrant + 1 quadrant = quadrant + 1
@ -455,6 +457,8 @@ function add_fraction(stress_map, x, y, fraction)
end end
function add_fraction_by_quadrant(stress_map, x, y, fraction, quadrant) function add_fraction_by_quadrant(stress_map, x, y, fraction, quadrant)
x = 2 * floor(x / 2)
y = 2 * floor(y / 2)
local x_t = quadrant[x] local x_t = quadrant[x]
if not x_t then if not x_t then
x_t = {} x_t = {}

View File

@ -25,6 +25,7 @@ function SetupPlayer.register(config)
Debug.cheat(function() Debug.cheat(function()
player.force.manual_mining_speed_modifier = config.cheats.manual_mining_speed_modifier player.force.manual_mining_speed_modifier = config.cheats.manual_mining_speed_modifier
player.force.character_inventory_slots_bonus = config.cheats.character_inventory_slots_bonus
end) end)
end) end)
end end