mirror of https://github.com/axmolengine/axmol.git
rename some variable
This commit is contained in:
parent
d3a58fa5ad
commit
6b400dd4ec
|
@ -58,7 +58,7 @@ namespace cocos2d {
|
|||
jobject JniHelper::classloader = NULL;
|
||||
JNIEnv* JniHelper::env = NULL;
|
||||
|
||||
static pthread_key_t thread_key;
|
||||
static pthread_key_t s_threadKey;
|
||||
|
||||
JavaVM* JniHelper::getJavaVM() {
|
||||
pthread_t thisthread = pthread_self();
|
||||
|
@ -96,7 +96,7 @@ namespace cocos2d {
|
|||
// must call DetachCurrentThread() in future.
|
||||
// see: http://developer.android.com/guide/practices/design/jni.html
|
||||
|
||||
pthread_key_create (&thread_key, JniHelper::detach_current_thread);
|
||||
pthread_key_create (&s_threadKey, JniHelper::detach_current_thread);
|
||||
if (jvm->AttachCurrentThread(&_env, NULL) < 0)
|
||||
{
|
||||
LOGD("Failed to get the environment using AttachCurrentThread()");
|
||||
|
@ -106,8 +106,8 @@ namespace cocos2d {
|
|||
} else {
|
||||
// Success : Attached and obtained JNIEnv!
|
||||
JniHelper::env = _env;
|
||||
if (pthread_getspecific(thread_key) == NULL)
|
||||
pthread_setspecific(thread_key, _env);
|
||||
if (pthread_getspecific(s_threadKey) == NULL)
|
||||
pthread_setspecific(s_threadKey, _env);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -215,19 +215,19 @@ static cocos_dimensions engine_init_display(struct engine* engine) {
|
|||
/**
|
||||
* Invoke the dispatching of the next bunch of Runnables in the Java-Land
|
||||
*/
|
||||
static bool initialized = false;
|
||||
static bool s_methodInitialized = false;
|
||||
static void dispatch_pending_runnables() {
|
||||
static cocos2d::JniMethodInfo info;
|
||||
|
||||
if (!initialized) {
|
||||
initialized = cocos2d::JniHelper::getStaticMethodInfo(
|
||||
if (!s_methodInitialized) {
|
||||
s_methodInitialized = cocos2d::JniHelper::getStaticMethodInfo(
|
||||
info,
|
||||
"org/cocos2dx/lib/Cocos2dxHelper",
|
||||
"dispatchPendingRunnables",
|
||||
"()V"
|
||||
);
|
||||
|
||||
if (!initialized) {
|
||||
if (!s_methodInitialized) {
|
||||
LOGW("Unable to dispatch pending Runnables!");
|
||||
return;
|
||||
}
|
||||
|
@ -652,7 +652,7 @@ void android_main(struct android_app* state) {
|
|||
engine_term_display(&engine);
|
||||
|
||||
memset(&engine, 0, sizeof(engine));
|
||||
initialized = false;
|
||||
s_methodInitialized = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue