refactor: use small_rng for Emscripten only, simplify platform to top-level functions only, no trait/struct

This commit is contained in:
Ryan Walters
2025-09-03 11:11:04 -05:00
parent 208ad3e733
commit 4cc5816d1f
9 changed files with 256 additions and 251 deletions

View File

@@ -22,13 +22,12 @@ mod texture;
/// This function initializes SDL, the window, the game state, and then enters
/// the main game loop.
pub fn main() {
let platform = platform::get_platform();
if platform.requires_console() {
if platform::requires_console() {
// Setup buffered tracing subscriber that will buffer logs until console is ready
let switchable_writer = platform::tracing_buffer::setup_switchable_subscriber();
// Initialize platform-specific console
platform.init_console().expect("Could not initialize console");
platform::init_console().expect("Could not initialize console");
// Now that console is initialized, flush buffered logs and switch to direct output
debug!("Switching to direct logging mode and flushing buffer...");