mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-20 21:43:12 -07:00
Track Finger IDs on Switch
This commit is contained in:
parent
1b8fa556f8
commit
fc58e83e9c
5 changed files with 46 additions and 34 deletions
|
@ -56,7 +56,7 @@ class Host
|
|||
std::function<void(bool)> chiaki_even_login_pin_request_cb = nullptr;
|
||||
std::function<void(uint8_t, uint8_t)> chiaki_event_rumble_cb = nullptr;
|
||||
std::function<void(ChiakiQuitEvent *)> chiaki_event_quit_cb = nullptr;
|
||||
std::function<void(ChiakiControllerState *)> io_read_controller_cb = nullptr;
|
||||
std::function<void(ChiakiControllerState *, std::map<uint32_t, int8_t> *)> io_read_controller_cb = nullptr;
|
||||
|
||||
// internal state
|
||||
bool discovered = false;
|
||||
|
@ -76,6 +76,7 @@ class Host
|
|||
ChiakiTarget target = CHIAKI_TARGET_PS4_UNKNOWN;
|
||||
ChiakiDiscoveryHostState state = CHIAKI_DISCOVERY_HOST_STATE_UNKNOWN;
|
||||
ChiakiControllerState controller_state = {0};
|
||||
std::map<uint32_t, int8_t> finger_id_touch_id;
|
||||
|
||||
// mac address = 48 bits
|
||||
uint8_t server_mac[6] = {0};
|
||||
|
@ -115,7 +116,7 @@ class Host
|
|||
void SetEventLoginPinRequestCallback(std::function<void(bool)> chiaki_even_login_pin_request_cb);
|
||||
void SetEventRumbleCallback(std::function<void(uint8_t, uint8_t)> chiaki_event_rumble_cb);
|
||||
void SetEventQuitCallback(std::function<void(ChiakiQuitEvent *)> chiaki_event_quit_cb);
|
||||
void SetReadControllerCallback(std::function<void(ChiakiControllerState *)> io_read_controller_cb);
|
||||
void SetReadControllerCallback(std::function<void(ChiakiControllerState *, std::map<uint32_t, int8_t> *)> io_read_controller_cb);
|
||||
bool IsRegistered();
|
||||
bool IsDiscovered();
|
||||
bool IsReady();
|
||||
|
|
|
@ -35,6 +35,8 @@ Reproducible: False
|
|||
#endif
|
||||
|
||||
#include <mutex>
|
||||
#include <map>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <libavcodec/avcodec.h>
|
||||
|
@ -96,7 +98,7 @@ class IO
|
|||
GLuint CreateAndCompileShader(GLenum type, const char *source);
|
||||
void SetOpenGlYUVPixels(AVFrame *frame);
|
||||
bool ReadGameKeys(SDL_Event *event, ChiakiControllerState *state);
|
||||
bool ReadGameTouchScreen(ChiakiControllerState *state);
|
||||
bool ReadGameTouchScreen(ChiakiControllerState *state, std::map<uint32_t, int8_t> *finger_id_touch_id);
|
||||
bool ReadGameSixAxis(ChiakiControllerState *state);
|
||||
public:
|
||||
// singleton configuration
|
||||
|
@ -114,7 +116,7 @@ class IO
|
|||
bool InitController();
|
||||
bool FreeController();
|
||||
bool MainLoop();
|
||||
void UpdateControllerState(ChiakiControllerState *state);
|
||||
void UpdateControllerState(ChiakiControllerState *state, std::map<uint32_t, int8_t> *finger_id_touch_id);
|
||||
void SetRumble(uint8_t left, uint8_t right);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue