Пример #1
0
	void ExecuteConsoleFunction( long appPtr, char const * commandStr ) const
	{
		DROIDLOG( "OvrConsole", "Received console command \"%s\"", commandStr );
	
		char cmdName[128];
		char const * parms = "";
		int cmdLen = (int)strlen( commandStr );
		char const * spacePtr = strstr( commandStr, " " );
		if ( spacePtr != NULL && spacePtr - commandStr < cmdLen )
		{
			parms = spacePtr + 1;
			OVR_strncpy( cmdName, sizeof( cmdName ), commandStr, spacePtr - commandStr );
		} 
		else
		{
			OVR_strcpy( cmdName, sizeof( cmdName ), commandStr );
		}

		LOG( "ExecuteConsoleFunction( %s, %s )", cmdName, parms );
		for ( int i = 0 ; i < ConsoleFunctions.GetSizeI(); ++i )
		{
			LOG( "Checking console function '%s'", ConsoleFunctions[i].GetName() );
			if ( OVR_stricmp( ConsoleFunctions[i].GetName(), cmdName ) == 0 )
			{
				LOG( "Executing console function '%s'", cmdName );
				ConsoleFunctions[i].Execute( reinterpret_cast< void* >( appPtr ), parms );
				return;
			}
		}

		DROIDLOG( "OvrConsole", "ERROR: unknown console command '%s'", cmdName );
	}
String NativeBuildStrings::GetFieldString( const char * name )
{
	jfieldID field = env->GetStaticFieldID(BuildClass, name , "Ljava/lang/String;");

	// get reference to the string
	jstring jstr = (jstring)env->GetStaticObjectField(BuildClass, field);

	jboolean isCopy;
	const char * cstr = env->GetStringUTFChars(jstr, &isCopy);
	DROIDLOG( "VrApp", "Buildstring %s: %s", name, cstr );

	String	str = String( cstr );

	env->ReleaseStringUTFChars(jstr, cstr);


	return str;
}
Пример #3
0
void DebugPrint( void * appPtr, const char * cmd ) { 
	DROIDLOG( "OvrDebug", "%s", cmd ); 
}