From 68b5ce87bc6b40e2b3d575e1150050bbcc954f17 Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Fri, 22 Jun 2018 14:51:12 -0400 Subject: Fonts are now stored in BitmapManager, and can be accessed with 'get_font' --- src/gl_renderer.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/gl_renderer.rs') diff --git a/src/gl_renderer.rs b/src/gl_renderer.rs index 97ecc86..64f9151 100644 --- a/src/gl_renderer.rs +++ b/src/gl_renderer.rs @@ -19,25 +19,15 @@ extern crate simple_error; use std::error::Error; -use bitmap::{Bitmap, load_font}; -use grp::GroupManager; +use bitmap::BitmapManager; /// Renderer using the OpenGL library. pub struct GLRenderer; impl GLRenderer { /// Instantiate a new instance of the renderer. - pub fn new(groups: &GroupManager) -> Result> { - let tables = match groups.get("TABLES.DAT") { - Some(tables) => tables, - None => bail!("GRP does not contain a TABLES.DAT"), - }; - - // TODO: Separate bitmaps for textfont and smalltextfont? - let data = &tables[5376..7424]; - - // TODO: The BitmapManager should maintain the font. - let _font: Bitmap = load_font(data); + pub fn new(bitmaps: &BitmapManager) -> Result> { + let _font = bitmaps.get_font("textfont").unwrap(); Ok(GLRenderer { }) } -- cgit v1.3