Beispiel #1
0
void XSlideInOut::Draw( void )
{
	if( IsComplete() )
		return;
	if( m_nType == 1 )
	{
		// m_nXPos를 중심으로 좌측에 이전 화면을 찍는다.
		GetpSurface1()->Draw( (float)m_nXPos - GetpSurface1()->GetWidth(), 0.f );
		// m_nXPos를 중심으로 우측에 새 화면을 찍는다.
		GetpSurface2()->Draw( (float)m_nXPos, 0.f );
		m_nXPos -= m_nSpeed;
		if( m_nXPos <= 0 )				// 화면 왼쪽까지 다 이동했으면 완료
			SetComplete( TRUE );
	} else 
	{
		// m_nXPos를 중심으로 좌측에 새 화면을 찍는다.
		GetpSurface2()->Draw( (float)m_nXPos - GetpSurface1()->GetWidth(), 0.f );
		// m_nXPos를 중심으로 우측에 이전 화면을 찍는다.
		GetpSurface1()->Draw( (float)m_nXPos, 0 );
		m_nXPos += m_nSpeed;
		if( m_nXPos >= XE::GetGameWidth() )				// 화면 왼쪽까지 다 이동했으면 완료
			SetComplete( TRUE );		
	}
	XTransition::Draw();
}
void CASW_Objective_Countdown::InputCancelCountdown( inputdata_t &inputdata )
{
    if (m_bCountdownStarted)
    {
        m_fCountdownFinishTime = 0;
        SetThink(NULL);
        SetComplete(true);
    }
}
void CASW_Objective_Kill_Goo::GooKilled(CASW_Alien_Goo* pGoo)
{
	if (IsObjectiveComplete())
		return;
	//Msg("CASW_Objective_Kill_Goo see Alien Goo killed!\n");	
	m_iCurrentKills++;
	//Msg(" Currently %d goos killed, target is %d\n", m_iCurrentKills, m_iTargetKills);
	if (m_iCurrentKills >= m_iTargetKills)
	{
		Msg("  we're done!\n");
		SetComplete(true);
	}
	else
	{
		CReliableBroadcastRecipientFilter filter;
		UserMessageBegin( filter, "ShowObjectives" );
		WRITE_FLOAT( 5.0f );
		MessageEnd();
	}
}
Beispiel #4
0
BOOL XTransition::Process( float dt )
{
//	if( m_nDrawCnt == 0 )		return 1;	// Draw를 먼저하게 하기위해 첫번째 프레임은 처리하지 않는다
	// 이전씬의 화면과 새씬의 화면을 트랜지션 하는 경우, 가령 오버랩같은 경우는
	// 이전씬화면이 프론트화면에 떠있을때 트랜지션의 생성자를 불러서 스크린을 캡쳐한후
	// 새씬을 Draw해서 프론트버퍼로 오게하고 다시 화면을 잡는다. 그리고 그 프레임에서 즉시 트랜지션을 덮어씌운다
// 	if( m_nDrawCnt == 1 )		// draw를 1회 하면 이변수가 1이 된다
// 	{
// 		XBREAK( GetfSec() == 0 );
// 		m_Timer.Set( GetfSec() );	// 타이머 시작
// 	}
	// process
	if( IsComplete() )
		return 0;
	XBREAK( m_Timer.GetWaitTime() == 0 );
//	float slerp = m_Timer.GetPassTime() / (float)m_Timer.GetWaitTime();
	float slerp = m_Timer.GetSlerp();
	if( slerp >= 1.0f ) {
		slerp = 1.0f;
		SetComplete( TRUE );
	}
	SetfSlerp( slerp );
	return 1;
}
   void TaskActorGameEvent::HandleGameEvent(const dtGame::Message &msg)
   {
      const dtGame::GameEventMessage &eventMsg = static_cast<const dtGame::GameEventMessage&>(msg);

      if(eventMsg.GetGameEvent() == NULL)
      {
         LOG_WARNING("HandleGameEvent: Game event message contained a NULL game event.");
         return;
      }

      if( ! mGameEvent.valid() && ! mGameEventFail.valid() )
      {
         LOG_WARNING("HandleGameEvent: Game event task actor has NULL game events.  Perhaps it was "
                    " assigned to the task before being added to the event manager.");
         return;
      }

      // Determine which event has been received.
      const dtCore::UniqueId& eventId = eventMsg.GetGameEvent()->GetUniqueId();
      bool isFailEvent = false;
      if( mGameEvent.valid() && eventId == mGameEvent->GetUniqueId() )
      {
         // DO NOTHING.
      }
      else if( mGameEventFail.valid() && eventId == mGameEventFail->GetUniqueId() )
      {
         isFailEvent = true;
      }
      else
      {
         // Not an event to act upon.
         return;
      }

      //If we got here we have a game event we were looking for.  So, all we need to do
      //is track the number of times we got the event, and if it reaches the min occurances
      //attempt to mark ourselves complete.
      TaskActorProxy &proxy = static_cast<TaskActorProxy&>(GetGameActorProxy());
      if(!IsComplete() && !IsFailed())
      {
         if(proxy.RequestScoreChange(proxy,proxy))
         {
            if( isFailEvent ) // Fail event
            {
               SetFailed( true );
            }
            else // Complete Event
            {
               mNumTimesEventFired++;
               float newScore = (float)mNumTimesEventFired / (float)mMinOccurances;
               if (newScore >= GetPassingScore())
                  SetComplete(true);

               SetScore(newScore);
            }

            // Notify the system that the task state has changed.
            proxy.NotifyScoreChanged(proxy);
            proxy.NotifyFullActorUpdate();
         }
      }
   }
Beispiel #6
0
void CASW_Marker::InputSetComplete( inputdata_t &inputdata )
{
	SetComplete( true );
}
// ---------------------------------------------------------
// CDownloadMgrSession::DispatchMessageL
// ---------------------------------------------------------
//
void CDownloadMgrSession::DispatchMessageL( const RMessage2& aMessage )
	{
    CLOG_ENTERFN( "CDownloadMgrSession::DispatchMessageL" )
    CLOG_WRITE_FORMAT( "Message function: %d", aMessage.Function() )
    // Set this false in case of the asyncron requests!!!
    iComplete = ETrue;
    SetCurrentMessage( aMessage );
    
    // Fixed for Bug id - JJUN-78WCJ3 (DownloadMgrServer crashes under IPC attack)
    //This check will make sure that before start of any download, InitializeL() should
    // be called so that all the member variables will be initialized.
    if(aMessage.Function() != EHttpDownloadMgrInitialize && iClientAppInstance == NULL)
        {
        User::Leave(KErrGeneral);
        }
        
    // check for session-relative requests
	switch( aMessage.Function() )
		{
        case EHttpDownloadMgrInitialize:
            {
            InitializeL();
            return;
            }
	    case EHttpDownloadMgrCreateDownload:
            {
		    NewDownloadL();
            return;
            }
        case EHttpDownloadMgrAttach:
            {
            DownloadMgrAttachL();
            return;
            }
        case EHttpDownloadAttach:
            {
            DownloadAttachL();
            return;
            }
		case EHttpDownloadAttachToDownload:
		    {
		    AttachToDownloadL();
		    return;
		    }
        case EHttpDownloadMgrPauseAll:
            {
            PauseAllL();
            return;
            }
        case EHttpDownloadMgrStartAllL:
            {
            StartAllL();
            return;
            }
        case EHttpDownloadMgrResetAll:
            {
            ResetAll();
            return;
            }
        case EHttpDownloadMgrDeleteAll:
            {
            DeleteAll();
            return;
            }
        case EHttpDownloadMgrDisconnect:
            {
            Disconnect();
            return;
            }
        case EHttpDownloadMgrGetIntAttribute:
            {
            GetIntAttributeL();
            return;
            }
        case EHttpDownloadMgrGetBoolAttribute:
            {
            GetBoolAttributeL();
            return;
            }
        case EHttpDownloadMgrGetStringAttribute:
            {
            GetStringAttributeL();
            return;
            }
        case EHttpDownloadMgrGetString8Attribute:
            {
            GetString8AttributeL();
            return;
            }
        case EHttpDownloadMgrSetIntAttribute:
            {
            SetIntAttributeL();
            return;
            }
        case EHttpDownloadMgrSetBoolAttribute:
            {
            SetBoolAttributeL();
            return;
            }
        case EHttpDownloadMgrSetStringAttribute:
            {
            SetStringAttributeL();
            return;
            }
        case EHttpDownloadMgrSetString8Attribute:
            {
            SetString8AttributeL();
            return;
            }
        case EHttpDownloadMgrSessionEventSubscription:
            {
            InitSessionEvent( aMessage );
            // Send event from the queue
            TUint dummy( 0 );
            Event( NULL, (THttpDownloadState)dummy, (THttpProgressState)dummy, dummy );
            // This is an asyncron request will be completed later!
            SetComplete( EFalse );
            return;
            }
        case EHttpDownloadMgrSessionEventCancel:
            {
            CancelMovedEvent();
            return;
            }
		}
	// ok, it must be subsession relative
	CDownloadSubSession* download = DownloadFromHandle( aMessage.Int3() );
    __ASSERT_DEBUG( download, PanicClient( EBadSubsessionHandle ) );

    TRAPD( err, download->DispatchMessageL( aMessage ) );

    if( err )
        {
        download->OnError( err );
        User::Leave( err );
        }
	}
void CASW_Objective_Triggered::InputSetIncomplete( inputdata_t &inputdata )
{
	SetComplete(false);
	SetFailed(false);
}
void CASW_Objective_Triggered::InputSetComplete( inputdata_t &inputdata )
{
	SetComplete(true);
}