Skip to content

Commit

Permalink
Fix wasm32 build
Browse files Browse the repository at this point in the history
  • Loading branch information
KoffeinFlummi committed Nov 27, 2023
1 parent 4b75dbd commit cd509a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/panels/menu_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl MenuBarPanel {
ui.separator();

// Opening files manually is not available on web assembly
#[cfg(all(not(target_arch = "wasm"), not(target_os = "android")))]
#[cfg(all(not(target_arch = "wasm32"), not(target_os = "android")))]
if ui.selectable_label(false, "🗁 Open Log File").clicked() {
if let Some(data_source) = open_log_file() {
sam.data_source = Box::new(data_source);
Expand All @@ -49,7 +49,7 @@ impl MenuBarPanel {
ui.toggle_value(&mut sam.archive_window.open, "🗄 Flight Archive");

// Toggle archive panel
#[cfg(all(not(target_arch = "wasm"), not(target_os = "android")))]
#[cfg(all(not(target_arch = "wasm32"), not(target_os = "android")))]
if ui.selectable_label(data_source_is_sim, "💻 Simulate").clicked() {
sam.data_source = Box::new(SimulationDataSource::default());
}
Expand Down
3 changes: 3 additions & 0 deletions src/simulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ use mithril::telemetry::*;

use crate::gui::windows::archive::ARCHIVE;

#[cfg(not(target_arch = "wasm32"))]
type Rng = rand::rngs::StdRng;
#[cfg(target_arch = "wasm32")]
type Rng = rand::rngs::SmallRng;

const GRAVITY: f32 = 9.80665;

Expand Down

0 comments on commit cd509a8

Please sign in to comment.