summaryrefslogtreecommitdiff
path: root/lyt/pane.cpp
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 /lyt/pane.cpp
parent247a25c8ecaa8e6496ea1f35c0c7d4eb1154a0a9 (diff)
downloadLayoutStudio-871feeefbe94a774fea234bbd0fe31620d0dee44.tar.gz
LayoutStudio-871feeefbe94a774fea234bbd0fe31620d0dee44.zip
changed LYTPane::flags to a set of three bools
Diffstat (limited to '')
-rw-r--r--lyt/pane.cpp16
1 files changed, 14 insertions, 2 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);