mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: platform: android: hide SDL calls under XASH_SDL macro
This commit is contained in:
@@ -13,9 +13,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
*/
|
||||
#include "platform/platform.h"
|
||||
|
||||
#if !defined(XASH_DEDICATED)
|
||||
|
||||
#include "input.h"
|
||||
#include "client.h"
|
||||
#include "sound.h"
|
||||
@@ -25,7 +22,9 @@ GNU General Public License for more details.
|
||||
|
||||
#include <android/log.h>
|
||||
#include <jni.h>
|
||||
#if XASH_SDL
|
||||
#include <SDL.h>
|
||||
#endif // XASH_SDL
|
||||
|
||||
struct jnimethods_s
|
||||
{
|
||||
@@ -39,6 +38,9 @@ struct jnimethods_s
|
||||
|
||||
void Android_Init( void )
|
||||
{
|
||||
memset( &jni, 0, sizeof( jni ));
|
||||
|
||||
#if XASH_SDL
|
||||
jni.env = (JNIEnv *)SDL_AndroidGetJNIEnv();
|
||||
jni.activity = (jobject)SDL_AndroidGetActivity();
|
||||
jni.actcls = (*jni.env)->GetObjectClass( jni.env, jni.activity );
|
||||
@@ -51,6 +53,7 @@ void Android_Init( void )
|
||||
SDL_SetHint( SDL_HINT_ANDROID_BLOCK_ON_PAUSE, "0" );
|
||||
SDL_SetHint( SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO, "0" );
|
||||
SDL_SetHint( SDL_HINT_ANDROID_TRAP_BACK_BUTTON, "1" );
|
||||
#endif // !XASH_SDL
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -134,5 +137,3 @@ void Platform_ShellExecute( const char *path, const char *parms )
|
||||
SDL_OpenURL( path );
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // XASH_DEDICATED
|
||||
|
||||
Reference in New Issue
Block a user