OverlayContainer to use HopSlotMap

This commit is contained in:
galister
2025-10-03 12:52:29 +09:00
parent a1edc2f0b8
commit 231850cf73
19 changed files with 121 additions and 123 deletions

View File

@@ -2,8 +2,8 @@ use std::{
collections::VecDeque,
ops::Add,
sync::{
Arc,
atomic::{AtomicBool, AtomicUsize, Ordering},
Arc,
},
time::{Duration, Instant},
};
@@ -23,10 +23,10 @@ use crate::{
overlay::{OverlayData, ShouldRender},
task::{SystemTask, TaskType},
},
graphics::{CommandBuffers, init_openxr_graphics},
graphics::{init_openxr_graphics, CommandBuffers},
overlays::{
toast::{Toast, ToastTopic},
watch::{WATCH_NAME, watch_fade},
watch::{watch_fade, WATCH_NAME},
},
state::AppState,
subsystem::notifications::NotificationManager,
@@ -155,7 +155,7 @@ pub fn openxr_run(
lines.allocate(&xr_state, app.gfx.clone())?,
];
let watch_id = overlays.get_by_name(WATCH_NAME).unwrap().state.id; // want panic
let watch_id = overlays.lookup(WATCH_NAME).unwrap(); // want panic
let mut input_source = input::OpenXrInputSource::new(&xr_state)?;
@@ -311,7 +311,7 @@ pub fn openxr_run(
);
}
for o in overlays.iter_mut() {
for o in overlays.values_mut() {
o.after_input(&mut app)?;
}
@@ -335,7 +335,7 @@ pub fn openxr_run(
}
overlays
.iter_mut()
.values_mut()
.for_each(|o| o.state.auto_movement(&mut app));
let lengths_haptics = interact(&mut overlays, &mut app);
@@ -379,7 +379,7 @@ pub fn openxr_run(
skybox.render(&xr_state, &app, &mut buffers)?;
}
for o in overlays.iter_mut() {
for o in overlays.values_mut() {
o.data.cur_visible = false;
if !o.state.want_visible {
continue;
@@ -431,7 +431,7 @@ pub fn openxr_run(
}
}
for o in overlays.iter_mut() {
for o in overlays.values_mut() {
if !o.data.cur_visible {
continue;
}

View File

@@ -128,7 +128,7 @@ impl PlayspaceMover {
let overlay_offset = data.pose.inverse().transform_vector3a(relative_pos) * -1.0;
overlays.iter_mut().for_each(|overlay| {
overlays.values_mut().for_each(|overlay| {
if overlay.state.grabbable {
overlay.state.dirty = true;
overlay.state.transform.translation += overlay_offset;