mirror of
https://github.com/SpaceManiac/SpacemanDMM.git
synced 2025-12-23 05:36:47 +00:00
Fix APC terminal layering
This commit is contained in:
parent
0003604d1c
commit
8fc31897d2
2 changed files with 13 additions and 9 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue