git-svn-id: svn://db.shs.com.ru/libs@701 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -83,11 +83,12 @@ public:
|
||||
void load(TextureManager * tm);
|
||||
void copyToQGLMap(QGLEngineShaders::QGLMap & m) const;
|
||||
QString bitmap_path;
|
||||
GLuint bitmap_id;
|
||||
GLuint bitmap_id;
|
||||
QPointF bitmap_offset;
|
||||
QPointF bitmap_scale;
|
||||
float color_amount;
|
||||
float color_offset;
|
||||
bool use_bitmap;
|
||||
|
||||
bool _changed;
|
||||
int _type, _layer;
|
||||
@@ -105,7 +106,6 @@ public:
|
||||
void setTypes();
|
||||
QString name;
|
||||
QColor color_diffuse;
|
||||
QColor color_specular;
|
||||
QColor color_emission;
|
||||
bool glass;
|
||||
float transparency;
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
float dispersion;
|
||||
Map map_diffuse ;
|
||||
Map map_normal ;
|
||||
Map map_specular ;
|
||||
Map map_metalness;
|
||||
Map map_roughness;
|
||||
Map map_emission ;
|
||||
Map map_relief ;
|
||||
@@ -126,21 +126,23 @@ public:
|
||||
|
||||
inline QDataStream & operator <<(QDataStream & s, const Map & m) {
|
||||
ChunkStream cs;
|
||||
cs.add(1, m.bitmap_path).add(2, m.color_amount).add(3, m.color_offset).add(6, m.bitmap_scale);
|
||||
cs.add(1, m.bitmap_path).add(2, m.color_amount).add(3, m.color_offset).add(6, m.bitmap_scale)
|
||||
.add(7, m.use_bitmap);
|
||||
s << cs.data(); return s;
|
||||
}
|
||||
inline QDataStream & operator >>(QDataStream & s, Map & m) {
|
||||
ChunkStream cs(s);
|
||||
cs.readAll();
|
||||
cs.get(1, m.bitmap_path).get(2, m.color_amount).get(3, m.color_offset).get(6, m.bitmap_scale);
|
||||
cs.get(1, m.bitmap_path).get(2, m.color_amount).get(3, m.color_offset).get(6, m.bitmap_scale)
|
||||
.get(7, m.use_bitmap);
|
||||
return s;
|
||||
}
|
||||
|
||||
inline QDataStream & operator <<(QDataStream & s, const Material * m) {
|
||||
ChunkStream cs;
|
||||
cs.add(1, m->name).add(2, m->color_diffuse).add(3, m->color_specular).add(4, m->color_emission)
|
||||
cs.add(1, m->name).add(2, m->color_diffuse).add(4, m->color_emission)
|
||||
.add(5, m->transparency).add(6, m->reflectivity).add(7, m->glass).add(8, m->map_diffuse).add(9, m->map_normal)
|
||||
.add(10, m->map_relief).add(11, m->map_specular).add(12, m->map_roughness).add(13, m->map_emission);
|
||||
.add(10, m->map_relief).add(11, m->map_metalness).add(12, m->map_roughness).add(13, m->map_emission);
|
||||
s << /*qCompress*/(cs.data()); return s;
|
||||
}
|
||||
inline QDataStream & operator >>(QDataStream & s, Material *& m) {
|
||||
@@ -153,7 +155,6 @@ inline QDataStream & operator >>(QDataStream & s, Material *& m) {
|
||||
switch (cs.read()) {
|
||||
case 1: cs.get(m->name); break;
|
||||
case 2: cs.get(m->color_diffuse); break;
|
||||
case 3: cs.get(m->color_specular); break;
|
||||
case 4: cs.get(m->color_emission); break;
|
||||
case 5: cs.get(m->transparency); break;
|
||||
case 6: cs.get(m->reflectivity); break;
|
||||
@@ -161,7 +162,7 @@ inline QDataStream & operator >>(QDataStream & s, Material *& m) {
|
||||
case 8: cs.get(m->map_diffuse); break;
|
||||
case 9: cs.get(m->map_normal); break;
|
||||
case 10: cs.get(m->map_relief); break;
|
||||
case 11: cs.get(m->map_specular); break;
|
||||
case 11: cs.get(m->map_metalness); break;
|
||||
case 12: cs.get(m->map_roughness); break;
|
||||
case 13: cs.get(m->map_emission); break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user