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(); }
//========================================================= //========================================================= void CWeaponGravityGun::PrimaryAttack( void ) { if ( !m_active ) { SendWeaponAnim( ACT_VM_PRIMARYATTACK ); EffectCreate(); SoundCreate(); } else { EffectUpdate(); SoundUpdate(); } }
void TestEffect::Update(systime_t ticks, DisplayBuffer& buffer) { EffectUpdate(&m_Eff, -1, -1, ticks, &buffer); }
void CWeaponGravityGun::EffectCreate( void ) { EffectUpdate(); m_active = true; }