Exemple #1
0
void UI_Main::gamepadCursorMove( void ) {
	int64_t time = trap::Milliseconds();

	static int64_t lastTime;
	if( !lastTime ) {
		lastTime = time;
		return;
	}
	if( lastTime == time ) {
		return;
	}

	int frameTimeMsec = time - lastTime;
	clamp_high( frameTimeMsec, 100 );

	gamepadStickCursorMove( frameTimeMsec );
	gamepadDpadCursorMove( frameTimeMsec );
}
Exemple #2
0
void UI_Main::gamepadCursorMove( void )
{
	unsigned int time = trap::Milliseconds();

	static unsigned int lastTime;
	if( !lastTime ) {
		lastTime = time;
		return;
	}

	float frameTime = ( time - lastTime ) * 0.001f;
	lastTime = time;

	if( !frameTime ) {
		return;
	}

	clamp_high( frameTime, 0.1f );

	gamepadStickCursorMove( frameTime );
	gamepadDpadCursorMove( frameTime );
}