00001 // Filename: iffChunk.cxx 00002 // Created by: drose (23Apr01) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #include "iffChunk.h" 00020 #include "iffInputFile.h" 00021 00022 #include <indent.h> 00023 00024 TypeHandle IffChunk::_type_handle; 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Function: IffChunk::output 00028 // Access: Public, Virtual 00029 // Description: 00030 //////////////////////////////////////////////////////////////////// 00031 void IffChunk:: 00032 output(ostream &out) const { 00033 out << _id << " (" << get_type() << ")"; 00034 } 00035 00036 //////////////////////////////////////////////////////////////////// 00037 // Function: IffChunk::write 00038 // Access: Public, Virtual 00039 // Description: 00040 //////////////////////////////////////////////////////////////////// 00041 void IffChunk:: 00042 write(ostream &out, int indent_level) const { 00043 indent(out, indent_level) << _id << " { ... }\n"; 00044 } 00045 00046 //////////////////////////////////////////////////////////////////// 00047 // Function: IffChunk::make_new_chunk 00048 // Access: Public, Virtual 00049 // Description: Allocates and returns a new chunk of the appropriate 00050 // type based on the given ID, according to the context 00051 // given by this chunk itself. 00052 //////////////////////////////////////////////////////////////////// 00053 IffChunk *IffChunk:: 00054 make_new_chunk(IffInputFile *in, IffId id) { 00055 return in->make_new_chunk(id); 00056 }