@@ -87,19 +87,64 @@ fn main() {
8787 0 ,
8888 true ,
8989 ) ;
90+ fb. clear ( ) ;
9091
9192 // The dither_cache was calculated in build/main.rs and
9293 // this env is set to the file path containing this cache.
9394 let start = Instant :: now ( ) ;
9495 let dither_cache_compressed = include_bytes ! ( env!( "OUT_DIR_DITHERCACHE_FILE" ) ) ;
9596 let mut dither_cache_raw = Cursor :: new ( Vec :: with_capacity (
96- blue_noise_dither:: CachedDither2XTo4X :: calc_dither_cache_len ( 320 , 240 ) * 2 ,
97+ blue_noise_dither:: CachedDither2XTo4X :: calc_dither_cache_len (
98+ game:: DOOMGENERIC_RESX as u32 / 2 ,
99+ game:: DOOMGENERIC_RESY as u32 / 2 ,
100+ ) * 2 ,
97101 ) ) ;
98102 zstd:: stream:: copy_decode ( Cursor :: new ( dither_cache_compressed) , & mut dither_cache_raw) . unwrap ( ) ;
99103 let dither_cache_raw = dither_cache_raw. into_inner ( ) ;
100104 let mut ditherer = blue_noise_dither:: CachedDither2XTo4X :: new ( dither_cache_raw) ;
101105 info ! ( "Loaded dither cache in {:?}" , start. elapsed( ) ) ;
102106
107+ // Title
108+ let title_text = concat ! ( "DOOMarkable v" , env!( "CARGO_PKG_VERSION" ) ) ;
109+ let subtitle_text = "https://github.com/LinusCDE/doomarkable" ;
110+ let title_size = 80 ;
111+ let subtitle_size = 30 ;
112+ let title_rect = fb. draw_text (
113+ Point2 { x : 0f32 , y : 0f32 } ,
114+ title_text,
115+ title_size as f32 ,
116+ common:: color:: BLACK ,
117+ true ,
118+ ) ;
119+ let subtitle_rect = fb. draw_text (
120+ Point2 { x : 0f32 , y : 0f32 } ,
121+ subtitle_text,
122+ subtitle_size as f32 ,
123+ common:: color:: BLACK ,
124+ true ,
125+ ) ;
126+
127+ fb. draw_text (
128+ Point2 {
129+ x : ( common:: DISPLAYWIDTH as u32 - title_rect. width ) as f32 / 2.0 ,
130+ y : ( 62 - 20 + title_size) as f32 ,
131+ } ,
132+ title_text,
133+ title_size as f32 ,
134+ common:: color:: BLACK ,
135+ false ,
136+ ) ;
137+ fb. draw_text (
138+ Point2 {
139+ x : ( common:: DISPLAYWIDTH as u32 - subtitle_rect. width ) as f32 / 2.0 ,
140+ y : ( 62 - 20 + title_size + subtitle_size) as f32 ,
141+ } ,
142+ subtitle_text,
143+ subtitle_size as f32 ,
144+ common:: color:: BLACK ,
145+ false ,
146+ ) ;
147+
103148 // Keys
104149 let key_boxes = [
105150 (
@@ -196,7 +241,6 @@ fn main() {
196241 key_labels. insert ( keys:: KEY_ENTER , ( 25.0 , "Enter" ) ) ;
197242 key_labels. insert ( * keys:: KEY_USE , ( 25.0 , "Use" ) ) ;
198243
199- fb. clear ( ) ;
200244 for ( boxx, key) in & key_boxes {
201245 fb. draw_rect (
202246 Point2 {
@@ -252,7 +296,7 @@ fn main() {
252296 let pos = Point2 {
253297 x : ( common:: DISPLAYWIDTH as i32 - width as i32 ) / 2 ,
254298 //y: (common::DISPLAYHEIGHT as i32 - height as i32) / 2,
255- y : 62 ,
299+ y : 62 + 140 ,
256300 } ;
257301
258302 loop {
0 commit comments