plane_master
Vars | |
alpha_enabled | Tracks if we're using our true alpha, or being manipulated in some other way |
---|---|
blend_mode_override | blend mode to apply to the render relay in case you dont want to use the plane_masters blend_mode |
critical | Bitfield that describes how this plane master will render if its z layer is being "optimized" If a plane master is NOT critical, it will be completely dropped if we start to render outside a client's multiz boundary prefs Of note: most of the time we will relay renders to non critical planes in this stage. so the plane master will end up drawing roughly "in order" with its friends This is NOT done for parallax and other problem children, because the rules of BLEND_MULTIPLY appear to not behave as expected :( This will also just make debugging harder, because we do fragile things in order to ensure things operate as epected. I'm sorry Compile time See code__DEFINES\layers.dm for our bitflags |
documentation | Will be sent to the debug ui as a description for each plane Also useful as a place to explain to coders how/why your plane works, and what it's meant to do Plaintext and basic html are fine to use here. I'll bonk you if I find you putting "lmao stuff" in here, make this useful. |
force_hidden | If this plane master is being forced to hide. Hidden PMs will dump ANYTHING relayed or drawn onto them. Be careful with this Remember: a hidden plane master will dump anything drawn directly to it onto the output render. It does NOT hide its contents Use alpha for that |
home | The plane master group we're a member of, our "home" |
is_outside_bounds | If this plane master is outside of our visual bounds right now |
multiz_scaled | If this plane should be scaled by multiz Planes with this set should NEVER be relay'd into each other, as that will cause visual fuck |
offset | Our offset from our "true" plane, see below |
offsetting_flags | If our plane master has different offsetting logic Possible flags are defined in [_DEFINES/layers.dm] |
real_plane | When rendering multiz, lower levels get their own set of plane masters Real plane here represents the "true" plane value of something, ignoring the offset required to handle lower levels |
relays | list of current relays this plane is utilizing to render |
relays_generated | if render relays have already be generated |
render_relay_planes | list of planes we will relay this plane's render to |
start_hidden | If this plane master should be hidden from the player at roundstart We do this so PMs can opt into being temporary, to reduce load on clients |
true_alpha | Our real alpha value, so alpha can persist through being hidden/shown |
Procs | |
add_relay_to | Creates a connection between this plane master and the passed in plane Helper for out of system code, shouldn't be used in this file Build system to differenchiate between generated and non generated render relays |
check_outside_bounds | Hook to allow planes to work around is_outside_bounds Return false to allow a show, true otherwise |
generate_render_relays | Plane master proc called in Initialize() that creates relay objects, and sets them up as needed Sets: |
get_relay_to | Gets the relay atom we're using to connect to the target plane, if one exists |
hide_from | Hides a plane master from the passeed in mob Do your effect cleanup here |
hide_plane | Forces this plane master to hide, until unhide_plane is called This allows us to disable unused PMs without breaking anything else |
mirror_parent_hidden | Mirrors our force hidden state to the hidden state of the plane that came before, assuming it's valid This allows us to mirror any hidden sets from before we were created, no matter how low that chance is |
offset_relay | Offsets a given render relay using the given parameter by adjusting its plane and layer values, avoiding changing the layer if it has a custom-set layer. |
offset_relays_in_place | Offsets our relays in place using the given parameter by adjusting their plane and layer values, avoiding changing the layer for relays with custom-set layers. |
remove_relay_from | Breaks a connection between this plane master, and the passed in place |
set_home | Sets the plane group that owns us, it also determines what screen we render to Returns FALSE if the set_home fails, TRUE otherwise |
show_to | Shows a plane master to the passed in mob Override this to apply unique effects and such Returns TRUE if the call is allowed, FALSE otherwise |
unhide_plane | Disables any forced hiding, allows the plane master to be used as normal |
update_offset | Updates our "offset", basically what layer of multiz we're meant to render Top is 0, goes up as you go down It's taken into account by render targets and relays, so we gotta make sure they're on the same page |
Var Details
alpha_enabled
Tracks if we're using our true alpha, or being manipulated in some other way
blend_mode_override
blend mode to apply to the render relay in case you dont want to use the plane_masters blend_mode
critical
Bitfield that describes how this plane master will render if its z layer is being "optimized" If a plane master is NOT critical, it will be completely dropped if we start to render outside a client's multiz boundary prefs Of note: most of the time we will relay renders to non critical planes in this stage. so the plane master will end up drawing roughly "in order" with its friends This is NOT done for parallax and other problem children, because the rules of BLEND_MULTIPLY appear to not behave as expected :( This will also just make debugging harder, because we do fragile things in order to ensure things operate as epected. I'm sorry Compile time See code__DEFINES\layers.dm for our bitflags
documentation
Will be sent to the debug ui as a description for each plane Also useful as a place to explain to coders how/why your plane works, and what it's meant to do Plaintext and basic html are fine to use here. I'll bonk you if I find you putting "lmao stuff" in here, make this useful.
force_hidden
If this plane master is being forced to hide. Hidden PMs will dump ANYTHING relayed or drawn onto them. Be careful with this Remember: a hidden plane master will dump anything drawn directly to it onto the output render. It does NOT hide its contents Use alpha for that
home
The plane master group we're a member of, our "home"
is_outside_bounds
If this plane master is outside of our visual bounds right now
multiz_scaled
If this plane should be scaled by multiz Planes with this set should NEVER be relay'd into each other, as that will cause visual fuck
offset
Our offset from our "true" plane, see below
offsetting_flags
If our plane master has different offsetting logic Possible flags are defined in [_DEFINES/layers.dm]
real_plane
When rendering multiz, lower levels get their own set of plane masters Real plane here represents the "true" plane value of something, ignoring the offset required to handle lower levels
relays
list of current relays this plane is utilizing to render
relays_generated
if render relays have already be generated
render_relay_planes
list of planes we will relay this plane's render to
start_hidden
If this plane master should be hidden from the player at roundstart We do this so PMs can opt into being temporary, to reduce load on clients
true_alpha
Our real alpha value, so alpha can persist through being hidden/shown
Proc Details
add_relay_to
Creates a connection between this plane master and the passed in plane Helper for out of system code, shouldn't be used in this file Build system to differenchiate between generated and non generated render relays
check_outside_bounds
Hook to allow planes to work around is_outside_bounds Return false to allow a show, true otherwise
generate_render_relays
Plane master proc called in Initialize() that creates relay objects, and sets them up as needed Sets:
- layer from plane to avoid z-fighting
- planes to relay the render to
- render_source so that the plane will render on these objects
- mouse opacity to ensure proper mouse hit tracking
- name for debugging purposes Other vars such as alpha will automatically be applied with the render source
get_relay_to
Gets the relay atom we're using to connect to the target plane, if one exists
hide_from
Hides a plane master from the passeed in mob Do your effect cleanup here
hide_plane
Forces this plane master to hide, until unhide_plane is called This allows us to disable unused PMs without breaking anything else
mirror_parent_hidden
Mirrors our force hidden state to the hidden state of the plane that came before, assuming it's valid This allows us to mirror any hidden sets from before we were created, no matter how low that chance is
offset_relay
Offsets a given render relay using the given parameter by adjusting its plane and layer values, avoiding changing the layer if it has a custom-set layer.
Parameters:
- rpr: the render plane relay we will offset
- new_offset: the offset we will adjust it by
offset_relays_in_place
Offsets our relays in place using the given parameter by adjusting their plane and layer values, avoiding changing the layer for relays with custom-set layers.
Used in [proc/build_planes_offset] to make the relays for non-offsetting planes match the highest rendering plane that matches the target, to avoid them rendering on the highest level above things that should be visible.
Parameters:
- new_offset: the offset we will adjust our relays to
remove_relay_from
Breaks a connection between this plane master, and the passed in place
set_home
Sets the plane group that owns us, it also determines what screen we render to Returns FALSE if the set_home fails, TRUE otherwise
show_to
Shows a plane master to the passed in mob Override this to apply unique effects and such Returns TRUE if the call is allowed, FALSE otherwise
unhide_plane
Disables any forced hiding, allows the plane master to be used as normal
update_offset
Updates our "offset", basically what layer of multiz we're meant to render Top is 0, goes up as you go down It's taken into account by render targets and relays, so we gotta make sure they're on the same page