Minor iOS update - v. 1.1.24

master
MoNTE48 2018-12-26 22:59:09 +01:00 committed by Maksim
parent 8df7922eb8
commit d7befa1a30
17 changed files with 156 additions and 42 deletions

View File

@ -38,13 +38,13 @@ CROSS_PREFIX = arm-linux-androideabi
# toolchain config for x86
################################################################################
# TARGET_HOST = x86-linux
# TARGET_ABI = x86
# TARGET_TOOLCHAIN = x86
# TARGET_CFLAGS_ADDON = -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32 -Ofast -funroll-loops -fdata-sections -ffunction-sections -fvisibility=hidden -flto -D__ANDROID_API__=$(API)
# TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON)
# TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch,--gc-sections,--icf=safe
# CROSS_PREFIX = i686-linux-android
#TARGET_HOST = x86-linux
#TARGET_ABI = x86
#TARGET_TOOLCHAIN = x86
#TARGET_CFLAGS_ADDON = -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32 -Ofast -funroll-loops -fdata-sections -ffunction-sections -fvisibility=hidden -flto -D__ANDROID_API__=$(API)
#TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON)
#TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch,--gc-sections,--icf=safe
#CROSS_PREFIX = i686-linux-android
################################################################################
@ -57,7 +57,7 @@ LEVELDB_TIMESTAMP = $(LEVELDB_DIR)/timestamp
LEVELDB_TIMESTAMP_INT = $(ANDR_ROOT)/deps/leveldb_timestamp
LEVELDB_URL = https://github.com/google/leveldb/archive/v$(LEVELDB_VERSION).zip
OPENAL_VERSION = 1.18.2
OPENAL_VERSION = 1.19.1
OPENAL_DIR = $(ANDR_ROOT)/deps/openal-soft
OPENAL_LIB = $(OPENAL_DIR)/libopenal.a
OPENAL_TIMESTAMP = $(OPENAL_DIR)/timestamp
@ -77,7 +77,7 @@ IRRLICHT_TIMESTAMP = $(IRRLICHT_DIR)/timestamp
IRRLICHT_TIMESTAMP_INT = $(ANDR_ROOT)/deps/irrlicht_timestamp
IRRLICHT_URL_HTTP = https://github.com/zaki/irrlicht/archive/$(IRRLICHT_COMMIT).zip
CURL_VERSION = 7.61.0
CURL_VERSION = 7.62.0
CURL_DIR = $(ANDR_ROOT)/deps/curl
CURL_LIB = $(CURL_DIR)/lib/.libs/libcurl.a
CURL_TIMESTAMP = $(CURL_DIR)/timestamp

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objectVersion = 51;
objects = {
/* Begin PBXBuildFile section */
@ -1395,7 +1395,7 @@
};
};
buildConfigurationList = F8E6C4D41DCA3B7900F64426 /* Build configuration list for PBXProject "MultiCraft" */;
compatibilityVersion = "Xcode 8.0";
compatibilityVersion = "Xcode 10.0";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
@ -1788,7 +1788,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -1836,7 +1836,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
@ -1885,8 +1885,11 @@
"${SRCROOT}/../deps/libcurl/include",
);
INFOPLIST_FILE = MultiCraft/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
OTHER_CFLAGS = (
"$(inherited)",
"-isystem",
@ -1921,6 +1924,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = mobi.MultiCraft;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
@ -1967,8 +1971,11 @@
"${SRCROOT}/../deps/libcurl/include",
);
INFOPLIST_FILE = MultiCraft/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
OTHER_CFLAGS = (
"$(inherited)",
"-isystem",
@ -2003,6 +2010,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = mobi.MultiCraft;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;

View File

@ -91,8 +91,8 @@
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "AppStore.jpg",
"scale" : "1x"
}
@ -101,4 +101,4 @@
"version" : 1,
"author" : "xcode"
}
}
}

View File

@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.23</string>
<string>1.1.24</string>
<key>CFBundleVersion</key>
<string>37</string>
<string>39</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>

View File

@ -1,5 +1,5 @@
project 'MultiCraft/MultiCraft.xcodeproj'
platform :ios, '8.0'
platform :ios, '9.0'
target 'MultiCraft' do
source 'https://github.com/appodeal/CocoaPods.git'
@ -8,8 +8,8 @@ target 'MultiCraft' do
pod 'SSZipArchive'
pod 'SDVersion', :git => 'https://github.com/skitudeiosdevelopers/SDVersion'
pod 'Appodeal/Core', '2.4.8.1-Beta'
pod 'Appodeal/Interstitial', '2.4.8.1-Beta'
pod 'Appodeal/Video', '2.4.8.1-Beta'
pod 'Appodeal/Core', '2.5.0-Beta'
pod 'Appodeal/Interstitial', '2.5.0-Beta'
pod 'Appodeal/Video', '2.5.0-Beta'
pod 'PersonalizedAdConsent', :git => 'https://github.com/MultiCraftProject/googleads-consent-sdk-ios'
end

View File

@ -3,7 +3,6 @@
. sdk.sh
[ ! -d irrlicht-src ] && \
#svn co -r 5641 svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es irrlicht-src
svn co svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es irrlicht-src
cd irrlicht-src/

View File

@ -14,7 +14,7 @@ cd libcurl-src
CC=$IOS_CC CFLAGS=$IOS_FLAGS \
./configure --host=arm-apple-darwin --prefix=/ --disable-shared --enable-static \
--disable-debug --disable-dependency-tracking -disable-ftp \
--disable-debug --disable-verbose --disable-dependency-tracking --disable-ftp \
--disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict \
--disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp \
--disable-gopher --disable-sspi --disable-manual --disable-zlib --without-zlib \

View File

@ -20,14 +20,14 @@ fi
# 32-bit
make -j$(sysctl -n hw.ncpu) \
HOST_CC="clang -m32 -arch i386" CROSS="$(dirname $IOS_CC)/" \
TARGET_FLAGS="${IOS_FLAGS/-arch arm64/}" TARGET_SYS=iOS \
TARGET_FLAGS="${IOS_FLAGS_LUA/-arch arm64/}" TARGET_SYS=iOS \
-j$(sysctl -n hw.ncpu)
mv src/libluajit.a tmp32.a
make clean
# 64-bit
make -j$(sysctl -n hw.ncpu) \
HOST_CC=clang CROSS="$(dirname $IOS_CC)/" \
TARGET_FLAGS="${IOS_FLAGS/-arch armv7/}" TARGET_SYS=iOS \
TARGET_FLAGS="${IOS_FLAGS_LUA/-arch armv7/}" TARGET_SYS=iOS \
-j$(sysctl -n hw.ncpu)
mv src/libluajit.a tmp64.a
make clean

View File

@ -2,9 +2,10 @@
# This file sets the appropiate compiler and flags for compiling for iOS without XCode
sdk=iphoneos
osver=8.0
osver=9.0
export IOS_COMPILER=$(xcrun --sdk $sdk --find clang)
export IOS_CC=$IOS_COMPILER
export IOS_CXX=$IOS_COMPILER
export IOS_FLAGS="-isysroot $(xcrun --sdk $sdk --show-sdk-path) -arch armv7 -arch arm64 -miphoneos-version-min=$osver -fvisibility=hidden -fdata-sections -ffunction-sections -fvisibility=hidden -flto -Ofast"
export IOS_FLAGS="-isysroot $(xcrun --sdk $sdk --show-sdk-path) -arch armv7 -arch armv7s -arch arm64 -arch arm64e -miphoneos-version-min=$osver -fvisibility=hidden -fdata-sections -ffunction-sections -fvisibility=hidden -flto -Ofast"
export IOS_FLAGS_LUA="-isysroot $(xcrun --sdk $sdk --show-sdk-path) -arch armv7 -arch arm64 -miphoneos-version-min=$osver -fvisibility=hidden -fdata-sections -ffunction-sections -fvisibility=hidden -flto -Ofast"

View File

@ -36,11 +36,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "clientlauncher.h"
#include "version.h"
#if 0 // toggle to 1 for ads
#define ADS
#include "ads.h"
#endif
#ifdef __IOS__
namespace irr {
class CIrrDeviceiOS : public IrrlichtDevice {
@ -49,6 +44,9 @@ namespace irr {
};
}
#endif
#if defined(__ANDROID__) || defined(__IOS__)
#include "porting.h"
#endif
/* mainmenumanager.h
*/
@ -268,6 +266,9 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
#ifdef ADS
ads_enable(false);
#endif
#if defined(__ANDROID__) || defined(__IOS__)
porting::notifyExitGame();
#endif
} //try
catch (con::PeerNotFoundException &e) {

View File

@ -362,6 +362,9 @@ void FontEngine::initFont(unsigned int basesize, FontMode mode)
}
// give up
#if defined(__ANDROID__) || defined(__IOS__)
porting::notifyAbortLoading();
#endif
errorstream << "FontEngine: failed to load freetype font: "
<< font_path << std::endl;
errorstream << "minetest can not continue without a valid font. Please correct "

View File

@ -1459,7 +1459,7 @@ private:
bool m_invert_mouse;
bool m_first_loop_after_window_activation;
bool m_camera_offset_changed;
#if defined(__ANDROID__) || defined(__IOS__)
bool show_minimap;
bool m_cache_hold_aux1;
@ -1619,7 +1619,7 @@ bool Game::startup(bool *kill,
runData.time_from_last_punch = 10.0;
runData.profiler_max_page = 3;
runData.update_wielded_item_trigger = true;
memset(&flags, 0, sizeof(flags));
flags.show_chat = true;
flags.show_hud = true;
@ -1904,6 +1904,10 @@ bool Game::createClient(const std::string &playername,
return false;
}
#if defined(__ANDROID__) || defined(__IOS__)
porting::notifyServerConnect(!simple_singleplayer_mode);
#endif
GameGlobalShaderConstantSetterFactory *scsf = new GameGlobalShaderConstantSetterFactory(
&flags.force_fog_off, &runData.fog_range, client);
shader_src->addShaderConstantSetterFactory(scsf);
@ -4042,7 +4046,7 @@ void Game::handleDigging(const PointedThing &pointed, const v3s16 &nodepos,
bool is_valid_position;
MapNode wasnode = map.getNodeNoEx(nodepos, &is_valid_position);
if (is_valid_position) {
if (client->moddingEnabled() &&
if (client->moddingEnabled() &&
client->getScript()->on_dignode(nodepos, wasnode)) {
return;
}
@ -4693,7 +4697,7 @@ void Game::showPauseMenu()
<< "bgcolor[#00000060;true]"
<< "button_exit[3.5," << (ypos++) << ";4,0.5;btn_continue;"
<< strgettext("Continue") << "]";
if (!simple_singleplayer_mode) {
#if !defined(__ANDROID__) && !defined(__IOS__)
os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_change_password;"

View File

@ -215,6 +215,9 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev,
if (!loadMainMenuScript()) {
errorstream << "No future without main menu!" << std::endl;
#if defined(__ANDROID__) || defined(__IOS__)
porting::notifyAbortLoading();
#endif
abort();
}
@ -624,4 +627,3 @@ unsigned int GUIEngine::queueAsync(const std::string &serialized_func,
{
return m_script->queueAsync(serialized_func, serialized_params);
}

View File

@ -80,6 +80,7 @@ extern "C" {
namespace porting {
std::string path_storage = DIR_DELIM "sdcard" DIR_DELIM;
int device_memory_max = 0;
android_app* app_global;
JNIEnv* jnienv;
@ -260,6 +261,59 @@ std::string getInputDialogValue()
return text;
}
int getMemoryMax()
{
if (device_memory_max == 0) {
jmethodID getMemory = jnienv->GetMethodID(nativeActivity,
"getMemoryMax", "()I");
if (getMemory == 0)
assert("porting::getMemoryMax unable to find java method" == 0);
device_memory_max = jnienv->CallIntMethod(
app_global->activity->clazz, getMemory);
}
return device_memory_max;
}
void notifyAbortLoading()
{
jmethodID notifyAbort = jnienv->GetMethodID(nativeActivity,
"notifyAbortLoading", "()V");
if (notifyAbort == 0) {
assert("porting::notifyAbortLoading unable to find java method" == 0);
}
jnienv->CallVoidMethod(app_global->activity->clazz, notifyAbort);
}
void notifyServerConnect(bool is_multiplayer)
{
jmethodID notifyConnect = jnienv->GetMethodID(nativeActivity,
"notifyServerConnect", "(Z)V");
if (notifyConnect == 0) {
assert("porting::notifyServerConnect unable to find java method" == 0);
}
jboolean param = (jboolean)is_multiplayer;
jnienv->CallVoidMethod(app_global->activity->clazz, notifyConnect, param);
}
void notifyExitGame()
{
jmethodID notifyExit = jnienv->GetMethodID(nativeActivity,
"notifyExitGame", "()V");
if (notifyExit == 0) {
assert("porting::notifyExitGame unable to find java method" == 0);
}
jnienv->CallVoidMethod(app_global->activity->clazz, notifyExit);
}
#ifndef SERVER
float getDisplayDensity()
{

View File

@ -72,6 +72,28 @@ int getInputDialogState();
*/
std::string getInputDialogValue();
/**
* get max device RAM as integer value
* returns -1 on failure
*/
int getMemoryMax();
/**
* notify java that font loading failded
*/
void notifyAbortLoading();
/**
* notify java on server connection
*/
void notifyServerConnect(bool is_multiplayer);
/**
* notify java on game exit.
*/
void notifyExitGame();
}
#endif

View File

@ -61,9 +61,20 @@ namespace porting {
ioswrap_get_dialog(&str);
return std::string(str);
}
void notifyServerConnect(bool is_multiplayer) {
#ifdef ADS
ads_allow(!is_multiplayer);
#endif
}
void notifyExitGame() {
#ifdef ADS
ads_allow(true);
#endif
}
}
extern int real_main(int argc, char *argv[]);
void irrlicht_main() {

View File

@ -5,6 +5,11 @@
#error This file should only be included on iOS
#endif
#if 0 // toggle to 1 for ads
#define ADS
#include "ads.h"
#endif
namespace porting {
void initializePathsiOS();
void copyAssets();
@ -14,6 +19,10 @@ namespace porting {
const std::string &current, int editType);
int getInputDialogState();
std::string getInputDialogValue();
inline void notifyAbortLoading() {}
void notifyServerConnect(bool is_multiplayer);
void notifyExitGame();
}
#endif