Пример #1
0
void CScriptCameraHint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr) {
  switch (msg) {
  case EScriptObjectMessage::Deleted:
  case EScriptObjectMessage::Deactivate:
    mgr.GetCameraManager()->DeleteCameraHint(GetUniqueId(), mgr);
    break;
  case EScriptObjectMessage::InitializedInArea:
    InitializeInArea(mgr);
    break;
  default:
    break;
  }

  if (GetActive()) {
    switch (msg) {
    case EScriptObjectMessage::Increment:
      AddHelper(sender);
      mgr.GetCameraManager()->AddActiveCameraHint(GetUniqueId(), mgr);
      x166_inactive = false;
      break;
    case EScriptObjectMessage::Decrement:
      RemoveHelper(sender);
      mgr.GetCameraManager()->AddInactiveCameraHint(GetUniqueId(), mgr);
      break;
    default:
      break;
    }
  }

  if (msg == EScriptObjectMessage::Follow) {
    if (!GetActive()) {
      if (TCastToConstPtr<CActor> act = mgr.GetObjectById(sender)) {
        zeus::CVector3f followerToThisFlat = x168_origXf.origin - act->GetTranslation();
        followerToThisFlat.z() = 0.f;
        if (followerToThisFlat.canBeNormalized())
          followerToThisFlat.normalize();
        else
          followerToThisFlat = act->GetTransform().basis[1];
        zeus::CVector3f target = act->GetTranslation() + followerToThisFlat;
        target.z() = x168_origXf.origin.z() + followerToThisFlat.z();
        SetTransform(zeus::lookAt(act->GetTranslation(), target));
      }
    }
    AddHelper(sender);
    mgr.GetCameraManager()->AddActiveCameraHint(GetUniqueId(), mgr);
  }

  CActor::AcceptScriptMsg(msg, sender, mgr);
}
void ScreenLogin::keyPressEvent(QKeyEvent *e)
{
    if( !GetActive() ) return;

    if( e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return )
        w_login->connectToServer();
}
Пример #3
0
void Window_Selectable::DrawContent() const{
	TCHAR buf[WND_SELECTABLE_TITLELENGTH];
	BYTE color;
	int contentSize = 0;
	BYTE _state = state;
	if(GetActive()){
		if(drawFocus){
			DrawFocus();
		}
		int cntX = frameArea.x + contentArea.x;
		int cntY = frameArea.y + contentArea.y;
		// タイトルを描画する場合
		if(useTitle){
			GetTitle(buf);
			DrawStringToHandle(
				cntX + GetDrawDeltaX(buf, -1, titleFontSize.hFont), 
				cntY, buf,
				GetPresetColor(presetColorIndex, COLORSET_COLOR_NORMAL),
				titleFontSize.hFont);
			cntY += titleFontSize.lineHeight;
		}

		// 各選択肢の描画
		contentSize = num;
		for(int n=0; n<contentSize; n++){
			color = select.isActive[n] ? ((select.index == n) 
			? WND_SELECTABLE_COLOR_SELECTED : WND_SELECTABLE_COLOR_ACTIVE) 
			: WND_SELECTABLE_COLOR_INACTIVE,
			DrawContentItem(n, color);
		}
	}
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
}
Пример #4
0
CChildWnd* CWindowManager::Open(CRuntimeClass* pClass, BOOL bFocus)
{
	CSingleLock pLock( &theApp.m_pSection, TRUE );
	
	CChildWnd* pChild = Find( pClass );
	
	if ( pChild && pChild->IsIconic() )
	{
		pChild->ShowWindow( SW_SHOWNORMAL );
	}
#if 0	
	if ( pChild && GetActive() == pChild )
	{
		pChild->DestroyWindow();
		return NULL;
	}
#endif
	pLock.Unlock();
	
	if ( ! pChild ) pChild = (CChildWnd*)pClass->CreateObject();
	
	if ( bFocus ) pChild->BringWindowToTop();
	
	return pChild;
}
Пример #5
0
void CInstanceMesh::Render()
{
  if ( !mStaticMesh || !GetActive() )
    return;

  Math::Mat44f lTransform = GetTransform();
  mCenter = lTransform* mStaticMesh->GetAABB().GetCenter();

  if( mIsDynamic )
  {    
      mPhysicActor->GetMat44( lTransform );
      Math::Vect3f lUp( 0.0f, -mStaticMesh->GetAABB().GetCenter().y, 0.0f );

      Math::Mat44f lCenterTransform;
      lCenterTransform.SetIdentity();

      lCenterTransform.Translate( lUp );
      lTransform = lTransform * lCenterTransform;
  }

  CFrustum lCameraFrustum = CameraMInstance->GetCurrentCamera()->GetFrustum();
  CGraphicsManager* lGM = GraphicsInstance;
  if ( lCameraFrustum.SphereVisible( D3DXVECTOR3( mCenter.u ), mRadius ) )
  {
    lGM ->SetTransform( lTransform );
    mStaticMesh->Render( lGM  );
    lGM ->SetTransform( Math::Mat44f() );
  }
}
void CRenderGameInfoRendererCommand ::Execute(CRenderManager &RM)
{	
	if( GetActive() )
	{
		CORE->GetProcess()->Render(RM);
	}
}
Пример #7
0
void Bullet::Update(float fDeltaTime)
{
	if (GetActive())
	{
		Vector2 position = GetPosition();
		Vector2 velocity = GetVelocity();
		position += velocity * fDeltaTime;
		SetPosition(position);
		RecalculateAABB();

		GameObject* other = nullptr;
		bool collision = CollisionManager::GetSingleton()->IsColliding(this, &other);

		if (collision && other->GetCollisionLayer() == ECOLLISIONLAYER_ALL)
		{
			other->SetHealth(GetHealth() - 30);
			SetActive(false);
		}

		Engine::GetSingleton()->GetSpriteBatch()->GetViewRect(&minX, &minY, &maxX, &maxY);
		if (position.x > maxX)
			SetActive(false);
		else if (position.x < minX)
			SetActive(false);
		else if (position.y > maxY)
			SetActive(false);
		else if (position.y < minY)
			SetActive(false);
	}
	return;
}
Пример #8
0
bool Chunk::Destroy(int x, int y, int z) {
	if (GetActive(x, y, z)) {
		m_blocks[x][y][z].SetActive(false);
		RebuildMesh();
		return true;
	}
	return false;
}
Пример #9
0
int slNode::GetIconId()
{
	if (!GetActive())
		return nodeFactory.GetDisabledIconId();
	else if (GetSlId() == GetCluster()->GetLocalNodeID())
		return nodeFactory.GetLocalIconId();
	else
		return nodeFactory.GetIconId();
}
void ScreenCreate::keyPressEvent(QKeyEvent *keyEvent)
{
    if(GetActive())
    {
        if(keyEvent->key() == Qt::Key_Right)
        {
             gotoMenuScreen();
        }
    }
}
void
avtLegendAttributesColleague::GetOptions(AnnotationObject &annot)
{
    annot = atts;

    // Make sure that the name is set properly.
    annot.SetObjectType(AnnotationObject::LegendAttributes);
    annot.SetVisible(GetVisible());
    annot.SetActive(GetActive());
}
Пример #12
0
void CScriptCameraPitchVolume::Think(float, CStateManager& mgr) {
  if (!GetActive())
    return;

  if (x13c_24_entered && !x13c_25_occupied)
    Entered(mgr);
  else if (!x13c_24_entered && x13c_25_occupied)
    Exited(mgr);

  x13c_24_entered = false;
}
Пример #13
0
void CBloodFlower::Think(float dt, CStateManager& mgr) {
  if (!GetActive())
    return;

  CPatterned::Think(dt, mgr);
  x574_podEffect->Update(dt);
  if (x5bc_projectileDelay > 0.f)
    x5bc_projectileDelay -= dt;

  x5c0_ += dt;
}
Пример #14
0
void Stripe::OnKeyLeft()
{
	if(!m_hasAnimated) return;
	if(GetActive() == "" && m_menuItems.size() != 0)
	{
		m_menuItems[m_menuItems.size()-1]->SetActive(true);
	}
	else
	{
		for( int i = m_menuItems.size()-1; i >= 0; i-- )
		{
			if( m_menuItems[i]->IsActive())
			{
				m_menuItems[i]->SetActive(false);
				m_menuItems[((i-1)+m_menuItems.size())%m_menuItems.size()]->SetActive(true);
				if(GetActive() != m_seperator ) return;
			}
		}
	}
}
Пример #15
0
void Stripe::OnKeyRight()
{
	if(!m_hasAnimated) return;

	// none is active
	if(GetActive() == "" && m_menuItems.size() != 0)
	{
		m_menuItems[0]->SetActive(true);
	}
	else
	{
		for( int i = 0; i < m_menuItems.size(); i++ )
		{
			if( m_menuItems[i]->IsActive())
			{
				m_menuItems[i]->SetActive(false);
				m_menuItems[(i+1)%m_menuItems.size()]->SetActive(true);
				if(GetActive() != m_seperator ) return;
			}
		}
	}
}
Пример #16
0
void CScriptDoor::Think(float dt, CStateManager& mgr) {
  if (!GetActive())
    return;

  if (!x2a8_26_isOpen && x25c_animTime < 0.5f)
    x25c_animTime += dt;

  if (x2a8_27_conditionsMet && GetDoorOpenCondition(mgr) == 2) {
    x2a8_27_conditionsMet = false;
    OpenDoor(x280_prevDoor, mgr);
  }

  if (x2a8_24_closing) {
    x2a8_25_wasOpen = false;
    mgr.GetCameraManager()->GetBallCamera()->DoorClosed(GetUniqueId());
    x2a8_28_projectilesCollide = false;
    x2a8_24_closing = false;
    SendScriptMsgs(EScriptObjectState::Closed, mgr, EScriptObjectMessage::Decrement);
    x25c_animTime = 0.f;
    x2a8_30_doClose = false;
  }

  if (x2a8_26_isOpen && !x64_modelData->IsAnimating())
    RemoveMaterial(EMaterialTypes::Solid, EMaterialTypes::Occluder, EMaterialTypes::Orbit, EMaterialTypes::Scannable,
                   mgr);
  else {
    if (x2a8_25_wasOpen && !x64_modelData->IsAnimating()) {
      x2a8_25_wasOpen = false;
      mgr.GetCameraManager()->GetBallCamera()->DoorClosed(GetUniqueId());
      x2a8_28_projectilesCollide = false;
      x2a8_27_conditionsMet = false;
      SendScriptMsgs(EScriptObjectState::Closed, mgr, EScriptObjectMessage::None);
    }

    if (GetScannableObjectInfo())
      AddMaterial(EMaterialTypes::Solid, EMaterialTypes::Metal, EMaterialTypes::Occluder, EMaterialTypes::Orbit,
                  EMaterialTypes::Scannable, mgr);
    else
      AddMaterial(EMaterialTypes::Solid, EMaterialTypes::Metal, EMaterialTypes::Occluder, EMaterialTypes::Orbit, mgr);
  }

  if (x64_modelData->IsAnimating())
    UpdateAnimation((x64_modelData->GetAnimationDuration(s32(x260_doorAnimState)) / x258_animLen) * dt, mgr, true);

  xe7_31_targetable = mgr.GetPlayerState()->GetCurrentVisor() == CPlayerState::EPlayerVisor::Scan;
}
Пример #17
0
void CChoreoChannel::SaveToBuffer( CUtlBuffer& buf, CChoreoScene *pScene, IChoreoStringPool *pStringPool )
{
	buf.PutShort( pStringPool->FindOrAddString( GetName() ) );

	int c = GetNumEvents();
	Assert( c <= 255 );
	buf.PutUnsignedChar( c );

	for ( int i = 0; i < c; i++ )
	{
		CChoreoEvent *e = GetEvent( i );
		Assert( e );
		e->SaveToBuffer( buf, pScene, pStringPool );
	}

	buf.PutChar( GetActive() ? 1 : 0 );
}
Пример #18
0
void CScriptSwitch::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& mgr) {
  if (GetActive()) {
    if (msg == EScriptObjectMessage::Open)
      x34_opened = true;
    else if (msg == EScriptObjectMessage::Close)
      x34_opened = false;
    else if (msg == EScriptObjectMessage::SetToZero) {
      if (x34_opened) {
        SendScriptMsgs(EScriptObjectState::Open, mgr, EScriptObjectMessage::None);
        if (x35_closeOnOpened)
          x34_opened = false;
      } else
        SendScriptMsgs(EScriptObjectState::Closed, mgr, EScriptObjectMessage::None);
    }
  }

  CEntity::AcceptScriptMsg(msg, objId, mgr);
}
Пример #19
0
void BWindow_Result::DrawContent() const{
	if(!GetActive()) return;
	DrawDollsWithIcon(
		WND_MANAGE_DOLLS_X, 
		WND_MANAGE_DOLLS_Y - WND_RESULT_DY,
		CAMPDOLL_GAUGE_TYPE_EXP);

	switch(phaze){
	case WND_RESULT_SHOW_INFO:
		DrawResultInfo(activeCount);
		break;
	case WND_RESULT_ADD_EXP:
	case WND_RESULT_WAITKEY:
	case WND_RESULT_LEVELUP:
		DrawResultInfo(-1);
		break;
	}
	w_dollNotice.Draw();
}
Пример #20
0
void slSequence::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *properties, ctlSQLBox *sqlPane)
{
	if (!expandedKids)
	{
		expandedKids = true;

		browser->RemoveDummyChild(this);
	}


	if (properties)
	{
		CreateListColumns(properties);

		properties->AppendItem(_("Name"), GetName());
		properties->AppendItem(_("ID"), GetSlId());
		properties->AppendYesNoItem(_("Active"), GetActive());
	}
}
Пример #21
0
void slSubscription::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *properties, ctlSQLBox *sqlPane)
{
    if (!expandedKids)
    {
        expandedKids = true;

        browser->RemoveDummyChild(this);
        // Log

        if (WantDummyChild())
        {
            wxTreeItemId id = browser->GetItemParent(browser->GetItemParent(GetId()));
            if (id)
            {
                slSet *set = (slSet *)browser->GetObject(id);
                if (set && set->IsCreatedBy(setFactory))
                {
                    wxLogInfo(wxT("Adding child object to subscription %s"), GetIdentifier().c_str());

                    browser->AppendCollection(this, slSequenceFactory);
                    browser->AppendCollection(this, slTableFactory);
                }
            }
        }
    }


    if (properties)
    {
        CreateListColumns(properties);

        properties->AppendItem(_("Provider ID"), GetProviderId());
        properties->AppendItem(_("Provider Name"), GetProviderNode());
        properties->AppendItem(_("Receiver ID"), GetReceiverId());
        properties->AppendItem(_("Receiver Name"), GetReceiverNode());

        properties->AppendYesNoItem(_("Active"), GetActive());
        properties->AppendYesNoItem(_("May forward"), GetForward());
        if (GetForward())
            properties->AppendYesNoItem(_("Is forwarded"), GetIsSubscribed());
    }
}
Пример #22
0
void CWindowManager::Cascade(BOOL bActiveOnly)
{
	CSingleLock pLock( &theApp.m_pSection, TRUE );

	CChildWnd* pActive = bActiveOnly ? GetActive() : NULL;

	for ( POSITION pos = GetIterator() ; pos ; )
	{
		CChildWnd* pChild = GetNext( pos );

		if ( ! pChild && pChild->IsWindowVisible() &&
			 ! pChild->IsIconic() && ( pChild == pActive || ! pActive ) )
		{
			CRect rcClient;
			pChild->ShowWindow( SW_RESTORE );
			pChild->GetParent()->GetClientRect( &rcClient );
			pChild->MoveWindow( &rcClient );
		}
	}
}
Пример #23
0
void Chunk::UpdateWallFlags() {

	int x_minus = 0;
	int x_plus = 0;
	int y_minus = 0;
	int y_plus = 0;
	int z_minus = 0;
	int z_plus = 0;

	for (int a = 0; a < CHUNK_SIZE; ++a) {
		for (int b = 0; b < CHUNK_SIZE; ++b) {
			if (GetActive(0, a, b))
				++x_minus;
			if (GetActive(CHUNK_SIZE - 1, a, b))
				++x_plus;
			if (GetActive(a, 0, b))
				++y_minus;
			if (GetActive(a, CHUNK_SIZE - 1, b))
				++y_plus;
			if (GetActive(a, b, 0))
				++z_minus;
			if (GetActive(a, b, CHUNK_SIZE - 1))
				++z_plus;
		}
	}

	m_x_minus_full = false;
	m_x_plus_full = false;
	m_y_minus_full = false;
	m_y_plus_full = false;
	m_z_minus_full = false;
	m_z_plus_full = false;

	int wall_size = CHUNK_SIZE * CHUNK_SIZE;

	if (x_minus == wall_size)
		m_x_minus_full = true;
	if (x_plus == wall_size)
		m_x_plus_full = true;
	if (y_minus == wall_size)
		m_y_minus_full = true;
	if (y_plus == wall_size)
		m_y_plus_full = true;
	if (z_minus == wall_size)
		m_z_minus_full = true;
	if (z_plus == wall_size)
		m_z_plus_full = true;
}
Пример #24
0
// ****************************************************************************
// Method: avtImageColleague::GetOptions
//
// Purpose: 
//   This method stores the text label's attributes in an object that can
//   be passed back to the client.
//
// Arguments:
//   annot : The AnnotationObject to populate.
//
// Programmer: John C. Anderson
// Creation:   Fri Sep 03 08:59:53 PDT 2004
//
// Modifications:
//   
// ****************************************************************************
void
avtImageColleague::GetOptions(AnnotationObject &annot)
{
    annot.SetObjectType(AnnotationObject::Image);
    annot.SetVisible(GetVisible());
    annot.SetActive(GetActive());

    annot.SetFontShadow(maintainAspectRatio);

    stringVector sv;
    sv.push_back(currentImage);
    annot.SetText(sv);

    annot.SetPosition(actor->GetPosition());

    double pos[] = {width, height, 0};
    annot.SetPosition2(pos);

    annot.SetIntAttribute1(useOpacityColor ? 1 : 0);
    annot.SetColor1(opacityColor);
}
Пример #25
0
void LocationDlg::UpdateEnabling()
{
	GetAnimPos()->Enable(m_iAnim != -1);
	GetSaveAnim()->Enable(m_iAnim != -1);
	GetActive()->Enable(m_iAnim != -1);
	GetSpeed()->Enable(m_iAnim != -1);
	GetReset()->Enable(m_iAnim != -1);
	GetPlay()->Enable(m_iAnim != -1);
	GetRecord1()->Enable(m_iAnim != -1);
	GetStop()->Enable(m_iAnim != -1);
	GetLoop()->Enable(m_iAnim != -1);
	GetContinuous()->Enable(m_iAnim != -1);
	GetSmooth()->Enable(m_iAnim != -1 && GetAnim(m_iAnim)->NumPoints() > 2);
	GetPosOnly()->Enable(m_iAnim != -1);

	GetRecordInterval()->Enable(m_iAnim != -1);
	GetRecordLinear()->Enable(m_iAnim != -1);

	GetRecordSpacing()->Enable(m_bRecordInterval);
	GetPlayToDisk()->Enable(m_iAnim != -1);
}
Пример #26
0
void CPathCamera::Think(float dt, CStateManager& mgr) {
  if (!GetActive())
    return;

  if (mgr.GetCameraManager()->GetPathCameraId() != GetUniqueId())
    return;

  if (x188_spline.GetSize() <= 0)
    return;

  zeus::CTransform xf = GetTransform();
  zeus::CVector3f ballLook = mgr.GetCameraManager()->GetBallCamera()->GetLookPos();
  if ((x1ec_flags & 0x10)) {
    if (const CScriptCameraHint* hint = mgr.GetCameraManager()->GetCameraHint(mgr))
      ballLook.z() = hint->GetTranslation().z();
  }

  if (!mgr.GetPlayer().GetVelocity().canBeNormalized() && (ballLook - GetTranslation()).canBeNormalized()) {
    if (x1ec_flags & 4)
      SetTransform(x188_spline.GetInterpolatedSplinePointByLength(x1d4_pos));
    else
      SetTransform(zeus::lookAt(GetTranslation(), ballLook));
    return;
  }

  xf = MoveAlongSpline(dt, mgr);
  SetTranslation(xf.origin);

  if (x1ec_flags & 0x20)
    ClampToClosedDoor(mgr);

  zeus::CVector3f tmp = ballLook - GetTranslation();
  tmp.z() = 0.f;
  if (tmp.canBeNormalized())
    SetTransform(zeus::lookAt(GetTranslation(), ballLook));

  if (x1ec_flags & 4)
    SetTransform(xf);
}
Пример #27
0
void
avtText2DColleague::GetOptions(AnnotationObject &annot)
{
    annot.SetObjectType(AnnotationObject::Text2D);
    annot.SetVisible(GetVisible());
    annot.SetActive(GetActive());

    annot.SetPosition(textActor->GetPosition());
    // Store the width and height in position2.
    double p2wh[3];
    p2wh[0] = textActor->GetTextHeight();
    p2wh[1] = 0.;
    p2wh[2] = 0.;
    annot.SetPosition2(p2wh);

    // Store the text color and opacity.
    annot.SetTextColor(textColor);
    annot.SetUseForegroundForTextColor(useForegroundForTextColor);

    // Store the font properties into the annotation object.
    int ff = textActor->GetTextProperty()->GetFontFamily();
    AnnotationObject::FontFamily aff;
    if(ff == VTK_ARIAL)
        aff = AnnotationObject::Arial;
    else if(ff == VTK_COURIER)
        aff = AnnotationObject::Courier;
    else if(ff == VTK_TIMES)
        aff = AnnotationObject::Times;
    else
        aff = AnnotationObject::Arial;
    annot.SetFontFamily(aff);
    annot.SetFontBold(textActor->GetTextProperty()->GetBold() > 0);
    annot.SetFontItalic(textActor->GetTextProperty()->GetItalic() > 0);
    annot.SetFontShadow(textActor->GetTextProperty()->GetShadow() > 0);

    stringVector text;
    text.push_back(textFormatString);
    annot.SetText(text);
}
Пример #28
0
   void DeltaDrawablePrivate::RemovedFromScene(Scene* scene, osg::Node* node)
   {
      // for now don't include this check, since we're calling
      //   DeltaDrawablePrivate::AddedToScene() first
      //if (mParentScene != scene) { return; } // we're not even in this scene; nothing to do here.

      mParentScene = NULL;

      for (ChildList::iterator itr = mChildList.begin();
         itr != mChildList.end();
         ++itr)
      {
         (*itr)->RemovedFromScene(scene);
      }

      // we've just been removed from a scene
      // if we're inactive, we should remove our Switch
      if (GetActive() == false)
      {
         RemoveSwitchNode(node);
      }
   }
Пример #29
0
void CChoreoActor::SaveToBuffer( CUtlBuffer& buf, CChoreoScene *pScene )
{
	int i, c;
	buf.PutString( GetName() );

	c = GetNumChannels();
	buf.PutShort( c );
	for ( i = 0; i < c; i++ )
	{
		CChoreoChannel *channel = GetChannel( i );
		Assert( channel );
		channel->SaveToBuffer( buf, pScene );
	}

	/*
	if ( Q_strlen( a->GetFacePoserModelName() ) > 0 )
	{
		FilePrintf( buf, level + 1, "faceposermodel \"%s\"\n", a->GetFacePoserModelName() );
	}
	*/
	buf.PutChar( GetActive() ? 1 : 0 );
}
Пример #30
0
   void DeltaDrawablePrivate::AddedToScene(Scene* scene, osg::Node* node)
   {
      if (mParentScene == scene) { return; } // nothing to do here.

      mParentScene = scene;

      for (ChildList::iterator itr = mChildList.begin();
         itr != mChildList.end();
         ++itr)
      {
         (*itr)->AddedToScene(scene);
      }

      // If we've been set to inactive before being added to a Scene,
      // then we need to do add in our Switch node.
      if (mParentScene != NULL)
      {
         if (GetActive() == false)
         {
            InsertSwitchNode(node);
         }
      }
   }