summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-08-17 05:56:17 +0200
committerTreeki <treeki@gmail.com>2012-08-17 05:56:17 +0200
commit871feeefbe94a774fea234bbd0fe31620d0dee44 (patch)
treede96769c3f74cdc88defa59226a432728ec05bc3
parent247a25c8ecaa8e6496ea1f35c0c7d4eb1154a0a9 (diff)
downloadLayoutStudio-871feeefbe94a774fea234bbd0fe31620d0dee44.tar.gz
LayoutStudio-871feeefbe94a774fea234bbd0fe31620d0dee44.zip
changed LYTPane::flags to a set of three bools
-rw-r--r--lyt/pane.cpp16
-rw-r--r--lyt/pane.h2
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<LYTPane *> children;
- quint8 flags;
+ bool visible, influencedAlpha, isWidescreen;
enum OriginType {
Left = 0, Top = 0,