Updated Free Heroes 2 project

This commit is contained in:
pelya
2010-11-26 13:19:35 +02:00
parent d936c74345
commit a420dee9f6
5 changed files with 96 additions and 7 deletions

View File

@@ -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'

View File

@@ -0,0 +1 @@
../../../../../fheroes2

View File

@@ -0,0 +1 @@
/home/pelya/doc/fheroes2-ai

View File

@@ -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 <android/log.h>
+#endif
#ifdef ANDROID
#include <android/log.h>
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<FH2RemoteClient> :: iterator it = clients.begin(); it != clients.end(); it++ )
+ it->SetModes(ST_INGAME);
GameOver::Result::Get().Reset();
std::vector<FH2RemoteClient>::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<u16>((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 <list>
#include <utility>
#include <list>
#include "maps_tiles.h"

View File

@@ -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.
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.