Fix APC terminal layering

This commit is contained in:
Tad Hardesty 2019-11-16 18:34:23 -08:00
parent 0003604d1c
commit 8fc31897d2
2 changed files with 13 additions and 9 deletions

View file

@ -176,11 +176,11 @@ pub fn generate(ctx: Context, icon_cache: &IconCache) -> Result<Image, ()> {
}
// APC terminals
if atom.istype("/obj/machinery/power/apc/") {
let mut terminal = Sprite::from_vars(objtree, &objtree.expect("/obj/machinery/power/terminal"));
terminal.dir = atom.sprite.dir;
underlays.push(terminal);
}
let mut terminal = Sprite::from_vars(objtree, &objtree.expect("/obj/machinery/power/terminal"));
terminal.dir = atom.sprite.dir;
// TODO: un-hack this
::render_passes::apply_fancy_layer("/obj/machinery/power/terminal", &mut terminal);
underlays.push(terminal);
}
for pass in render_passes {

View file

@ -280,10 +280,7 @@ impl RenderPass for FancyLayers {
sprite: &mut Sprite<'a>,
_: &'a ObjectTree,
) {
sprite.plane = 0;
if let Some(layer) = fancy_layer_for_path(atom.get_path()) {
sprite.layer = layer;
}
apply_fancy_layer(atom.get_path(), sprite)
}
}
@ -315,3 +312,10 @@ fn fancy_layer_for_path(p: &str) -> Option<i32> {
return None
})
}
pub fn apply_fancy_layer(path: &str, sprite: &mut Sprite) {
sprite.plane = 0;
if let Some(layer) = fancy_layer_for_path(path) {
sprite.layer = layer;
}
}