Files
Bubberstation/code/modules/unit_tests/plane_double_transform.dm
LemonInTheDark a625fc8038 Cleans up the fallout from plane cube (#70235)
* Cleans up the fallout from plane cube

Alright.
Makes cleaning bubbles respect planes
Adds support for updating overlays on move, fixing an issue with pointing at items
Adds better error messages for failing to provide args for mutable_appearance()
Fixes a bug where string overlays were not respecting insertion order

* Adds documentation for offset spokesman and offset_const

* Better stack trace

* Removes some redundant uses of cached MAs

At this scale, attempting to cache MAs like this has 0 impact on anything
And just makes things more messy then they need to be

* ensures fullscreen objects START offset, so things are always proper

* ensures chatmessages always have the right offset

* fixes compile

* whoops, the above lighting plane should actually be ABOVE the lighting plane

* fixes compile, also cleans up the fire overlay a tad

* Adds a unit test for plane masters that are shrunk by multiz being double shrunk

This is slightly hacky because of how I'm handing the plane master
group, but it's not THAT bad, and gives me some real good coverage

* Properly targets the seethrough plane at the game world plate. This fixes unit tests, and also just makes more sense

* whoops

* oh

* adds datum support for allocate(), cleans up a harddel from testing

* Makes camera chunks index at 1, and also makes them support non powers of two sizes, since that was unneeded

* fixes runtime in allocate
2022-10-20 09:00:02 +13:00

45 lines
2.0 KiB
Plaintext

/// Ensures plane masters that get shrunk by multiz NEVER render into each other
/datum/unit_test/plane_double_transform
/datum/unit_test/plane_double_transform/Run()
// We're going to operate off the actual plane master setup of an actual mob
// It's not perfect, but it'll help things a lot
var/mob/living/carbon/human/judger = allocate(/mob/living/carbon/human)
// Hack to account for not having an actual hud
var/datum/plane_master_group/hudless/our_group = allocate(/datum/plane_master_group/hudless)
our_group.our_mob = judger
our_group.show_hud()
// End hack
// Generates a list of render target -> PM for future use
var/list/render_target_to_plane = list()
for(var/plane_key as anything in our_group.plane_masters)
var/atom/movable/screen/plane_master/plane = our_group.plane_masters[plane_key]
if(plane.render_target)
render_target_to_plane[plane.render_target] = plane
for(var/plane_key as anything in our_group.plane_masters)
var/atom/movable/screen/plane_master/plane = our_group.plane_masters[plane_key]
if(!plane.multiz_scaled)
continue
// Walk the relay targets
for(var/target_plane in plane.render_relay_planes)
var/atom/movable/screen/plane_master/target = our_group.plane_masters["[target_plane]"]
if(target.multiz_scaled)
TEST_FAIL("[plane.type] draws a render relay into [target.type]. Both are scaled by multiz, so this will cause strange transforms.\n\
consider making a new render plate that they can both draw to instead, or something of that nature.")
// Now we walk for filters that take from us
for(var/filter_id in plane.filter_data)
var/list/filter = plane.filter_data[filter_id]
if(!filter["render_source"])
continue
var/atom/movable/screen/plane_master/target = render_target_to_plane[filter["render_source"]]
if(target.multiz_scaled)
TEST_FAIL("[plane.type] draws a render relay into [target.type]. Both are scaled by multiz, so this will cause strange transforms.\n\
consider making a new render plate that they can both draw to instead, or something of that nature.")