chore: remove unused functions, add 'web' task to Justfile

This commit is contained in:
Ryan Walters
2025-09-03 16:31:21 -05:00
parent 4cc5816d1f
commit 0907b5ebe7
3 changed files with 6 additions and 13 deletions

View File

@@ -38,3 +38,7 @@ coverage:
samply:
cargo build --profile profile
samply record ./target/profile/pacman{{ binary_extension }}
# Build the project for Emscripten
web:
bun run web.build.ts

View File

@@ -1,7 +1,7 @@
//! Desktop platform implementation.
use std::borrow::Cow;
use std::time::{Duration, Instant};
use std::time::Duration;
use rand::rngs::ThreadRng;
@@ -17,10 +17,6 @@ pub fn sleep(duration: Duration, focused: bool) {
}
}
pub fn get_time() -> f64 {
Instant::now().elapsed().as_secs_f64()
}
pub fn init_console() -> Result<(), PlatformError> {
#[cfg(windows)]
{
@@ -53,10 +49,6 @@ pub fn requires_console() -> bool {
cfg!(windows)
}
pub fn get_canvas_size() -> Option<(u32, u32)> {
None // Desktop doesn't need this
}
pub fn get_asset_bytes(asset: Asset) -> Result<Cow<'static, [u8]>, AssetError> {
match asset {
Asset::Wav1 => Ok(Cow::Borrowed(include_bytes!("../../assets/game/sound/waka/1.ogg"))),

View File

@@ -8,6 +8,7 @@ use crate::error::{AssetError, PlatformError};
use rand::{rngs::SmallRng, SeedableRng};
// Emscripten FFI functions
#[allow(dead_code)]
extern "C" {
fn emscripten_get_now() -> f64;
fn emscripten_sleep(ms: u32);
@@ -20,10 +21,6 @@ pub fn sleep(duration: Duration, _focused: bool) {
}
}
pub fn get_time() -> f64 {
unsafe { emscripten_get_now() }
}
pub fn init_console() -> Result<(), PlatformError> {
Ok(()) // No-op for Emscripten
}