mirror of
https://github.com/edubart/otclient.git
synced 2025-12-18 14:47:11 +01:00
Compiling and running on android, but the window is black when run (bug)
This commit is contained in:
@@ -177,6 +177,8 @@ std::string Application::getOs()
|
||||
return "mac";
|
||||
#elif __linux
|
||||
return "linux";
|
||||
#elif defined ANDROID
|
||||
return "android";
|
||||
#else
|
||||
return "unknown";
|
||||
#endif
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
#include <framework/luaengine/luainterface.h>
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <android/log.h>
|
||||
#endif // ANDROID
|
||||
|
||||
Logger g_logger;
|
||||
|
||||
void Logger::log(Fw::LogLevel level, const std::string& message)
|
||||
@@ -66,6 +70,9 @@ void Logger::log(Fw::LogLevel level, const std::string& message)
|
||||
outmsg = tmp.str();
|
||||
#endif
|
||||
*/
|
||||
#ifdef ANDROID
|
||||
__android_log_print(ANDROID_LOG_INFO, "OTClientMobile", outmsg.c_str());
|
||||
#endif // ANDROID
|
||||
|
||||
std::cout << outmsg << std::endl;
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@ bool ResourceManager::discoverWorkDir(const std::string& existentFile)
|
||||
std::string possiblePaths[] = { g_platform.getCurrentDir(),
|
||||
g_resources.getBaseDir(),
|
||||
g_resources.getBaseDir() + "../",
|
||||
g_resources.getBaseDir() + "../share/" + g_app.getCompactName() + "/" };
|
||||
g_resources.getBaseDir() + "../share/" + g_app.getCompactName() + "/",
|
||||
"/sdcard/OTClient/" };
|
||||
|
||||
bool found = false;
|
||||
for(const std::string& dir : possiblePaths) {
|
||||
@@ -71,12 +72,20 @@ bool ResourceManager::setupUserWriteDir(const std::string& appWriteDirName)
|
||||
{
|
||||
std::string userDir = getUserDir();
|
||||
std::string dirName;
|
||||
|
||||
#ifndef WIN32
|
||||
dirName = stdext::format(".%s", appWriteDirName);
|
||||
#else
|
||||
dirName = appWriteDirName;
|
||||
#endif
|
||||
std::string writeDir = userDir + dirName;
|
||||
|
||||
std::string writeDir;
|
||||
|
||||
#ifdef ANDROID
|
||||
writeDir = getWorkDir();
|
||||
#else
|
||||
writeDir = userDir + dirName;
|
||||
#endif
|
||||
|
||||
if(!PHYSFS_setWriteDir(writeDir.c_str())) {
|
||||
if(!PHYSFS_setWriteDir(userDir.c_str()) || !PHYSFS_mkdir(dirName.c_str())) {
|
||||
|
||||
Reference in New Issue
Block a user