This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
use crate::windows::WindowOwner;
|
||||
use crate::{CrashReport, SystemOS};
|
||||
use prometeu_hal::color::Color;
|
||||
use prometeu_hal::log::{LogLevel, LogSource};
|
||||
use prometeu_hal::window::Rect;
|
||||
use prometeu_hal::primitives::Rect;
|
||||
use prometeu_hal::{HardwareBridge, InputSignals};
|
||||
use prometeu_vm::VirtualMachine;
|
||||
|
||||
@@ -61,15 +62,15 @@ impl PrometeuHub {
|
||||
}
|
||||
|
||||
if let Some((title, rect, color)) = next_window {
|
||||
let mut window = os.window();
|
||||
let mut window = os.windows();
|
||||
window.remove_all_windows();
|
||||
let id = window.add_window(title, rect, color);
|
||||
let id = window.add_window(title, WindowOwner::Hub, rect, color);
|
||||
window.set_focus(id);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn render(&mut self, os: &mut SystemOS, hw: &mut dyn HardwareBridge) {
|
||||
for window in os.window().windows() {
|
||||
for window in os.windows().windows() {
|
||||
hw.gfx_mut().fill_rect(
|
||||
window.viewport.x,
|
||||
window.viewport.y,
|
||||
@@ -91,9 +92,9 @@ impl PrometeuHub {
|
||||
|
||||
self.gui_update(os, hw);
|
||||
|
||||
if let Some(focused_id) = os.window().focused_window() {
|
||||
if let Some(focused_id) = os.windows().focused_window() {
|
||||
if hw.pad().start().down {
|
||||
os.window().close_window(focused_id);
|
||||
os.windows().close_window(focused_id);
|
||||
} else {
|
||||
crash = os.vm().tick(vm, signals, hw);
|
||||
}
|
||||
@@ -102,6 +103,9 @@ impl PrometeuHub {
|
||||
self.render(os, hw);
|
||||
hw.gfx_mut().present();
|
||||
|
||||
SystemProfileUpdate { crash, focused_window_active: os.window().focused_window().is_some() }
|
||||
SystemProfileUpdate {
|
||||
crash,
|
||||
focused_window_active: os.windows().focused_window().is_some(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user