+ } else if ( obj_type == SG_COLOR_LIST ) {
+ // read color list properties
+ for ( j = 0; j < nproperties; ++j ) {
+ char prop_type;
+ sgReadChar( fp, &prop_type );
+
+ sgReadUInt( fp, &nbytes );
+ // cout << "property size = " << nbytes << endl;
+ if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
+ char *ptr = buf.get_ptr();
+ sgReadBytes( fp, nbytes, ptr );
+ }
+
+ // read color list elements
+ for ( j = 0; j < nelements; ++j ) {
+ sgReadUInt( fp, &nbytes );
+ // cout << "element size = " << nbytes << endl;
+ if ( nbytes > buf.get_size() ) { buf.resize( nbytes ); }
+ char *ptr = buf.get_ptr();
+ sgReadBytes( fp, nbytes, ptr );
+ int count = nbytes / (sizeof(float) * 4);
+ float *fptr = (float *)ptr;
+ for ( k = 0; k < count; ++k ) {
+ if ( sgIsBigEndian() ) {
+ sgEndianSwap( (unsigned int *)&(fptr[0]) );
+ sgEndianSwap( (unsigned int *)&(fptr[1]) );
+ sgEndianSwap( (unsigned int *)&(fptr[2]) );
+ sgEndianSwap( (unsigned int *)&(fptr[3]) );
+ }
+ p = Point3D( fptr[0], fptr[1], fptr[2] );
+ // cout << "node = " << p << endl;
+ colors.push_back( p );
+ fptr += 4;
+ }
+ }