From 987b6ac1232dbafd50b9a6a26fcf769f5bdcd0a6 Mon Sep 17 00:00:00 2001 From: faketruth Date: Wed, 26 Sep 2012 14:36:08 +0000 Subject: Fixed a bug in the inventory system where it would de-sync when dragging items with non-default metadata/health Android: Updated VS2008 project to point to correct Android files Android: Updated makefiles to compile CryptoPP Android: Modified CryptoPP config.h and misc.cpp so it compiles for Android Android: Added pretty MCServer icons git-svn-id: http://mc-server.googlecode.com/svn/trunk@893 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- Android/jni/Android.mk | 5 ++++- Android/jni/Application.mk | 5 ++++- Android/jni/app-android.cpp | 7 ++++--- Android/res/drawable-hdpi/ic_launcher.png | Bin 9397 -> 12967 bytes Android/res/drawable-ldpi/ic_launcher.png | Bin 2729 -> 5942 bytes Android/res/drawable-mdpi/ic_launcher.png | Bin 5237 -> 7989 bytes Android/res/drawable-xhdpi/ic_launcher.png | Bin 14383 -> 18851 bytes CryptoPP/config.h | 2 +- CryptoPP/misc.cpp | 4 +++- VC2008/MCServer.vcproj | 10 +++++----- source/UI/SlotArea.cpp | 2 +- 11 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Android/jni/Android.mk b/Android/jni/Android.mk index 6fd8d3a14..ae0123ba2 100644 --- a/Android/jni/Android.mk +++ b/Android/jni/Android.mk @@ -5,7 +5,7 @@ LOCAL_MODULE := mcserver -LOCAL_SRC_FILES := $(shell find ../lua-5.1.4 ../jsoncpp-src-0.5.0 ../zlib-1.2.7 ../source ../squirrel_3_0_1_stable ../tolua++-1.0.93 ../iniFile ../WebServer '(' -name '*.cpp' -o -name '*.c' ')') +LOCAL_SRC_FILES := $(shell find ../CryptoPP ../lua-5.1.4 ../jsoncpp-src-0.5.0 ../zlib-1.2.7 ../source ../squirrel_3_0_1_stable ../tolua++-1.0.93 ../iniFile ../WebServer '(' -name '*.cpp' -o -name '*.c' ')') LOCAL_SRC_FILES := $(filter-out %SquirrelFunctions.cpp %SquirrelBindings.cpp %cPlugin_Squirrel.cpp %cSquirrelCommandBinder.cpp %minigzip.c %lua.c %tolua.c %toluabind.c %LeakFinder.cpp %StackWalker.cpp %example.c,$(LOCAL_SRC_FILES)) LOCAL_SRC_FILES := $(patsubst %.cpp,../%.cpp,$(LOCAL_SRC_FILES)) LOCAL_SRC_FILES := $(patsubst %.c,../%.c,$(LOCAL_SRC_FILES)) @@ -16,6 +16,8 @@ LOCAL_CFLAGS := -DANDROID_NDK \ -O3 \ -funroll-loops \ -mfloat-abi=softfp -mfpu=neon \ + -fexceptions \ + -D_DEBUG \ LOCAL_STATIC_LIBRARIES := cpufeatures @@ -36,6 +38,7 @@ LOCAL_C_INCLUDES := ../source \ ../squirrel_3_0_1_stable/include \ ../squirrel_3_0_1_stable \ ../squirrel_3_0_1_stable/sqrat \ + .. \ LOCAL_LDLIBS := -ldl -llog diff --git a/Android/jni/Application.mk b/Android/jni/Application.mk index c68dfe204..e00c8b5e2 100644 --- a/Android/jni/Application.mk +++ b/Android/jni/Application.mk @@ -1,4 +1,7 @@ # Build both ARMv5TE and ARMv7-A machine code. APP_MODULES := mcserver # APP_ABI := armeabi armeabi-v7a -APP_STL := stlport_static \ No newline at end of file +#APP_STL := stlport_static + +APP_STL := gnustl_static +APP_CPPFLAGS := -frtti \ No newline at end of file diff --git a/Android/jni/app-android.cpp b/Android/jni/app-android.cpp index a6fb1baf2..d90374225 100644 --- a/Android/jni/app-android.cpp +++ b/Android/jni/app-android.cpp @@ -10,11 +10,12 @@ #include #include -#include "cCriticalSection.h" -#include "cRoot.h" -#include "cMakeDir.h" +#include "OSSupport/CriticalSection.h" +#include "OSSupport/MakeDir.h" #include "ToJava.h" +#include "Root.h" + #include cCriticalSection g_CriticalSection; diff --git a/Android/res/drawable-hdpi/ic_launcher.png b/Android/res/drawable-hdpi/ic_launcher.png index 96a442e5b..d8a74a2d8 100644 Binary files a/Android/res/drawable-hdpi/ic_launcher.png and b/Android/res/drawable-hdpi/ic_launcher.png differ diff --git a/Android/res/drawable-ldpi/ic_launcher.png b/Android/res/drawable-ldpi/ic_launcher.png index 99238729d..5fa7251f8 100644 Binary files a/Android/res/drawable-ldpi/ic_launcher.png and b/Android/res/drawable-ldpi/ic_launcher.png differ diff --git a/Android/res/drawable-mdpi/ic_launcher.png b/Android/res/drawable-mdpi/ic_launcher.png index 359047dfa..0e3af7c05 100644 Binary files a/Android/res/drawable-mdpi/ic_launcher.png and b/Android/res/drawable-mdpi/ic_launcher.png differ diff --git a/Android/res/drawable-xhdpi/ic_launcher.png b/Android/res/drawable-xhdpi/ic_launcher.png index 71c6d760f..60b19df2d 100644 Binary files a/Android/res/drawable-xhdpi/ic_launcher.png and b/Android/res/drawable-xhdpi/ic_launcher.png differ diff --git a/CryptoPP/config.h b/CryptoPP/config.h index 93a79ed3d..ba7c00110 100644 --- a/CryptoPP/config.h +++ b/CryptoPP/config.h @@ -243,7 +243,7 @@ NAMESPACE_END # pragma warn -8037 #endif -#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION) +#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION) || defined(ANDROID_NDK) #define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION #endif diff --git a/CryptoPP/misc.cpp b/CryptoPP/misc.cpp index 3c2c2a5f0..93760e3a3 100644 --- a/CryptoPP/misc.cpp +++ b/CryptoPP/misc.cpp @@ -112,13 +112,14 @@ bool VerifyBufsEqual(const byte *buf, const byte *mask, size_t count) return acc8 == 0; } -#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) +#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) && !defined(ANDROID_NDK) using std::new_handler; using std::set_new_handler; #endif void CallNewHandler() { +#if !defined(ANDROID_NDK) new_handler newHandler = set_new_handler(NULL); if (newHandler) set_new_handler(newHandler); @@ -127,6 +128,7 @@ void CallNewHandler() newHandler(); else throw std::bad_alloc(); +#endif } #if CRYPTOPP_BOOL_ALIGN16_ENABLED diff --git a/VC2008/MCServer.vcproj b/VC2008/MCServer.vcproj index aab1fc9ce..6dd3a944f 100644 --- a/VC2008/MCServer.vcproj +++ b/VC2008/MCServer.vcproj @@ -1186,7 +1186,7 @@ Name="Android Specific" >