Implement get_draw_layer API function
This commit is contained in:
1 parent
749dd69589
commit
e3288b96ac
2 files changed
+8
-2
No files matched your search
@@ -69,6 +69,10 @@ impl DrawCommandRecorder {
|
||||
self.set_draw_layer(self.current_layer.0, sublayer);
|
||||
}
|
||||
|
||||
pub fn get_draw_layer(&self) -> (i32, i32) {
|
||||
self.current_layer
|
||||
}
|
||||
|
||||
pub fn set_draw_color(&mut self, color: Srgba) {
|
||||
self.current_draw_color = color;
|
||||
}
|
||||
|
||||
@@ -255,8 +255,10 @@ pub unsafe extern "C-unwind" fn draw_image_quad(state: *mut ffi::lua_State) -> c
|
||||
0
|
||||
}
|
||||
|
||||
pub fn get_draw_layer(_: &Lua, _: ()) -> LuaResult<()> {
|
||||
unimplemented!()
|
||||
pub fn get_draw_layer(l: &Lua, _: ()) -> LuaResult<i32> {
|
||||
let ctx = l.app_data_ref::<Context>().unwrap();
|
||||
// matching PoB's behavior where only the sublayer is returned
|
||||
Ok(ctx.recorder.get_draw_layer().1)
|
||||
}
|
||||
|
||||
pub fn set_blend_mode(_: &Lua, _: ()) -> LuaResult<()> {
|
||||
|
||||
Reference in new issue
Block a user