QTfrontend/game.cpp
changeset 177 c67c15e6fae3
parent 174 0b2c5b22f644
child 178 efdc2a63be8e
--- a/QTfrontend/game.cpp	Thu Sep 28 16:34:42 2006 +0000
+++ b/QTfrontend/game.cpp	Sun Oct 01 20:14:30 2006 +0000
@@ -221,6 +221,11 @@
 void HWGame::ClientRead()
 {
 	readbuffer.append(IPCSocket->readAll());
+	onClientRead();
+}
+
+void HWGame::onClientRead()
+{
 	quint8 msglen;
 	quint32 bufsize;
 	while (((bufsize = readbuffer.size()) > 0) &&
@@ -247,9 +252,15 @@
 
 	demo = new QByteArray;
 	QProcess * process;
-	QStringList arguments;
 	process = new QProcess;
 	connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(StartProcessError(QProcess::ProcessError)));
+	QStringList arguments=setArguments();
+	process->start(bindir->absolutePath() + "/hwengine", arguments);
+}
+
+QStringList HWGame::setArguments()
+{
+	QStringList arguments;
 	arguments << resolutions[0][config->vid_Resolution()];
 	arguments << resolutions[1][config->vid_Resolution()];
 	arguments << "16";
@@ -258,7 +269,7 @@
 	arguments << (config->isSoundEnabled() ? "1" : "0");
 	arguments << tr("en.txt");
 	arguments << "128";
-	process->start(bindir->absolutePath() + "/hwengine", arguments);
+	return arguments;
 }
 
 void HWGame::StartProcessError(QProcess::ProcessError error)