diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index dc818ae0290..645dcc3cc08 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -62,7 +62,10 @@ //GASES #define MIN_TOXIC_GAS_DAMAGE 1 #define MAX_TOXIC_GAS_DAMAGE 10 -#define MOLES_GAS_VISIBLE 0.5 //Moles in a standard cell after which gases are visible +#define MOLES_GAS_VISIBLE 0.25 //Moles in a standard cell after which gases are visible + +#define FACTOR_GAS_VISIBLE_MAX 20 //moles_visible * FACTOR_GAS_VISIBLE_MAX = Moles after which gas is at maximum visibility +#define MOLES_GAS_VISIBLE_STEP 0.25 //Mole step for alpha updates. This means alpha can update at 0.25, 0.5, 0.75 and so on //REACTIONS //return values for reactions (bitflags) @@ -246,6 +249,13 @@ #define ASSERT_GAS(gas_id, gas_mixture) if (!gas_mixture.gases[gas_id]) { ADD_GAS(gas_id, gas_mixture.gases) }; +//prefer this to gas_mixture/total_moles in performance critical areas +#define TOTAL_MOLES(cached_gases, out_var)\ + out_var = 0;\ + for(var/total_moles_id in cached_gases){\ + out_var += cached_gases[total_moles_id][MOLES];\ + } + GLOBAL_LIST_INIT(pipe_paint_colors, list( "amethyst" = rgb(130,43,255), //supplymain "blue" = rgb(0,0,255), diff --git a/code/game/objects/effects/decals/cleanable/misc.dm b/code/game/objects/effects/decals/cleanable/misc.dm index f6cee09d54c..0251e39f529 100644 --- a/code/game/objects/effects/decals/cleanable/misc.dm +++ b/code/game/objects/effects/decals/cleanable/misc.dm @@ -203,20 +203,20 @@ /obj/effect/decal/cleanable/glitter name = "generic glitter pile" desc = "The herpes of arts and crafts." - icon = 'icons/effects/tile_effects.dmi' + icon = 'icons/effects/atmospherics.dmi' gender = NEUTER /obj/effect/decal/cleanable/glitter/pink name = "pink glitter" - icon_state = "plasma" + icon_state = "plasma_old" /obj/effect/decal/cleanable/glitter/white name = "white glitter" - icon_state = "nitrous_oxide" + icon_state = "nitrous_oxide_old" /obj/effect/decal/cleanable/glitter/blue name = "blue glitter" - icon_state = "freon" + icon_state = "freon_old" /obj/effect/decal/cleanable/plasma name = "stabilized plasma" diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm index 568ce6c95d0..a6a4c7be646 100644 --- a/code/modules/atmospherics/environmental/LINDA_fire.dm +++ b/code/modules/atmospherics/environmental/LINDA_fire.dm @@ -139,7 +139,7 @@ add_overlay(lightning_overlay) if(temperature > 4500000) //This is where noblium happens. Some fusion-y effects. var/fusion_amt = temperature < LERP(4500000,12000000,0.5) ? gauss_lerp(temperature, 4500000, 12000000) : 1 - var/mutable_appearance/fusion_overlay = mutable_appearance('icons/effects/tile_effects.dmi', "chem_gas") + var/mutable_appearance/fusion_overlay = mutable_appearance('icons/effects/atmospherics.dmi', "fusion_gas") fusion_overlay.blend_mode = BLEND_ADD fusion_overlay.alpha = fusion_amt * 255 var/mutable_appearance/rainbow_overlay = mutable_appearance('icons/mob/screen_gen.dmi', "druggy") diff --git a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm index f40c2890be9..71dc36ef178 100644 --- a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm +++ b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm @@ -113,17 +113,18 @@ /turf/open/proc/tile_graphic() var/static/list/nonoverlaying_gases = typecache_of_gases_with_no_overlays() - if(air) - . = new /list - var/list/gases = air.gases - for(var/id in gases) - if (nonoverlaying_gases[id]) - continue - var/gas = gases[id] - var/gas_meta = gas[GAS_META] - var/gas_overlay = gas_meta[META_GAS_OVERLAY] - if(gas_overlay && gas[MOLES] > gas_meta[META_GAS_MOLES_VISIBLE]) - . += gas_overlay + if(!air) + return + . = new /list + var/list/gases = air.gases + for(var/id in gases) + if (nonoverlaying_gases[id]) + continue + var/gas = gases[id] + var/gas_meta = gas[GAS_META] + var/gas_overlay = gas_meta[META_GAS_OVERLAY] + if(gas_overlay && gas[MOLES] > gas_meta[META_GAS_MOLES_VISIBLE]) + . += gas_overlay[min(FACTOR_GAS_VISIBLE_MAX, CEILING(gas[MOLES] / MOLES_GAS_VISIBLE_STEP, 1))] /proc/typecache_of_gases_with_no_overlays() . = list() diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index c1d9874a646..956400b679d 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -91,13 +91,6 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) if(!.) . += HEAT_CAPACITY_VACUUM //we want vacuums in turfs to have the same heat capacity as space -//prefer this in performance critical areas -#define TOTAL_MOLES(cached_gases, out_var)\ - out_var = 0;\ - for(var/total_moles_id in cached_gases){\ - out_var += cached_gases[total_moles_id][MOLES];\ - } - /datum/gas_mixture/proc/total_moles() var/cached_gases = gases TOTAL_MOLES(cached_gases, .) diff --git a/code/modules/atmospherics/gasmixtures/gas_types.dm b/code/modules/atmospherics/gasmixtures/gas_types.dm index 09a8c29a5f8..37d0eaa37cb 100644 --- a/code/modules/atmospherics/gasmixtures/gas_types.dm +++ b/code/modules/atmospherics/gasmixtures/gas_types.dm @@ -9,9 +9,13 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g gas_info[META_GAS_SPECIFIC_HEAT] = initial(gas.specific_heat) gas_info[META_GAS_NAME] = initial(gas.name) + gas_info[META_GAS_MOLES_VISIBLE] = initial(gas.moles_visible) if(initial(gas.moles_visible) != null) - gas_info[META_GAS_OVERLAY] = new /obj/effect/overlay/gas(initial(gas.gas_overlay)) + gas_info[META_GAS_OVERLAY] = new /list(FACTOR_GAS_VISIBLE_MAX) + for(var/i in 1 to FACTOR_GAS_VISIBLE_MAX) + gas_info[META_GAS_OVERLAY][i] = new /obj/effect/overlay/gas(initial(gas.gas_overlay), i * 255 / FACTOR_GAS_VISIBLE_MAX) + gas_info[META_GAS_FUSION_POWER] = initial(gas.fusion_power) gas_info[META_GAS_DANGER] = initial(gas.dangerous) gas_info[META_GAS_ID] = initial(gas.id) @@ -39,7 +43,7 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g var/id = "" var/specific_heat = 0 var/name = "" - var/gas_overlay = "" //icon_state in icons/effects/tile_effects.dmi + var/gas_overlay = "" //icon_state in icons/effects/atmospherics.dmi var/moles_visible = null var/dangerous = FALSE //currently used by canisters var/fusion_power = 0 //How much the gas accelerates a fusion reaction @@ -96,7 +100,7 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g specific_heat = 40 name = "Nitrous Oxide" gas_overlay = "nitrous_oxide" - moles_visible = 1 + moles_visible = MOLES_GAS_VISIBLE * 2 dangerous = TRUE rarity = 600 @@ -151,12 +155,13 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g rarity = 250 /obj/effect/overlay/gas - icon = 'icons/effects/tile_effects.dmi' + icon = 'icons/effects/atmospherics.dmi' mouse_opacity = MOUSE_OPACITY_TRANSPARENT anchored = TRUE // should only appear in vis_contents, but to be safe layer = FLY_LAYER appearance_flags = TILE_BOUND -/obj/effect/overlay/gas/New(state) +/obj/effect/overlay/gas/New(state, alph) . = ..() icon_state = state + alpha = alph diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 9c22d57669b..5c46cf48c8d 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -150,7 +150,7 @@ GLOBAL_LIST_INIT(hallucination_list, list( var/turf/center var/list/flood_images = list() var/list/turf/flood_turfs = list() - var/image_icon = 'icons/effects/tile_effects.dmi' + var/image_icon = 'icons/effects/atmospherics.dmi' var/image_state = "plasma" var/radius = 0 var/next_expand = 0 diff --git a/icons/effects/atmospherics.dmi b/icons/effects/atmospherics.dmi new file mode 100644 index 00000000000..acf48a0bd09 Binary files /dev/null and b/icons/effects/atmospherics.dmi differ diff --git a/icons/effects/tile_effects.dmi b/icons/effects/tile_effects.dmi deleted file mode 100644 index 18dde378e11..00000000000 Binary files a/icons/effects/tile_effects.dmi and /dev/null differ