Fix SMX_GetConfig not returning a result.

This caused SMXConfig to think it was setting both controller configurations even
when only one was connected, which made the UI not refresh correctly if only P2
was connected.
master
Glenn Maynard 7 years ago
parent 4610748374
commit eb84ffe29d
  1. 5
      sdk/SMX.h
  2. 2
      sdk/Windows/SMX.cpp

@ -79,7 +79,10 @@ extern "C" SMX_API void SMX_SetLights(const char lightsData[864]);
extern "C" SMX_API void SMX_ReenableAutoLights(); extern "C" SMX_API void SMX_ReenableAutoLights();
// Get the current controller's configuration. // Get the current controller's configuration.
extern "C" SMX_API void SMX_GetConfig(int pad, SMXConfig *config); //
// Return true if a configuration is available. If false is returned, no panel is connected
// and no data will be set.
extern "C" SMX_API bool SMX_GetConfig(int pad, SMXConfig *config);
// Update the current controller's configuration. This doesn't block, and the new configuration will // Update the current controller's configuration. This doesn't block, and the new configuration will
// be sent in the background. SMX_GetConfig will return the new configuration as soon as this call // be sent in the background. SMX_GetConfig will return the new configuration as soon as this call

@ -53,7 +53,7 @@ SMX_API void SMX_SetLogCallback(SMXLogCallback callback)
}); });
} }
SMX_API void SMX_GetConfig(int pad, SMXConfig *config) { g_pSMX->GetDevice(pad)->GetConfig(*config); } SMX_API bool SMX_GetConfig(int pad, SMXConfig *config) { return g_pSMX->GetDevice(pad)->GetConfig(*config); }
SMX_API void SMX_SetConfig(int pad, const SMXConfig *config) { g_pSMX->GetDevice(pad)->SetConfig(*config); } SMX_API void SMX_SetConfig(int pad, const SMXConfig *config) { g_pSMX->GetDevice(pad)->SetConfig(*config); }
SMX_API void SMX_GetInfo(int pad, SMXInfo *info) { g_pSMX->GetDevice(pad)->GetInfo(*info); } SMX_API void SMX_GetInfo(int pad, SMXInfo *info) { g_pSMX->GetDevice(pad)->GetInfo(*info); }
SMX_API uint16_t SMX_GetInputState(int pad) { return g_pSMX->GetDevice(pad)->GetInputState(); } SMX_API uint16_t SMX_GetInputState(int pad) { return g_pSMX->GetDevice(pad)->GetInputState(); }

Loading…
Cancel
Save