Simplify reading from file ;)
authorunc0rr
Thu, 10 May 2007 21:19:12 +0000
changeset 512 efc640bb60d0
parent 511 2b5b9e00419d
child 513 69e06d710d46
Simplify reading from file ;)
QTfrontend/game.cpp
--- a/QTfrontend/game.cpp	Wed May 09 20:32:41 2007 +0000
+++ b/QTfrontend/game.cpp	Thu May 10 21:19:12 2007 +0000
@@ -255,17 +255,7 @@
 	}
 
 	// read demo
-	QDataStream stream(&demofile);
-	char buf[512];
-	int readbytes;
-	do
-	{
-		readbytes = stream.readRawData((char *)&buf, 512);
-		toSendBuf.append(QByteArray((char *)&buf, readbytes));
-		//SendIPC(QByteArray((char *)&buf, readbytes));
-
-	} while (readbytes > 0);
-	demofile.close();
+	toSendBuf = demofile.readAll();
 
 	// run engine
 	demo = new QByteArray;