Struct ascending_graphics::Map
source · pub struct Map {
pub pos: Vec2,
pub tiles: [TileData; 9216],
pub stores: Vec<Index>,
pub orders: Vec<DrawOrder>,
pub filled_tiles: [u16; 9],
pub tilesize: u32,
pub can_render: bool,
pub changed: bool,
}Fields§
§pos: Vec2X, Y, GroupID for loaded map. Add this to the higher up Map struct. pub world_pos: Vec3, its render position. within the screen.
tiles: [TileData; 9216]§stores: Vec<Index>Store index per each layer.
orders: Vec<DrawOrder>the draw order of the maps. created when update is called.
filled_tiles: [u16; 9]count if any Filled Tiles Exist. this is to optimize out empty maps in rendering.
tilesize: u32§can_render: bool§changed: boolif the position or a tile gets changed.
Implementations§
source§impl Map
impl Map
pub fn create_quad(&mut self, renderer: &mut GpuRenderer, atlas: &mut AtlasSet)
pub fn new(renderer: &mut GpuRenderer, tilesize: u32) -> Self
pub fn get_tile(&self, pos: (u32, u32, u32)) -> TileData
pub fn set_tile(&mut self, pos: (u32, u32, u32), tile: TileData)
sourcepub fn update(
&mut self,
renderer: &mut GpuRenderer,
atlas: &mut AtlasSet
) -> Option<Vec<OrderedIndex>>
pub fn update( &mut self, renderer: &mut GpuRenderer, atlas: &mut AtlasSet ) -> Option<Vec<OrderedIndex>>
used to check and update the vertex array or Texture witht he image buffer.
Auto Trait Implementations§
impl Freeze for Map
impl RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnwindSafe for Map
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
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn 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.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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.source§fn as_any(&self) -> &(dyn Any + 'static)
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.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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.