Meat statue fixes (#55790)

Fixes few statue bugs with textured materials.
Makes materials use managed filters. This can have side effects on things that already had unmanaged filters on.
This commit is contained in:
AnturK
2020-12-30 11:47:57 -05:00
committed by GitHub
parent 15557f8ee6
commit adcd4af1ff
2 changed files with 8 additions and 7 deletions
+5 -6
View File
@@ -34,16 +34,15 @@ Simple datum which is instanced once per type and is used for every object of sa
var/turf_sound_override
///what texture icon state to overlay
var/texture_layer_icon_state
///a cached filter for the texture icon
var/cached_texture_filter
///a cached icon for the texture filter
var/cached_texture_filter_icon
///What type of shard the material will shatter to
var/obj/item/shard_type
/datum/material/New()
. = ..()
if(texture_layer_icon_state)
var/texture_icon = icon('icons/materials/composite.dmi', texture_layer_icon_state)
cached_texture_filter = filter(type="layer", icon=texture_icon, blend_mode = BLEND_INSET_OVERLAY)
cached_texture_filter_icon = icon('icons/materials/composite.dmi', texture_layer_icon_state)
@@ -56,7 +55,7 @@ Simple datum which is instanced once per type and is used for every object of sa
source.alpha = alpha
if(texture_layer_icon_state)
ADD_KEEP_TOGETHER(source, MATERIAL_SOURCE(src))
source.filters += cached_texture_filter
source.add_filter("material_texture_[name]",1,layering_filter(icon=cached_texture_filter_icon,blend_mode=BLEND_INSET_OVERLAY))
if(alpha < 255)
source.opacity = FALSE
@@ -125,7 +124,7 @@ Simple datum which is instanced once per type and is used for every object of sa
if(color)
source.remove_atom_colour(FIXED_COLOUR_PRIORITY, color)
if(texture_layer_icon_state)
source.filters -= cached_texture_filter
source.remove_filter("material_texture_[name]")
REMOVE_KEEP_TOGETHER(source, MATERIAL_SOURCE(src))
source.alpha = initial(source.alpha)
+3 -1
View File
@@ -487,7 +487,8 @@ Moving interrupts
return
if(!target_appearance_with_filters)
target_appearance_with_filters = new(current_target)
target_appearance_with_filters.appearance_flags |= KEEP_TOGETHER
// KEEP_APART in case carving block gets KEEP_TOGETHER from somewhere like material texture filters.
target_appearance_with_filters.appearance_flags |= KEEP_TOGETHER | KEEP_APART
//Doesn't use filter helpers because MAs aren't atoms
target_appearance_with_filters.filters = filter(type="color",color=greyscale_with_value_bump,space=FILTER_COLOR_HSV)
completion = value
@@ -549,6 +550,7 @@ Moving interrupts
content_ma.pixel_x = 0
content_ma.pixel_y = 0
content_ma.alpha = 255
content_ma.appearance_flags &= ~KEEP_APART //Don't want this
content_ma.filters = filter(type="color",color=greyscale_with_value_bump,space=FILTER_COLOR_HSV)
update_icon()