mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2025-12-10 23:21:32 +00:00
hand optimizations
This commit is contained in:
@@ -55,30 +55,36 @@
|
|||||||
// i need to learn how to use the icon cutter
|
// i need to learn how to use the icon cutter
|
||||||
// anyways, 1 to 4 means NORTH SOUTH EAST WEST
|
// anyways, 1 to 4 means NORTH SOUTH EAST WEST
|
||||||
var/dir
|
var/dir
|
||||||
for(var/i in 0 to 3)
|
var/state
|
||||||
dir = (1 << i)
|
|
||||||
|
|
||||||
|
|
||||||
for(var/i in 1 to 4)
|
|
||||||
I = image('icons/turf/wall_masks.dmi', "[material.icon_base][wall_connections[i]]", dir = 1<<(i-1))
|
|
||||||
I.color = material.icon_colour
|
|
||||||
add_overlay(I)
|
|
||||||
|
|
||||||
if(reinf_material)
|
if(reinf_material)
|
||||||
|
// normal and reinf
|
||||||
if(construction_stage != null && construction_stage < 6)
|
if(construction_stage != null && construction_stage < 6)
|
||||||
I = image('icons/turf/wall_masks.dmi', "reinf_construct-[construction_stage]")
|
I = image('icons/turf/wall_masks.dmi', "reinf_construct-[construction_stage]")
|
||||||
I.color = reinf_material.icon_colour
|
I.color = reinf_material.icon_colour
|
||||||
add_overlay(I)
|
add_overlay(I)
|
||||||
|
if(reinf_material.icon_reinf_directionals)
|
||||||
|
for(var/i in 0 to 3)
|
||||||
|
state = get_corner_state_using_junctions(i)
|
||||||
|
dir = (1<<i)
|
||||||
|
I = image('icons/turf/wall_masks.dmi', "[material.icon_base][state]", dir = dir)
|
||||||
|
I.color = material.icon_colour
|
||||||
|
add_overlay(I)
|
||||||
|
I = image('icons/turf/wall_masks.dmi', "[reinf_material.icon_reinf][state]", dir = dir)
|
||||||
|
I.color = material.icon_colour
|
||||||
|
add_overlay(I)
|
||||||
else
|
else
|
||||||
if("[reinf_material.icon_reinf]0" in icon_states('icons/turf/wall_masks.dmi'))
|
for(var/i in 0 to 3)
|
||||||
// Directional icon
|
I = image('icons/turf/wall_masks.dmi', "[material.icon_base][get_corner_state_using_junctions(i)]", dir = (1<<i))
|
||||||
for(var/i = 1 to 4)
|
I.color = material.icon_colour
|
||||||
I = image('icons/turf/wall_masks.dmi', "[reinf_material.icon_reinf][wall_connections[i]]", dir = 1<<(i-1))
|
add_overlay(I)
|
||||||
|
I = image('icons/turf/wall_masks.dmi', reinf_material.icon_reinf)
|
||||||
I.color = reinf_material.icon_colour
|
I.color = reinf_material.icon_colour
|
||||||
add_overlay(I)
|
add_overlay(I)
|
||||||
else
|
else
|
||||||
I = image('icons/turf/wall_masks.dmi', reinf_material.icon_reinf)
|
// just normal
|
||||||
I.color = reinf_material.icon_colour
|
for(var/i in 0 to 3)
|
||||||
|
I = image('icons/turf/wall_masks.dmi', "[material.icon_base][get_corner_state_using_junctions(i)]", dir = (1<<i))
|
||||||
|
I.color = material.icon_colour
|
||||||
add_overlay(I)
|
add_overlay(I)
|
||||||
|
|
||||||
// handle damage overlays
|
// handle damage overlays
|
||||||
|
|||||||
@@ -295,6 +295,7 @@
|
|||||||
hardness = 20
|
hardness = 20
|
||||||
icon_base = "stone"
|
icon_base = "stone"
|
||||||
icon_reinf = "reinf_stone"
|
icon_reinf = "reinf_stone"
|
||||||
|
icon_reinf_directionals = TRUE
|
||||||
door_icon_base = "stone"
|
door_icon_base = "stone"
|
||||||
sheet_singular_name = "sheet"
|
sheet_singular_name = "sheet"
|
||||||
sheet_plural_name = "sheets"
|
sheet_plural_name = "sheets"
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ var/list/name_to_material
|
|||||||
var/icon_base = "metal" // Wall and table base icon tag. See header.
|
var/icon_base = "metal" // Wall and table base icon tag. See header.
|
||||||
var/door_icon_base = "metal" // Door base icon tag. See header.
|
var/door_icon_base = "metal" // Door base icon tag. See header.
|
||||||
var/icon_reinf = "reinf_metal" // Overlay used
|
var/icon_reinf = "reinf_metal" // Overlay used
|
||||||
|
/// do we have directional reinforced states on walls?
|
||||||
|
var/icon_reinf_directionals = FALSE
|
||||||
var/list/stack_origin_tech = list(TECH_MATERIAL = 1) // Research level for stacks.
|
var/list/stack_origin_tech = list(TECH_MATERIAL = 1) // Research level for stacks.
|
||||||
var/pass_stack_colors = FALSE // Will stacks made from this material pass their colors onto objects?
|
var/pass_stack_colors = FALSE // Will stacks made from this material pass their colors onto objects?
|
||||||
|
|
||||||
@@ -251,6 +253,7 @@ var/list/name_to_material
|
|||||||
radioactivity = 12
|
radioactivity = 12
|
||||||
icon_base = "stone"
|
icon_base = "stone"
|
||||||
icon_reinf = "reinf_stone"
|
icon_reinf = "reinf_stone"
|
||||||
|
icon_reinf_directionals = TRUE
|
||||||
icon_colour = "#007A00"
|
icon_colour = "#007A00"
|
||||||
weight = 22
|
weight = 22
|
||||||
stack_origin_tech = list(TECH_MATERIAL = 5)
|
stack_origin_tech = list(TECH_MATERIAL = 5)
|
||||||
@@ -350,6 +353,7 @@ var/list/name_to_material
|
|||||||
stack_type = /obj/item/stack/material/sandstone
|
stack_type = /obj/item/stack/material/sandstone
|
||||||
icon_base = "stone"
|
icon_base = "stone"
|
||||||
icon_reinf = "reinf_stone"
|
icon_reinf = "reinf_stone"
|
||||||
|
icon_reinf_directionals = TRUE
|
||||||
icon_colour = "#D9C179"
|
icon_colour = "#D9C179"
|
||||||
shard_type = SHARD_STONE_PIECE
|
shard_type = SHARD_STONE_PIECE
|
||||||
weight = 22
|
weight = 22
|
||||||
@@ -917,6 +921,7 @@ var/list/name_to_material
|
|||||||
icon_colour = "#42291a"
|
icon_colour = "#42291a"
|
||||||
icon_base = "stone"
|
icon_base = "stone"
|
||||||
icon_reinf = "reinf_stone"
|
icon_reinf = "reinf_stone"
|
||||||
|
icon_reinf_directionals = TRUE
|
||||||
integrity = 65 //a bit stronger than regular wood
|
integrity = 65 //a bit stronger than regular wood
|
||||||
hardness = 20
|
hardness = 20
|
||||||
weight = 20 //likewise, heavier
|
weight = 20 //likewise, heavier
|
||||||
@@ -965,6 +970,7 @@ var/list/name_to_material
|
|||||||
stack_type = /obj/item/stack/material/snowbrick
|
stack_type = /obj/item/stack/material/snowbrick
|
||||||
icon_base = "stone"
|
icon_base = "stone"
|
||||||
icon_reinf = "reinf_stone"
|
icon_reinf = "reinf_stone"
|
||||||
|
icon_reinf_directionals = TRUE
|
||||||
icon_colour = "#D8FDFF"
|
icon_colour = "#D8FDFF"
|
||||||
integrity = 50
|
integrity = 50
|
||||||
weight = 2
|
weight = 2
|
||||||
|
|||||||
@@ -511,7 +511,18 @@ var/list/table_icon_cache = list()
|
|||||||
/atom/proc/get_corner_state_using_junctions(corner)
|
/atom/proc/get_corner_state_using_junctions(corner)
|
||||||
// north, south, east, west, in that order
|
// north, south, east, west, in that order
|
||||||
// which translates to northwest, southeast, northeast, southwest in that order
|
// which translates to northwest, southeast, northeast, southwest in that order
|
||||||
|
// honestly fuck you, precompute.
|
||||||
|
// cache for sanic speed
|
||||||
|
var/smoothing_junction = src.smoothing_junction
|
||||||
switch(corner)
|
switch(corner)
|
||||||
|
if(1)
|
||||||
|
return ((smoothing_junction & NORTHWEST_JUNCTION)? CORNER_DIAGONAL : NONE) | ((smoothing_junction & NORTH_JUNCTION)? CORNER_CLOCKWISE : NONE) | ((smoothing_junction & WEST_JUNCTION)? CORNER_COUNTERCLOCKWISE : NONE)
|
||||||
|
if(2)
|
||||||
|
return ((smoothing_junction & SOUTHEAST_JUNCTION)? CORNER_DIAGONAL : NONE) | ((smoothing_junction & SOUTH_JUNCTION)? CORNER_CLOCKWISE : NONE) | ((smoothing_junction & EAST_JUNCTION)? CORNER_COUNTERCLOCKWISE : NONE)
|
||||||
|
if(3)
|
||||||
|
return ((smoothing_junction & NORTHEAST_JUNCTION)? CORNER_DIAGONAL : NONE) | ((smoothing_junction & EAST_JUNCTION)? CORNER_CLOCKWISE : NONE) | ((smoothing_junction & NORTH_JUNCTION)? CORNER_COUNTERCLOCKWISE : NONE)
|
||||||
|
if(4)
|
||||||
|
return ((smoothing_junction & SOUTHWEST_JUNCTION)? CORNER_DIAGONAL : NONE) | ((smoothing_junction & WEST_JUNCTION)? CORNER_CLOCKWISE : NONE) | ((smoothing_junction & SOUTH_JUNCTION)? CORNER_COUNTERCLOCKWISE : NONE)
|
||||||
|
|
||||||
#undef CORNER_NONE
|
#undef CORNER_NONE
|
||||||
#undef CORNER_COUNTERCLOCKWISE
|
#undef CORNER_COUNTERCLOCKWISE
|
||||||
|
|||||||
Reference in New Issue
Block a user