From 871feeefbe94a774fea234bbd0fe31620d0dee44 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 17 Aug 2012 05:56:17 +0200 Subject: changed LYTPane::flags to a set of three bools --- lyt/pane.cpp | 16 ++++++++++++++-- lyt/pane.h | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lyt/pane.cpp b/lyt/pane.cpp index 3a4abd0..2612fb7 100644 --- a/lyt/pane.cpp +++ b/lyt/pane.cpp @@ -60,13 +60,19 @@ void LYTPane::dumpToDebug(bool showHeading) const { qDebug() << "- Rotation:" << xRot << "," << yRot << "," << zRot; qDebug() << "- Scale:" << xScale << "," << yScale; qDebug() << "- Size:" << width << "x" << height; - qDebug() << "- Flags:" << flags << "- Origin:" << horzOrigin << "," << vertOrigin; + qDebug() << "- Visible:" << visible << "- Influenced Alpha:" << influencedAlpha << "- Widescreen:" << isWidescreen; + qDebug() << "- Origin:" << horzOrigin << "," << vertOrigin; qDebug() << "- Alpha:" << alpha << "- Userdata:" << userdata; } void LYTPane::writeToDataStream(QDataStream &out) const { + quint8 flags = + (visible ? 1 : 0) | + (influencedAlpha ? 2 : 0) | + (isWidescreen ? 4 : 0); + out << (quint8)flags; out << (quint8)((int)horzOrigin + ((int)vertOrigin * 3)); out << (quint8)alpha; @@ -88,7 +94,13 @@ void LYTPane::writeToDataStream(QDataStream &out) const { } void LYTPane::readFromDataStream(QDataStream &in) { - in >> (quint8&)flags; + quint8 flags; + in >> flags; + + visible = (flags & 1); + influencedAlpha = (flags & 2); + isWidescreen = (flags & 4); + quint8 rawOrigin; in >> rawOrigin; horzOrigin = (OriginType)(rawOrigin % 3); diff --git a/lyt/pane.h b/lyt/pane.h index 24d4a41..56a6c87 100644 --- a/lyt/pane.h +++ b/lyt/pane.h @@ -53,7 +53,7 @@ public: LYTPane *parent; QList children; - quint8 flags; + bool visible, influencedAlpha, isWidescreen; enum OriginType { Left = 0, Top = 0, -- cgit v1.2.3