From 83158d3d1641a62301cf59befaec99d900a0d63b Mon Sep 17 00:00:00 2001 From: Karolis2011 Date: Sat, 10 Oct 2015 16:58:01 +0300 Subject: [PATCH] More tolarable 3 way manifold rendering fix. --- code/_helpers/icons.dm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/code/_helpers/icons.dm b/code/_helpers/icons.dm index 140219a19d6..2e4c0a3cc50 100644 --- a/code/_helpers/icons.dm +++ b/code/_helpers/icons.dm @@ -768,14 +768,26 @@ proc // Creates a single icon from a given /atom or /image. Only the first argu addY1 = min(flatY1, I:pixel_y+1) addY2 = max(flatY2, I:pixel_y+add.Height()) + //Ratates overlay based on atom direction + if((I in A.overlays) || (I in A.underlays)) + if(istype(A, /obj/machinery/atmospherics/pipe/manifold)) + var/realdir = A.dir + add.Turn(dir2angle(realdir) - 180) + if(addX1!=flatX1 || addX2!=flatX2 || addY1!=flatY1 || addY2!=flatY2) // Resize the flattened icon so the new icon fits flat.Crop(addX1-flatX1+1, addY1-flatY1+1, addX2-flatX1+1, addY2-flatY1+1) flatX1=addX1;flatX2=addX2 flatY1=addY1;flatY2=addY2 - + var/iconmode + if(I in A.overlays) + iconmode = ICON_OVERLAY + else if(I in A.underlays) + iconmode = ICON_UNDERLAY + else + iconmode = blendMode2iconMode(curblend) // Blend the overlay into the flattened icon - flat.Blend(add, blendMode2iconMode(curblend), I:pixel_x + 2 - flatX1, I:pixel_y + 2 - flatY1) + flat.Blend(add, iconmode, I:pixel_x + 2 - flatX1, I:pixel_y + 2 - flatY1) if(A.color) flat.Blend(A.color, ICON_MULTIPLY)