mirror of
https://github.com/RetroDECK/RetroQUEST.git
synced 2025-04-21 01:24:06 +00:00
Checkpoint: now the core can be loaded with errors (but getting there!)
This commit is contained in:
parent
0fff64f084
commit
9dffd94f24
|
@ -53,8 +53,11 @@ void RetroHost::forwarded_input( const godot::Ref<godot::InputEvent> &event )
|
||||||
if(retro_key > RETROK_LAST)
|
if(retro_key > RETROK_LAST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this->core.retro_keyboard_event_callback( key_event->is_pressed(), retro_key,
|
if (this->core.retro_keyboard_event_callback) {
|
||||||
0, modifiers );
|
this->core.retro_keyboard_event_callback(key_event->is_pressed(), retro_key, 0, modifiers);
|
||||||
|
} else {
|
||||||
|
godot::UtilityFunctions::printerr("[RetroHost] retro_keyboard_event_callback is not set.");
|
||||||
|
}
|
||||||
|
|
||||||
keyboard_state[retro_key] = key_event->is_pressed();
|
keyboard_state[retro_key] = key_event->is_pressed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,6 +141,7 @@ bool RetroHost::load_core(godot::String name)
|
||||||
load_symbol_return_false_on_err(this->core.handle, this->core.retro_run, retro_run);
|
load_symbol_return_false_on_err(this->core.handle, this->core.retro_run, retro_run);
|
||||||
load_symbol_return_false_on_err(this->core.handle, this->core.retro_load_game, retro_load_game);
|
load_symbol_return_false_on_err(this->core.handle, this->core.retro_load_game, retro_load_game);
|
||||||
load_symbol_return_false_on_err(this->core.handle, this->core.retro_unload_game, retro_unload_game);
|
load_symbol_return_false_on_err(this->core.handle, this->core.retro_unload_game, retro_unload_game);
|
||||||
|
load_symbol_return_false_on_err(this->core.handle, this->core.retro_keyboard_event_callback, retro_keyboard_event_callback);
|
||||||
|
|
||||||
godot::UtilityFunctions::print("[RetroHost] All symbols loaded successfully.");
|
godot::UtilityFunctions::print("[RetroHost] All symbols loaded successfully.");
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ private:
|
||||||
bool (*retro_load_game)(const struct retro_game_info *game);
|
bool (*retro_load_game)(const struct retro_game_info *game);
|
||||||
void (*retro_unload_game)(void);
|
void (*retro_unload_game)(void);
|
||||||
|
|
||||||
retro_keyboard_event_t retro_keyboard_event_callback;
|
retro_keyboard_event_t retro_keyboard_event_callback = nullptr;
|
||||||
} core;
|
} core;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in a new issue