chore: cleaned up code

Signed-off-by: Sienna Meridian Satterwhite <sienna@r3t.io>
This commit is contained in:
2025-12-17 20:11:31 +00:00
parent c57a9c0787
commit 0bbc2c094a
15 changed files with 220 additions and 90 deletions

View File

@@ -181,7 +181,7 @@ impl WindowToEguiContextMap {
// NOTE: We don't use bevy_winit since we own the event loop
// event_loop_proxy: Res<bevy_winit::EventLoopProxyWrapper<bevy_winit::WakeUp>>,
) {
for (egui_context_entity, camera, egui_context) in added_contexts {
for (egui_context_entity, camera, _egui_context) in added_contexts {
if let bevy::camera::RenderTarget::Window(window_ref) = camera.target
&& let Some(window_ref) = window_ref.normalize(primary_window.single().ok())
{

View File

@@ -35,7 +35,7 @@ pub fn process_output_system(
egui_global_settings: Res<EguiGlobalSettings>,
window_to_egui_context_map: Res<WindowToEguiContextMap>,
) {
let mut should_request_redraw = false;
let mut _should_request_redraw = false;
for (entity, mut context, mut full_output, mut render_output, mut egui_output, settings) in
context_query.iter_mut()
@@ -115,7 +115,7 @@ pub fn process_output_system(
}
let needs_repaint = !render_output.is_empty();
should_request_redraw |= ctx.has_requested_repaint() && needs_repaint;
_should_request_redraw |= ctx.has_requested_repaint() && needs_repaint;
}
// NOTE: RequestRedraw not needed - we own winit and run unbounded (continuous redraws)

View File

@@ -42,10 +42,7 @@ use std::{
};
use bevy::prelude::*;
use serde::{
Deserialize,
Serialize,
};
use uuid::Uuid;
use crate::networking::{

View File

@@ -5,7 +5,6 @@
//! dispatcher system polls once and routes messages to appropriate handlers.
use bevy::{
ecs::system::SystemState,
prelude::*,
};
@@ -13,14 +12,12 @@ use crate::networking::{
GossipBridge,
JoinType,
NetworkedEntity,
TombstoneRegistry,
VersionedMessage,
apply_entity_delta,
apply_full_state,
blob_support::BlobStore,
build_missing_deltas,
delta_generation::NodeVectorClock,
entity_map::NetworkEntityMap,
messages::SyncMessage,
operation_log::OperationLog,
plugin::SessionSecret,

View File

@@ -3,10 +3,7 @@
//! This module defines the protocol messages used for distributed
//! synchronization according to RFC 0001.
use serde::{
Deserialize,
Serialize,
};
use crate::networking::{
locks::LockMessage,

View File

@@ -4,10 +4,7 @@
//! on components in the distributed system. Each operation type corresponds to
//! a specific CRDT merge strategy.
use serde::{
Deserialize,
Serialize,
};
use crate::networking::{
messages::ComponentData,

View File

@@ -41,10 +41,7 @@
use std::collections::HashMap;
use bevy::prelude::*;
use serde::{
Deserialize,
Serialize,
};
use crate::networking::vector_clock::{
NodeId,

View File

@@ -6,10 +6,7 @@ use std::fmt;
/// human-readable ! session codes, ALPN-based network isolation, and persistent
/// session tracking.
use bevy::prelude::*;
use serde::{
Deserialize,
Serialize,
};
use uuid::Uuid;
use crate::networking::VectorClock;

View File

@@ -5,10 +5,7 @@
use std::collections::HashMap;
use serde::{
Deserialize,
Serialize,
};
use crate::networking::error::{
NetworkingError,

View File

@@ -77,7 +77,7 @@ impl ApplicationHandler for DesktopApp {
///
/// This takes ownership of the main thread and runs the winit event loop.
/// The update_fn is called each frame to update game logic.
pub fn run(mut update_fn: impl FnMut() + 'static) -> Result<(), Box<dyn std::error::Error>> {
pub fn run(_update_fn: impl FnMut() + 'static) -> Result<(), Box<dyn std::error::Error>> {
let event_loop = EventLoop::new()?;
event_loop.set_control_flow(ControlFlow::Poll); // Run as fast as possible

View File

@@ -51,31 +51,24 @@
//! Note: Battery-aware adaptive frame limiting is planned for production use.
use bevy::prelude::*;
use bevy::app::AppExit;
use bevy::input::{
ButtonInput,
mouse::MouseButton as BevyMouseButton,
keyboard::KeyCode as BevyKeyCode,
touch::{Touches, TouchInput},
gestures::*,
keyboard::KeyboardInput,
mouse::{MouseButtonInput, MouseMotion, MouseWheel},
};
use bevy::window::{
PrimaryWindow, WindowCreated, WindowResized, WindowScaleFactorChanged, WindowClosing,
WindowResolution, WindowMode, WindowPosition, WindowEvent as BevyWindowEvent,
RawHandleWrapper, WindowWrapper,
CursorMoved, CursorEntered, CursorLeft,
WindowFocused, WindowOccluded, WindowMoved, WindowThemeChanged, WindowDestroyed,
FileDragAndDrop, Ime, WindowCloseRequested,
};
use bevy::ecs::message::Messages;
use crate::platform::input::{InputEvent, InputEventBuffer};
use crate::platform::input::InputEventBuffer;
use super::{push_window_event, push_device_event, drain_as_input_events, set_scale_factor};
use std::sync::Arc;
use winit::application::ApplicationHandler;
use winit::event::{Event as WinitEvent, WindowEvent as WinitWindowEvent};
use winit::event_loop::{ActiveEventLoop, ControlFlow, EventLoop, EventLoopProxy};
use winit::event::WindowEvent as WinitWindowEvent;
use winit::event_loop::{ActiveEventLoop, ControlFlow, EventLoop};
use winit::window::{Window as WinitWindow, WindowId, WindowAttributes};
/// Application handler state machine

View File

@@ -51,11 +51,11 @@ use glam::Vec2;
use std::sync::{Mutex, OnceLock};
use std::path::PathBuf;
use winit::event::{
DeviceEvent, ElementState, MouseButton as WinitMouseButton, MouseScrollDelta, WindowEvent,
Touch as WinitTouch, Force as WinitForce, TouchPhase as WinitTouchPhase,
ElementState, MouseButton as WinitMouseButton, MouseScrollDelta, WindowEvent,
Force as WinitForce, TouchPhase as WinitTouchPhase,
Ime as WinitIme,
};
use winit::keyboard::{PhysicalKey, Key as LogicalKey, NamedKey};
use winit::keyboard::{PhysicalKey, Key as LogicalKey};
use winit::window::Theme as WinitTheme;
/// Raw winit input events before conversion