2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-26 03:39:16 +01:00

gpgs_support: drop Google Play Games services support, it wasn't used anyway by any game. We need another interface, probably intent-based.

This commit is contained in:
Alibek Omarov 2019-04-27 12:09:27 +03:00
parent a56fe98dc5
commit 0cfc3966c5
2 changed files with 0 additions and 82 deletions

View File

@ -1,17 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := gpgs_support
APP_PLATFORM := android-12
include $(XASH3D_CONFIG)
LOCAL_CPPFLAGS += -std=c++11
LOCAL_SRC_FILES := gpgs_support.cpp
LOCAL_STATIC_LIBRARIES := libgpg-1
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)

View File

@ -1,65 +0,0 @@
/*
gpgs_support.cpp -- a Google Play Games support library
Copyright (C) 2016 a1batross
*/
#include <jni.h>
#include <android/log.h>
#if defined(GOOGLE_PLAY_BUILD)
#include <gpg/game_services.h>
#include <gpg/android_initialization.h>
using gpg::GameServices;
#else
typedef void *GameServices;
#endif
GameServices *services = nullptr;
extern "C"
{
// After construction of GameServices, pass pointer to this function
// GameServices is recommended to be created in client.dll
void SetGameServicesPtr( GameServices *ptr );
// Share a pointer to external code, like server library or menu.
GameServices *GetGameServicesPtr( void );
}
void SetGameServicesPtr( GameServices *ptr )
{
#ifdef GOOGLE_PLAY_BUILD
static bool once;
if( once )
{
__android_log_print( ANDROID_LOG_ERROR, "GPGSSupport", "To prevent overwriting of GameServices pointer, setting pointer twice is prohibited" );
return;
}
services = ptr;
once = true;
#else
__android_log_print( ANDROID_LOG_WARN, "GPGSSupport", "Not a Google Play build of engine!" );
#endif
}
GameServices *GetGameServicesPtr( void )
{
#ifdef GOOGLE_PLAY_BUILD
return services;
#else
return nullptr;
#endif
}
extern "C" __attribute__((visibility("default"))) jint JNI_OnLoad( JavaVM *vm, void *reserved )
{
#ifdef GOOGLE_PLAY_BUILD
gpg::AndroidInitialization::JNI_OnLoad( vm );
__android_log_print( ANDROID_LOG_VERBOSE, "GPGSSupport", "%s", __PRETTY_FUNCTION__ );
#endif
return JNI_VERSION_1_6;
}