Browse Source

visit multitexture during prepare_scene() too

David Rose 17 years ago
parent
commit
472e203d67
1 changed files with 6 additions and 3 deletions
  1. 6 3
      panda/src/pgraph/geomNode.cxx

+ 6 - 3
panda/src/pgraph/geomNode.cxx

@@ -384,9 +384,12 @@ r_prepare_scene(const RenderState *state,
     if (attrib != (const RenderAttrib *)NULL) {
       const TextureAttrib *ta;
       DCAST_INTO_V(ta, attrib);
-      Texture *texture = ta->get_texture();
-      if (texture != (Texture *)NULL) {
-        texture->prepare(prepared_objects);
+      int num_stages = ta->get_num_on_stages();
+      for (int i = 0; i < num_stages; ++i) {
+        Texture *texture = ta->get_on_texture(ta->get_on_stage(i));
+        if (texture != (Texture *)NULL) {
+          texture->prepare(prepared_objects);
+        }
       }
     }
   }