1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-28 23:06:24 +02:00

iOS: don't create unused CConsoleHandler

This commit is contained in:
Andrey Filipenkov 2022-09-27 07:05:10 +03:00
parent 70c51e4370
commit 53ac61b52b
5 changed files with 17 additions and 1 deletions

View File

@ -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()

View File

@ -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();

View File

@ -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");
}

View File

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

View File

@ -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);