Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void onIncrementAchievement(unsigned char _iArgumentCount, const void *_pArguments, void *_pUserData){
- JNIEnv *pJNIEnv = GetJNIEnv();
- if (pJNIEnv){
- if ( _pArguments && ( _iArgumentCount > 0 ) ){
- const S3DX::AIVariable *pVariables = (const S3DX::AIVariable *)_pArguments ;
- if(_iArgumentCount != 2)
- LOGI("INCORRECT NUMBER OF PARAMETERS");
- else{
- if(pVariables[0].GetType() == S3DX::AIVariable::eTypeString){
- // CHANGE ME!
- jclass pJNIActivityClass = pJNIEnv->FindClass ( "com/nurfacegames/testgame01/TestGame01" );
- if(pJNIActivityClass == NULL)
- LOGI("jclass was null!?!");
- else{
- jmethodID pJNIMethodID = pJNIEnv->GetStaticMethodID(pJNIActivityClass, "onIncrementAchievement", "(Ljava/lang/String;Ljava/lang/Integer;)V");
- if(pJNIMethodID == NULL)
- LOGI("jmethodID was null!?!?");
- else{
- //Create a new string
- jstring arg;
- arg = pJNIEnv->NewStringUTF(pVariables[0].GetStringValue());
- jint arg2 = pVariables[1].GetNumberValue();
- //Call the method and pass the string parameter along
- pJNIEnv->CallStaticVoidMethod(pJNIActivityClass, pJNIMethodID, arg, arg2);
- //Free the string
- pJNIEnv->DeleteLocalRef(arg);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement