Panda3D
cLwoClip.cxx
1 // Filename: cLwoClip.cxx
2 // Created by: drose (27Apr01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "cLwoClip.h"
16 #include "lwoToEggConverter.h"
17 
18 #include "lwoClip.h"
19 #include "lwoStillImage.h"
20 #include "dcast.h"
21 
22 
23 ////////////////////////////////////////////////////////////////////
24 // Function: CLwoClip::Constructor
25 // Access: Public
26 // Description:
27 ////////////////////////////////////////////////////////////////////
28 CLwoClip::
29 CLwoClip(LwoToEggConverter *converter, const LwoClip *clip) :
30  _converter(converter),
31  _clip(clip)
32 {
33  _still_image = false;
34 
35  // Walk through the chunk list, looking for some basic properties.
36  int num_chunks = _clip->get_num_chunks();
37  for (int i = 0; i < num_chunks; i++) {
38  const IffChunk *chunk = _clip->get_chunk(i);
39 
40  if (chunk->is_of_type(LwoStillImage::get_class_type())) {
41  const LwoStillImage *image = DCAST(LwoStillImage, chunk);
42  _filename = image->_filename;
43  _still_image = true;
44  }
45  }
46 }
A single image file, or a numbered sequence of images (e.g.
Definition: lwoClip.h:27
The basic kind of record in an EA "IFF" file, which the LightWave object file is based on...
Definition: iffChunk.h:32
A single still image associated with a LwoClip chunk.
Definition: lwoStillImage.h:28
This class supervises the construction of an EggData structure from the data represented by the LwoHe...
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
Definition: typedObject.I:63