From 0d3881785726c555500f0669a77368204cb2a6fa Mon Sep 17 00:00:00 2001 From: Maschell Date: Tue, 17 Jul 2018 15:30:55 +0200 Subject: [PATCH] Formatting --- src/main.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b655078..ddeeda5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,8 +17,8 @@ WUPS_PLUGIN_LICENSE("GPL"); WUPS_FS_ACCESS() #define SD_PATH "sd:" -#define WIIU_PATH "/wiiu" -#define DEFAULT_HID_TO_VPAD_PATH SD_PATH WIIU_PATH "/apps/hidtovpad" +#define WIIU_PATH "/wiiu" +#define DEFAULT_HID_TO_VPAD_PATH SD_PATH WIIU_PATH "/apps/hidtovpad" void rumbleChanged(bool newValue) { DEBUG_FUNCTION_LINE("rumbleChanged %d \n",newValue); @@ -50,24 +50,24 @@ WUPS_GET_CONFIG() { DEINITIALIZE_PLUGIN() { //CursorDrawer::destroyInstance(); ControllerPatcher::DeInit(); - ControllerPatcher::stopNetworkServer(); + ControllerPatcher::stopNetworkServer(); } -ON_APPLICATION_START(args){ +ON_APPLICATION_START(args) { socket_lib_init(); log_init(); - DEBUG_FUNCTION_LINE("Initializing the controller data\n"); - ControllerPatcher::Init(CONTROLLER_PATCHER_PATH); + DEBUG_FUNCTION_LINE("Initializing the controller data\n"); + ControllerPatcher::Init(CONTROLLER_PATCHER_PATH); ControllerPatcher::disableControllerMapping(); DEBUG_FUNCTION_LINE("Starting HID to VPAD network server\n"); ControllerPatcher::startNetworkServer(); ControllerPatcher::disableWiiUEnergySetting(); } -ON_APP_STATUS_CHANGED(status){ - if(status == WUPS_APP_STATUS_CLOSED){ - //CursorDrawer::destroyInstance(); +ON_APP_STATUS_CHANGED(status) { + if(status == WUPS_APP_STATUS_CLOSED) { + //CursorDrawer::destroyInstance(); DEBUG_FUNCTION_LINE("ON_APPLICATION_ENDING\n"); ControllerPatcher::destroyConfigHelper(); DEBUG_FUNCTION_LINE("Calling stopNetworkServer\n"); @@ -82,28 +82,28 @@ DECL_FUNCTION(int32_t, VPADRead, VPADChan chan, VPADStatus *buffer, uint32_t buf int32_t result = real_VPADRead(chan, buffer, buffer_size, error); //A keyboard only sends data when the state changes. We force it to call the sampling callback on each frame! ControllerPatcher::sampleKeyboardData(); - + bool do_callback = (result > 0 && (buffer[0].hold & VPAD_BUTTON_TV)); ControllerPatcher::handleCallbackData(do_callback); - if(ControllerPatcher::areControllersConnected() && buffer_size > 0){ + if(ControllerPatcher::areControllersConnected() && buffer_size > 0) { ControllerPatcher::setRumble(UController_Type_Gamepad,!!VPADBASEGetMotorOnRemainingCount(VPAD_CHAN_0)); - if(ControllerPatcher::setControllerDataFromHID(buffer) == CONTROLLER_PATCHER_ERROR_NONE){ + if(ControllerPatcher::setControllerDataFromHID(buffer) == CONTROLLER_PATCHER_ERROR_NONE) { - if(buffer[0].hold & VPAD_BUTTON_HOME){ + if(buffer[0].hold & VPAD_BUTTON_HOME) { //You can open the home menu this way, but not close it. Need a proper way to close it using the same button... //OSSendAppSwitchRequest(5,0,0); //Open the home menu! } - if(error != NULL){ + if(error != NULL) { *error = 0; } result = 1; // We want the WiiU to ignore everything else. } } - if(ControllerPatcher::isButtonRemappingDone()){ + if(ControllerPatcher::isButtonRemappingDone()) { ControllerPatcher::buttonRemapping(buffer,result); //ControllerPatcher::printVPADButtons(buffer); //Leads to random crashes on app transitions. } @@ -111,4 +111,4 @@ DECL_FUNCTION(int32_t, VPADRead, VPADChan chan, VPADStatus *buffer, uint32_t buf return result; } -WUPS_MUST_REPLACE(VPADRead, WUPS_LOADER_LIBRARY_VPAD, VPADRead); +WUPS_MUST_REPLACE(VPADRead, WUPS_LOADER_LIBRARY_VPAD, VPADRead);