From: Sam S. <sam...@gm...> - 2005-12-04 16:38:58
|
One more C++ thing I noticed: I have a class called Light that's derived from Entity, in the default constructor I have: Light::Light() { m_light=create_light(); } Now, in the constructor that takes a Tiki::File, I didn't want to duplicate the above line, so I tried: Light::Light(Tiki::File f) { Light(); loadFromFile(f); } Now, m_light gets assigned a pointer in a linked list of where lights are located (to make finding them as fast as possible for vertex lighting). Anyway, it gets a value inside of Light();, but as soon as it returns from that call, it goes back to being NULL again before loadFromFile gets called. Is there another way I'm supposed to call the default constructor from another constructor? -Sam |