Wiimote to GunCon3: retry github actions

This commit is contained in:
Barış Hamil 2026-02-10 16:13:40 +03:00
parent e74432dba1
commit b600979f91
4 changed files with 15 additions and 16 deletions

View file

@ -5,6 +5,7 @@
#include "Emu/system_config.h"
#include "Utilities/File.h"
#include "util/yaml.hpp"
#include "util/logs.hpp"
#include <algorithm>
#include <sstream>
@ -226,9 +227,10 @@ static std::string get_config_path()
void wiimote_manager::load_config()
{
const std::string path = get_config_path();
if (!fs::exists(path)) return;
fs::file f(path, fs::read);
if (!f) return;
auto [root, error] = yaml_load(fs::read_all_text(path));
auto [root, error] = yaml_load(f.to_string());
if (!error.empty())
{
wiimote_log.error("Failed to load wiimote config: %s", error);
@ -240,14 +242,7 @@ void wiimote_manager::load_config()
{
if (root[key])
{
try
{
btn = static_cast<wiimote_button>(root[key].as<u16>());
}
catch (const YAML::Exception&)
{
wiimote_log.error("Invalid value for %s in wiimote config", key);
}
btn = static_cast<wiimote_button>(root[key].as<u16>(static_cast<u16>(btn)));
}
};
@ -283,7 +278,7 @@ void wiimote_manager::save_config()
YAML::Emitter emitter;
emitter << root;
fs::write_all_text(get_config_path(), emitter.c_str());
fs::write_file(get_config_path(), fs::rewrite, emitter.c_str(), emitter.size());
}
wiimote_manager::wiimote_manager()

View file

@ -3,7 +3,7 @@
#include "util/types.hpp"
#include "Utilities/Thread.h"
#include "Utilities/mutex.h"
#include <hidapi/hidapi.h>
#include <hidapi.h>
#include <vector>
#include <string>
#include <memory>

View file

@ -1,14 +1,15 @@
#include "stdafx.h"
#include "hid_instance.h"
#include "util/logs.hpp"
#include "stdafx.h"
#include "hid_instance.h"
#include "util/logs.hpp"
#include "Emu/System.h"
#if defined(__APPLE__)
#include <hidapi/hidapi_darwin.h>
#include "3rdparty/hidapi/hidapi/mac/hidapi_darwin.h"
#endif
LOG_CHANNEL(hid_log, "HID");
std::mutex g_hid_mutex;
hid_instance::~hid_instance()

View file

@ -1,8 +1,11 @@
#pragma once
#include "util/types.hpp"
#include "util/logs.hpp"
#include <mutex>
#include <hidapi/hidapi.h>
#include <hidapi.h>
LOG_CHANNEL(hid_log, "HID");
struct hid_instance
{