mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
Fix world encode
This commit is contained in:
parent
7f0d7fbb53
commit
8d18843147
1 changed files with 7 additions and 5 deletions
|
@ -99,16 +99,18 @@ impl WorldData for ParticleWorldState {
|
|||
else {
|
||||
return Err(eyre!("chunk not loaded"));
|
||||
};
|
||||
let mut chunk_iter = chunk.iter_mut();
|
||||
let (shift_x, shift_y) = self.get_shift::<CHUNK_SIZE>(cx, cy);
|
||||
for ((j, i), p) in (shift_x..shift_x + CHUNK_SIZE as isize)
|
||||
.flat_map(|i| (shift_y..shift_y + CHUNK_SIZE as isize).map(move |j| (i, j)))
|
||||
.zip(chunk.iter_mut())
|
||||
{
|
||||
*p = pixel_array.get_pixel(i, j);
|
||||
for j in shift_y..shift_y + CHUNK_SIZE as isize {
|
||||
for i in shift_x..shift_x + CHUNK_SIZE as isize {
|
||||
*chunk_iter.next().unwrap() = pixel_array.get_pixel(i, j);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
unsafe fn decode_world(&self, chunk: NoitaWorldUpdate) -> eyre::Result<()> {
|
||||
return Ok(()); // TODO
|
||||
let chunk_coord = chunk.coord;
|
||||
let (cx, cy) = (chunk_coord.0 as isize, chunk_coord.1 as isize);
|
||||
let Some(pixel_array) = unsafe { self.world_ptr.as_mut() }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue