Fixing controller input.

This commit is contained in:
Ben Vanik 2014-05-28 20:19:28 -07:00
parent c06526e5df
commit 18b1f9f513
2 changed files with 18 additions and 21 deletions

View File

@ -86,22 +86,19 @@ void AudioSystem::ThreadStart() {
}
size_t pumped = 0;
{
SCOPE_profile_cpu_i("apu", "Pump");
if (result >= WAIT_OBJECT_0 && result <= WAIT_OBJECT_0 + (maximum_client_count_ - 1)) {
size_t index = result - WAIT_OBJECT_0;
do {
xe_mutex_lock(lock_);
uint32_t client_callback = clients_[index].callback;
uint32_t client_callback_arg = clients_[index].wrapped_callback_arg;
xe_mutex_unlock(lock_);
if (client_callback) {
processor->Execute(thread_state_, client_callback, client_callback_arg, 0);
}
pumped++;
index++;
} while (index < maximum_client_count_ && WaitForSingleObject(client_wait_handles_[index], 0) == WAIT_OBJECT_0);
}
if (result >= WAIT_OBJECT_0 && result <= WAIT_OBJECT_0 + (maximum_client_count_ - 1)) {
size_t index = result - WAIT_OBJECT_0;
do {
xe_mutex_lock(lock_);
uint32_t client_callback = clients_[index].callback;
uint32_t client_callback_arg = clients_[index].wrapped_callback_arg;
xe_mutex_unlock(lock_);
if (client_callback) {
processor->Execute(thread_state_, client_callback, client_callback_arg, 0);
}
pumped++;
index++;
} while (index < maximum_client_count_ && WaitForSingleObject(client_wait_handles_[index], 0) == WAIT_OBJECT_0);
}
if (!running_) {

View File

@ -46,16 +46,16 @@ InputSystem* xe::hid::Create(Emulator* emulator) {
// NOTE: in any mode we create as many as we can, falling back to nop.
#if XE_PLATFORM_WIN32
InputDriver* winkey_driver = xe::hid::winkey::Create(input_system);
if (winkey_driver) {
input_system->AddDriver(winkey_driver);
any_created = true;
}
InputDriver* xinput_driver = xe::hid::xinput::Create(input_system);
if (xinput_driver) {
input_system->AddDriver(xinput_driver);
any_created = true;
}
InputDriver* winkey_driver = xe::hid::winkey::Create(input_system);
if (winkey_driver) {
input_system->AddDriver(winkey_driver);
any_created = true;
}
#endif // WIN32
// Fallback to nop if none created.