From 362c716a827e25a37dc11f8c6e66336e12f60c0a Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 6 May 2003 00:35:42 +0000 Subject: [PATCH] fix egg files not getting their trefs updated --- pandatool/src/egg-palettize/eggFile.cxx | 1 + .../src/egg-palettize/textureReference.cxx | 19 +++++++++++++++++++ .../src/egg-palettize/textureReference.h | 1 + 3 files changed, 21 insertions(+) diff --git a/pandatool/src/egg-palettize/eggFile.cxx b/pandatool/src/egg-palettize/eggFile.cxx index aec5a201cf..d6d4b51491 100644 --- a/pandatool/src/egg-palettize/eggFile.cxx +++ b/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; diff --git a/pandatool/src/egg-palettize/textureReference.cxx b/pandatool/src/egg-palettize/textureReference.cxx index ece744dead..18fb83c8f9 100644 --- a/pandatool/src/egg-palettize/textureReference.cxx +++ b/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 diff --git a/pandatool/src/egg-palettize/textureReference.h b/pandatool/src/egg-palettize/textureReference.h index 6a22f3e828..c0a4f4e6bb 100644 --- a/pandatool/src/egg-palettize/textureReference.h +++ b/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;