Small things
This commit is contained in:
@@ -38,7 +38,7 @@ void KaizenGui::QueryDevices(SDL_Event event) {
|
||||
|
||||
void KaizenGui::HandleInput(SDL_Event event) {
|
||||
n64::Core& core = n64::Core::GetInstance();
|
||||
n64::PIF &pif = core.GetMem().mmio.si.pif;
|
||||
n64::PIF &pif = n64::Core::GetMem().mmio.si.pif;
|
||||
switch(event.type) {
|
||||
case SDL_EVENT_GAMEPAD_AXIS_MOTION:
|
||||
if(!gamepad)
|
||||
@@ -89,8 +89,6 @@ void KaizenGui::HandleInput(SDL_Event event) {
|
||||
break;
|
||||
case SDL_EVENT_KEY_DOWN:
|
||||
case SDL_EVENT_KEY_UP:
|
||||
if(gamepad)
|
||||
break;
|
||||
{
|
||||
auto keys = SDL_GetKeyboardState(nullptr);
|
||||
if((keys[SDL_SCANCODE_LCTRL] || keys[SDL_SCANCODE_RCTRL]) && keys[SDL_SCANCODE_O]) {
|
||||
@@ -115,6 +113,9 @@ void KaizenGui::HandleInput(SDL_Event event) {
|
||||
}
|
||||
}
|
||||
|
||||
if(gamepad)
|
||||
break;
|
||||
|
||||
pif.UpdateButton(0, n64::Controller::Key::Z, keys[SDL_SCANCODE_Z]);
|
||||
pif.UpdateButton(0, n64::Controller::Key::CUp, keys[SDL_SCANCODE_HOME]);
|
||||
pif.UpdateButton(0, n64::Controller::Key::CDown, keys[SDL_SCANCODE_END]);
|
||||
@@ -211,7 +212,7 @@ void KaizenGui::RenderUI() {
|
||||
ImGui::EndMainMenuBar();
|
||||
}
|
||||
|
||||
if(!Util::Error::GetInstance().IsHandled()) {
|
||||
if(!Util::Error::IsHandled()) {
|
||||
ImGui::OpenPopup(Util::Error::GetSeverity().as_c_str());
|
||||
}
|
||||
|
||||
@@ -354,7 +355,7 @@ void KaizenGui::RenderUI() {
|
||||
fileDialogOpen = false;
|
||||
const SDL_DialogFileFilter filters[] = {{"All files", "*"}, {"Nintendo 64 executable", "n64;z64;v64"}, {"Nintendo 64 executable archive", "rar;tar;zip;7z"}};
|
||||
SDL_ShowOpenFileDialog([](void *userdata, const char * const *filelist, int filter) {
|
||||
KaizenGui* kaizen = (KaizenGui*)userdata;
|
||||
auto kaizen = (KaizenGui*)userdata;
|
||||
|
||||
if (!filelist) {
|
||||
panic("An error occured: {}", SDL_GetError());
|
||||
@@ -413,6 +414,6 @@ void KaizenGui::run() {
|
||||
}
|
||||
}
|
||||
|
||||
void KaizenGui::LoadTAS(const std::string &path) const noexcept {
|
||||
void KaizenGui::LoadTAS(const std::string &path) noexcept {
|
||||
n64::Core::GetInstance().LoadTAS(fs::path(path));
|
||||
}
|
||||
Reference in New Issue
Block a user