Yogstation 13 - Modules - TypesDefine Details

code/__HELPERS/_planes.dm

SET_PLANETakes an atom to change the plane of, a new plane value, and something that can be used as a reference to a z level as input Modifies the new value to match the plane we actually want. Note, if you pass in an already offset plane the offsets will add up Use PLANE_TO_TRUE() to avoid this
MUTATE_PLANETakes a plane and a z reference, and offsets the plane by the mutation The SSmapping.max_plane_offset bit here is technically redundant, but saves a bit of work in the base case And the base case is important to me. Non multiz shouldn't get hit too bad by this code
GET_TURF_PLANE_OFFSETTakes a z reference that we are unsure of, sanity checks it Returns either its offset, or 0 if it's not a valid ref Will return the reference's PLANE'S offset if we can't get anything out of the z level. We do our best
GET_Z_PLANE_OFFSETEssentially just an unsafe version of GET_TURF_PLANE_OFFSET() Takes a z value we returns its offset with a list lookup Will runtime during parts of init. Be careful :)
GET_NEW_PLANETakes a plane to offset, and the multiplier to use, and well, does the offsetting Respects a blacklist we use to remove redundant plane masters, such as hud objects
SET_PLANE_W_SCALARTakes an object, new plane, and multipler, and offsets the plane This is for cases where you have a multipler precalculated, and just want to use it Often an optimization, sometimes a necessity
SET_PLANE_IMPLICITImplicit plane set. We take the turf from the object we're changing the plane of, and use ITS z as a spokesperson for our plane value
GET_LOWEST_STACK_OFFSETTakes a z level, gets the lowest plane offset in its "stack"
PLANE_TO_TRUETakes a plane, returns the canonical, unoffset plane it represents
PLANE_TO_OFFSETTakes a plane, returns the offset it uses
PLANE_IS_CRITICALTakes a plane, returns TRUE if it is of critical priority, FALSE otherwise
TRUE_PLANE_TO_OFFSETSTakes a true plane, returns the offset planes that would canonically represent it
OFFSET_RENDER_TARGETTakes a render target and an offset, returns a canonical render target string for it
_OFFSET_RENDER_TARGETHelper macro for the above Honestly just exists to make the pattern of render target strings more readable

Define Details

GET_LOWEST_STACK_OFFSET

Takes a z level, gets the lowest plane offset in its "stack"

GET_NEW_PLANE

Takes a plane to offset, and the multiplier to use, and well, does the offsetting Respects a blacklist we use to remove redundant plane masters, such as hud objects

GET_TURF_PLANE_OFFSET

Takes a z reference that we are unsure of, sanity checks it Returns either its offset, or 0 if it's not a valid ref Will return the reference's PLANE'S offset if we can't get anything out of the z level. We do our best

GET_Z_PLANE_OFFSET

Essentially just an unsafe version of GET_TURF_PLANE_OFFSET() Takes a z value we returns its offset with a list lookup Will runtime during parts of init. Be careful :)

MUTATE_PLANE

Takes a plane and a z reference, and offsets the plane by the mutation The SSmapping.max_plane_offset bit here is technically redundant, but saves a bit of work in the base case And the base case is important to me. Non multiz shouldn't get hit too bad by this code

OFFSET_RENDER_TARGET

Takes a render target and an offset, returns a canonical render target string for it

PLANE_IS_CRITICAL

Takes a plane, returns TRUE if it is of critical priority, FALSE otherwise

PLANE_TO_OFFSET

Takes a plane, returns the offset it uses

PLANE_TO_TRUE

Takes a plane, returns the canonical, unoffset plane it represents

SET_PLANE

Takes an atom to change the plane of, a new plane value, and something that can be used as a reference to a z level as input Modifies the new value to match the plane we actually want. Note, if you pass in an already offset plane the offsets will add up Use PLANE_TO_TRUE() to avoid this

SET_PLANE_IMPLICIT

Implicit plane set. We take the turf from the object we're changing the plane of, and use ITS z as a spokesperson for our plane value

SET_PLANE_W_SCALAR

Takes an object, new plane, and multipler, and offsets the plane This is for cases where you have a multipler precalculated, and just want to use it Often an optimization, sometimes a necessity

TRUE_PLANE_TO_OFFSETS

Takes a true plane, returns the offset planes that would canonically represent it

_OFFSET_RENDER_TARGET

Helper macro for the above Honestly just exists to make the pattern of render target strings more readable