Updated fheroes2 project
This commit is contained in:
2
build.sh
2
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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<u16>(MAJOR_VERSION << 8) | MINOR_VERSION);
|
||||
|
||||
Reference in New Issue
Block a user