Files
Matt Atlas 94d92803b4 Replaces our lighting system with CM's. (#21465)
Depends on #21458.

Ports https://github.com/cmss13-devs/cmss13/pull/4229, with the original
authors as:

- https://github.com/tgstation/TerraGov-Marine-Corps/pull/1964 for the
lighting controller (A-lexa)
- https://github.com/tgstation/TerraGov-Marine-Corps/pull/4747 and
https://github.com/tgstation/TerraGov-Marine-Corps/pull/7263 for the
lighting (TiviPlus)
- https://github.com/tgstation/tgstation/pull/54520 for the dir lighting
component
- https://github.com/tgstation/tgstation/pull/75018 for the out of
bounds fix in lighting
- https://github.com/tgstation/TerraGov-Marine-Corps/pull/6678 for the
emissives (TiviPlus)

The main driving reason behind this is that current lighting consumes
way too much processing power, especially for things like odysseys/away
sites where a billion light sources are processing/moving at once and
the game slows down to a crawl. Hopefully this improves the situation by
a good margin, but we will need some testmerging to confirm that.
<img width="1349" height="1349" alt="image"
src="https://github.com/user-attachments/assets/1059ba2b-c0c5-495a-9c76-2d75d0c42bf2"
/>
<img width="1349" height="1349" alt="image"
src="https://github.com/user-attachments/assets/9704b0f6-4cf6-4dfd-a6cb-5702ad07d677"
/>


- [x] Resolve todos
- [x] Look into open space fuckery (border objects)

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: JohnWildkins <john.wildkins@gmail.com>
2025-11-04 21:27:42 +00:00

119 lines
5.4 KiB
Plaintext

#define TURF_IS_MIMICING(T) (isturf(T) && (T:z_flags & ZM_MIMIC_BELOW))
#define CHECK_OO_EXISTENCE(OO) if (OO && !TURF_IS_MIMICING(OO.loc)) { qdel(OO); }
#define UPDATE_OO_IF_PRESENT CHECK_OO_EXISTENCE(bound_overlay); if (bound_overlay) { update_above(); }
// Turf MZ flags.
#define ZM_MIMIC_BELOW 1 // If this turf should mimic the turf on the Z below.
#define ZM_MIMIC_OVERWRITE 2 // If this turf is Z-mimicing, overwrite the turf's appearance instead of using a movable. This is faster, but means the turf cannot have its own appearance (say, edges or a translucent sprite).
#define ZM_ALLOW_ATMOS 4 // If this turf permits passage of air.
#define ZM_MIMIC_NO_AO 8 // If the turf shouldn't apply regular turf AO and only do Z-mimic AO.
#define ZM_NO_OCCLUDE 16 // Don't occlude below atoms if we're a non-mimic z-turf.
#define ZM_MIMIC_BASETURF 32 // We dont want to show space, we want to show the base turf of the area (for stuff like glass floors)
// Movable flags.
#define ZMM_IGNORE 1 //! Do not copy this movable.
// Convenience flag.
#define ZM_MIMIC_DEFAULTS (ZM_MIMIC_BELOW)
// For debug purposes, should contain the above defines in ascending order.
GLOBAL_LIST_INIT(mimic_defines, list("ZM_MIMIC_BELOW",
"ZM_MIMIC_OVERWRITE",
// "ZM_ALLOW_LIGHTING", //Exists on Nebula, but not Aurora?
"ZM_ALLOW_ATMOS",
"ZM_MIMIC_NO_AO",
"ZM_NO_OCCLUDE",
"ZM_MIMIC_BASETURF"))
///EMP will protect itself.
#define EMP_PROTECT_SELF (1<<0)
///EMP will protect the contents from also being EMPed.
#define EMP_PROTECT_CONTENTS (1<<1)
///EMP will protect the wires.
#define EMP_PROTECT_WIRES (1<<2)
///Protects against all EMP types.
#define EMP_PROTECT_ALL (EMP_PROTECT_SELF | EMP_PROTECT_CONTENTS | EMP_PROTECT_WIRES)
// Flags bitmask
/// If a dense atom (potentially) only blocks movements from a given direction, i.e. window panes
#define ATOM_FLAG_CHECKS_BORDER FLAG(1)
/// Used for atoms if they don't want to get a blood overlay.
#define ATOM_FLAG_NO_BLOOD FLAG(2)
/// Reagents do not react in this containers
#define ATOM_FLAG_NO_REACT FLAG(3)
/// Is an open container for chemistry purposes
#define ATOM_FLAG_OPEN_CONTAINER FLAG(4)
/// Reagent container that can pour its contents with a lid on.
#define ATOM_FLAG_POUR_CONTAINER FLAG(5)
/// Should we use the initial icon for display? Mostly used by overlay only objects
#define ATOM_FLAG_HTML_USE_INITIAL_ICON FLAG(6)
/// If a dense atom like a platform does not allow movement through it like a window pane BUT allows pickup.
#define ATOM_FLAG_ALWAYS_ALLOW_PICKUP FLAG(7)
/// A reagent container that can dispense when being attacked by another container.
#define ATOM_FLAG_DISPENSER FLAG(8)
#define ATOM_AWAITING_OVERLAY_UPDATE FLAG(10)
// Movable flags.
/// Does this object require proximity checking in Enter()?
#define MOVABLE_FLAG_PROXMOVE FLAG(1)
///Is this an effect that should move?
#define MOVABLE_FLAG_EFFECTMOVE FLAG(2)
///Shuttle transition will delete this.
#define MOVABLE_FLAG_DEL_SHUTTLE FLAG(3)
// Atom flags
/// Use when this shouldn't be obscured by large icons.
#define CRITICAL_ATOM FLAG(20)
// Obj flags
/// Can this object be rotated?
#define OBJ_FLAG_ROTATABLE FLAG(0)
/// This object can be rotated even while anchored
#define OBJ_FLAG_ROTATABLE_ANCHORED FLAG(1)
/// Can this take a signaler? only in use for machinery
#define OBJ_FLAG_SIGNALER FLAG(2)
/// Will prevent mobs from falling
#define OBJ_FLAG_NOFALL FLAG(3)
/// Object moves with shuttle transition even if turf below is a background turf.
#define OBJ_FLAG_MOVES_UNSUPPORTED FLAG(4)
#define OBJ_FLAG_CONDUCTABLE FLAG(5)
// Item flags
/// When an item has this it produces no "X has been hit by Y with Z" message with the default handler.
#define ITEM_FLAG_NO_BLUDGEON FLAG(0)
/// Does not get contaminated by phoron.
#define ITEM_FLAG_PHORON_GUARD FLAG(1)
/// Prevents syringes, parapens and hyposprays if equiped to slot_suit or slot_head.
#define ITEM_FLAG_THICK_MATERIAL FLAG(2)
/// Functions with internals
#define ITEM_FLAG_AIRTIGHT FLAG(3)
///Prevents from slipping on wet floors, in space, etc.
#define ITEM_FLAG_NO_SLIP FLAG(4)
/// Blocks the effect that chemical clouds would have on a mob -- glasses, mask and helmets ONLY! (NOTE: flag shared with ONESIZEFITSALL)
#define ITEM_FLAG_BLOCK_GAS_SMOKE_EFFECT FLAG(5)
/// At the moment, masks with this flag will not prevent eating even if they are covering your face.
#define ITEM_FLAG_FLEXIBLE_MATERIAL FLAG(6)
/// Allows syringes and hyposprays to inject, even if the material is thick
#define ITEM_FLAG_INJECTION_PORT FLAG(7)
/// When applied to footwear, this makes it so that they don't trigger things like landmines and mouse traps
#define ITEM_FLAG_LIGHT_STEP FLAG(8)
/// whether wearing this item will protect you from loud noises such as flashbangs | this only works for ear slots or the head slot
#define ITEM_FLAG_SOUND_PROTECTION FLAG(9)
/// won't block flavourtext when worn on equipment slot
#define ITEM_FLAG_SHOW_FLAVOR_TEXT FLAG(10)
/// Uses the special held maptext system, which sets a specific maptext if the item is in possession of a mob.
#define ITEM_FLAG_HELD_MAP_TEXT FLAG(11)
/// Cannot be moved from its current inventory slot. Mostly for augments, modules, and other "attached" items.
#define ITEM_FLAG_NO_MOVE FLAG(12)
/// Can be used for surgery, giving the "You're not sure what you can do with this." message if no surgery is available.
#define ITEM_FLAG_SURGERY FLAG(13)
///All the cardinal direction bitflags.
#define ALL_CARDINALS (NORTH|SOUTH|EAST|WEST)