Browse Source

fix egg files not getting their trefs updated

David Rose 22 years ago
parent
commit
362c716a82

+ 1 - 0
pandatool/src/egg-palettize/eggFile.cxx

@@ -168,6 +168,7 @@ scan_textures() {
         // It hasn't changed substantially, so keep the original
         // (which still has the placement references from a previous
         // pass).
+        aref->from_egg_quick(*bref);
         combined_textures.push_back(aref);
         delete bref;
 

+ 19 - 0
pandatool/src/egg-palettize/textureReference.cxx

@@ -135,6 +135,25 @@ from_egg(EggFile *egg_file, EggData *data, EggTexture *egg_tex) {
   _wrap_v = egg_tex->determine_wrap_v();
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: TextureReference::from_egg_quick
+//       Access: Public
+//  Description: Sets up the pointers within the TextureReference
+//               to the same egg file pointers indicated by the other
+//               TextureReference object, without changing any of the
+//               other internal data stored here regarding the egg
+//               structures.  This is intended for use when we have
+//               already shown that the two TextureReferences describe
+//               equivalent data.
+////////////////////////////////////////////////////////////////////
+void TextureReference::
+from_egg_quick(const TextureReference &other) {
+  nassertv(_tref_name == other._tref_name);
+  _egg_file = other._egg_file;
+  _egg_tex = other._egg_tex;
+  _egg_data = other._egg_data;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: TextureReference::get_egg_file
 //       Access: Public

+ 1 - 0
pandatool/src/egg-palettize/textureReference.h

@@ -50,6 +50,7 @@ public:
   ~TextureReference();
 
   void from_egg(EggFile *egg_file, EggData *data, EggTexture *egg_tex);
+  void from_egg_quick(const TextureReference &other);
 
   EggFile *get_egg_file() const;
   SourceTextureImage *get_source() const;