fn bg_win_color(&self,
                    x: u8,
                    y: u8,
                    map: TileMap,
                    set: TileSet) -> AlphaColor {
        let tile_map_x = x / 8;
        let tile_map_y = y / 8;
        let tile_x     = x % 8;
        let tile_y     = y % 8;

        // The screen is divided in 8x8 pixel tiles. It creates a
        // matrix of 32x32 tiles (As far as the GPU is concerned the
        // screen resolution is 256x256). The tile map contains one u8
        // per tile which is the index of the tile to use in the tile
        // set.
        let tile_index = self.tile_index(tile_map_x, tile_map_y, map);

        let tile_color = self.pix_color(tile_index, tile_x, tile_y, set);

        AlphaColor {
            // Transform tile_color through the palette
            color:  self.bgp.transform(tile_color),
            // The pixel is transparent if the value pre-palette is white
            opaque: tile_color != Color::White,
        }
    }
/// Get one pixel from either the window or the background.
Get one pixel from either the window or the background.
Get one pixel from either the window or the background .
fn bg_win_color(&self,
                    x: u8,
                    y: u8,
                    map: TileMap,
                    set: TileSet) -> AlphaColor {
        let tile_map_x = x / 8;
        let tile_map_y = y / 8;
        let tile_x     = x % 8;
        let tile_y     = y % 8;
        // The screen is divided in 8x8 pixel tiles. It creates a
        // matrix of 32x32 tiles (As far as the GPU is concerned the
        // screen resolution is 256x256). The tile map contains one u8
        // per tile which is the index of the tile to use in the tile
        // set.
        let tile_index = self.tile_index(tile_map_x, tile_map_y, map);
        let tile_color = self.pix_color(tile_index, tile_x, tile_y, set);
        AlphaColor {
            // Transform tile_color through the palette
            color:  self.bgp.transform(tile_color),
            // The pixel is transparent if the value pre-palette is white
            opaque: tile_color != Color::White,
        }
    }
fn bg_win_color ( & self , x : u8 , y : u8 , map : TileMap , set : TileSet ) -> AlphaColor { let tile_map_x = x / 8 ; let tile_map_y = y / 8 ; let tile_x = x % 8 ; let tile_y = y % 8 ; // The screen is divided in 8x8 pixel tiles. It creates a // matrix of 32x32 tiles (As far as the GPU is concerned the // screen resolution is 256x256). The tile map contains one u8 // per tile which is the index of the tile to use in the tile // set. let tile_index = self . tile_index ( tile_map_x , tile_map_y , map ) ; let tile_color = self . pix_color ( tile_index , tile_x , tile_y , set ) ; AlphaColor { // Transform tile_color through the palette color : self . bgp . transform ( tile_color ) , // The pixel is transparent if the value pre-palette is white opaque : tile_color != Color :: White , } }
Get one pixel from either the window or the background.
Get one pixel from either the window or the background .
&self
x
u8
y
u8
map
TileMap
set
TileSet
&self
x
u8
y
u8
map
TileMap
set
TileSet