mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-11 15:59:08 +01:00
Hold max and min lightbar color for pulse charging animation
This commit is contained in:
parent
99c812301d
commit
8859879396
@ -36,7 +36,7 @@ namespace DS4Windows
|
|||||||
internal const int PULSE_FLASH_DURATION = 2000;
|
internal const int PULSE_FLASH_DURATION = 2000;
|
||||||
internal const double PULSE_FLASH_SEGMENTS = PULSE_FLASH_DURATION / 40;
|
internal const double PULSE_FLASH_SEGMENTS = PULSE_FLASH_DURATION / 40;
|
||||||
internal const int PULSE_CHARGING_DURATION = 4000;
|
internal const int PULSE_CHARGING_DURATION = 4000;
|
||||||
internal const double PULSE_CHARGING_SEGMENTS = PULSE_CHARGING_DURATION / 40;
|
internal const double PULSE_CHARGING_SEGMENTS = (PULSE_CHARGING_DURATION / 40) - 2;
|
||||||
|
|
||||||
public static void updateLightBar(DS4Device device, int deviceNum)
|
public static void updateLightBar(DS4Device device, int deviceNum)
|
||||||
{
|
{
|
||||||
@ -190,6 +190,8 @@ namespace DS4Windows
|
|||||||
if (elapsed < PULSE_CHARGING_DURATION)
|
if (elapsed < PULSE_CHARGING_DURATION)
|
||||||
{
|
{
|
||||||
elapsed = elapsed / 40;
|
elapsed = elapsed / 40;
|
||||||
|
if (elapsed > PULSE_CHARGING_SEGMENTS)
|
||||||
|
elapsed = (long)PULSE_CHARGING_SEGMENTS;
|
||||||
ratio = 100.0 * (elapsed / PULSE_CHARGING_SEGMENTS);
|
ratio = 100.0 * (elapsed / PULSE_CHARGING_SEGMENTS);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -203,6 +205,8 @@ namespace DS4Windows
|
|||||||
if (elapsed < PULSE_CHARGING_DURATION)
|
if (elapsed < PULSE_CHARGING_DURATION)
|
||||||
{
|
{
|
||||||
elapsed = elapsed / 40;
|
elapsed = elapsed / 40;
|
||||||
|
if (elapsed > PULSE_CHARGING_SEGMENTS)
|
||||||
|
elapsed = (long)PULSE_CHARGING_SEGMENTS;
|
||||||
ratio = (0 - 100.0) * (elapsed / PULSE_CHARGING_SEGMENTS) + 100.0;
|
ratio = (0 - 100.0) * (elapsed / PULSE_CHARGING_SEGMENTS) + 100.0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user