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

@@ -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;
}