|
|
|
@ -181,7 +181,7 @@ Lock event queue and return pointer to next event.
@@ -181,7 +181,7 @@ Lock event queue and return pointer to next event.
|
|
|
|
|
Caller must do Android_PushEvent() to unlock queue after setting parameters. |
|
|
|
|
======================== |
|
|
|
|
*/ |
|
|
|
|
event_t *Android_AllocEvent() |
|
|
|
|
event_t *Android_AllocEvent( void ) |
|
|
|
|
{ |
|
|
|
|
Android_Lock(); |
|
|
|
|
if( events.count == ANDROID_MAX_EVENTS ) |
|
|
|
@ -418,6 +418,7 @@ DECLARE_JNI_INTERFACE( void, nativeBall, jint id, jbyte ball, jshort xrel, jshor
@@ -418,6 +418,7 @@ DECLARE_JNI_INTERFACE( void, nativeBall, jint id, jbyte ball, jshort xrel, jshor
|
|
|
|
|
|
|
|
|
|
DECLARE_JNI_INTERFACE( void, nativeHat, jint id, jbyte hat, jbyte key, jboolean down ) |
|
|
|
|
{ |
|
|
|
|
event_t *event = Android_AllocEvent(); |
|
|
|
|
static byte engineKeys; |
|
|
|
|
|
|
|
|
|
if( !key ) |
|
|
|
@ -428,7 +429,6 @@ DECLARE_JNI_INTERFACE( void, nativeHat, jint id, jbyte hat, jbyte key, jboolean
@@ -428,7 +429,6 @@ DECLARE_JNI_INTERFACE( void, nativeHat, jint id, jbyte hat, jbyte key, jboolean
|
|
|
|
|
else |
|
|
|
|
engineKeys &= ~key; |
|
|
|
|
|
|
|
|
|
event_t *event = Android_AllocEvent(); |
|
|
|
|
event->type = event_joyhat; |
|
|
|
|
event->arg = id; |
|
|
|
|
event->hat.hat = hat; |
|
|
|
@ -584,7 +584,7 @@ Android_Init
@@ -584,7 +584,7 @@ Android_Init
|
|
|
|
|
Initialize android-related cvars |
|
|
|
|
======================== |
|
|
|
|
*/ |
|
|
|
|
void Android_Init() |
|
|
|
|
void Android_Init( void ) |
|
|
|
|
{ |
|
|
|
|
android_sleep = Cvar_Get( "android_sleep", "1", FCVAR_ARCHIVE, "Enable sleep in background" ); |
|
|
|
|
} |
|
|
|
@ -658,12 +658,14 @@ Android_GetAndroidID
@@ -658,12 +658,14 @@ Android_GetAndroidID
|
|
|
|
|
const char *Android_GetAndroidID( void ) |
|
|
|
|
{ |
|
|
|
|
static char id[65]; |
|
|
|
|
const char *resultCStr; |
|
|
|
|
jstring resultJNIStr; |
|
|
|
|
|
|
|
|
|
if( id[0] ) |
|
|
|
|
return id; |
|
|
|
|
|
|
|
|
|
jstring resultJNIStr = (jstring)(*jni.env)->CallStaticObjectMethod( jni.env, jni.actcls, jni.getAndroidId ); |
|
|
|
|
const char *resultCStr = (*jni.env)->GetStringUTFChars( jni.env, resultJNIStr, NULL ); |
|
|
|
|
resultJNIStr = (jstring)(*jni.env)->CallStaticObjectMethod( jni.env, jni.actcls, jni.getAndroidId ); |
|
|
|
|
resultCStr = (*jni.env)->GetStringUTFChars( jni.env, resultJNIStr, NULL ); |
|
|
|
|
Q_strncpy( id, resultCStr, 64 ); |
|
|
|
|
(*jni.env)->ReleaseStringUTFChars( jni.env, resultJNIStr, resultCStr ); |
|
|
|
|
|
|
|
|
@ -795,7 +797,7 @@ Android_RunEvents
@@ -795,7 +797,7 @@ Android_RunEvents
|
|
|
|
|
Execute all events from queue |
|
|
|
|
======================== |
|
|
|
|
*/ |
|
|
|
|
void Platform_RunEvents() |
|
|
|
|
void Platform_RunEvents( void ) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
|