fix: key stealing, disable Emscripten module, disable colored ANSI for emscripten builds

This commit is contained in:
2023-09-12 13:36:29 -05:00
parent 98d8960c57
commit 0630fc56ec
4 changed files with 12 additions and 7 deletions

View File

@@ -17,15 +17,13 @@ mod map;
mod modulation;
mod pacman;
#[cfg(target_os = "emscripten")]
mod emscripten;
pub fn main() {
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
// Setup tracing
let subscriber = tracing_subscriber::fmt()
.with_ansi(cfg!(not(target_os = "emscripten")))
.with_max_level(tracing::Level::DEBUG)
.finish()
.with(ErrorLayer::default());
@@ -77,6 +75,7 @@ pub fn main() {
// TODO: Fix key repeat delay issues by using VecDeque for instant key repeat
for event in event_pump.poll_iter() {
match event {
// Handle quitting keys or window close
Event::Quit { .. }
@@ -146,7 +145,7 @@ pub fn main() {
true
};
loop {
if !main_loop() {
break;