From ebcc95da4c26369511caa90d89c5ed06e1e4853a Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 14 Oct 2010 20:17:20 +0200 Subject: brlyt packing added, plus some changes in the existing API (mostly for const correctness). brlyt writing may still need some testing (especially for the material structs) --- lyt/binaryfile.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lyt/binaryfile.cpp') diff --git a/lyt/binaryfile.cpp b/lyt/binaryfile.cpp index 2b285c2..26ca8a0 100644 --- a/lyt/binaryfile.cpp +++ b/lyt/binaryfile.cpp @@ -20,13 +20,11 @@ #include -LYTBinaryFile::LYTBinaryFile(Magic magic, Version version) { - this->magic.value = magic.value; - this->version.value = version.value; +LYTBinaryFile::LYTBinaryFile(Magic m, Version v) : magic(m), version(v) { } -LYTBinaryFile::LYTBinaryFile(QByteArray data) { +LYTBinaryFile::LYTBinaryFile(QByteArray data) : magic(0), version(0) { QDataStream reader(data); InitDataStream(reader); @@ -49,7 +47,7 @@ LYTBinaryFile::LYTBinaryFile(QByteArray data) { } -QByteArray LYTBinaryFile::pack() { +QByteArray LYTBinaryFile::pack() const { // first off, calculate filesize for the header quint32 fileSize = 16; -- cgit v1.2.3