Wall Icon Refactor (#3023)

changes:

Atom types can now define custom adjacency code for the smoothing system.
Walls now draw using the generic icon smoothing system.
Walls now pre-bake colors into their icons instead of doing it client-side with the color var.
Walls can now use the SSoverlay appearance cache; wall icon updates should be faster.
The "rusty" wall type now actually works.
Smoothing now uses mutable_appearance instead of image in some places.
Should be a bit easier on clients, though I haven't done profiling.

This PR breaks 510 compatibility.
This commit is contained in:
Lohikar
2017-07-15 08:22:21 -05:00
committed by skull132
parent 1bda977ae7
commit 41e39f52d1
12 changed files with 208 additions and 72 deletions

View File

@@ -83,6 +83,8 @@ var/list/name_to_material
var/door_icon_base = "metal" // Door base icon tag. See header.
var/icon_reinf = "reinf_metal" // Overlay used
var/list/stack_origin_tech = list(TECH_MATERIAL = 1) // Research level for stacks.
var/icon/wall_icon
var/icon/multipart_reinf_icon
// Attributes
var/cut_delay = 0 // Delay in ticks when cutting through this wall.
@@ -153,6 +155,31 @@ var/list/name_to_material
if(!shard_icon)
shard_icon = shard_type
var/skip_blend = FALSE
switch (icon_base)
if ("solid")
wall_icon = 'icons/turf/smooth/composite_solid.dmi'
if ("stone")
wall_icon = 'icons/turf/smooth/composite_stone.dmi'
multipart_reinf_icon = 'icons/turf/smooth/composite_stone_reinf.dmi'
if ("metal")
wall_icon = 'icons/turf/smooth/composite_metal.dmi'
if ("cult")
wall_icon = 'icons/turf/smooth/cult_wall.dmi'
skip_blend = TRUE
if ("arust")
wall_icon = 'icons/turf/smooth/rusty_wall.dmi'
skip_blend = TRUE
else
world.log << "materials: [src] has unknown icon_base [icon_base]."
if (wall_icon && icon_colour && !skip_blend)
wall_icon = new(wall_icon)
wall_icon.Blend(icon_colour, ICON_MULTIPLY)
if (multipart_reinf_icon)
multipart_reinf_icon = new(multipart_reinf_icon)
multipart_reinf_icon.Blend(icon_colour, ICON_MULTIPLY)
// This is a placeholder for proper integration of windows/windoors into the system.
/material/proc/build_windows(var/mob/living/user, var/obj/item/stack/used_stack)
return 0
@@ -599,6 +626,7 @@ var/list/name_to_material
stack_type = null
icon_colour = "#B7410E"
icon_base = "arust"
icon_reinf = "reinf_over"
integrity = 250
explosion_resistance = 8
hardness = 15