Ejemplo n.º 1
0
void LDigit::Deeds( void )
//           ~~~~~
{
	switch( CurrentState )
	{
	case 1:
		pre_int = mnt_int = 0;
		is_big = 0;
		break;
	case 2:
		if( character != _T('_') )
		{
			mnt_int = 10 * mnt_int + character.digitValue();
			if(mnt_int < pre_int)
				is_big = 1;
			else
				pre_int = mnt_int;
		}
		break;
	case 3 :
		mnt_float = mnt_int;
		power = 0;
		break;
	case 4 :
		if( GetPreviousState() == 2 )
		{
			mnt_float = mnt_int;
			power = 0;
		}
		else
		{
			if( character != _T('_') )
			{
				decimal++;
				mnt_float = 10 * mnt_float + character.digitValue();
				power--;
			}
		}
		break;
	case 5 :
		if( GetPreviousState() == 2 )
		{
			mnt_float = mnt_int;
			power = 0;
		}
		powerE = 0;
		sign = 1;
		break;
		//  case 6 :
		//    break;
	case 7 :
		sign = -1;
		break;
	case 8 :
		if( character != _T('_') )
			powerE = 10 * powerE + character.digitValue();
		break;
	}
}
bool ribi::kalman::FixedLagSmootherKalmanFilterCalculationElements::IsComplete() const
{
  const std::size_t sz = GetMeasurement().size();
  return
       sz != 0
    //Others, e.g.
    //&& sz == m_innovation.size()
    //&& sz == m_innovation_covariance.size1()
    //&& sz == m_innovation_covariance.size2()
    //&& sz == m_innovation_covariance.size1()
    && sz == GetMeasurement().size()
    && sz == GetPredictedState().size()
    && sz == GetPreviousState().size();
}
void LXMLSizeSDigit::Deeds( void )
//           ~~~~~
{
	switch( CurrentState )
	{
	case 1:
		asign = 1;
		pre_int = mnt_int = 0;
		is_big = 0;
		break;
	case 2:
		if( character == _T('-') )
			asign = -1;
		break;
	case 3:
		if( character != _T('_') )
		{
			mnt_int = 10 * mnt_int + character.digitValue();
			if( mnt_int < pre_int )
				is_big = 1;
			else
				pre_int = mnt_int;
		}
		break;
	case 4:
		mnt_float = mnt_int;
		power = 0;
		break;
	case 5:
		if( GetPreviousState() == 3 )
		{
			mnt_float = mnt_int;
			power = 0;
		}
		else
		{
			if( character != _T('_') )
			{
				decimal++;
				mnt_float = 10 * mnt_float + character.digitValue();
				power--;
			}
		}
		break;
	}
}
Ejemplo n.º 4
0
/*****************************************************************************
 * FUNCTION
 *  ProcessPSCallConnectFailEvent
 * DESCRIPTION
 *  This is the function to process Protocol(Response) failure Event.
 * PARAMETERS
 *  cause       [IN]        
 *  void(?)     [IN]        *(this points to CM_CALL_HANDLE of the call which requested CM_KB_OUTGOINGCALL)
 * RETURNS
 *  void
 *****************************************************************************/
void ProcessPSCallConnectFailEvent(U16 cause)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    CM_CALL_HANDLE callHandle;
    U8 type;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    SetCallEndCause(cause);
    
    if (GetCCFlag() == TRUE)
    {
        callHandle = GetOutgoingCallHandle();

        if (callHandle == -1)
        {
            PRINT_INFORMATION("\n ProcessPSCallConnectFailEvent Getting the Connected Handle has -1 \n");
            return;
        }

        switch (GetCurrentState())
        {
                /* amanda add 0326, MO MT collision */
            case CM_INCOMING_STATE:
                PurgeOutgoingCallsStructure();
                cause = 0;
                break;

            case CM_OUTGOING_STATE:
                type = GetOutgoingCallType();
                PurgeOutgoingCallsStructure();
                
                if (GetTotalCallCount() == 0)
                {
                    SetCurrentState(CM_IDLE_STATE);
                }
                else
                {
                    SetCurrentState(GetPreviousState());
                }
                SetPreviousState(CM_OUTGOING_STATE);
                
                if (GetTotalCallCount() == 0)
                {
                    /* only voice call can redial */
                #ifdef __MMI_VIDEO_TELEPHONY__
                    if ((type != CM_VOICE_CALL && type != CSMCC_VIDEO_CALL) || (IsRedialNeeded(cause) == FALSE))
                #else /* __MMI_VIDEO_TELEPHONY__ */
                    if ((type != CM_VOICE_CALL) || (IsRedialNeeded(cause) == FALSE))
                #endif/* __MMI_VIDEO_TELEPHONY__ */ 
                    {
                        /* no need to redial, just show error and get out of CM */
                        /*ShowCallManagementErrorMessage(cause, cm_p->ucm_operation);*/
                        SetCallEndCause(cause);
                        mmi_gsm_release_ind(GetCallEndCause());
                        return;
                    }
                    else
                    {
                        /* need to redial, show error and redial */
                        if (IsRedialSet())
                        {
                            SetCallEndedBeforeConnFlag(FALSE);
                            CheckRedialOrShowError(cause);
        					/* abort SS if needed */
                            return;
                        }
                    }
                }
                /* still have other call, can't redial, just show error */
                break;

            default:
                PRINT_INFORMATION("\n ProcessPSCallConnectFailEvent CM State m/c Corrupted \n");
                break;
        }
    }

    if(cm_p->ucm_operation == MMI_GSM_UCM_DIAL)
    {
        /*SS_PARSING_RSP FAIL*/
        ShowCallManagementErrorMessage(cause, cm_p->ucm_operation);
    }
    else if(cm_p->ucm_operation == MMI_GSM_UCM_HOLD_AND_DIAL)
    {
        /*SS_PARSING_RSP FAIL*/
        ShowCallManagementErrorMessage(cause, cm_p->ucm_operation);
    }
#ifdef __MMI_DUAL_SIM_MASTER__
    else if(cm_p->slave_ss_session)
    {
        MTPNP_PFAL_CC_UCMShowCallErrorMessage(cause,MMI_GSM_UCM_IDLE);
        mmi_gsm_set_slave_ss_falg(FALSE);
    }
#endif /* __MMI_DUAL_SIM_MASTER__ */    
    else
    {
        mmi_gsm_release_ind(GetCallEndCause());
    }
    return;
}
Ejemplo n.º 5
0
void InitializeMainMenu(void)
{
	FILE *fp;
	Vec3 Tint;
	float xPos, yPos;
	
	//Animation variables initialize
	firstAnimated = TRUE;
	secondAnimated = FALSE;
	fadeOut = FALSE;
	firstMoveTimer = 0;
	secondMoveTimer = 0;
	firstStartLocation = rand() % 4;
	secondStartLocation = rand() % 4;
	firstTextureNum = MAX_TEXTURES + 1;
	secondTextureNum = MAX_TEXTURES + 1;

	// Reset the object list
	ResetObjectList();
	deleteSave = FALSE;
	exitGame = FALSE;

	//Check if it is possible to load a game
	fp = fopen(GameData, "r");
	if(fp)
	{
		canLoad = TRUE;
		fclose(fp);
	}
	else
	{
		canLoad = FALSE;
	}

	//Grabs the first starting location
	SetStartLocation(&xPos, &yPos, firstStartLocation);

	FirstBackground = (Sprite *) CreateSprite("TextureFiles/BlurFoxHall.png", 2560, 1440, 1, 1, 1, xPos, yPos);
	SecondBackground = (Sprite *) CreateSprite("TextureFiles/BlurFoxMansion.png", 2560, 1440, 1, 1, 1, xPos, yPos);

	//Randomizes the textures for the animation
	firstTextureNum = RandomNewTexture(FirstBackground, secondTextureNum);
	secondTextureNum = RandomNewTexture(SecondBackground, firstTextureNum);

	//Second background should not be seen
	SecondBackground->Alpha = 0.0f;

	//Nice looking things for the menu
	Overlay = (Sprite *) CreateSprite("TextureFiles/MenuOverlay.png", 1920, 1080, 2, 1, 1, 0, 0);
	Logo = (Sprite *) CreateSprite("TextureFiles/MansionMashersMainMenu.png", 1200, 675, 3, 1, 1, 0, 200);

	//Button backgrounds
	FoxScroll = (Sprite *) CreateSprite("TextureFiles/MenuBackFoxAnimationFix.png", 447, 500, 4, 18, 1, -300, -130);
	FoxScroll->AnimationSpeed = 2.0f;
	DogScroll = (Sprite *) CreateSprite("TextureFiles/MenuBackDogAnimationFix.png", 447, 500, 4, 18, 1, 300, -130);
	DogScroll->AnimationSpeed = 2.0f;
	//Sets the frame that the scrolls are on.
	prevFrame = FoxScroll->CurrentFrame;
	FoxScrollBottom = (Sprite *) CreateSprite("TextureFiles/ScrollBottom.png", 447, 44, 9, 1, 1,  -300, 60);
	DogScrollBottom = (Sprite *) CreateSprite("TextureFiles/ScrollBottom.png", 447, 44, 9, 1, 1,  300, 60);

	//Menu buttons
	NewGameButton = CreateButton("TextureFiles/NewGameButton.png", 0, -130, 394, 394);
	LoadGameButton = CreateButton("TextureFiles/LoadGameButton.png", -290, -8, 439, 170);
	OptionsButton = CreateButton("TextureFiles/OptionsButton.png", 290, -8, 439, 170);
	CreditsButton = CreateButton("TextureFiles/CreditsButton.png", -290, -270, 439, 170);
	QuitGameButton = CreateButton("TextureFiles/QuitGameButton.png", 290, -270, 439, 170);

	//Update button Z index
	NewGameButton->ButtonSprite->ZIndex = 10;
	LoadGameButton->ButtonSprite->ZIndex = 8;
	OptionsButton->ButtonSprite->ZIndex = 8;
	CreditsButton->ButtonSprite->ZIndex = 8;
	QuitGameButton->ButtonSprite->ZIndex = 8;

	OptionsButton->ButtonSprite->Visible = FALSE;
	QuitGameButton->ButtonSprite->Visible = FALSE;
	CreditsButton->ButtonSprite->Visible = FALSE;
	LoadGameButton->ButtonSprite->Visible = FALSE;
	
	//Delete save game objects
	Vec3Set(&Tint, 0, 0, 0);
	BlackBackground = (Sprite *) CreateSprite("TextureFiles/BlankPlatform.png", 1920, 1080, 499, 1, 1, 0, 0);
	BlackBackground->Tint = Tint;
	BlackBackground->Alpha = 0.5f;
	DeleteText = (Sprite *) CreateSprite("TextureFiles/DeleteText.png", 651, 334, 500, 1, 1, 0, 100);
	YesButton = CreateButton("TextureFiles/DeleteButton.png", -300, -200, 400, 150);
	YesButton->ButtonSprite->ZIndex = 500;
	NoButton = CreateButton("TextureFiles/BackButton.png", 300, -200, 400, 150);
	NoButton->ButtonSprite->ZIndex = 500;

	//Exit Game Confirmation
	Vec3Set(&Tint, 0, 0, 0);
	ExitConfirm = (Sprite *) CreateSprite("TextureFiles/ExitConfirm.png", 639, 204, 500, 1, 1, 0, 100);
	ExitButton = CreateButton("TextureFiles/ExitButton.png", -300, -200, 400, 150);
	ExitButton->ButtonSprite->ZIndex = 500;

	//Should not be visible at the start
	BlackBackground->Visible = FALSE;
	DeleteText->Visible = FALSE;
	ExitConfirm->Visible = FALSE;
	YesButton->ButtonSprite->Visible = FALSE;
	NoButton->ButtonSprite->Visible = FALSE;
	ExitButton->ButtonSprite->Visible = FALSE;

	//Help out text
	GettingImpatientTimer = -2.5;
	TimerGoingUp = TRUE;
	Vec3Set(&Tint, 1, 1, 1);
	SillyGooseUseMouse = CreateText("Use the mouse to navigate the menu!", 0, -480, 100, Tint, Center, Border);
	ChangeTextZIndex(SillyGooseUseMouse, 600);
	ChangeTextAlpha(SillyGooseUseMouse, 0);
	ChangeTextVisibility(SillyGooseUseMouse);

	CreateBoundingBoxes();

	// Set camera to (0,0)
	ResetCamera();

	//Basically don't remake the sound because we only went to the options menu and came back
	if(GetPreviousState() != GS_Options)
		CreatePauseSound(&MenuBackSnd, "Sounds/MenuTheme.mp3", LargeSnd);
}
Ejemplo n.º 6
0
/*****************************************************************************
 * FUNCTION
 *  ProcessPSCallConnectFailEvent
 * DESCRIPTION
 *  This is the function to process Protocol(Response) failure Event.
 * PARAMETERS
 *  cause       [IN]        
 *  void(?)     [IN]        *(this points to CM_CALL_HANDLE of the call which requested CM_KB_OUTGOINGCALL)
 * RETURNS
 *  void
 *****************************************************************************/
void ProcessPSCallConnectFailEvent(U16 cause)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    CM_CALL_HANDLE callHandle;
    U8 type;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (GetCCFlag() == TRUE)
    {
        callHandle = GetOutgoingCallHandle();

        if (callHandle == -1)
        {
            PRINT_INFORMATION("\n ProcessPSCallConnectFailEvent Getting the Connected Handle has -1 \n");
            return;
        }

        switch (GetCurrentState())
        {
                /* amanda add 0326, MO MT collision */
            case CM_INCOMING_STATE:
                PurgeOutgoingCallsStructure();
                cause = 0;
                break;

            case CM_OUTGOING_STATE:
                type = GetOutgoingCallType();
                PurgeOutgoingCallsStructure();
                SetCurrentState(GetPreviousState());
                SetPreviousState(CM_OUTGOING_STATE);
                if (GetTotalCallCount() == 0)
                {
                    /* only voice call can redial */
                    if ((type != CM_VOICE_CALL) || (IsRedialNeeded(cause) == FALSE))
                    {
                        /* no need to redial, just show error and get out of CM */
                        ShowCallManagementErrorMessage(cause);
                        GetOutOfCMforAdjustHistory();
                        return;
                    }
                    else
                    {
                        /* need to redial, show error and redial */
                        if (IsRedialSet())
                        {
                            SetCallEndedBeforeConnFlag(FALSE);
                            CheckRedialOrShowError(cause);
        					/* abort SS if needed */
                            DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
                            return;
                        }
                    }
                }
                /* still have other call, can't redial, just show error */
                break;

            default:
                PRINT_INFORMATION("\n ProcessPSCallConnectFailEvent CM State m/c Corrupted \n");
                break;
        }
    }
    ShowCallManagementErrorMessage(cause);
}