diff -r 4933920eba89 -r e8afb1bf2779 rust/lib-hedgewars-engine/src/world.rs --- a/rust/lib-hedgewars-engine/src/world.rs Mon May 20 14:58:30 2024 +0200 +++ b/rust/lib-hedgewars-engine/src/world.rs Tue May 21 14:38:30 2024 +0200 @@ -12,6 +12,7 @@ }; use lfprng::LaggedFibonacciPRNG; use std::path::{Path, PathBuf}; +use log::trace; use crate::render::{camera::Camera, GearEntry, GearRenderer, MapRenderer}; @@ -59,11 +60,15 @@ self.gear_renderer = Some(GearRenderer::new(&self.data_path.as_path())); self.camera = Camera::with_size(Size::new(width as usize, height as usize)); + if let Some(ref state) = self.game_state { + self.camera.position = state.land.play_box().center(); + } + } + + pub fn init_renderer(&mut self) { use mapgen::{theme::Theme, MapGenerator}; if let Some(ref state) = self.game_state { - self.camera.position = state.land.play_box().center(); - let theme = Theme::load(self.data_path.join(Path::new("Themes/Cheese/")).as_path()).unwrap(); let texture = MapGenerator::new().make_texture(&state.land, &theme);