|
|
@@ -170,7 +170,7 @@ fn main() {
|
|
170
|
170
|
let mut sources = TileSources::new(config.tile_sources()).unwrap();
|
|
171
|
171
|
|
|
172
|
172
|
let mut window = glutin::WindowBuilder::new().build().unwrap();
|
|
173
|
|
- window.set_title("DeltaMap");
|
|
|
173
|
+ window.set_title(&("DeltaMap - ".to_string() + sources.current_name()));
|
|
174
|
174
|
window.set_window_resize_callback(Some(resize_callback as fn(u32, u32)));
|
|
175
|
175
|
let _ = unsafe { window.make_current() };
|
|
176
|
176
|
|
|
|
@@ -194,6 +194,7 @@ fn main() {
|
|
194
|
194
|
|
|
195
|
195
|
'outer: for event in window.wait_events() {
|
|
196
|
196
|
let mut start_loop = Instant::now();
|
|
|
197
|
+ let start_source_id = sources.current().id();
|
|
197
|
198
|
|
|
198
|
199
|
let mut redraw = false;
|
|
199
|
200
|
|
|
|
@@ -247,6 +248,11 @@ fn main() {
|
|
247
|
248
|
let diff = start_loop.elapsed();
|
|
248
|
249
|
println!("EVENT LOOP SECS {}", diff.as_secs() as f64 + f64::from(diff.subsec_nanos()) * 1e-9);
|
|
249
|
250
|
}
|
|
|
251
|
+
|
|
|
252
|
+ // set window title
|
|
|
253
|
+ if sources.current().id() != start_source_id {
|
|
|
254
|
+ window.set_title(&("DeltaMap - ".to_string() + sources.current_name()));
|
|
|
255
|
+ }
|
|
250
|
256
|
}
|
|
251
|
257
|
}
|
|
252
|
258
|
|
|
|
@@ -271,6 +277,10 @@ impl TileSources {
|
|
271
|
277
|
&self.sources[self.current_index].1
|
|
272
|
278
|
}
|
|
273
|
279
|
|
|
|
280
|
+ pub fn current_name(&self) -> &str {
|
|
|
281
|
+ &self.sources[self.current_index].0
|
|
|
282
|
+ }
|
|
|
283
|
+
|
|
274
|
284
|
pub fn switch_to_next(&mut self) {
|
|
275
|
285
|
self.current_index = (self.current_index + 1) % self.sources.len();
|
|
276
|
286
|
}
|