Exemplo n.º 1
0
void HoldJudgment::SetHoldJudgment( HoldNoteScore hns )
{
	//LOG->Trace( "Judgment::SetJudgment()" );

	// Matt: To save API. Command can handle if desired.
	if( hns != HNS_Missed )
	{
		ResetAnimation();
	}

	switch( hns )
	{
	case HNS_Held:
		m_sprJudgment->SetState( 0 );
		m_sprJudgment->PlayCommand( "Held" );
		break;
	case HNS_LetGo:
		m_sprJudgment->SetState( 1 );
		m_sprJudgment->PlayCommand( "LetGo" );
		break;
	case HNS_Missed:
		//m_sprJudgment->SetState( 2 ); // Matt: Not until after 5.0
		m_sprJudgment->PlayCommand( "MissedHold" );
		break;
	case HNS_None:
	default:
		FAIL_M(ssprintf("Cannot set hold judgment to %i", hns));
	}
}
Exemplo n.º 2
0
void
RasterImage::RecoverFromInvalidFrames(const IntSize& aSize, uint32_t aFlags)
{
  if (!mHasSize) {
    return;
  }

  NS_WARNING("A RasterImage's frames became invalid. Attempting to recover...");

  // Discard all existing frames, since they're probably all now invalid.
  SurfaceCache::RemoveImage(ImageKey(this));

  // Relock the image if it's supposed to be locked.
  if (mLockCount > 0) {
    SurfaceCache::LockImage(ImageKey(this));
  }

  // Animated images require some special handling, because we normally require
  // that they never be discarded.
  if (mAnimationState) {
    Decode(mSize, aFlags | FLAG_SYNC_DECODE, PlaybackType::eAnimated);
    ResetAnimation();
    return;
  }

  // For non-animated images, it's fine to recover using an async decode.
  Decode(aSize, aFlags, PlaybackType::eStatic);
}
Exemplo n.º 3
0
////////////////////////////////////////
//		PUBLIC UTILITY FUNCTIONS
////////////////////////////////////////
// Gets the current frame in the animation
// and moves to the next one in order.
RECT CAnimation::GetFrame()
{
	SetTimeWaited(GetTimeWaited() + GAME->GetTimer().GetDeltaTime());

	RECT tRect;
	
	tRect.left = GetCurrentFrame() * GetFrameWidth();
	tRect.top = 0;
	tRect.right = tRect.left + GetFrameWidth();
	tRect.bottom = tRect.top + GetFrameHeight();	
	
				
	if(GetTimeWaited() > GetTimePerFrame() && !GetStatic())
	{	
		SetTimeWaited(0.0f);
		SetCurrentFrame(GetCurrentFrame() + 1);

		if(GetCurrentFrame() > GetFrameCount())
		{
			if(GetLooping())
				ResetAnimation();	
			else
			{
				SetCurrentFrame(GetFrameCount());
				SetStatic(true);
			}
		}
		
	}

	return tRect;
}
Exemplo n.º 4
0
MAS::Widget *MAS::Window::Popup(MAS::Dialog *p, int xx, int yy, MAS::Widget *f) {
   SetAnimationProperties(skin->winAnimationLength, skin->winAnimationType);

   Animate();
   Widget *ret = Dialog::Popup(p, xx, yy, f);
   ResetAnimation();
   return ret;
}
Exemplo n.º 5
0
void HoldJudgment::Load( const RString &sPath )
{
	m_sprJudgment.Load( sPath );
	m_sprJudgment->StopAnimating();
	m_sprJudgment->SetName( "HoldJudgment" );
	ActorUtil::LoadAllCommands( *m_sprJudgment, "HoldJudgment" );
	ResetAnimation();
	this->AddChild( m_sprJudgment );
}
Exemplo n.º 6
0
 void SetAnimation(int y=0,int maxFrames=0,float timer=-1){
     if (timer >= 0){
         SetAnimationTime(timer);
     }
     isFormated = false;
     sprY = y;
     MaxFrames = maxFrames;
     ResetAnimation();
 }
Exemplo n.º 7
0
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
//		¥ RestartProgram
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// starts a program from the beginning
void CProgMoanChannel::RestartProgram()
{
    std::memset(mLocalRegs,0,sizeof(mLocalRegs));
    ResetAnimation();
    ResetMovement();
    ResetScale();
    ResetRotate();
    mState=kRunning;
    inheritedChannel::RestartProgram();
}
bool CHL2MP_Player::Weapon_Switch( CBaseCombatWeapon *pWeapon, int viewmodelindex )
{
	bool bRet = BaseClass::Weapon_Switch( pWeapon, viewmodelindex );

	if ( bRet == true )
	{
		ResetAnimation();
	}

	return bRet;
}
Exemplo n.º 9
0
void Game_Vehicle::UpdateAnimationAirship() {
	if (IsAboard()) {
		const auto limit = 11;

		IncAnimCount();

		if (GetAnimCount() > limit) {
			IncAnimFrame();
		}
	} else {
		ResetAnimation();
	}
}
//-----------------------------------------------------------------------------
// Purpose: Sets HL2 specific defaults.
//-----------------------------------------------------------------------------
void CHL2MP_Player::Spawn(void)
{
	m_flNextModelChangeTime = 0.0f;
	m_flNextTeamChangeTime = 0.0f;

	PickDefaultSpawnTeam();

	BaseClass::Spawn();
	
	if ( !IsObserver() )
	{
		pl.deadflag = false;
		RemoveSolidFlags( FSOLID_NOT_SOLID );

		RemoveEffects( EF_NODRAW );
		
		GiveDefaultItems();
	}

	SetNumAnimOverlays( 3 );
	ResetAnimation();

	m_nRenderFX = kRenderNormal;

	m_Local.m_iHideHUD = 0;
	
	AddFlag(FL_ONGROUND); // set the player on the ground at the start of the round.

	m_impactEnergyScale = HL2MPPLAYER_PHYSDAMAGE_SCALE;

	if ( HL2MPRules()->IsIntermission() )
	{
		AddFlag( FL_FROZEN );
	}
	else
	{
		RemoveFlag( FL_FROZEN );
	}

	m_iSpawnInterpCounter = (m_iSpawnInterpCounter + 1) % 8;

	m_Local.m_bDucked = false;

	SetPlayerUnderwater(false);

	m_bReady = false;

	m_flNextKickAttack = gpGlobals->curtime;
	CBaseViewModel *Leg = GetViewModel(1);
	Leg->SetWeaponModel("models/weapons/v_kick.mdl", NULL);
}
Exemplo n.º 11
0
	void CSprite::SetAnimation(const char* anim_name, __INT32 loop)
	{
		if (!m_SpriteData) return;
		ResetAnimation();
		m_SpriteData->m_Anims.BeginTravel();
		while (!m_SpriteData->m_Anims.IsEndOfTravel())
		{
			SSpriteDBAnimation *anim = m_SpriteData->m_Anims.Travel();
			if (strcmp(anim_name, anim->Name) == 0)
			{
				m_pCurrentAnimation = anim;
			}
		}
		m_iLoop = loop;
		m_iCurrentAnimTotalFrame = 0;
		m_iLoopCounter = loop;
	}
Exemplo n.º 12
0
//==============================================================================================================================
void TextureAnimation3D::NextFrame(int speed)
{
	//Sleep for 1/speed of a second (if speed=0 then do not sleep at all)
	mAnimSleep->Sleep(speed);

	if (mAnimSleep->IsTimeUp())
	{
		int testFrame = (int)(fCurrFrameID + 1.0f);

		if (testFrame < m_pTextures.size())
		{
			bLastFrame = false;
			fCurrFrameID += 0.1f;
		}
		else
		{
			bLastFrame = true;
			ResetAnimation();
		}
	}
}
Exemplo n.º 13
0
bool CGUIControl::CheckAnimation(ANIMATION_TYPE animType)
{
  // rule out the animations we shouldn't perform
  if (!IsVisible() || !HasProcessed())
  { // hidden or never processed - don't allow exit or entry animations for this control
    if (animType == ANIM_TYPE_WINDOW_CLOSE)
    { // could be animating a (delayed) window open anim, so reset it
      ResetAnimation(ANIM_TYPE_WINDOW_OPEN);
      return false;
    }
  }
  if (!IsVisible())
  { // hidden - only allow hidden anims if we're animating a visible anim
    if (animType == ANIM_TYPE_HIDDEN && !IsAnimating(ANIM_TYPE_VISIBLE))
    {
      // update states to force it hidden
      UpdateStates(animType, ANIM_PROCESS_NORMAL, ANIM_STATE_APPLIED);
      return false;
    }
    if (animType == ANIM_TYPE_WINDOW_OPEN)
      return false;
  }
  return true;
}
Exemplo n.º 14
0
void MD2MeshImpl::SetEndFrame( int iNewEndFrame )
{
   iEndFrame = iNewEndFrame;
   ResetAnimation();
}
Exemplo n.º 15
0
 Animation(float w,float h):Animation(){
    SetGridSize(w,h);
    ResetAnimation();
 };
Exemplo n.º 16
0
void MAS::Widget::MsgEnd()         {
   GetParent()->HandleEvent(*this, MSG_END);
   ClearFlag(D_GOTFOCUS | D_GOTMOUSE | D_CHANGEDSKIN | D_MOVED | D_RESIZED);
   ResetAnimation();
}
Exemplo n.º 17
0
void MD2MeshImpl::SetStartFrame( int iNewStartFrame )
{
   iStartFrame = iNewStartFrame;
   ResetAnimation();
}
Exemplo n.º 18
0
//------------------------------------------------------------------------
void CDebugGun::Shoot(bool bPrimary)
{   
  CWeapon::StartFire();

  ResetAnimation();
  
  // console cmd      
  string cmd;  

  cmd = (bPrimary) ? g_pGameCVars->i_debuggun_1->GetString() : g_pGameCVars->i_debuggun_2->GetString();  
  cmd += " ";        
        
  unsigned int flags = rwi_stop_at_pierceable|rwi_colltype_any;
  
  if (m_fireModes[m_fireMode].first == "pierceability")
  { 
    flags = (unsigned int)m_fireModes[m_fireMode].second & rwi_pierceability_mask;
  }
  
  IPhysicalWorld* pWorld = gEnv->pPhysicalWorld;
  IPhysicalEntity *pSkip = GetOwnerActor()->GetEntity()->GetPhysics();
  ray_hit rayhit;
  int hits = 0;

  CCamera& cam = GetISystem()->GetViewCamera();
  Vec3 pos = cam.GetPosition()+cam.GetViewdir();
  Vec3 dir = cam.GetViewdir() * HIT_RANGE;

  IEntity* pEntity = 0;

  if (hits = pWorld->RayWorldIntersection(pos, dir, ent_all, flags, &rayhit, 1, &pSkip, 1))
  {
    pEntity = (IEntity*)rayhit.pCollider->GetForeignData(PHYS_FOREIGN_ID_ENTITY);        
  }
  
  cmd.append(pEntity ? pEntity->GetName() : "0");   
  
  // if we execute an AI command take care of ai_debugdraw
  if (cmd.substr(0, 3) == "ai_")
  {
    if (pEntity && m_pAIDebugDraw->GetIVal() == 0)
      m_pAIDebugDraw->Set(1);
    else if(!pEntity && m_aiDebugDrawPrev == 0 && m_pAIDebugDraw->GetIVal() == 1)
      m_pAIDebugDraw->Set(0);
  }

  gEnv->pConsole->ExecuteString(cmd.c_str());

  // if 2nd button hits a vehicle, enable movement profiling  
  if (!bPrimary)
  {
    static IVehicleSystem* pVehicleSystem = g_pGame->GetIGameFramework()->GetIVehicleSystem();
     
    string vehicleCmd = "v_debugVehicle ";
    vehicleCmd.append((pEntity && pVehicleSystem->GetVehicle(pEntity->GetId())) ? pEntity->GetName() : "0");
    
    gEnv->pConsole->ExecuteString(vehicleCmd.c_str());
  }

  OnShoot(GetOwnerId(), 0, 0, pos, dir, Vec3(ZERO));
}
Exemplo n.º 19
0
void MD2MeshImpl::SetFrameRate( int iNewFrameRate )
{
   iFrameRate = iNewFrameRate;
   ResetAnimation();
}