[][src]Struct thorium::dmg_render::DMGOAMEntry

pub struct DMGOAMEntry {
    pub xm8: u8,
    pub ym16: u8,
    pub tile_id: u8,
    pub display_behind_bg_win_13: bool,
    pub vflip: bool,
    pub hflip: bool,
    pub use_high_palette: bool,
}

An individual entry within the DMG OAM.

Fields

xm8: u8

X-8 of the object (viewport relative).

Objects are 8 pixels wide, so if you use 0 here then the object will be all the way off the left of the screen.

ym16: u8

Y-16 of the object (viewport relative).

Objects are 8 or 16 pixels tall, so if this value is low enough the object will be all the way above the screen.

tile_id: u8

The tile index for this object.

Objects always index from the base of block 0 of the VRAM. If objects are set for "tall" mode, then the least bit is ignored and the upper part of the object will be the even index of the tile pair (tile_id & 0xFE) and the lower part of the object will be the odd index (tile_id | 0x01).

display_behind_bg_win_13: bool

Causes this object to be "behind" non-zero-index background/win pixels.

If this flag is enabled wherever the pixel from the background or window comes from indexes 1, 2, or 3 then the object won't get to use its pixel. If this flag is disabled then the object overrides the base index all the time.

vflip: bool

Flip the object vertically.

hflip: bool

Flip the object horizontally.

use_high_palette: bool

If the object should use the high bank for palette translation.

Methods

impl DMGOAMEntry[src]

pub fn screen_left_top(&self) -> (u8, u8)[src]

Obtains the left and top position of the object in screen space.

pub fn get_pixel(
    &self,
    screen_x: u8,
    screen_y: u8,
    memory: &DMGTileMemory,
    tall: bool
) -> u8
[src]

Obtains the pixel from this object on the screen.

Panics

If the screen_x or screen_y are out of bounds this will panic

Trait Implementations

impl Clone for DMGOAMEntry[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for DMGOAMEntry[src]

impl Debug for DMGOAMEntry[src]

Auto Trait Implementations

impl Send for DMGOAMEntry

impl Sync for DMGOAMEntry

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]