static void Draw(void)
{
    int i;
    systime_t current = chVTGetSystemTime();
    /* clear buffer */
    memset(display.pixels, 0, sizeof(struct Color) * LEDCOUNT);

    if (effects.p_next != NULL)
    {
        EffectUpdate(effects.p_next, 0, 0, current, &display);
    }

    /* render volume for a 5s */
    if (showVolume == true)
    {
        startVolumeEffect = current;
        showVolume = false;
        effVolume_cfg.volume = newVolume;
        showVolumeEffect = true;
        if (chVTTimeElapsedSinceX(startVolumeEffect) > MS2ST(15000))
        {
            EffectReset(&effVolume, 0, 0, current);
        }
    }

    if (showVolumeEffect == true)
    {
        if (chVTTimeElapsedSinceX(startVolumeEffect) <= MS2ST(5000))
        {
            EffectUpdate(&effVolume, 0, 0, current, &display);
        }
        else
        {
            showVolumeEffect = false;
        }
    }

    //draw buttons
    if (showControls == true)
    {
        EffectUpdate(&effButtons, 0, 0, current, &display);
    }

    for (i = 0; i < LEDCOUNT; i++)
    {
        SetLedColor(i, &display.pixels[i]);
    }
    SetUpdateLed();
}
Ejemplo n.º 2
0
//=========================================================
//=========================================================
void CWeaponGravityGun::PrimaryAttack( void )
{
	if ( !m_active )
	{
		SendWeaponAnim( ACT_VM_PRIMARYATTACK );
		EffectCreate();
		SoundCreate();
	}
	else
	{
		EffectUpdate();
		SoundUpdate();
	}
}
Ejemplo n.º 3
0
void TestEffect::Update(systime_t ticks, DisplayBuffer& buffer)
{
    EffectUpdate(&m_Eff, -1, -1, ticks, &buffer);
}
Ejemplo n.º 4
0
void CWeaponGravityGun::EffectCreate( void )
{
	EffectUpdate();
	m_active = true;
}