~ubuntu-branches/ubuntu/trusty/openscenegraph/trusty

« back to all changes in this revision

Viewing changes to OpenSceneGraph/src/osgPlugins/OpenFlight/VertexRecords.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-11-12 02:21:14 UTC
  • mfrom: (31.1.3 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20131112022114-qaxfhdnhn88vnh10
Tags: 3.2.0~rc1-1ubuntu1
Fix deprecated url_feof.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
 
1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2
2
 *
3
 
 * This library is open source and may be redistributed and/or modified under  
4
 
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
 
3
 * This library is open source and may be redistributed and/or modified under
 
4
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5
5
 * (at your option) any later version.  The full license is in LICENSE file
6
6
 * included with this distribution, and on the openscenegraph.org website.
7
 
 * 
 
7
 *
8
8
 * This library is distributed in the hope that it will be useful,
9
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
 * OpenSceneGraph Public License for more details.
12
12
*/
13
13
 
68
68
            // color
69
69
            if (flags & PACKED_COLOR)
70
70
                vertex.setColor(packedColor);                                             // Packed color
71
 
            else if (colorIndex >= 0)
 
71
            else if( ( (flags & NO_COLOR) == 0 ) &&
 
72
                     ( colorIndex >= 0 ) )
 
73
            {
 
74
                // Only use the color index if the NO_COLOR bit is _not_ set
 
75
                // and the index isn't negative.
72
76
                vertex.setColor(getColorFromPool(colorIndex, document.getColorPool()));   // Color from pool
 
77
            }
73
78
 
74
79
            if (_parent.valid())
75
80
                _parent->addVertex(vertex);
108
113
            // color
109
114
            if (flags & PACKED_COLOR)
110
115
                vertex.setColor(packedColor);                                               // Packed color
111
 
            else if (colorIndex >= 0)
 
116
            else if( ( (flags & NO_COLOR) == 0 ) &&
 
117
                     ( colorIndex >= 0 ) )
 
118
            {
 
119
                // Only use the color index if the NO_COLOR bit is _not_ set
 
120
                // and the index isn't negative.
112
121
                vertex.setColor(getColorFromPool(colorIndex, document.getColorPool()));   // Color from pool
 
122
            }
113
123
 
114
124
            if (_parent.valid())
115
125
                _parent->addVertex(vertex);
148
158
            // color
149
159
            if (flags & PACKED_COLOR)
150
160
                vertex.setColor(packedColor);                                               // Packed color
151
 
            else if (colorIndex >= 0)
 
161
            else if( ( (flags & NO_COLOR) == 0 ) &&
 
162
                     ( colorIndex >= 0 ) )
 
163
            {
 
164
                // Only use the color index if the NO_COLOR bit is _not_ set
 
165
                // and the index isn't negative.
152
166
                vertex.setColor(getColorFromPool(colorIndex, document.getColorPool()));   // Color from pool
 
167
            }
153
168
 
154
169
            if (_parent.valid())
155
170
                _parent->addVertex(vertex);
186
201
            vertex.setCoord(coord*document.unitScale());
187
202
            vertex.setNormal(normal);
188
203
            vertex.setUV(0,uv);
189
 
            
 
204
 
190
205
 
191
206
            if (!coord.valid())
192
207
            {
206
221
            // color
207
222
            if (flags & PACKED_COLOR)
208
223
                vertex.setColor(packedColor);                                               // Packed color
209
 
            else if (colorIndex >= 0)
 
224
            else if( ( (flags & NO_COLOR) == 0 ) &&
 
225
                     ( colorIndex >= 0 ) )
 
226
            {
 
227
                // Only use the color index if the NO_COLOR bit is _not_ set
 
228
                // and the index isn't negative.
210
229
                vertex.setColor(getColorFromPool(colorIndex, document.getColorPool()));   // Color from pool
 
230
            }
211
231
 
212
232
            if (_parent.valid())
213
233
                _parent->addVertex(vertex);