mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Re-fix map orientation.
This commit is contained in:
parent
16c24e86b3
commit
14e4dfb53f
@ -111,12 +111,15 @@ impl Client {
|
||||
let mut world_map_raw = vec![0u8; 4 * world_map.len()/*map_size.x * map_size.y*/];
|
||||
LittleEndian::write_u32_into(&world_map, &mut world_map_raw);
|
||||
log::debug!("Preparing image...");
|
||||
let world_map = Arc::new(image::DynamicImage::ImageRgba8({
|
||||
// Should not fail if the dimensions are correct.
|
||||
let world_map =
|
||||
image::ImageBuffer::from_raw(map_size.x, map_size.y, world_map_raw);
|
||||
world_map.ok_or(Error::Other("Server sent a bad world map image".into()))?
|
||||
}));
|
||||
let world_map = Arc::new(
|
||||
image::DynamicImage::ImageRgba8({
|
||||
// Should not fail if the dimensions are correct.
|
||||
let world_map =
|
||||
image::ImageBuffer::from_raw(map_size.x, map_size.y, world_map_raw);
|
||||
world_map.ok_or(Error::Other("Server sent a bad world map image".into()))?
|
||||
})
|
||||
.flipv(),
|
||||
);
|
||||
log::debug!("Done preparing image...");
|
||||
|
||||
(state, entity, server_info, (world_map, map_size))
|
||||
|
@ -177,8 +177,8 @@ impl<'a> Widget for Map<'a> {
|
||||
.get(self.client.entity())
|
||||
.map_or(Vec3::zero(), |pos| pos.0);
|
||||
|
||||
let x = player_pos.x as f64 / worldsize.x * 700.0;
|
||||
let y = (1.0 - player_pos.y as f64 / worldsize.y) * 700.0;
|
||||
let x = player_pos.x as f64 / worldsize.x * 700.0/*= x-Size of the map image*/;
|
||||
let y = player_pos.y as f64 / worldsize.y * 700.0;
|
||||
let indic_ani = (self.pulse * 6.0/*animation speed*/).cos()/*starts at 1.0*/ * 0.5 + 0.50; // changes the animation frame
|
||||
let indic_scale = 1.2;
|
||||
// Indicator
|
||||
|
@ -152,7 +152,7 @@ impl<'a> Widget for MiniMap<'a> {
|
||||
.map_or(Vec3::zero(), |pos| pos.0);
|
||||
|
||||
let x = player_pos.x as f64 / worldsize.x * 92.0 * 4.0;
|
||||
let y = (1.0 - player_pos.y as f64 / worldsize.y) * 82.0 * 4.0;
|
||||
let y = player_pos.y as f64 / worldsize.y * 82.0 * 4.0;
|
||||
let indic_ani = (self.pulse * 6.0).cos() * 0.5 + 0.5; //Animation timer
|
||||
let indic_scale = 0.8;
|
||||
// Indicator
|
||||
|
Loading…
Reference in New Issue
Block a user