From 637441239434fabedfe83f5abc1af4232c802f7a Mon Sep 17 00:00:00 2001 From: Genny Date: Thu, 23 Sep 2021 20:33:50 -0500 Subject: Improve API, monocommit, sorry --- src/block/screendescriptor.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/block/screendescriptor.rs') diff --git a/src/block/screendescriptor.rs b/src/block/screendescriptor.rs index ff70896..444b44f 100644 --- a/src/block/screendescriptor.rs +++ b/src/block/screendescriptor.rs @@ -9,6 +9,16 @@ pub struct ScreenDescriptor { } impl ScreenDescriptor { + pub fn new(width: u16, height: u16) -> Self { + Self { + width, + height, + packed: 0, + background_color_index: 0, + pixel_aspect_ratio: 0, + } + } + pub fn set_color_table_present(&mut self, is_present: bool) { if is_present { self.packed |= 0b1000_0000; -- cgit 1.4.1-3-g733a5