|
|
@ -412,20 +412,20 @@ private: |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Return lights for the given pad and pad state, using the loaded panel animations.
|
|
|
|
// Return lights for the given pad and pad state, using the loaded panel animations.
|
|
|
|
void GetCurrentLights(string &asLightsDataOut, int pad, int iPadState) |
|
|
|
bool GetCurrentLights(string &asLightsDataOut, int pad, int iPadState) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_Lock.AssertLockedByCurrentThread(); |
|
|
|
m_Lock.AssertLockedByCurrentThread(); |
|
|
|
|
|
|
|
|
|
|
|
// Get this pad's configuration.
|
|
|
|
// Get this pad's configuration.
|
|
|
|
SMXConfig config; |
|
|
|
SMXConfig config; |
|
|
|
if(!SMXManager::g_pSMX->GetDevice(pad)->GetConfig(config)) |
|
|
|
if(!SMXManager::g_pSMX->GetDevice(pad)->GetConfig(config)) |
|
|
|
return; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
// If this controller handles animation itself, don't handle it here too. It can
|
|
|
|
// If this controller handles animation itself, don't handle it here too. It can
|
|
|
|
// lead to confusing situations if SMXConfig's animations don't match the ones stored
|
|
|
|
// lead to confusing situations if SMXConfig's animations don't match the ones stored
|
|
|
|
// on the pad.
|
|
|
|
// on the pad.
|
|
|
|
if(config.masterVersion >= 4) |
|
|
|
if(config.masterVersion >= 4) |
|
|
|
return; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
AnimationStateForPad &pad_state = pad_states[pad]; |
|
|
|
AnimationStateForPad &pad_state = pad_states[pad]; |
|
|
|
|
|
|
|
|
|
|
@ -453,20 +453,24 @@ private: |
|
|
|
for(auto &animation_state: pad_state.animations[panel]) |
|
|
|
for(auto &animation_state: pad_state.animations[panel]) |
|
|
|
animation_state.Update(); |
|
|
|
animation_state.Update(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Run a single light animation update.
|
|
|
|
// Run a single light animation update.
|
|
|
|
void UpdateLights() |
|
|
|
void UpdateLights() |
|
|
|
{ |
|
|
|
{ |
|
|
|
string asLightsData[2]; |
|
|
|
string asLightsData[2]; |
|
|
|
|
|
|
|
bool bHaveLights = false; |
|
|
|
for(int pad = 0; pad < 2; pad++) |
|
|
|
for(int pad = 0; pad < 2; pad++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int iPadState = SMXManager::g_pSMX->GetDevice(pad)->GetInputState(); |
|
|
|
int iPadState = SMXManager::g_pSMX->GetDevice(pad)->GetInputState(); |
|
|
|
GetCurrentLights(asLightsData[pad], pad, iPadState); |
|
|
|
if(GetCurrentLights(asLightsData[pad], pad, iPadState)) |
|
|
|
|
|
|
|
bHaveLights = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Update lights.
|
|
|
|
// Update lights.
|
|
|
|
SMXManager::g_pSMX->SetLights(asLightsData); |
|
|
|
if(bHaveLights) |
|
|
|
|
|
|
|
SMXManager::g_pSMX->SetLights(asLightsData); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|