From 95e3400eb90422409ec65f0f4a88318a21378c44 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Tue, 27 Sep 2022 06:31:06 +0300 Subject: [PATCH 1/4] raise iOS deployment target to 12.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86e15c821..c918facbd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,7 +171,7 @@ endif() if(APPLE_IOS) set(CMAKE_MACOSX_RPATH 1) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.0) + set(CMAKE_OSX_DEPLOYMENT_TARGET 12.0) list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_PREFIX_PATH}") # required for Boost set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH FALSE) From 70c51e43707cb6e7d1fcb38be4465fca2e85da10 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Tue, 27 Sep 2022 07:01:16 +0300 Subject: [PATCH 2/4] iOS: don't compile unused function --- client/CMT.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/CMT.cpp b/client/CMT.cpp index 9a9139085..bfcef4aed 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -975,6 +975,7 @@ void playIntro() } } +#ifndef VCMI_IOS static bool checkVideoMode(int monitorIndex, int w, int h) { //we only check that our desired window size fits on screen @@ -996,6 +997,7 @@ static bool checkVideoMode(int monitorIndex, int w, int h) return false; } +#endif static void cleanupRenderer() { From 53ac61b52b65cfb97c2aaaa9f57dd66caa3c1bae Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Tue, 27 Sep 2022 07:05:10 +0300 Subject: [PATCH 3/4] iOS: don't create unused CConsoleHandler --- client/CMT.cpp | 6 ++++++ launcher/mainwindow_moc.cpp | 2 ++ lib/logging/CLogger.cpp | 6 +++++- lib/logging/CLogger.h | 2 ++ server/CVCMIServer.cpp | 2 ++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/client/CMT.cpp b/client/CMT.cpp index bfcef4aed..3d9382016 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -104,7 +104,9 @@ static po::variables_map vm; //static bool setResolution = false; //set by event handling thread after resolution is adjusted +#ifndef VCMI_IOS void processCommand(const std::string &message); +#endif static void setScreenRes(int w, int h, int bpp, bool fullscreen, int displayIndex, bool resetVideo=true); void playIntro(); static void mainLoop(); @@ -236,9 +238,11 @@ int main(int argc, char * argv[]) // Init old logging system and new (temporary) logging system CStopWatch total, pomtime; std::cout.flags(std::ios::unitbuf); +#ifndef VCMI_IOS console = new CConsoleHandler(); *console->cb = processCommand; console->start(); +#endif const bfs::path logPath = VCMIDirs::get().userLogsPath() / "VCMI_Client_log.txt"; logConfig = new CBasicLogConfigurator(logPath, console); @@ -553,6 +557,7 @@ void removeGUI() LOCPLINT = nullptr; } +#ifndef VCMI_IOS void processCommand(const std::string &message) { std::istringstream readed; @@ -965,6 +970,7 @@ void processCommand(const std::string &message) LOCPLINT->cb->sendMessage(message); }*/ } +#endif //plays intro, ends when intro is over or button has been pressed (handles events) void playIntro() diff --git a/launcher/mainwindow_moc.cpp b/launcher/mainwindow_moc.cpp index 82769300f..969b55747 100644 --- a/launcher/mainwindow_moc.cpp +++ b/launcher/mainwindow_moc.cpp @@ -27,7 +27,9 @@ void MainWindow::load() // This is important on Mac for relative paths to work inside DMG. QDir::setCurrent(QApplication::applicationDirPath()); +#ifndef VCMI_IOS console = new CConsoleHandler(); +#endif CBasicLogConfigurator logConfig(VCMIDirs::get().userLogsPath() / "VCMI_Launcher_log.txt", console); logConfig.configureDefault(); diff --git a/lib/logging/CLogger.cpp b/lib/logging/CLogger.cpp index 2fa3a933c..564e6a6de 100644 --- a/lib/logging/CLogger.cpp +++ b/lib/logging/CLogger.cpp @@ -346,7 +346,11 @@ EConsoleTextColor::EConsoleTextColor CColorMapping::getColorFor(const CLoggerDom throw std::runtime_error("failed to find color for requested domain/level pair"); } -CLogConsoleTarget::CLogConsoleTarget(CConsoleHandler * console) : console(console), threshold(ELogLevel::INFO), coloredOutputEnabled(true) +CLogConsoleTarget::CLogConsoleTarget(CConsoleHandler * console) : +#ifndef VCMI_IOS + console(console), +#endif + threshold(ELogLevel::INFO), coloredOutputEnabled(true) { formatter.setPattern("%m"); } diff --git a/lib/logging/CLogger.h b/lib/logging/CLogger.h index 4f5ee2773..1f602db51 100644 --- a/lib/logging/CLogger.h +++ b/lib/logging/CLogger.h @@ -198,7 +198,9 @@ public: void write(const LogRecord & record) override; private: +#ifndef VCMI_IOS CConsoleHandler * console; +#endif ELogLevel::ELogLevel threshold; bool coloredOutputEnabled; CLogFormatter formatter; diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index 6015608c7..742ff5194 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -935,7 +935,9 @@ int main(int argc, char * argv[]) signal(SIGSEGV, handleLinuxSignal); #endif +#ifndef VCMI_IOS console = new CConsoleHandler(); +#endif CBasicLogConfigurator logConfig(VCMIDirs::get().userLogsPath() / "VCMI_Server_log.txt", console); logConfig.configureDefault(); logGlobal->info(SERVER_NAME); From 1dc7ccb7d0efcef89457461c13e7f29d03f18544 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Tue, 27 Sep 2022 07:06:17 +0300 Subject: [PATCH 4/4] remove declaration of non-existent function --- client/CPlayerInterface.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 62463f048..af9287e0a 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -84,8 +84,6 @@ using namespace CSDL_Ext; -void processCommand(const std::string &message, CClient *&client); - extern std::queue SDLEventsQueue; extern boost::mutex eventsM; boost::recursive_mutex * CPlayerInterface::pim = new boost::recursive_mutex;