Index: src/engine/tools.cpp =================================================================== --- src/engine/tools.cpp (revision 2769) +++ src/engine/tools.cpp (working copy) @@ -761,7 +761,7 @@ if(stat(name.c_str(), &fs) || !S_ISREG(fs.st_mode)) return false; - return writable ? 0 == access(name.c_str(), W_OK) : S_IRUSR & fs.st_mode; + return writable ? 0 == access(name.c_str(), W_OK) : true; } bool IsDirectory(const std::string & name, bool writable) Index: src/fheroes2/system/settings.h =================================================================== --- src/fheroes2/system/settings.h (revision 2769) +++ src/fheroes2/system/settings.h (working copy) @@ -104,9 +104,10 @@ #elif defined(ANDROID) namespace std { - #define endl "\n" + static const char * android_endl = "\n"; } - #define VERBOSE(x) { std::ostringstream osss; osss << x; __android_log_print(ANDROID_LOG_INFO, "FHeroes", "%s", osss.str().c_str()); } + #define endl android_endl + #define VERBOSE(x) if(true) { std::ostringstream osss; osss << x; __android_log_print(ANDROID_LOG_INFO, "FHeroes", "%s", osss.str().c_str()); } else String::GetTime() #else #define VERBOSE(x) std::cout << x << std::endl #endif Index: src/fheroes2/network/server.cpp =================================================================== --- src/fheroes2/network/server.cpp (revision 2769) +++ src/fheroes2/network/server.cpp (working copy) @@ -876,7 +876,7 @@ int FH2Server::RunServerProcess(void*) { - const std::string command = Settings::GetProgramPath(); + const std::string command = Settings::Get().GetProgramPath(); std::ostringstream os; os << command << " -s" << ">" << GetDirname(command) << SEPARATOR << "fh2server.log"; return system(os.str().c_str()); @@ -899,7 +899,7 @@ // clear background cursor.Hide(); - display.Blit(AGG::GetICN(ICN::HEROES, 0)); + AGG::GetICN(ICN::HEROES, 0).Blit(display); //display.Blit(AGG::GetICN(ICN::HEROES, 0)); // I think that's the expected logic cursor.Show(); display.Flip(); } Index: src/fheroes2/network/localclient.cpp =================================================================== --- src/fheroes2/network/localclient.cpp (revision 2769) +++ src/fheroes2/network/localclient.cpp (working copy) @@ -490,7 +490,7 @@ { MapsFileInfoList lists; Network::PacketPopMapsFileInfoList(packet, lists); - if(Maps::FileInfo *fi = Dialog::SelectScenario(lists)) + if(const Maps::FileInfo *fi = Dialog::SelectScenario(lists)) { // send set_maps_info packet.Reset(); @@ -626,7 +626,7 @@ // clear background const Sprite &back = AGG::GetICN(ICN::HEROES, 0); cursor.Hide(); - display.Blit(back); + back.Blit(display); //display.Blit(back); // I think that's the expected logic cursor.Show(); display.Flip(); Index: src/fheroes2/network/network.cpp =================================================================== --- src/fheroes2/network/network.cpp (revision 2769) +++ src/fheroes2/network/network.cpp (working copy) @@ -159,7 +159,9 @@ Network::SetProtocolVersion(static_cast(MAJOR_VERSION << 8) | MINOR_VERSION); if(SDL::Init(INIT_TIMER)) +#ifndef ANDROID try +#endif { std::atexit(SDL::Quit); @@ -177,6 +179,7 @@ return FH2Server::Main(NULL); } +#ifndef ANDROID catch(std::bad_alloc) { } @@ -184,7 +187,7 @@ { VERBOSE(conf.String()); } - +#endif return 0; }