macos gui: handle fallible
This commit is contained in:
parent
24bcdd1bb6
commit
861b8c2996
|
@ -301,7 +301,14 @@ impl CacaoWindowManager {
|
||||||
if state {
|
if state {
|
||||||
let is_running = self.is_emulator_running();
|
let is_running = self.is_emulator_running();
|
||||||
if is_running {
|
if is_running {
|
||||||
let new_layer_window = new_layer_window(self);
|
let new_layer_window: Sender<RendererMessage<[u8; 4]>> =
|
||||||
|
match new_layer_window(self) {
|
||||||
|
Ok(t) => t,
|
||||||
|
Err(e) => {
|
||||||
|
log::error!("couldn't create tile window: {e:?}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
if let Some(ref handles) = self.handles {
|
if let Some(ref handles) = self.handles {
|
||||||
handles
|
handles
|
||||||
.sender
|
.sender
|
||||||
|
@ -316,7 +323,13 @@ impl CacaoWindowManager {
|
||||||
if state {
|
if state {
|
||||||
let is_running = self.is_emulator_running();
|
let is_running = self.is_emulator_running();
|
||||||
if is_running {
|
if is_running {
|
||||||
let new_tile_window = new_tile_window(self);
|
let new_tile_window = match new_tile_window(self) {
|
||||||
|
Ok(t) => t,
|
||||||
|
Err(e) => {
|
||||||
|
log::error!("couldn't create tile window: {e:?}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
if let Some(ref handles) = self.handles {
|
if let Some(ref handles) = self.handles {
|
||||||
handles
|
handles
|
||||||
.sender
|
.sender
|
||||||
|
|
|
@ -170,7 +170,13 @@ impl Dispatcher for TwincUiApp {
|
||||||
let (output, stream) = audio::create_output(false);
|
let (output, stream) = audio::create_output(false);
|
||||||
let mut window_manager = self.current_game.write().unwrap();
|
let mut window_manager = self.current_game.write().unwrap();
|
||||||
window_manager.update_handles(sender, stream);
|
window_manager.update_handles(sender, stream);
|
||||||
let mut core = frontend_common::run(prepared, &mut *window_manager, output);
|
let mut core = match frontend_common::run(prepared, &mut *window_manager, output) {
|
||||||
|
Ok(c) => c,
|
||||||
|
Err(e) => {
|
||||||
|
log::error!("couldn't create emulator core: {e:?}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
let handle = std::thread::Builder::new()
|
let handle = std::thread::Builder::new()
|
||||||
.name(String::from("EmuCore"))
|
.name(String::from("EmuCore"))
|
||||||
.spawn(move || loop {
|
.spawn(move || loop {
|
||||||
|
|
Loading…
Reference in a new issue