mspielberg / factorio-railloader

Rapidly load and unload trains of bulk materials.
GNU Lesser General Public License v3.0
9 stars 19 forks source link

Graphical rendering issue on Apple M2 Silicon #49

Open NCommander opened 11 months ago

NCommander commented 11 months ago

I originally posted this on reddit (https://www.reddit.com/r/factorio/comments/18l15ng/how_to_debug_a_renderer_issue_with_mods/) , but I was able to isolate a problem with railloader on Apple M2 silicon. When installed, it causes rails to render as white lines when zoomed out: image

but look fine when zoomed in:

image

Adjusting settings had no effect.

paul90 commented 5 months ago

Is there a fix for this?

c-spencer commented 1 month ago

Tentative fix for this is changing triple_rail_pictures in prototypes/entity/pictures.lua to do a full copy and then adjust the shifts (current version loses some extra properties like mipmaps?)

local function triple_rail_pictures(direction, layers)
  local out = {}
  for _, layer in ipairs(layers) do
    local l = all_base_rail_pictures["straight_rail_" .. direction][layer]
    for i=-1,1 do
      local shift = { i * 2, 0 }
      if direction == "vertical" then
        shift = { 0, i * 2 }
      end

      out[#out+1] = util.table.deepcopy(l)
      out[#out].shift = shift
      out[#out].hr_version.shift = shift
    end
  end
  return out
end