Reverted deprecated Android changes

This commit is contained in:
Sergii Pylypenko
2019-09-04 15:23:05 +03:00
parent 4eef03cee5
commit ffcda991e7
4 changed files with 6 additions and 33 deletions

View File

@@ -1823,14 +1823,14 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DWITH_XAUDIO2"
fi
if [ -n "$libtimidity" ]; then
if [ -n "$libtimidity_config" ]; then
CFLAGS="$CFLAGS -DLIBTIMIDITY"
CFLAGS="$CFLAGS `$libtimidity --cflags | tr '\n\r' ' '`"
CFLAGS="$CFLAGS `$libtimidity_config --cflags | tr '\n\r' ' '`"
if [ "$enable_static" != "0" ]; then
LIBS="$LIBS `$libtimidity --libs --static | tr '\n\r' ' '`"
LIBS="$LIBS `$libtimidity_config --libs --static | tr '\n\r' ' '`"
else
LIBS="$LIBS `$libtimidity --libs | tr '\n\r' ' '`"
LIBS="$LIBS `$libtimidity_config --libs | tr '\n\r' ' '`"
fi
fi
@@ -2772,7 +2772,7 @@ detect_lzo2() {
}
detect_libtimidity() {
detect_pkg_config "$with_libtimidity" "libtimidity" "libtimidity" "0.1" "1"
detect_pkg_config "$with_libtimidity" "libtimidity" "libtimidity_config" "0.1" "1"
}
detect_fluidsynth() {

2
configure vendored
View File

@@ -124,7 +124,7 @@ AWKCOMMAND='
if ($0 == "MORPHOS" && "'$os'" != "MORPHOS") { next; }
if ($0 == "MSVC" && "'$os'" != "MSVC") { next; }
if ($0 == "DIRECTMUSIC" && "'$with_direct_music'" == "0") { next; }
if ($0 == "LIBTIMIDITY" && "'$libtimidity'" == "" ) { next; }
if ($0 == "LIBTIMIDITY" && "'$libtimidity_config'" == "" ) { next; }
if ($0 == "FLUIDSYNTH" && "'$fluidsynth'" == "" ) { next; }
if ($0 == "HAVE_THREAD" && "'$with_threads'" == "0") { next; }
if ($0 == "SSE" && "'$with_sse'" != "1") { next; }

View File

@@ -292,11 +292,7 @@ static const char * const _subdirs[] = {
"ai" PATHSEP "library" PATHSEP,
"game" PATHSEP,
"game" PATHSEP "library" PATHSEP,
#ifdef __ANDROID__
"screenshot" PATHSEP,
#else
"screenshot" PATHSEP,
#endif
};
assert_compile(lengthof(_subdirs) == NUM_SUBDIRS);
@@ -1283,21 +1279,6 @@ void DeterminePaths(const char *exe)
_searchpaths[SP_AUTODOWNLOAD_DIR] = NULL;
}
#endif /* ENABLE_NETWORK */
#ifdef __ANDROID__
// Copy savegames from "full" OpenTTD to "lite" save directory
char curdir[PATH_MAX];
if (getcwd(curdir, sizeof(curdir)) && strstr(curdir, "org.openttd.sdl.lowmem")) {
// No, I won't implement file copying in C, shell script is just fine for this job
DEBUG(misc, 1, "Copying savegames from ../../org.openttd.sdl/files/.openttd/save to %s", curdir);
system("cd ../../org.openttd.sdl/files/.openttd/save && "
"for F in *.sav ; do "
"ls \"../../../../org.openttd.sdl.lowmem/files/.openttd/save/$F\" || "
"cat \"$F\" > \"../../../../org.openttd.sdl.lowmem/files/.openttd/save/$F\" ; "
"done");
chdir(curdir);
}
#endif
}
/**

View File

@@ -615,14 +615,6 @@ int VideoDriver_SDL::PollEvent()
} else if (ev.button.button == SDL_BUTTON_LEFT) {
_left_button_down = false;
_left_button_clicked = false;
#ifdef __ANDROID__
if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_RMASK) {
// Two-finger click - hacky way to determine if the right mouse button is already pressed without processing the left button event
// Cancel whatever action we were doing, to allow two finger scrolling
ResetObjectToPlace();
ToolbarSelectLastTool();
}
#endif
} else if (ev.button.button == SDL_BUTTON_RIGHT) {
_right_button_down = false;
}