Skip to main content

GfxRuntime

Struct GfxRuntime 

Source
pub struct GfxRuntime {
    pub current_layer: i32,
    /* private fields */
}

Fields§

§current_layer: i32

Current 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

Source

pub fn new() -> Self

Source

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).

Source

pub fn debug_object_snapshot( &self, stage: usize, obj_idx: usize, ) -> Option<DebugObjectSpriteBinding>

Source

pub fn object_sprite_binding( &self, stage: i64, obj_idx: i64, ) -> Option<(LayerId, SpriteId)>

Source

pub fn object_set_center( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, x: i64, y: i64, ) -> Result<()>

Source

pub fn object_set_scale( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, x: i64, y: i64, ) -> Result<()>

Source

pub fn object_set_rotate( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, z: i64, ) -> Result<()>

Source

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<()>

Source

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<()>

Source

pub fn stage_clear( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, ) -> Result<()>

Source

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<()>

Source

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.

Source

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<()>

Source

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<()>

Source

pub fn object_set_disp( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, disp: i64, ) -> Result<()>

Source

pub fn object_set_pos( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, x: i64, y: i64, ) -> Result<()>

Source

pub fn object_set_x( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, x: i64, ) -> Result<()>

Source

pub fn object_set_y( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, y: i64, ) -> Result<()>

Source

pub fn object_set_patno( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, patno: i64, ) -> Result<()>

Source

pub fn object_set_layer( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, layer_no: i64, ) -> Result<()>

Source

pub fn object_set_order( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, order: i64, ) -> Result<()>

Source

pub fn object_set_alpha( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, alpha: i64, ) -> Result<()>

Source

pub fn object_set_tr( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, tr: i64, ) -> Result<()>

Source

pub fn object_set_mono( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, mono: i64, ) -> Result<()>

Source

pub fn object_set_reverse( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, reverse: i64, ) -> Result<()>

Source

pub fn object_set_bright( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, bright: i64, ) -> Result<()>

Source

pub fn object_set_dark( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, dark: i64, ) -> Result<()>

Source

pub fn object_set_color_rate( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, rate: i64, ) -> Result<()>

Source

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<()>

Source

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<()>

Source

pub fn object_set_blend( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, blend: i64, ) -> Result<()>

Source

pub fn object_set_light_no( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, light_no: i64, ) -> Result<()>

Source

pub fn object_set_fog_use( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, fog_use: i64, ) -> Result<()>

Source

pub fn object_set_z(&mut self, stage: i64, obj_idx: i64, z: i64) -> Result<()>

Source

pub fn object_clear( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, ) -> Result<()>

Source

pub fn clear_objects_in_layer_no( &mut self, images: &mut ImageManager, layers: &mut LayerManager, layer_no: i64, ) -> Result<()>

Source

pub fn object_get_pos(&self, stage: i64, obj_idx: i64) -> Option<(i64, i64)>

Source

pub fn object_get_disp(&self, stage: i64, obj_idx: i64) -> Option<bool>

Source

pub fn object_get_patno(&self, stage: i64, obj_idx: i64) -> Option<i64>

Source

pub fn object_get_layer(&self, stage: i64, obj_idx: i64) -> Option<i64>

Source

pub fn object_get_order(&self, stage: i64, obj_idx: i64) -> Option<i64>

Source

pub fn object_get_alpha(&self, stage: i64, obj_idx: i64) -> Option<i64>

Source

pub fn object_set_pat_no( &mut self, images: &mut ImageManager, layers: &mut LayerManager, stage: i64, obj_idx: i64, patno: i64, ) -> Result<()>

Source

pub fn object_peek_pos(&self, stage: i64, obj_idx: i64) -> Option<(i64, i64)>

Source

pub fn object_peek_disp(&self, stage: i64, obj_idx: i64) -> Option<i64>

Source

pub fn object_peek_patno(&self, stage: i64, obj_idx: i64) -> Option<i64>

Source

pub fn object_peek_layer(&self, stage: i64, obj_idx: i64) -> Option<i64>

Source

pub fn object_peek_order(&self, stage: i64, obj_idx: i64) -> Option<i64>

Source

pub fn object_peek_alpha(&self, stage: i64, obj_idx: i64) -> Option<i64>

Source

pub fn object_peek_file(&self, stage: i64, obj_idx: i64) -> Option<String>

Trait Implementations§

Source§

impl Debug for GfxRuntime

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GfxRuntime

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,