Fix remote action type undefined error

This commit is contained in:
dijunkun
2023-12-18 16:06:53 +08:00
parent 0034359431
commit e3987b4a42

View File

@@ -185,6 +185,7 @@ inline int ProcessMouseKeyEven(SDL_Event &ev) {
SendData(peer_client, DATA_TYPE::DATA, (const char *)&remote_action, SendData(peer_client, DATA_TYPE::DATA, (const char *)&remote_action,
sizeof(remote_action)); sizeof(remote_action));
} else if (SDL_MOUSEBUTTONUP == ev.type) { } else if (SDL_MOUSEBUTTONUP == ev.type) {
remote_action.type = ControlType::mouse;
if (SDL_BUTTON_LEFT == ev.button.button) { if (SDL_BUTTON_LEFT == ev.button.button) {
remote_action.m.flag = MouseFlag::left_up; remote_action.m.flag = MouseFlag::left_up;
} else if (SDL_BUTTON_RIGHT == ev.button.button) { } else if (SDL_BUTTON_RIGHT == ev.button.button) {
@@ -193,6 +194,7 @@ inline int ProcessMouseKeyEven(SDL_Event &ev) {
SendData(peer_client, DATA_TYPE::DATA, (const char *)&remote_action, SendData(peer_client, DATA_TYPE::DATA, (const char *)&remote_action,
sizeof(remote_action)); sizeof(remote_action));
} else if (SDL_MOUSEMOTION == ev.type) { } else if (SDL_MOUSEMOTION == ev.type) {
remote_action.type = ControlType::mouse;
remote_action.m.flag = MouseFlag::move; remote_action.m.flag = MouseFlag::move;
SendData(peer_client, DATA_TYPE::DATA, (const char *)&remote_action, SendData(peer_client, DATA_TYPE::DATA, (const char *)&remote_action,
sizeof(remote_action)); sizeof(remote_action));