pub struct GfxRuntime {
pub current_layer: i32,
/* private fields */
}Fields§
§current_layer: i32Current logical layer number selected by named commands (LAYER/LAYER_SET). Used as a default for CHR/object operations when scripts omit an explicit layer.
Implementations§
Source§impl GfxRuntime
impl GfxRuntime
pub fn new() -> Self
Sourcepub fn ensure_stage_layer_id(
&mut self,
layers: &mut LayerManager,
stage: i64,
) -> Option<LayerId>
pub fn ensure_stage_layer_id( &mut self, layers: &mut LayerManager, stage: i64, ) -> Option<LayerId>
Expose stage layer allocation for non-Gfx backends (e.g., movie sprites).
pub fn debug_object_snapshot( &self, stage: usize, obj_idx: usize, ) -> Option<DebugObjectSpriteBinding>
pub fn object_sprite_binding( &self, stage: i64, obj_idx: i64, ) -> Option<(LayerId, SpriteId)>
pub fn object_set_center( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, x: i64, y: i64, ) -> Result<()>
pub fn object_set_scale( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, x: i64, y: i64, ) -> Result<()>
pub fn object_set_rotate( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, z: i64, ) -> Result<()>
pub fn object_set_clip( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, use_flag: i64, left: i64, top: i64, right: i64, bottom: i64, ) -> Result<()>
pub fn object_set_src_clip( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, use_flag: i64, left: i64, top: i64, right: i64, bottom: i64, ) -> Result<()>
pub fn stage_clear( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, ) -> Result<()>
pub fn object_create( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, file: &str, disp: i64, x: i64, y: i64, patno: i64, ) -> Result<()>
Sourcepub fn restore_gfx_object_from_globals(
&mut self,
images: &mut ImageManager,
layers: &mut LayerManager,
stage: i64,
obj_idx: i64,
src: &ObjectState,
) -> Result<()>
pub fn restore_gfx_object_from_globals( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, src: &ObjectState, ) -> Result<()>
Mirror of C++ C_elm_object::restruct_pct (and the restruct_type
dispatch around it) executed at the tail of C_elm_object::load. After
a save-file load, the per-object gfx runtime (sprite binding, image
asset, transform/color state) is empty - the saved stream restores
globals::ObjectState but the rendering side has no equivalent storage
in the save format. This rebuilds the gfx side from the loaded globals
so the next render frame sees the same picture the save captured.
Caller filters: only invoke for Gfx-backed objects whose file_name is
non-empty; everything else (mesh, movie, weather, number, string) needs
its own backend-specific path and is no-op here.
pub fn object_change_file( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, file: &str, disp: i64, x: i64, y: i64, patno: i64, ) -> Result<()>
pub fn object_create_mesh( &mut self, layers: &mut LayerManager, stage: i64, obj_idx: i64, file: &str, disp: i64, x: i64, y: i64, patno: i64, ) -> Result<()>
pub fn object_set_disp( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, disp: i64, ) -> Result<()>
pub fn object_set_pos( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, x: i64, y: i64, ) -> Result<()>
pub fn object_set_x( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, x: i64, ) -> Result<()>
pub fn object_set_y( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, y: i64, ) -> Result<()>
pub fn object_set_patno( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, patno: i64, ) -> Result<()>
pub fn object_set_layer( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, layer_no: i64, ) -> Result<()>
pub fn object_set_order( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, order: i64, ) -> Result<()>
pub fn object_set_alpha( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, alpha: i64, ) -> Result<()>
pub fn object_set_tr( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, tr: i64, ) -> Result<()>
pub fn object_set_mono( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, mono: i64, ) -> Result<()>
pub fn object_set_reverse( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, reverse: i64, ) -> Result<()>
pub fn object_set_bright( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, bright: i64, ) -> Result<()>
pub fn object_set_dark( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, dark: i64, ) -> Result<()>
pub fn object_set_color_rate( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, rate: i64, ) -> Result<()>
pub fn object_set_color_add( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, r: i64, g: i64, b: i64, ) -> Result<()>
pub fn object_set_color( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, r: i64, g: i64, b: i64, ) -> Result<()>
pub fn object_set_blend( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, blend: i64, ) -> Result<()>
pub fn object_set_light_no( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, light_no: i64, ) -> Result<()>
pub fn object_set_fog_use( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, fog_use: i64, ) -> Result<()>
pub fn object_set_z(&mut self, stage: i64, obj_idx: i64, z: i64) -> Result<()>
pub fn object_clear( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, ) -> Result<()>
pub fn clear_objects_in_layer_no( &mut self, images: &mut ImageManager, layers: &mut LayerManager, layer_no: i64, ) -> Result<()>
pub fn object_get_pos(&self, stage: i64, obj_idx: i64) -> Option<(i64, i64)>
pub fn object_get_disp(&self, stage: i64, obj_idx: i64) -> Option<bool>
pub fn object_get_patno(&self, stage: i64, obj_idx: i64) -> Option<i64>
pub fn object_get_layer(&self, stage: i64, obj_idx: i64) -> Option<i64>
pub fn object_get_order(&self, stage: i64, obj_idx: i64) -> Option<i64>
pub fn object_get_alpha(&self, stage: i64, obj_idx: i64) -> Option<i64>
pub fn object_set_pat_no( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, patno: i64, ) -> Result<()>
pub fn object_peek_pos(&self, stage: i64, obj_idx: i64) -> Option<(i64, i64)>
pub fn object_peek_disp(&self, stage: i64, obj_idx: i64) -> Option<i64>
pub fn object_peek_patno(&self, stage: i64, obj_idx: i64) -> Option<i64>
pub fn object_peek_layer(&self, stage: i64, obj_idx: i64) -> Option<i64>
pub fn object_peek_order(&self, stage: i64, obj_idx: i64) -> Option<i64>
pub fn object_peek_alpha(&self, stage: i64, obj_idx: i64) -> Option<i64>
pub fn object_peek_file(&self, stage: i64, obj_idx: i64) -> Option<String>
Trait Implementations§
Source§impl Debug for GfxRuntime
impl Debug for GfxRuntime
Auto Trait Implementations§
impl Freeze for GfxRuntime
impl RefUnwindSafe for GfxRuntime
impl Send for GfxRuntime
impl Sync for GfxRuntime
impl Unpin for GfxRuntime
impl UnsafeUnpin for GfxRuntime
impl UnwindSafe for GfxRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.