Changeset 8564
- Timestamp:
- 07/11/08 19:46:30
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/Opcodes.h
r8003 r8564 23 23 namespace flt { 24 24 25 26 // Note that INVALID_OP = -1 is not an actual opcode defined in the OpenFlight format. 27 // The purpose of INVALID_OP is to mark an opcode variable as invalid or uninitialized. 25 28 enum Opcodes 26 29 { 30 INVALID_OP = -1, 27 31 UNKNOWN_OP = 0, 28 32 HEADER_OP = 1, OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp
r8295 r8564 87 87 /*! 88 88 89 FLTReaderWriter supports importing and exporting OSG scene gr qphs89 FLTReaderWriter supports importing and exporting OSG scene graphs 90 90 from/to OpenFlight files. 91 91 … … 285 285 286 286 const int RECORD_HEADER_SIZE = 4; 287 opcode_type continuationOpcode = -1;287 opcode_type continuationOpcode = INVALID_OP; 288 288 std::string continuationBuffer; 289 289 … … 300 300 size_type size = (size_type)dataStream.readUInt16(); 301 301 302 // If size == 0, an EOF has probably been reached, i.e. there is nothing 303 // more to read so we must return. 302 304 if (size==0) 303 return ReadResult::ERROR_IN_READING_FILE; 305 { 306 // If a header was read, we return it. 307 // This allows us handle files with empty hierarchies. 308 if (document.getHeaderNode()) 309 { 310 return document.getHeaderNode(); 311 } 312 else // (no valid header) 313 { 314 return ReadResult::ERROR_IN_READING_FILE; 315 } 316 } 304 317 305 318 // variable length record complete? … … 311 324 recordStream.readRecordBody(continuationOpcode, continuationBuffer.length(), document); 312 325 313 continuationOpcode = -1;326 continuationOpcode = INVALID_OP; 314 327 continuationBuffer.clear(); 315 328 }
