Remove argument

This commit is contained in:
Gwilym Kuiper 2022-04-05 23:43:35 +01:00
parent f3c467c2f1
commit a0013096cc
3 changed files with 4 additions and 5 deletions

View file

@ -36,8 +36,7 @@ fn main(mut gba: agb::Gba) -> ! {
vram.remove_dynamic_tile(background_tile); vram.remove_dynamic_tile(background_tile);
FONT.render_text( FONT.render_text(
0, (0u16, 3u16).into(),
3,
"Hello, World!\nThis is a font rendering example", "Hello, World!\nThis is a font rendering example",
1, 1,
2, 2,

Binary file not shown.

View file

@ -1,3 +1,4 @@
use crate::fixnum::Vector2D;
use crate::hash_map::HashMap; use crate::hash_map::HashMap;
use super::tiled::{RegularMap, TileSetting, VRamManager}; use super::tiled::{RegularMap, TileSetting, VRamManager};
@ -54,8 +55,7 @@ impl Font {
impl Font { impl Font {
pub fn render_text( pub fn render_text(
&self, &self,
tile_x: u16, tile_pos: Vector2D<u16>,
tile_y: u16,
text: &str, text: &str,
foreground_colour: u8, foreground_colour: u8,
background_colour: u8, background_colour: u8,
@ -115,7 +115,7 @@ impl Font {
for ((x, y), tile) in tiles.into_iter() { for ((x, y), tile) in tiles.into_iter() {
bg.set_tile( bg.set_tile(
vram_manager, vram_manager,
(tile_x + x as u16, tile_y + y as u16).into(), (tile_pos.x + x as u16, tile_pos.y + y as u16).into(),
&tile.tile_set(), &tile.tile_set(),
TileSetting::from_raw(tile.tile_index()), TileSetting::from_raw(tile.tile_index()),
); );