Skip to content

Commit 5413ed1

Browse files
KodexKyZeno-
authored andcommittedNov 25, 2014
Fixes for Android build errors. Enable sensor landscape rotation.
Fix typo in Android Makefile ndk path. Fix touchscreen parts of game.cpp to work after Zeno's refactor. Fix isdigit and isspace overload conflict with Android Irrlicht in string.h Enable sensor landscape rotation in Android Manifiest. Add mapgen v5 to Android build. Fix Makefile not checking leveldb. Signed-off-by: Craig Robbins <kde.psych@gmail.com>
1 parent 9878e8d commit 5413ed1

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed
 

‎build/android/AndroidManifest.xml.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
android:label="Minetest"
1616
android:launchMode="singleTask"
1717
android:configChanges="orientation|keyboardHidden"
18-
android:screenOrientation="landscape"
18+
android:screenOrientation="sensorLandscape"
1919
android:clearTaskOnLaunch="true">
2020
<intent-filter>
2121
<action android:name="android.intent.action.MAIN" />

‎build/android/Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ FREETYPE_URL_GIT = https://github.com/cdave1/freetype2-android
125125

126126
-include $(PATHCFGFILE)
127127

128+
#use interim target variable to switch leveldb on or off
129+
ifeq ($(HAVE_LEVELDB),1)
130+
LEVELDB_TARGET = $(LEVELDB_LIB)
131+
endif
132+
128133
.PHONY : debug release reconfig delconfig \
129134
leveldb_download clean_leveldb leveldb\
130135
irrlicht_download clean_irrlicht irrlicht \
@@ -140,11 +145,6 @@ FREETYPE_URL_GIT = https://github.com/cdave1/freetype2-android
140145
$(OPENSSL_TIMESTAMP) curl_binary \
141146
$(ROOT)/jni/src/android_version.h
142147

143-
#use interim target variable to switch leveldb on or off
144-
ifeq ($(HAVE_LEVELDB),1)
145-
LEVELDB_TARGET = $(LEVELDB_LIB)
146-
endif
147-
148148
debug : $(PATHCFGFILE)
149149
export NDEBUG=; \
150150
export BUILD_TYPE=debug; \
@@ -172,9 +172,9 @@ $(PATHCFGFILE) :
172172
exit 1; \
173173
fi; \
174174
echo "ANDROID_NDK = $$ANDROID_NDK" > ${PATHCFGFILE}; \
175-
echo "NDK_MODULE_PATH = $$ANDROID_NDK/tools" >> ${PATHCFGFILE}; \
175+
echo "NDK_MODULE_PATH = $$ANDROID_NDK/toolchains" >> ${PATHCFGFILE}; \
176176
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";\
177-
echo "+ Note: NDK_MODULE_PATH is set to $$ANDROID_NDK/tools"; \
177+
echo "+ Note: NDK_MODULE_PATH is set to $$ANDROID_NDK/toolchains"; \
178178
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";\
179179
echo "Please specify path of ANDROID SDK"; \
180180
echo "e.g. /home/user/adt-bundle-linux-x86_64-20131030/sdk/"; \

‎build/android/jni/Android.mk

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ LOCAL_SRC_FILES := \
159159
jni/src/mapblock_mesh.cpp \
160160
jni/src/mapgen.cpp \
161161
jni/src/mapgen_singlenode.cpp \
162+
jni/src/mapgen_v5.cpp \
162163
jni/src/mapgen_v6.cpp \
163164
jni/src/mapgen_v7.cpp \
164165
jni/src/mapnode.cpp \

‎src/game.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,7 @@ bool Game::initGui(std::wstring *error_message)
20612061
#ifdef HAVE_TOUCHSCREENGUI
20622062

20632063
if (g_touchscreengui)
2064-
g_touchscreengui->init(tsrc, porting::getDisplayDensity());
2064+
g_touchscreengui->init(texture_src, porting::getDisplayDensity());
20652065

20662066
#endif
20672067

@@ -2852,8 +2852,8 @@ void Game::updateCameraDirection(CameraOrientation *cam,
28522852
#ifdef HAVE_TOUCHSCREENGUI
28532853

28542854
if (g_touchscreengui) {
2855-
camera_yaw = g_touchscreengui->getYaw();
2856-
camera_pitch = g_touchscreengui->getPitch();
2855+
cam->camera_yaw = g_touchscreengui->getYaw();
2856+
cam->camera_pitch = g_touchscreengui->getPitch();
28572857
} else {
28582858
#endif
28592859
s32 dx = input->getMousePos().X - (driver->getScreenSize().Width / 2);

‎src/util/string.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ inline std::string trim(const std::string &s)
212212
{
213213
size_t front = 0;
214214

215-
while (isspace(s[front]))
215+
while (std::isspace(s[front]))
216216
++front;
217217

218218
size_t back = s.size();
219-
while (back > front && isspace(s[back-1]))
219+
while (back > front && std::isspace(s[back-1]))
220220
--back;
221221

222222
return s.substr(front, back - front);
@@ -481,7 +481,7 @@ inline std::string unescape_string(std::string &s)
481481
inline bool is_number(const std::string &tocheck)
482482
{
483483
for (size_t i = 0; i < tocheck.size(); i++)
484-
if (!isdigit(tocheck[i]))
484+
if (!std::isdigit(tocheck[i]))
485485
return false;
486486

487487
return !tocheck.empty();

0 commit comments

Comments
 (0)
Please sign in to comment.