mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Attempt to fix server hosting on ios
This commit is contained in:
parent
56757bb5c2
commit
c4c1cd392a
@ -22,9 +22,9 @@
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
int result;
|
||||
#ifdef VCMI_IOS
|
||||
__argc = argc;
|
||||
__argv = argv;
|
||||
#ifdef VCMI_IOS
|
||||
{
|
||||
#endif
|
||||
QApplication vcmilauncher(argc, argv);
|
||||
|
@ -8,10 +8,9 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef VCMI_IOS
|
||||
extern int __argc;
|
||||
extern char ** __argv;
|
||||
|
||||
#ifdef VCMI_IOS
|
||||
extern "C" void launchGame(int argc, char * argv[]);
|
||||
#endif
|
||||
|
@ -22,8 +22,10 @@
|
||||
#include "updatedialog_moc.h"
|
||||
#include "main.h"
|
||||
|
||||
#ifdef VCMI_IOS
|
||||
int __argc;
|
||||
char ** __argv;
|
||||
#endif
|
||||
|
||||
void MainWindow::load()
|
||||
{
|
||||
@ -118,10 +120,11 @@ MainWindow::~MainWindow()
|
||||
|
||||
void MainWindow::startGame(const QStringList & args)
|
||||
{
|
||||
__argc = args.size();
|
||||
if(__argc)
|
||||
__argv = new char*[__argc];
|
||||
for(int i = 0; i < __argc; ++i)
|
||||
#ifdef Q_OS_IOS
|
||||
__argc = args.size() + 1; //first argument is omitted
|
||||
__argv = new char*[__argc];
|
||||
__argv[0] = "vcmiclient";
|
||||
for(int i = 1; i < __argc; ++i)
|
||||
{
|
||||
const char * s = args[i].toLocal8Bit().constData();
|
||||
__argv[i] = new char[strlen(s)];
|
||||
@ -129,8 +132,6 @@ void MainWindow::startGame(const QStringList & args)
|
||||
}
|
||||
|
||||
logGlobal->warn("Starting game with the arguments: %s", args.join(" ").toStdString());
|
||||
|
||||
#ifdef Q_OS_IOS
|
||||
qApp->quit();
|
||||
#else
|
||||
startExecutable(pathToQString(VCMIDirs::get().clientPath()), args);
|
||||
|
Loading…
Reference in New Issue
Block a user