added android makefiles

ensure data directory is created
This commit is contained in:
jeefo 2015-12-30 09:16:01 +03:00
commit 6bcf41c5d2
5 changed files with 53 additions and 4 deletions

1
Android.mk Normal file
View file

@ -0,0 +1 @@
include $(call all-subdir-makefiles)

View file

@ -54,12 +54,12 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v140_xp</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v140_xp</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

36
source/Android.mk Normal file
View file

@ -0,0 +1,36 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(XASH3D_CONFIG)
LOCAL_MODULE := yapb
LOCAL_CONLYFLAGS += -std=c99
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard)
LOCAL_MODULE_FILENAME = libyapb_hardfp
endif
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include \
$(LOCAL_PATH)/../include/engine
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_SRC_FILES := \
basecode.cpp \
manager.cpp \
chatlib.cpp \
combat.cpp \
globals.cpp \
interface.cpp \
navigate.cpp \
netmsg.cpp \
support.cpp \
waypoint.cpp \
LOCAL_CFLAGS += -O2 -DLINUX -DXASH_CSDM -D_LINUX -DPOSIX -DHAVE_STDINT_H -D__extern_always_inline=inline -D_strdup=strdup -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -fno-strict-aliasing -Wall -Werror -Wno-uninitialized -Wno-unused -Wno-switch -Wno-c++11-compat-deprecated-writable-strings
LOCAL_CPPFLAGS += -w -Wno-invalid-offsetof -fno-exceptions -fno-rtti
include $(BUILD_SHARED_LIBRARY)

View file

@ -3017,6 +3017,18 @@ DLL_GIVEFNPTRSTODLL GiveFnptrsToDll (enginefuncs_t *functionTable, globalvars_t
// register our cvars
convars.PushRegisteredConVarsToEngine ();
// ensure data & learned directory are created (as we can download waypoints from the net)
const char *path = GetWaypointDir ();
// ensure data path exists
CreatePath (const_cast <char *> (path));
char learnedPath[256];
snprintf (learnedPath, SIZEOF_CHAR (learnedPath), "%s/learned", path);
// ensure data/learned path exists
CreatePath (learnedPath);
#ifdef PLATFORM_ANDROID
g_gameVersion = CSV_OLD; // temporary, until opensource client dll get BotVoice message

View file

@ -960,7 +960,7 @@ extern bool OpenConfig(const char *fileName, const char *errorIfNotExists, File
const char *GetWaypointDir (void)
{
return FormatBuffer ("%s/addons/yapb/data/", GetModName ());
return FormatBuffer ("%s/addons/yapb/data/", GetModName ());
}
extern void RegisterCommand(const char *command, void funcPtr (void))