Esempio n. 1
0
void Cursor::setMode(Cursor::Mode m) {
  // m_mode = m;
  if (m_mode == m) {
    return;
  }
  m_mode = m;

  switch (m) {
  case Mode::PanningGallery:
    setImage(images[ordinal(Mode::PanningImage)]);
    setAnimate(false);
    break;

  case Mode::PanningImage:
    setImage(images[ordinal(Mode::PanningImage)]);
    break;

  case Mode::Selecting:
    setImage(images[ordinal(Mode::Selecting)]);
    setAnimate(true);
    break;

  case Mode::Selected:
    setImage(images[ordinal(Mode::Selected)]);
    setAnimate(false);
    break;

  case Mode::Normal:
  default:
    setImage(images[ordinal(Mode::Normal)]);
    setAnimate(false);
    break;
  }
}
Esempio n. 2
0
void effectFlame(struct Animate *a) {
	int yellow[3] = {255, rand() % 51 + 75, rand() % 10 + 1};
	int red = rand() % 16 + 240;

	if (a->open) {
		setAnimate(a, (yellow[0] + red) / 2, yellow[1], yellow[2], 0, 15);
	}
	nextStep(a);
}
Esempio n. 3
0
void Cursor::update(float dt) {

  if (m_animate) {
    m_angle += (m_da * dt);
    if (m_angle > 365.0f) {
      setAnimate(false);
    }
  }
}
Esempio n. 4
0
void Context::copySimulationContext(const Context& c)
{
    worldGravity_.setValue(c.getGravity());  ///< Gravity IN THE WORLD COORDINATE SYSTEM.
    setDt(c.getDt());
    setTime(c.getTime());
    setAnimate(c.getAnimate());



}
Esempio n. 5
0
void Context::copySimulationContext(const Context& c)
{
    worldGravity_.setValue(c.getGravity());  ///< Gravity IN THE WORLD COORDINATE SYSTEM.
    setDt(c.getDt());
    setTime(c.getTime());
    setAnimate(c.getAnimate());
#ifdef SOFA_SMP
    if(c.gpuPrioritary.getValue())
        gpuPrioritary.setValue(true);
#endif

#ifdef SOFA_SUPPORT_MOVING_FRAMES
    setPositionInWorld( c.getPositionInWorld());
    spatialVelocityInWorld_ = c.spatialVelocityInWorld_;
    velocityBasedLinearAccelerationInWorld_ = c.velocityBasedLinearAccelerationInWorld_;
#endif

#ifdef SOFA_SUPPORT_MULTIRESOLUTION
    // for multiresolution
// 	finestLevel_ = c.finestLevel_;
// 	coarsestLevel_ = c.coarsestLevel_;
// 	currentLevel_ = c.currentLevel_;
#endif

#ifdef SOFA_SMP
    if(!partition_)
    {
        if(processor.getValue()!=-1)
            is_partition_.setValue(true);
        if(is_partition())
        {

            partition_= new Iterative::IterativePartition();
//          partition_->setCPU(processor.getValue());
        }
    }
    if(processor.getValue()==-1&&c.processor.getValue()!=-1)
    {
        processor.setValue(c.processor.getValue());
        is_partition_.setValue(true);
    }
    if(c.is_partition()&&!partition_)
    {
        partition_=c.getPartition();
        is_partition_.setValue(true);
    }
    if((gpuPrioritary.getValue())&&partition_)
    {
        partition_->setGPUPrioritary();
    }

#endif

}
Esempio n. 6
0
Audio::Audio(): mStateInput(StateInput::getInstance()),
    mMainBackground("Main", 1, 1),
    mInGameBackground("Ingame", 1, 1),
    mSoundVolume("SoundVolume", 1, 2),
    mEffectLeftArrow("LeftArrow", 1, 2),
    mEffectRightArrow("RightArrow", 1, 2),
    mEffectNumbers1("Numbers", 1, 20),
    mEffectNumbers10("Numbers", 1, 20),
    mEffectNumbers100("Numbers", 1, 20),
    mMusicVolume("MusicVolume", 1, 2),
    mMusicLeftArrow("LeftArrow", 1, 2),
    mMusicRightArrow("RightArrow", 1, 2),
    mMusicNumbers1("Numbers", 1, 20),
    mMusicNumbers10("Numbers", 1, 20),
    mMusicNumbers100("Numbers", 1, 20),
    mSoundMute("SoundMute", 1, 4),
    mMusicMute("MusicMute", 1, 4),
    mBack("Back", 1, 2),
    mBlip("Blip", 1, 1),
    mWindow(Window::getWindow()),
    mStatus(0),
    mBlipPos(240, 150),
    currentBackground(&mMainBackground),
    currentSelection(&mBack),
    mEVolume(100),
    mMVolume(100),
    mChangeVolume(false),
    mEffectNr1(0),
    mEffectNr10(0),
    mEffectNr100(1),
    mEffectHighlightNr(0),
    mMusicNr1(0),
    mMusicNr10(0),
    mMusicNr100(1),
    mMusicHighlightNr(0),
    mEMute(false),
    mMMute(false),
    mHighlight(1)

{
    setSpritePosition();
    setAnimate();
}
	void FalagardActionButton::updateAnimate(ANIMATE& animate)
	{
		if(!animate.d_animate) return;

		int time_now = (int)(System::getSingleton().getCurTimeElapsed()*1000.0f);

		const Image* pFrame = animate.d_animate->getFrame( time_now-animate.d_time_start, animate.d_time_total );
	
		animate.d_currentFrame = pFrame;
		animate.d_alpha = animate.d_animate->getFrameAlpha( time_now-animate.d_time_start, animate.d_time_total );
		requestRedraw();
		if( pFrame == NULL )
		{
			if( m_bCoolDown ) // 如果是cooldown ,就开始播放特效动画
			{
				setAnimate( "CoolDownEnd", -1, 0 );
				animate.d_alpha = 0;
			}
		}
	}
Esempio n. 8
0
HippoBubble::HippoBubble(void)
{
    idle_ = FALSE;
    screenSaverRunning_ = FALSE;
    haveMouse_ = FALSE;
    effectiveIdle_ = FALSE;
    shown_ = FALSE;
    desiredWidth_ = BASE_WIDTH;
    desiredHeight_ = BASE_HEIGHT;
    layerDC_ = NULL;
    oldBitmap_ = NULL;
    images_ = NULL;
 
    // Notes on animation
    // 
    // * Without our usage of UpdateLayeredWindow, it would fade the window in and
    // out using AnimateWindow, but you turn on fading in then you'll probably have difficulties 
    // the second time you show the window ... it appears that the web browser control has some 
    // bugs with WM_PRINTCLIENT; the first time the contents of the window are properly
    // initialized before fade-in, but on subsequent shows they are not. A crude
    // workaround might be to reembed a new control every time, but there are probably
    // less sledgehammer methods. Even without animation there are sometimes problems
    // with reshowing the window, which is why we turn on updateOnShow(). (This may
    // no longer be necessary with our usage of UpdateLayeredWindow())
    //
    // * AnimateWindow isn't compatible with UpdateLayeredWindow() ... when you start
    // animating the window, the shape is removed. This is presumably because AnimateWindow
    // internally uses SetLayeredWindowAttributes, which is exclusive with UpdateLayeredWindow
    // So to animate a shaped window, we'd have to fade the bits in and out ourselves.
    //
    setAnimate(false);
    setUseParent(true);
    setUpdateOnShow(true);
    setWindowStyle(WS_POPUP);
    setExtendedStyle(WS_EX_TOPMOST | WS_EX_LAYERED | WS_EX_NOACTIVATE);
    setClassName(L"HippoBubbleClass");
    setTitle(L"Hippo Notification");
    setApplication(this);
}