diff --git a/project/jni/application/fheroes2/AndroidAppSettings.cfg b/project/jni/application/fheroes2/AndroidAppSettings.cfg index 05ba0cc82..a2991ab63 100644 --- a/project/jni/application/fheroes2/AndroidAppSettings.cfg +++ b/project/jni/application/fheroes2/AndroidAppSettings.cfg @@ -21,13 +21,13 @@ RedefinedKeys="LCTRL m t h e" AppTouchscreenKeyboardKeysAmount=0 AppTouchscreenKeyboardKeysAmountAutoFire=0 MultiABI=n -AppVersionCode=208201 -AppVersionName="2082.01" +AppVersionCode=208302 +AppVersionName="2083.02" CompiledLibraries="sdl_net sdl_mixer sdl_image sdl_ttf png intl" CustomBuildScript=n -AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_NET -DWITH_XML -DWITH_IMAGE -DWITH_TTF -DAI_EMPTY' +AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF' AppLdflags='' -AppSubdirsBuild='fheroes2/src/engine/* fheroes2/src/fheroes2/* fheroes2/src/xmlccwrap/*' +AppSubdirsBuild='fheroes2/src/engine/* fheroes2/src/fheroes2/* fheroes2/src/xmlccwrap/* fheroes2-ai/*' AppUseCrystaXToolchain=n AppCmdline='fheroes2 -d' ReadmeText='^You may press "Home" now - the data will be downloaded in background' diff --git a/project/jni/application/fheroes2/fheroes2 b/project/jni/application/fheroes2/fheroes2 new file mode 120000 index 000000000..97b50e5d4 --- /dev/null +++ b/project/jni/application/fheroes2/fheroes2 @@ -0,0 +1 @@ +../../../../../fheroes2 \ No newline at end of file diff --git a/project/jni/application/fheroes2/fheroes2-ai b/project/jni/application/fheroes2/fheroes2-ai new file mode 120000 index 000000000..0444cbda5 --- /dev/null +++ b/project/jni/application/fheroes2/fheroes2-ai @@ -0,0 +1 @@ +/home/pelya/doc/fheroes2-ai \ No newline at end of file diff --git a/project/jni/application/fheroes2/fheroes2-r2083.diff b/project/jni/application/fheroes2/fheroes2-r2083.diff new file mode 100644 index 000000000..22aaf4b93 --- /dev/null +++ b/project/jni/application/fheroes2/fheroes2-r2083.diff @@ -0,0 +1,86 @@ +Index: files/lang/fheroes2.pot +=================================================================== +Index: src/fheroes2/system/settings.cpp +=================================================================== +--- src/fheroes2/system/settings.cpp (revision 2083) ++++ src/fheroes2/system/settings.cpp (working copy) +@@ -1427,6 +1427,9 @@ + { + u32 flags = opt_global.Modes(GLOBAL_USESWSURFACE) ? SDL_SWSURFACE : SDL_SWSURFACE | SDL_HWSURFACE; + if(opt_global.Modes(GLOBAL_FULLSCREEN)) flags |= SDL_FULLSCREEN; ++ #ifdef ANDROID ++ flags = SDL_SWSURFACE; ++ #endif + + #ifdef ANDROID + flags = SDL_SWSURFACE; +Index: src/fheroes2/system/settings.h +=================================================================== +--- src/fheroes2/system/settings.h (revision 2083) ++++ src/fheroes2/system/settings.h (working copy) +@@ -36,6 +36,9 @@ + #include "game.h" + #include "game_io.h" + #include "bitmodes.h" ++#ifdef ANDROID ++#include ++#endif + + #ifdef ANDROID + #include +Index: src/fheroes2/network/server.cpp +=================================================================== +--- src/fheroes2/network/server.cpp (revision 2083) ++++ src/fheroes2/network/server.cpp (working copy) +@@ -307,7 +307,8 @@ + for(Color::color_t color = Color::BLUE; color != Color::GRAY; ++color) if(color & conf.PlayersColors()) + world.GetKingdom(color).SetControl(Game::REMOTE); + +- std::for_each(clients.begin(), clients.end(), std::bind2nd(std::mem_fun_ref(&FH2RemoteClient::SetModes), ST_INGAME)); ++ for( std::vector :: iterator it = clients.begin(); it != clients.end(); it++ ) ++ it->SetModes(ST_INGAME); + + GameOver::Result::Get().Reset(); + std::vector::iterator it; +Index: src/fheroes2/network/network.cpp +=================================================================== +--- src/fheroes2/network/network.cpp (revision 2083) ++++ src/fheroes2/network/network.cpp (working copy) +@@ -154,7 +154,9 @@ + Network::SetProtocolVersion(static_cast((conf.MajorVersion() << 8)) | conf.MinorVersion()); + + if(SDL::Init(INIT_TIMER)) ++#ifndef ANDROID + try ++#endif + { + std::atexit(SDL::Quit); + +@@ -171,6 +173,7 @@ + + return FH2Server::callbackCreateThread(&server); + } ++#ifndef ANDROID + catch(std::bad_alloc) + { + } +@@ -178,6 +181,7 @@ + { + conf.Dump(); + } ++#endif + + return 0; + } +Index: src/fheroes2/maps/pairs.h +=================================================================== +--- src/fheroes2/maps/pairs.h (revision 2083) ++++ src/fheroes2/maps/pairs.h (working copy) +@@ -23,6 +23,7 @@ + #ifndef H2PAIRS_H + #define H2PAIRS_H + ++#include + #include + #include + #include "maps_tiles.h" diff --git a/project/jni/application/fheroes2/readme.txt b/project/jni/application/fheroes2/readme.txt index b9aef486a..5127b48ed 100644 --- a/project/jni/application/fheroes2/readme.txt +++ b/project/jni/application/fheroes2/readme.txt @@ -1,6 +1,7 @@ Grab Free Heroes 2 sources with SVN from https://fheroes2.svn.sourceforge.net/svnroot/fheroes2/trunk/fheroes2 -and put them here, in directory "fheroes2", then apply patch -fheroes2-r2082.diff +and put them here, in directory "fheroes2", +then add option "-DAI_EMPTY" to the AppCflags in AndroidAppSettings.cfg, and compile with build.sh -You will need Android SDK 2.2, NDK r4b, and "ant" tool. \ No newline at end of file +You will need Android SDK 2.2, NDK r4b, and "ant" tool. +If you want AI code you should contact author of Free Heroes 2, this code is not open-source. \ No newline at end of file