- Added ads support for Android

- basic "message" system between JGE and java through jni 
- Fixed pause/resume on android/sdl
This commit is contained in:
wagic.the.homebrew
2011-09-04 02:45:18 +00:00
parent 269934fe1e
commit 33691d1f13
21 changed files with 396 additions and 114 deletions

View File

@@ -315,6 +315,11 @@ JGE::JGE()
strcpy(mDebuggingMsg, "");
mCurrentMusic = NULL;
#endif
#if defined (ANDROID)
mJNIEnv = NULL;
#endif
Init();
}
@@ -567,5 +572,29 @@ void JGE::Scroll(int inXVelocity, int inYVelocity)
}
}
void JGE::SendCommand(string command)
{
#if defined (ANDROID)
sendJNICommand(command);
#endif
}
#if defined (ANDROID)
/// Access to JNI Environment
void JGE::SetJNIEnv(JNIEnv * env, jclass cls)
{
mJNIEnv = env;
mJNIClass = cls;
midSendCommand = mJNIEnv->GetStaticMethodID(mJNIClass,"jgeSendCommand","(Ljava/lang/String;)V");
}
void JGE::sendJNICommand(string command)
{
if (midSendCommand) {
mJNIEnv->CallStaticVoidMethod(mJNIClass, midSendCommand, mJNIEnv->NewStringUTF(command.c_str()));
}
}
#endif
std::queue< pair< pair<LocalKeySym, JButton>, bool> > JGE::keyBuffer;
std::multimap<LocalKeySym, JButton> JGE::keyBinds;