*** empty log message ***

This commit is contained in:
David Rose 2001-05-02 18:49:29 +00:00
parent 0d73d88a91
commit decb6d2007
5 changed files with 18 additions and 9 deletions

View File

@ -56,5 +56,11 @@ get_material() const {
////////////////////////////////////////////////////////////////////
INLINE bool FltGeometry::
has_color() const {
return ((_flags & F_no_color) == 0) || has_material();
// Even if the no_color bit is not set, if the color_index is -1,
// the face doesn't have a color (unless we've got packed color).
// On the other hand, if we have a material than we always have
// color.
return ((_flags & F_no_color) == 0 &&
(_color_index != -1 || ((_flags & F_packed_color) != 0)))
|| has_material();
}

View File

@ -189,8 +189,8 @@ extract_record(FltRecordReader &reader) {
if (_header->get_flt_version() >= 15.2) {
_texture_mapping_index = iterator.get_be_int16();
iterator.skip_bytes(2);
_color_index = iterator.get_be_uint32();
_alt_color_index = iterator.get_be_uint32();
_color_index = iterator.get_be_int32();
_alt_color_index = iterator.get_be_int32();
iterator.skip_bytes(2 + 2);
}
@ -242,8 +242,8 @@ build_record(FltRecordWriter &writer) const {
// New with 15.2
datagram.add_be_int16(_texture_mapping_index);
datagram.pad_bytes(2);
datagram.add_be_uint32(_color_index);
datagram.add_be_uint32(_alt_color_index);
datagram.add_be_int32(_color_index);
datagram.add_be_int32(_alt_color_index);
datagram.pad_bytes(2 + 2);
}

View File

@ -83,8 +83,8 @@ public:
FltPackedColor _packed_color;
FltPackedColor _alt_packed_color;
int _texture_mapping_index;
unsigned int _color_index;
unsigned int _alt_color_index;
int _color_index;
int _alt_color_index;
public:
INLINE bool has_texture() const;

View File

@ -12,5 +12,8 @@
////////////////////////////////////////////////////////////////////
INLINE bool FltVertex::
has_color() const {
return (_flags & F_no_color) == 0;
// Even if the no_color bit is not set, if the color_index is -1,
// the vertex doesn't have a color (unless we've got packed color).
return ((_flags & F_no_color) == 0 &&
(_color_index != -1 || ((_flags & F_packed_color) != 0)));
}

View File

@ -194,7 +194,7 @@ extract_record(FltRecordReader &reader) {
return false;
}
if (_header->get_flt_version() >= 15.2) {
_color_index = iterator.get_be_uint32();
_color_index = iterator.get_be_int32();
if (_has_normal && iterator.get_remaining_size() > 0) {
// If we extracted a normal, our double-word alignment is off; now