virtual void Init( bool isFirstInit )
	{
		m_pEntity->SetUpdateable( this );

		InitWatch();
		InitDocument(false);
	}
	virtual void Init( bool isFirstInit )
	{
		m_pEntity->SetUpdateable( this );

		InitWatch();
		InitDocument(false);

		if (!m_ImageFile.empty())
		{
			SetImage(m_ImageFile.c_str());
		}
	}
	virtual void Init( bool isFirstInit )
	{
		if (isFirstInit)
		{
			PreloadModels();

			CreateSplashScreen( "/Assets/GUI/title.tga", 1.0f, 0.0f, 0.5f, false );
		}
		
		m_pEntity->SetUpdateable( this );
		
		InitWatch();
	}
	virtual void Init( bool isFirstInit )
	{
		m_pEntity->SetUpdateable( this );

		m_pCameraControl = (ICameraControl*)IObjectUtils::GetUniqueInterface( "CameraControl", IID_ICAMERACONTROL );
		IGameManager* pGameManager = (IGameManager*)IObjectUtils::GetUniqueInterface( "GameManager", IID_IGAMEMANAGER );

		pGameManager->AddListener(this);
		m_pGlobalParameters = pGameManager->GetGlobalParameters();

		InitWatch();
		InitDocument(false);
	}
示例#5
0
int main ( void )
{
    int8_t status;
	sei();



	SerialInit(MYUBRR);
	InitWatch();
    /**
     * Reuse part of the idle thread's stack for the stack required
     * during this startup function.
     */
    SP = (int)&idle_thread_stack[(IDLE_STACK_SIZE_BYTES/2) - 1];

    /**
     * Note: to protect OS structures and data during initialisation,
     * interrupts must remain disabled until the first thread
     * has been restored. They are reenabled at the very end of
     * the first thread restore, at which point it is safe for a
     * reschedule to take place.
     */

    /**
     * Initialise the OS before creating our threads.
     *
     * Note that we cannot enable stack-checking on the idle thread on
     * this platform because we are already using part of the idle
     * thread's stack now as our startup stack. Prefilling for stack
     * checking would overwrite our current stack.
     *
     * If you are not reusing the idle thread's stack during startup then
     * you are free to enable stack-checking here.
     */
    status = atomOSInit(&idle_thread_stack[0], IDLE_STACK_SIZE_BYTES, FALSE);
    if (status == ATOM_OK)
    {

        /* Enable the system tick timer */
        avrInitSystemTickTimer();

        /* Create the main thread */
        status = atomThreadCreate(&main_tcb,
                     MAIN_THREAD_PRIO, main_thread_func, 0,
                     &main_thread_stack[0],
                     MAIN_STACK_SIZE_BYTES,
                     FALSE);
        if (status == ATOM_OK)
        {
            /**
             * Application threads successfully created. It is
             * now possible to start the OS. Execution will not return
             * from atomOSStart(), which will restore the context of
             * our application thread and start executing it.
             *
             * Note that interrupts are still disabled at this point.
             * They will be enabled as we restore and execute our first
             * thread in archFirstThreadRestore().
             */
            atomOSStart();

        }
    }
    while (1)
	{
		atomTimerDelay (2 * SYSTEM_TICKS_PER_SEC); // wait 2 sec

	}
    /* There was an error starting the OS if we reach here */
    return (0);
}