Skip to content

Commit

Permalink
Cleanup, fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aevyrie committed Jun 12, 2024
1 parent 75b569a commit eac676b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ use bevy_ecs::prelude::*;
use bevy_reflect::prelude::*;
use bevy_render::{Render, RenderApp, RenderSet};
use bevy_utils::Instant;
use bevy_window::prelude::*;

#[cfg(not(target_arch = "wasm32"))]
use bevy_render::pipelined_rendering::RenderExtractApp;
#[cfg(not(target_arch = "wasm32"))]
use bevy_window::prelude::*;
#[cfg(not(target_arch = "wasm32"))]
use bevy_winit::WinitWindows;

use std::{
Expand All @@ -47,7 +48,8 @@ use std::{
#[cfg(feature = "framepace_debug")]
pub mod debug;

/// A dummy label for the subapp of the rendered pipeline that does not exist in wasm32
/// Bevy does not export `RenderExtractApp` on wasm32, so we create a dummy label to ensure this
/// compiles on wasm32.
#[cfg(target_arch = "wasm32")]
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, bevy_app::AppLabel)]
struct RenderExtractApp;
Expand Down Expand Up @@ -124,6 +126,7 @@ struct FramepaceSettingsProxy {
limiter: Arc<Mutex<Limiter>>,
}

#[cfg(not(target_arch = "wasm32"))]
impl FramepaceSettingsProxy {
fn is_enabled(&self) -> bool {
self.limiter.try_lock().iter().any(|l| l.is_enabled())
Expand Down Expand Up @@ -258,6 +261,7 @@ pub struct FramePaceStats {
/// `spin_sleep` sleeps as long as possible given the platform's sleep accuracy, and spins for the
/// remainder. The dependency is however not WASM compatible, which is fine, because frame limiting
/// should not be used in a browser; this would compete with the browser's frame limiter.
#[allow(unused_variables)]
fn framerate_limiter(
mut timer: ResMut<FrameTimer>,
target_frametime: Res<FrametimeLimit>,
Expand Down

0 comments on commit eac676b

Please sign in to comment.