Removed unneeded patches
This commit is contained in:
@@ -1,336 +0,0 @@
|
|||||||
Index: files/lang/fheroes2.pot
|
|
||||||
===================================================================
|
|
||||||
Index: src/xmlccwrap/gzstream.h
|
|
||||||
===================================================================
|
|
||||||
--- src/xmlccwrap/gzstream.h (revision 2082)
|
|
||||||
+++ src/xmlccwrap/gzstream.h (working copy)
|
|
||||||
@@ -33,6 +33,7 @@
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <zlib.h>
|
|
||||||
+#include <stdio.h>
|
|
||||||
|
|
||||||
#ifdef GZSTREAM_NAMESPACE
|
|
||||||
namespace GZSTREAM_NAMESPACE {
|
|
||||||
Index: src/engine/tools.cpp
|
|
||||||
===================================================================
|
|
||||||
--- src/engine/tools.cpp (revision 2082)
|
|
||||||
+++ src/engine/tools.cpp (working copy)
|
|
||||||
@@ -25,7 +25,9 @@
|
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <cstring>
|
|
||||||
+#include <locale>
|
|
||||||
#include <climits>
|
|
||||||
+#include <cctype>
|
|
||||||
#include "error.h"
|
|
||||||
#include "types.h"
|
|
||||||
#include "tools.h"
|
|
||||||
Index: src/engine/midi_mtrk.cpp
|
|
||||||
===================================================================
|
|
||||||
--- src/engine/midi_mtrk.cpp (revision 2082)
|
|
||||||
+++ src/engine/midi_mtrk.cpp (working copy)
|
|
||||||
@@ -258,7 +258,9 @@
|
|
||||||
if(delta2) delta -= delta2;
|
|
||||||
|
|
||||||
// decrease duration
|
|
||||||
- std::for_each(notesoff.begin(), notesoff.end(), std::bind2nd(std::mem_fun_ref(&meta_t::decrease_duration), delta));
|
|
||||||
+ //std::for_each(notesoff.begin(), notesoff.end(), std::bind2nd(std::mem_fun_ref(&meta_t::decrease_duration), delta));
|
|
||||||
+ for( std::list<meta_t> :: iterator it = notesoff.begin(); it != notesoff.end(); it++ )
|
|
||||||
+ it->decrease_duration(delta);
|
|
||||||
}
|
|
||||||
|
|
||||||
// interval
|
|
||||||
Index: src/engine/error.cpp
|
|
||||||
===================================================================
|
|
||||||
--- src/engine/error.cpp (revision 2082)
|
|
||||||
+++ src/engine/error.cpp (working copy)
|
|
||||||
@@ -23,10 +23,19 @@
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <iostream>
|
|
||||||
#include "error.h"
|
|
||||||
+#ifdef ANDROID
|
|
||||||
+#include <android/log.h>
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* exception */
|
|
||||||
void Error::Except(const char* message, const char* cstr)
|
|
||||||
{
|
|
||||||
+#ifndef ANDROID
|
|
||||||
std::cerr << "Error::Except: " << message << cstr << std::endl;
|
|
||||||
throw Exception();
|
|
||||||
+#else
|
|
||||||
+ __android_log_print(ANDROID_LOG_FATAL, "fheroes2", "======");
|
|
||||||
+ __android_log_print(ANDROID_LOG_FATAL, "fheroes2", "Error: %s: %s", message, cstr);
|
|
||||||
+ __android_log_print(ANDROID_LOG_FATAL, "fheroes2", "======");
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
Index: src/fheroes2/gui/text.cpp
|
|
||||||
===================================================================
|
|
||||||
--- src/fheroes2/gui/text.cpp (revision 2082)
|
|
||||||
+++ src/fheroes2/gui/text.cpp (working copy)
|
|
||||||
@@ -21,6 +21,7 @@
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
+#include <cctype>
|
|
||||||
#include "agg.h"
|
|
||||||
#include "settings.h"
|
|
||||||
#include "text.h"
|
|
||||||
Index: src/fheroes2/system/settings.cpp
|
|
||||||
===================================================================
|
|
||||||
--- src/fheroes2/system/settings.cpp (revision 2082)
|
|
||||||
+++ 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
|
|
||||||
|
|
||||||
return flags;
|
|
||||||
}
|
|
||||||
Index: src/fheroes2/system/settings.h
|
|
||||||
===================================================================
|
|
||||||
--- src/fheroes2/system/settings.h (revision 2082)
|
|
||||||
+++ src/fheroes2/system/settings.h (working copy)
|
|
||||||
@@ -27,6 +27,7 @@
|
|
||||||
#include <list>
|
|
||||||
#include <iostream>
|
|
||||||
#include <iomanip>
|
|
||||||
+#include <sstream>
|
|
||||||
#include "gamedefs.h"
|
|
||||||
#include "difficulty.h"
|
|
||||||
#include "race.h"
|
|
||||||
@@ -35,6 +36,9 @@
|
|
||||||
#include "game.h"
|
|
||||||
#include "game_io.h"
|
|
||||||
#include "bitmodes.h"
|
|
||||||
+#ifdef ANDROID
|
|
||||||
+#include <android/log.h>
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
#define FORMAT_VERSION_2031 0x07EF
|
|
||||||
#define FORMAT_VERSION_1978 0x07BA
|
|
||||||
@@ -71,6 +75,9 @@
|
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
#define VERBOSE(x)
|
|
||||||
#define DEBUG(x, y, z)
|
|
||||||
+#elif defined(ANDROID)
|
|
||||||
+#define VERBOSE(x) { std::ostringstream osss; osss << x; __android_log_print(ANDROID_LOG_INFO, "FHeroes", "%s", osss.str().c_str()); }
|
|
||||||
+#define DEBUG(x, y, z) if(IS_DEBUG((x), (y))) VERBOSE(z)
|
|
||||||
#else
|
|
||||||
#define VERBOSE(x) std::cout << x << std::endl
|
|
||||||
#define DEBUG(x, y, z) if(IS_DEBUG((x), (y))) VERBOSE(z)
|
|
||||||
Index: src/fheroes2/heroes/portrait.cpp
|
|
||||||
===================================================================
|
|
||||||
--- src/fheroes2/heroes/portrait.cpp (revision 2082)
|
|
||||||
+++ src/fheroes2/heroes/portrait.cpp (working copy)
|
|
||||||
@@ -31,7 +31,7 @@
|
|
||||||
{
|
|
||||||
if(hero.GetType() == Skill::Primary::CAPTAIN)
|
|
||||||
return Captain(hero.GetRace(), sz);
|
|
||||||
- else return Hero(dynamic_cast<const Heroes &>(hero), sz);
|
|
||||||
+ else return Hero(reinterpret_cast<const Heroes &>(hero), sz);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Surface & Portrait::Captain(const Race::race_t rc, const Portrait::size_t sz)
|
|
||||||
Index: src/fheroes2/network/server.cpp
|
|
||||||
===================================================================
|
|
||||||
--- src/fheroes2/network/server.cpp (revision 2082)
|
|
||||||
+++ 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 2082)
|
|
||||||
+++ 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/dialog/dialog_selectfile.cpp
|
|
||||||
===================================================================
|
|
||||||
--- src/fheroes2/dialog/dialog_selectfile.cpp (revision 2082)
|
|
||||||
+++ src/fheroes2/dialog/dialog_selectfile.cpp (working copy)
|
|
||||||
@@ -34,7 +34,7 @@
|
|
||||||
#include "pocketpc.h"
|
|
||||||
#include "dialog.h"
|
|
||||||
|
|
||||||
-#ifdef __SYMBIAN32__
|
|
||||||
+#if defined __SYMBIAN32__ || defined(ANDROID)
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Index: src/fheroes2/maps/pairs.h
|
|
||||||
===================================================================
|
|
||||||
--- src/fheroes2/maps/pairs.h (revision 2082)
|
|
||||||
+++ src/fheroes2/maps/pairs.h (working copy)
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
#ifndef H2PAIRS_H
|
|
||||||
#define H2PAIRS_H
|
|
||||||
|
|
||||||
+#include <list>
|
|
||||||
#include <utility>
|
|
||||||
#include "maps_tiles.h"
|
|
||||||
|
|
||||||
Index: src/fheroes2/game/fheroes2.cpp
|
|
||||||
===================================================================
|
|
||||||
--- src/fheroes2/game/fheroes2.cpp (revision 2082)
|
|
||||||
+++ src/fheroes2/game/fheroes2.cpp (working copy)
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
+#include <SDL.h>
|
|
||||||
|
|
||||||
#include "gamedefs.h"
|
|
||||||
#include "engine.h"
|
|
||||||
@@ -69,13 +70,18 @@
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
+ VERBOSE("000 - entered SDL_main()");
|
|
||||||
Settings & conf = Settings::Get();
|
|
||||||
int test = 0;
|
|
||||||
|
|
||||||
- std::cout << "Free Heroes II, " + conf.BuildVersion() << std::endl;
|
|
||||||
+ //std::cout << "Free Heroes II, " + conf.BuildVersion() << std::endl;
|
|
||||||
+ VERBOSE("Free Heroes II, " + conf.BuildVersion());
|
|
||||||
|
|
||||||
LoadConfigFiles(conf, GetDirname(argv[0]));
|
|
||||||
|
|
||||||
+ VERBOSE("001");
|
|
||||||
+
|
|
||||||
+#ifndef ANDROID // Crashes for some reason
|
|
||||||
// getopt
|
|
||||||
{
|
|
||||||
int opt;
|
|
||||||
@@ -86,7 +92,7 @@
|
|
||||||
case 'e':
|
|
||||||
conf.SetEditor();
|
|
||||||
conf.SetDebug(DBG_DEVEL | DBG_GAME | DBG_INFO);
|
|
||||||
- std::cout << "start: editor mode." << std::endl;
|
|
||||||
+ //std::cout << "start: editor mode." << std::endl;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#ifndef BUILD_RELEASE
|
|
||||||
@@ -109,13 +115,20 @@
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
+ VERBOSE("002");
|
|
||||||
+
|
|
||||||
if(conf.SelectVideoDriver().size()) SetVideoDriver(conf.SelectVideoDriver());
|
|
||||||
|
|
||||||
+ VERBOSE("003");
|
|
||||||
+
|
|
||||||
// random init
|
|
||||||
Rand::Init();
|
|
||||||
if(conf.Music()) SetTimidityEnvPath(conf);
|
|
||||||
|
|
||||||
+ VERBOSE("004");
|
|
||||||
+
|
|
||||||
u32 subsystem = INIT_VIDEO | INIT_TIMER;
|
|
||||||
|
|
||||||
if(conf.Sound() || conf.Music())
|
|
||||||
@@ -128,9 +141,14 @@
|
|
||||||
Network::SetProtocolVersion(static_cast<u16>((conf.MajorVersion() << 8)) | conf.MinorVersion());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+ VERBOSE("005");
|
|
||||||
+
|
|
||||||
if(SDL::Init(subsystem))
|
|
||||||
+#ifndef ANDROID
|
|
||||||
try
|
|
||||||
+#endif
|
|
||||||
{
|
|
||||||
+ VERBOSE("006");
|
|
||||||
std::atexit(SDL::Quit);
|
|
||||||
|
|
||||||
if(conf.Unicode()) SetLangEnvPath(conf);
|
|
||||||
@@ -163,17 +181,23 @@
|
|
||||||
//Ensure the mouse position is updated to prevent bad initial values.
|
|
||||||
LocalEvent::Get().GetMouseCursor();
|
|
||||||
|
|
||||||
+ VERBOSE("007");
|
|
||||||
+
|
|
||||||
#ifdef WITH_ZLIB
|
|
||||||
ZSurface zicons;
|
|
||||||
if(zicons.Load(FH2_ICONS_WIDTH, FH2_ICONS_HEIGHT, FH2_ICONS_BPP, fh2_icons_pack, FH2_ICONS_SIZE, true)) Display::SetIcons(zicons);
|
|
||||||
#endif
|
|
||||||
AGG::Cache & cache = AGG::Cache::Get();
|
|
||||||
|
|
||||||
+ VERBOSE("008");
|
|
||||||
+
|
|
||||||
// read data dir
|
|
||||||
if(! cache.ReadDataDir()) Error::Except("FHeroes2: ", "AGG data files not found.");
|
|
||||||
|
|
||||||
if(IS_DEBUG(DBG_GAME, DBG_INFO)) conf.Dump();
|
|
||||||
|
|
||||||
+ VERBOSE("009");
|
|
||||||
+
|
|
||||||
// load palette
|
|
||||||
cache.LoadPAL();
|
|
||||||
|
|
||||||
@@ -233,7 +257,9 @@
|
|
||||||
//Display::ShowCursor();
|
|
||||||
if(Settings::Get().ExtUseFade()) Display::Fade();
|
|
||||||
|
|
||||||
- } catch(std::bad_alloc)
|
|
||||||
+ }
|
|
||||||
+#ifndef ANDROID
|
|
||||||
+ catch(std::bad_alloc)
|
|
||||||
{
|
|
||||||
DEBUG(DBG_GAME, DBG_WARN, "std::bad_alloc");
|
|
||||||
AGG::Cache::Get().Dump();
|
|
||||||
@@ -246,6 +272,7 @@
|
|
||||||
AGG::Cache::Get().Dump();
|
|
||||||
conf.Dump();
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
@@ -345,7 +372,7 @@
|
|
||||||
std::string strtmp = conf.LocalPrefix() + SEPARATOR + "fheroes2.cfg";
|
|
||||||
if(FilePresent(strtmp))
|
|
||||||
{
|
|
||||||
- std::cout << "config: " << strtmp << " load." << std::endl;
|
|
||||||
+ //std::cout << "config: " << strtmp << " load." << std::endl;
|
|
||||||
conf.Read(strtmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
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"
|
|
||||||
Reference in New Issue
Block a user