Browse Source

engine: android: allow building dedicated on Android

pull/2/head
Alibek Omarov 5 years ago
parent
commit
07aa9595c0
  1. 2
      engine/common/sys_con.c
  2. 4
      engine/platform/android/android.c
  3. 1
      engine/platform/android/dlsym-weak.h
  4. 13
      engine/platform/android/lib_android.c
  5. 2
      engine/platform/android/lib_android.h
  6. 2
      engine/platform/android/vid_android.c

2
engine/common/sys_con.c

@ -162,7 +162,7 @@ void Sys_PrintLog( const char *pMsg ) @@ -162,7 +162,7 @@ void Sys_PrintLog( const char *pMsg )
time( &crt_time );
crt_tm = localtime( &crt_time );
#ifdef __ANDROID__
#if XASH_ANDROID && !XASH_DEDICATED
__android_log_print( ANDROID_LOG_DEBUG, "Xash", "%s", pMsg );
#endif

4
engine/platform/android/android.c

@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "platform/platform.h"
#if defined __ANDROID__ || 1
#if !defined(XASH_DEDICATED)
#include "input.h"
#include "client.h"
#include "sound.h"
@ -973,4 +973,4 @@ void Platform_RunEvents() @@ -973,4 +973,4 @@ void Platform_RunEvents()
pthread_mutex_lock( &events.framemutex );
}
#endif // __ANDROID__
#endif // XASH_DEDICATED

1
engine/platform/android/dlsym-weak.h

@ -12,6 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,6 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef DLSYM_WEAH_H
#define DLSYM_WEAK_H

13
engine/platform/android/lib_android.c

@ -12,8 +12,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#ifdef __ANDROID__
#include "common.h"
#include "library.h"
#include "filesystem.h"
@ -54,11 +52,12 @@ void *ANDROID_LoadLibrary( const char *dllname ) @@ -54,11 +52,12 @@ void *ANDROID_LoadLibrary( const char *dllname )
void *ANDROID_GetProcAddress( void *hInstance, const char *name )
{
void *p = dlsym( hInstance, name );
#ifndef XASH_64BIT
if( p ) return p;
return dlsym_weak( hInstance, name );
}
p = dlsym_weak( hInstance, name );
#endif // XASH_64BIT
#endif // __ANDROID__
return p;
}

2
engine/platform/android/lib_android.h

@ -13,7 +13,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -13,7 +13,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifdef __ANDROID__
#ifndef ANDROID_LIB_H
#define ANDROID_LIB_H
@ -21,4 +20,3 @@ void *ANDROID_LoadLibrary( const char *dllname ); @@ -21,4 +20,3 @@ void *ANDROID_LoadLibrary( const char *dllname );
void *ANDROID_GetProcAddress( void *hInstance, const char *name );
#endif // ANDROID_LIB_H
#endif // __ANDROID__

2
engine/platform/android/vid_android.c

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
#include "platform/platform.h"
#if defined XASH_VIDEO == VIDEO_ANDROID || 1
#if defined XASH_VIDEO == VIDEO_ANDROID
#include "input.h"
#include "client.h"
#include "filesystem.h"

Loading…
Cancel
Save