コード例 #1
0
void AccelerometerHandler::Stop()
{
	g_bIsInit = false;
	s3eAccelerometerStop();
	
	Reset();
}
コード例 #2
0
ファイル: IwGameInput.cpp プロジェクト: Ser40/IwGameAds
void CIwGameInput::stopAccelerometer()
{
	if (AccelerometerActive)
	{
		s3eAccelerometerStop();
		AccelerometerActive = false;
	}
}
コード例 #3
0
float EggDropGameEngine::End()
{
	s3eAccelerometerStop();

	s3eLocation endLoc;
	Utils::GetLocation(&endLoc);

	g_lineGraph.Clear();
	
	double distance = LiveMaps::CalculateDistance(g_startLocation, endLoc);
	return (float)distance;
}
コード例 #4
0
ファイル: CCAccelerometer.cpp プロジェクト: styck/cocos2d-x
void CCAccelerometer::setDelegate(CCAccelerometerDelegate* pDelegate) 
{
	m_pAccelDelegate = pDelegate;

	if (pDelegate)
	{		
		if (s3eAccelerometerStart() != S3E_RESULT_SUCCESS)
		{
			CCLog("s3eAccelerometerStart() - ERROR\n");
		}
	}
	else
	{
		s3eAccelerometerStop();
	}
}
コード例 #5
0
ファイル: main.cpp プロジェクト: marmalade/project-ball
void ExampleShutDown()
{
    delete m_pAnimator;
    delete m_pSplinePoly2Tri;
    delete m_pBall;

    // Terminate
    IwGxTerminate();

    if (s_Accelerometer)
    {
        s3eAccelerometerStop();
        s_Accelerometer = false;
    }

    IW_PROFILE_TERM();
    delete &CIwProfileMenu::Get();
}
コード例 #6
0
int main(int argc, char* argv[])
{
	g_pointerdown = false;
	FillDefaultLocalScores();
	// Initialisation of Airplay Studio modules
	Iw2DInit();			// Initialise support for rendering with the standard SW renderer
	IwGxLightingOff();
	IwResManagerInit();
	Load();

	int16 sw = (int16)Iw2DGetSurfaceWidth();
	int16 sh = (int16)Iw2DGetSurfaceHeight();

	PAL_InitData_t palInitData;
	SC_Error_t retCode = SC_Client_New(&g_client, &palInitData, SC_TEST_GAME_ID,
			SC_TEST_GAME_SECRET, "AIW");

	if (retCode != SC_OK) 
		s3eDebugAssertShow(S3E_MESSAGE_CONTINUE_STOP, "Failed to create SC_Client");
	
	IwGetResManager()->LoadGroup("fonts.group");
	LoadGlobalImages();

	LoadMainControls();
	game = new CGame();
	mainmenu = new CMainMenu();
	profile = new CProfile();
	scores = new CScores();


	mainmenu->Load();
	game->Load();
	profile->Load();
	scores->Load();
	CBaseScene *curscene = (CBaseScene *)mainmenu;
	g_curSceneType = stMainMenu;


	uint32 timer = (uint32)s3eTimerGetMs();

	g_AccelerometerEnabled = (s3eAccelerometerStart() == S3E_RESULT_SUCCESS);

	

	while(curscene)
	{

		s3eDeviceYield(0);


		//// Check for user quit
		if (s3eDeviceCheckQuitRequest())
			break;


		int delta = uint32(s3eTimerGetMs()) - timer;
		timer += delta;

		// Make sure the delta-time value is safe
		if (delta < 0)
			delta = 0;
		if (delta > 100)
			delta = 100;

		if (g_AccelerometerEnabled)
		{

			if (!g_waiting)
			{
				if (g_errorDialog->Get_Visible())
				{
					if (UpdatePointer() == petDown)
						CloseErrorDlg();
					else
						g_errorDialog->Update(delta);
				}
				else
				{
					switch (UpdatePointer())
					{
						case petNone: break;
						case petDown: curscene->PointerDown(g_pointerx, g_pointery); break;
						case petUp: curscene->PointerUp(g_pointerx, g_pointery); break;
						case petMove: curscene->PointerMove(g_pointerx, g_pointery); break;
					}
					curscene->Update(delta);
				}
			}
			curscene->Render();
			if (g_waiting)
			{
				Iw2DSetColour(0xeeffffff);
				Iw2DFillRect(CIwSVec2(0, 0), CIwSVec2(sw, sh));

				Iw2DSetColour(0xff000000);
		
				Iw2DSetFont(g_font);
				Iw2DDrawString(g_waitcaption, CIwSVec2(0, 0), CIwSVec2(sw, sh), IW_2D_FONT_ALIGN_CENTRE, IW_2D_FONT_ALIGN_CENTRE);
			}
			if (g_errorDialog->Get_Visible())
			{
				g_errorDialog->Render();
			}
		}


		Iw2DSurfaceShow();

		switch (g_curSceneType)
		{
			case stNone: curscene = 0; break;
			case stMainMenu: 
			{
				if (curscene != (CBaseScene *)mainmenu)
				{
					curscene = (CBaseScene *)mainmenu; 
					curscene->Show();
				}
			}	break;
			case stGame: 
			{
				if (curscene != (CBaseScene *)game)
				{
					curscene = (CBaseScene *)game;
					curscene->Show();
				}
			}break;

			case stProfile: 
			{
				if (curscene != (CBaseScene *)profile)
				{
					curscene = (CBaseScene *)profile;
					curscene->Show();
				}
			}break;
			case stScores: 
			{
				if (curscene != (CBaseScene *)scores)
				{
					curscene = (CBaseScene *)scores;
					curscene->Show();
				}
			}break;
		}
	}
	Save();
	delete game;
	delete mainmenu;
	delete profile;
	delete scores;

	SC_Client_Release(g_client);
	UnloadGlobalImages();
	UnloadMainControls();
	if (g_AccelerometerEnabled)
		s3eAccelerometerStop();
	// Terminate system modules
	IwResManagerTerminate();
	Iw2DTerminate();

	return 0;
}
コード例 #7
0
CCAccelerometer::~CCAccelerometer()
{
    m_pDelegates->release();
    s3eAccelerometerStop();
}