Skip is in view for now

This commit is contained in:
Maximilian Ammann 2022-04-03 18:00:09 +02:00
parent f1be6ec9be
commit a447084674
2 changed files with 4 additions and 8 deletions

View File

@ -390,11 +390,7 @@ impl ViewRegion {
&& world_coords.y <= self.max_tile.y + self.padding
&& world_coords.x >= self.min_tile.x - self.padding
&& world_coords.y >= self.min_tile.y - self.padding
&& (world_coords.z == self.z
|| world_coords.z.checked_sub(1).unwrap_or(0) == self.z
|| world_coords.z.checked_sub(2).unwrap_or(0) == self.z
|| world_coords.z.checked_sub(3).unwrap_or(0) == self.z
|| world_coords.z + 1 == self.z)
&& world_coords.z == self.z
}
pub fn iter(&self) -> impl Iterator<Item = WorldTileCoords> + '_ {

View File

@ -401,9 +401,9 @@ impl RenderState {
let world_coords = entry.coords;
// FIXME: Does not take into account rendering tiles with different z
if !view_region.is_in_view(&entry.coords) {
/*if !view_region.is_in_view(&entry.coords) {
continue;
}
}*/
let zoom_factor = 2.0_f64.powf(world_coords.z as f64 - self.zoom) as f32;
@ -595,7 +595,7 @@ impl RenderState {
);
}
#[tracing::instrument]
#[tracing::instrument(skip_all)]
pub fn render(&mut self) -> Result<(), wgpu::SurfaceError> {
let frame = self.surface.get_current_texture()?;
let frame_view = frame