diff --git a/build.sh b/build.sh index 1ce557cb7..3251b011c 100755 --- a/build.sh +++ b/build.sh @@ -39,4 +39,4 @@ cd project && env PATH=$NDKBUILDPATH nice -n19 ndk-build V=1 -j4 && \ test -z "$1" && cd bin && \ { adb install -r MainActivity-debug.apk | grep 'Failure' && \ adb uninstall `grep AppFullName ../../AndroidAppSettings.cfg | sed 's/.*=//'` && adb install -r MainActivity-debug.apk ; true ; } && \ - adb shell am start -n `grep AppFullName ../../AndroidAppSettings.cfg | sed 's/.*=//'`/.MainActivity + true # adb shell am start -n `grep AppFullName ../../AndroidAppSettings.cfg | sed 's/.*=//'`/.MainActivity diff --git a/project/java/Video.java b/project/java/Video.java index ffa3e4c2a..8e4d51ea5 100644 --- a/project/java/Video.java +++ b/project/java/Video.java @@ -117,7 +117,7 @@ abstract class DifferentTouchInput return MultiTouchInput.Holder.sInstance; else return SingleTouchInput.Holder.sInstance; - } catch( java.lang.NoSuchMethodError e ) { + } catch( java.lang.NoSuchMethodError ee ) { return SingleTouchInput.Holder.sInstance; } } diff --git a/project/jni/application/fheroes2/AndroidAppSettings.cfg b/project/jni/application/fheroes2/AndroidAppSettings.cfg index 69ff62ab3..feeeb839a 100644 --- a/project/jni/application/fheroes2/AndroidAppSettings.cfg +++ b/project/jni/application/fheroes2/AndroidAppSettings.cfg @@ -5,7 +5,7 @@ AppName="Free Heroes 2" AppFullName=net.sourceforge.fheroes2 ScreenOrientation=h InhibitSuspend=n -AppDataDownloadUrl="Heroes 2 DEMO (45 Mb) - required if you don't own full version|http://downloads.pcworld.com/pub/new/fun_and_games/adventure_strategy/h2demo.zip|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/h2demo.zip/download^MIDI music support (18 Mb)|http://sourceforge.net/projects/libsdl-android/files/timidity.zip/download^Essential map pack (9 Mb)|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/EssentialMapPack.zip/download^Additional map pack (95 Mb)|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/AdditionalMapPack.zip/download^Mega map pack (280 Mb)|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/MegaMapPack.zip/download^!Game data|data12.zip^!Game data 2|data-cfg-fonts.zip^Russian translation|:fheroes2.cfg:fheroes2-ru.cfg^Czech translation|:fheroes2.cfg:fheroes2-cs.cfg^Spanish translation|:fheroes2.cfg:fheroes2-es.cfg^French translation|:fheroes2.cfg:fheroes2-fr.cfg^Hungarian translation|:fheroes2.cfg:fheroes2-hu.cfg^Polish translation|:fheroes2.cfg:fheroes2-pl.cfg^Portugese translation|:fheroes2.cfg:fheroes2-pt_BR.cfg^Swedish translation|:fheroes2.cfg:fheroes2-sv.cfg" +AppDataDownloadUrl="Heroes 2 DEMO (45 Mb) - required if you don't own full version|http://downloads.pcworld.com/pub/new/fun_and_games/adventure_strategy/h2demo.zip|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/h2demo.zip/download^MIDI music support (18 Mb)|http://sourceforge.net/projects/libsdl-android/files/timidity.zip/download^Essential map pack (9 Mb)|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/EssentialMapPack.zip/download^Additional map pack (95 Mb)|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/AdditionalMapPack.zip/download^Mega map pack (280 Mb)|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/MegaMapPack.zip/download^!Config files|data12.zip^!Fonts|data-cfg-fonts.zip^Russian translation|:fheroes2.cfg:fheroes2-ru.cfg^Czech translation|:fheroes2.cfg:fheroes2-cs.cfg^Spanish translation|:fheroes2.cfg:fheroes2-es.cfg^French translation|:fheroes2.cfg:fheroes2-fr.cfg^Hungarian translation|:fheroes2.cfg:fheroes2-hu.cfg^Polish translation|:fheroes2.cfg:fheroes2-pl.cfg^Portugese translation|:fheroes2.cfg:fheroes2-pt_BR.cfg^Swedish translation|:fheroes2.cfg:fheroes2-sv.cfg" VideoDepthBpp=16 NeedDepthBuffer=n NeedStencilBuffer=n @@ -33,13 +33,13 @@ StartupMenuButtonTimeout=3000 HiddenMenuOptions='KeyboardConfigMainMenu ScreenKeyboardThemeConfig ScreenKeyboardTransparencyConfig' FirstStartMenuOptions='' MultiABI=n -AppVersionCode=275018 -AppVersionName="2750.18" +AppVersionCode=276118 +AppVersionName="2761.18" ResetSdlConfigForThisVersion=n -DeleteFilesOnUpgrade="%" +DeleteFilesOnUpgrade="libsdl-DownloadFinished-5.flag libsdl-DownloadFinished-6.flag libsdl-DownloadFinished-7.flag libsdl-DownloadFinished-8.flag libsdl-DownloadFinished-9.flag libsdl-DownloadFinished-10.flag libsdl-DownloadFinished-11.flag libsdl-DownloadFinished-12.flag libsdl-DownloadFinished-13.flag libsdl-DownloadFinished-14.flag" CompiledLibraries="sdl_net sdl_mixer sdl_image sdl_ttf png intl" CustomBuildScript=n -AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF -DWITH_AI=simple -DWITH_NET' +AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF -DWITH_AI=simple -DWITH_DEBUG' # -DWITH_NET # network is disabled in rev 2761 AppLdflags='' AppSubdirsBuild='fheroes2/src/engine/* fheroes2/src/xmlccwrap/* fheroes2/src/fheroes2/ai fheroes2/src/fheroes2/ai/simple fheroes2/src/fheroes2/agg fheroes2/src/fheroes2/algorithm fheroes2/src/fheroes2/army fheroes2/src/fheroes2/battle2 fheroes2/src/fheroes2/castle fheroes2/src/fheroes2/dialog fheroes2/src/fheroes2/editor fheroes2/src/fheroes2/game fheroes2/src/fheroes2/gui fheroes2/src/fheroes2/heroes fheroes2/src/fheroes2/image fheroes2/src/fheroes2/kingdom fheroes2/src/fheroes2/maps fheroes2/src/fheroes2/monster fheroes2/src/fheroes2/network fheroes2/src/fheroes2/objects fheroes2/src/fheroes2/pocketpc fheroes2/src/fheroes2/resource fheroes2/src/fheroes2/spell fheroes2/src/fheroes2/system fheroes2/src/fheroes2/test' AppCmdline='fheroes2' diff --git a/project/jni/application/fheroes2/AndroidData/data-cfg-fonts.zip b/project/jni/application/fheroes2/AndroidData/data-cfg-fonts.zip index c572a7bdf..86756d87b 100644 Binary files a/project/jni/application/fheroes2/AndroidData/data-cfg-fonts.zip and b/project/jni/application/fheroes2/AndroidData/data-cfg-fonts.zip differ diff --git a/project/jni/application/fheroes2/AndroidData/data12.zip b/project/jni/application/fheroes2/AndroidData/data12.zip index e8aeb1f26..bf6df98e6 100644 Binary files a/project/jni/application/fheroes2/AndroidData/data12.zip and b/project/jni/application/fheroes2/AndroidData/data12.zip differ diff --git a/project/jni/application/fheroes2/AndroidData/fheroes2-cs.cfg b/project/jni/application/fheroes2/AndroidData/fheroes2-cs.cfg index 146a90bd6..59def1fda 100644 --- a/project/jni/application/fheroes2/AndroidData/fheroes2-cs.cfg +++ b/project/jni/application/fheroes2/AndroidData/fheroes2-cs.cfg @@ -43,8 +43,8 @@ videomode = 640x480 # fullscreen: on off (F4 switch) # fullscreen = off # -# debug -debug = on +# debug (0 - 9) +debug = 7 # # use ttf fonts unicode = on diff --git a/project/jni/application/fheroes2/AndroidData/fheroes2-es.cfg b/project/jni/application/fheroes2/AndroidData/fheroes2-es.cfg index 0282385e2..e07e36e93 100644 --- a/project/jni/application/fheroes2/AndroidData/fheroes2-es.cfg +++ b/project/jni/application/fheroes2/AndroidData/fheroes2-es.cfg @@ -43,8 +43,8 @@ videomode = 640x480 # fullscreen: on off (F4 switch) # fullscreen = off # -# debug -debug = on +# debug (0 - 9) +debug = 7 # # use ttf fonts unicode = on diff --git a/project/jni/application/fheroes2/AndroidData/fheroes2-fr.cfg b/project/jni/application/fheroes2/AndroidData/fheroes2-fr.cfg index 9eb08ca89..dab73bd3b 100644 --- a/project/jni/application/fheroes2/AndroidData/fheroes2-fr.cfg +++ b/project/jni/application/fheroes2/AndroidData/fheroes2-fr.cfg @@ -43,8 +43,8 @@ videomode = 640x480 # fullscreen: on off (F4 switch) # fullscreen = off # -# debug -debug = on +# debug (0 - 9) +debug = 7 # # use ttf fonts unicode = on diff --git a/project/jni/application/fheroes2/AndroidData/fheroes2-hu.cfg b/project/jni/application/fheroes2/AndroidData/fheroes2-hu.cfg index 62ddbf009..cbf735421 100644 --- a/project/jni/application/fheroes2/AndroidData/fheroes2-hu.cfg +++ b/project/jni/application/fheroes2/AndroidData/fheroes2-hu.cfg @@ -43,8 +43,8 @@ videomode = 640x480 # fullscreen: on off (F4 switch) # fullscreen = off # -# debug -debug = on +# debug (0 - 9) +debug = 7 # # use ttf fonts unicode = on diff --git a/project/jni/application/fheroes2/AndroidData/fheroes2-pl.cfg b/project/jni/application/fheroes2/AndroidData/fheroes2-pl.cfg index 7a39a63a7..7d240b691 100644 --- a/project/jni/application/fheroes2/AndroidData/fheroes2-pl.cfg +++ b/project/jni/application/fheroes2/AndroidData/fheroes2-pl.cfg @@ -43,8 +43,8 @@ videomode = 640x480 # fullscreen: on off (F4 switch) # fullscreen = off # -# debug -debug = on +# debug (0 - 9) +debug = 7 # # use ttf fonts unicode = on diff --git a/project/jni/application/fheroes2/AndroidData/fheroes2-pt_BR.cfg b/project/jni/application/fheroes2/AndroidData/fheroes2-pt_BR.cfg index ea3062b84..b98e73ae3 100644 --- a/project/jni/application/fheroes2/AndroidData/fheroes2-pt_BR.cfg +++ b/project/jni/application/fheroes2/AndroidData/fheroes2-pt_BR.cfg @@ -43,8 +43,8 @@ videomode = 640x480 # fullscreen: on off (F4 switch) # fullscreen = off # -# debug -debug = on +# debug (0 - 9) +debug = 7 # # use ttf fonts unicode = on diff --git a/project/jni/application/fheroes2/AndroidData/fheroes2-ru.cfg b/project/jni/application/fheroes2/AndroidData/fheroes2-ru.cfg index 41eff9f12..d349da006 100644 --- a/project/jni/application/fheroes2/AndroidData/fheroes2-ru.cfg +++ b/project/jni/application/fheroes2/AndroidData/fheroes2-ru.cfg @@ -43,8 +43,8 @@ videomode = 640x480 # fullscreen: on off (F4 switch) # fullscreen = off # -# debug -debug = on +# debug (0 - 9) +debug = 7 # # use ttf fonts unicode = on diff --git a/project/jni/application/fheroes2/AndroidData/fheroes2-sv.cfg b/project/jni/application/fheroes2/AndroidData/fheroes2-sv.cfg index 51bbeed2c..e887eea6b 100644 --- a/project/jni/application/fheroes2/AndroidData/fheroes2-sv.cfg +++ b/project/jni/application/fheroes2/AndroidData/fheroes2-sv.cfg @@ -43,8 +43,8 @@ videomode = 640x480 # fullscreen: on off (F4 switch) # fullscreen = off # -# debug -debug = on +# debug (0 - 9) +debug = 7 # # use ttf fonts unicode = on diff --git a/project/jni/application/fheroes2/fheroes2.diff b/project/jni/application/fheroes2/fheroes2.diff index 41cde3108..60b896bcd 100644 --- a/project/jni/application/fheroes2/fheroes2.diff +++ b/project/jni/application/fheroes2/fheroes2.diff @@ -1,6 +1,6 @@ Index: src/engine/tools.cpp =================================================================== ---- src/engine/tools.cpp (revision 2750) +--- src/engine/tools.cpp (revision 2761) +++ src/engine/tools.cpp (working copy) @@ -761,7 +761,7 @@ if(stat(name.c_str(), &fs) || !S_ISREG(fs.st_mode)) @@ -11,9 +11,103 @@ Index: src/engine/tools.cpp } bool IsDirectory(const std::string & name, bool writable) +Index: src/engine/sdlnet.cpp +=================================================================== +--- src/engine/sdlnet.cpp (revision 2761) ++++ src/engine/sdlnet.cpp (working copy) +@@ -137,7 +137,7 @@ + { + if(data + dtsz < itd2 + 1) Resize(1); + +- *itd2 = byte8; ++ *(u8 *)itd2 = byte8; + ++itd2; + } + +@@ -150,10 +150,10 @@ + { + if(data + dtsz < itd2 + 2) Resize(2); + +- *itd2 = 0x00FF & (byte16 >> 8); ++ *(u8 *)itd2 = 0x00FF & (byte16 >> 8); + ++itd2; + +- *itd2 = 0x00FF & byte16; ++ *(u8 *)itd2 = 0x00FF & byte16; + ++itd2; + } + +@@ -166,16 +166,16 @@ + { + if(data + dtsz < itd2 + 4) Resize(4); + +- *itd2 = 0x000000FF & (byte32 >> 24); ++ *(u8 *)itd2 = 0x000000FF & (byte32 >> 24); + ++itd2; + +- *itd2 = 0x000000FF & (byte32 >> 16); ++ *(u8 *)itd2 = 0x000000FF & (byte32 >> 16); + ++itd2; + +- *itd2 = 0x000000FF & (byte32 >> 8); ++ *(u8 *)itd2 = 0x000000FF & (byte32 >> 8); + ++itd2; + +- *itd2 = 0x000000FF & byte32; ++ *(u8 *)itd2 = 0x000000FF & byte32; + ++itd2; + } + +@@ -270,7 +270,7 @@ + { + if(itd1 + 1 > itd2) return false; + +- byte8 = *itd1; ++ byte8 = *(u8 *)itd1; + ++itd1; + + return true; +@@ -291,11 +291,11 @@ + { + if(itd1 + 2 > itd2) return false; + +- byte16 = *itd1; ++ byte16 = *(u8 *)itd1; + byte16 <<= 8; + ++itd1; + +- byte16 |= (0x00FF & *itd1); ++ byte16 |= (0x00FF & *(u8 *)itd1); + ++itd1; + + return true; +@@ -316,19 +316,19 @@ + { + if(itd1 + 4 > itd2) return false; + +- byte32 = *itd1; ++ byte32 = *(u8 *)itd1; + byte32 <<= 8; + ++itd1; + +- byte32 |= (0x000000FF & *itd1); ++ byte32 |= (0x000000FF & *(u8 *)itd1); + byte32 <<= 8; + ++itd1; + +- byte32 |= (0x000000FF & *itd1); ++ byte32 |= (0x000000FF & *(u8 *)itd1); + byte32 <<= 8; + ++itd1; + +- byte32 |= (0x000000FF & *itd1); ++ byte32 |= (0x000000FF & *(u8 *)itd1); + ++itd1; + + return true; Index: src/fheroes2/system/settings.h =================================================================== ---- src/fheroes2/system/settings.h (revision 2750) +--- src/fheroes2/system/settings.h (revision 2761) +++ src/fheroes2/system/settings.h (working copy) @@ -117,9 +117,10 @@ #elif defined(ANDROID) @@ -28,9 +122,38 @@ Index: src/fheroes2/system/settings.h #else #define VERBOSE(x) std::cout << x << std::endl #endif +Index: src/fheroes2/kingdom/world.cpp +=================================================================== +--- src/fheroes2/kingdom/world.cpp (revision 2761) ++++ src/fheroes2/kingdom/world.cpp (working copy) +@@ -1028,12 +1028,22 @@ + + Heroes* World::GetHeroes(Heroes::heroes_t id) + { +- return vec_heroes.Get(id); ++ //VERBOSE("World::GetHeroes: id " << id << " vec_heroes.size() " << vec_heroes.size()); ++ if(id >= vec_heroes.size()) ++ return NULL; ++ Heroes* h = vec_heroes.Get(id); ++ //VERBOSE("World::GetHeroes: id " << id << " hero " << h->GetID() << " name " << h->GetName()); ++ return h; + } + + const Heroes* World::GetHeroes(Heroes::heroes_t id) const + { +- return vec_heroes.Get(id); ++ //VERBOSE("World::GetHeroes: id " << id << " vec_heroes.size() " << vec_heroes.size()); ++ if(id >= vec_heroes.size()) ++ return NULL; ++ const Heroes* h = vec_heroes.Get(id); ++ //VERBOSE("World::GetHeroes: id " << id << " hero " << h->GetID() << " name " << h->GetName()); ++ return h; + } + + /* get heroes from index maps */ Index: src/fheroes2/network/server.cpp =================================================================== ---- src/fheroes2/network/server.cpp (revision 2750) +--- src/fheroes2/network/server.cpp (revision 2761) +++ src/fheroes2/network/server.cpp (working copy) @@ -876,7 +876,7 @@ @@ -52,7 +175,7 @@ Index: src/fheroes2/network/server.cpp } Index: src/fheroes2/network/localclient.cpp =================================================================== ---- src/fheroes2/network/localclient.cpp (revision 2750) +--- src/fheroes2/network/localclient.cpp (revision 2761) +++ src/fheroes2/network/localclient.cpp (working copy) @@ -490,7 +490,7 @@ { @@ -74,7 +197,7 @@ Index: src/fheroes2/network/localclient.cpp Index: src/fheroes2/network/network.cpp =================================================================== ---- src/fheroes2/network/network.cpp (revision 2750) +--- src/fheroes2/network/network.cpp (revision 2761) +++ src/fheroes2/network/network.cpp (working copy) @@ -159,7 +159,9 @@ Network::SetProtocolVersion(static_cast(MAJOR_VERSION << 8) | MINOR_VERSION);