summaryrefslogtreecommitdiff
path: root/lyt/materials
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2014-06-03 05:55:54 +0200
committerTreeki <treeki@gmail.com>2014-06-03 05:55:54 +0200
commit7a9387269e3b123b1647cf59c78cc6c998a9a330 (patch)
tree7874647c497a6b6113f660ff27f6f79b7fc7d4aa /lyt/materials
parentbe8b56a7f0a8f6ba5456a099b61d032fd8aa2f61 (diff)
downloadLayoutStudio-7a9387269e3b123b1647cf59c78cc6c998a9a330.tar.gz
LayoutStudio-7a9387269e3b123b1647cf59c78cc6c998a9a330.zip
experimental 3DS support
Diffstat (limited to '')
-rw-r--r--lyt/materials/material.cpp10
-rw-r--r--lyt/materials/material.h6
2 files changed, 9 insertions, 7 deletions
diff --git a/lyt/materials/material.cpp b/lyt/materials/material.cpp
index a775553..877338d 100644
--- a/lyt/materials/material.cpp
+++ b/lyt/materials/material.cpp
@@ -94,7 +94,7 @@ void LYTMaterial::writeToDataStream(QDataStream &out) const {
WriteFixedLengthASCII(out, name, 0x14);
for (int i = 0; i < 3; i++)
- WriteS10Color(this->colours[i], out);
+ WriteRGBA8Color(this->colours[i], out);
for (int i = 0; i < 4; i++)
WriteRGBA8Color(this->tevKColour[i], out);
@@ -176,7 +176,7 @@ void LYTMaterial::readFromDataStream(QDataStream &in) {
name = ReadFixedLengthASCII(in, 0x14);
for (int i = 0; i < 3; i++)
- ReadS10Color(this->colours[i], in);
+ ReadRGBA8Color(this->colours[i], in);
for (int i = 0; i < 4; i++)
ReadRGBA8Color(this->tevKColour[i], in);
@@ -186,6 +186,8 @@ void LYTMaterial::readFromDataStream(QDataStream &in) {
in >> (quint32&)resNumValue;
LYTMaterialResourceNum resourceNum(resNumValue);
+ qDebug() << "[[ resNum : " << resNumValue << "]]";
+
// this is really complicated -_-
// first off: TexMap
texMaps.clear();
@@ -208,7 +210,7 @@ void LYTMaterial::readFromDataStream(QDataStream &in) {
this->readTexCoordGen(in);
}
- // ChanCtrl
+ /*// ChanCtrl
if (resourceNum.hasChanCtrl()) {
this->hasChanCtrl = true;
this->chanCtrl.readFromDataStream(in);
@@ -267,7 +269,7 @@ void LYTMaterial::readFromDataStream(QDataStream &in) {
this->blendMode.readFromDataStream(in);
} else {
this->hasBlendMode = false;
- }
+ }*/
}
diff --git a/lyt/materials/material.h b/lyt/materials/material.h
index a42a9d8..025b304 100644
--- a/lyt/materials/material.h
+++ b/lyt/materials/material.h
@@ -45,9 +45,9 @@ public:
quint32 value() const { return m_value; }
- int getTexMapNum() const { return BitExtract(m_value, 4, 28); }
- int getTexSRTNum() const { return BitExtract(m_value, 4, 24); }
- int getTexCoordGenNum() const { return BitExtract(m_value, 4, 20); }
+ int getTexMapNum() const { return BitExtract(m_value, 2, 30); }
+ int getTexSRTNum() const { return BitExtract(m_value, 2, 28); }
+ int getTexCoordGenNum() const { return BitExtract(m_value, 2, 26); }
bool hasChanCtrl() const { return BitExtract(m_value, 1, 6); }
bool hasMatCol() const { return BitExtract(m_value, 1, 4); }
bool hasTevSwapTable() const { return BitExtract(m_value, 1, 19); }