瀏覽代碼

prepare for slot-based renderstate

David Rose 17 年之前
父節點
當前提交
656fb8d683
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 3 3
      pandatool/src/bam/bamToEgg.cxx
  2. 1 1
      pandatool/src/bam/eggToBam.cxx

+ 3 - 3
pandatool/src/bam/bamToEgg.cxx

@@ -421,7 +421,7 @@ convert_triangles(const GeomVertexData *vertex_data,
 
   // Check for a color scale.
   LVecBase4f color_scale(1.0f, 1.0f, 1.0f, 1.0f);
-  const ColorScaleAttrib *csa = net_state->get_color_scale();
+  const ColorScaleAttrib *csa = DCAST(ColorScaleAttrib, net_state->get_attrib(ColorScaleAttrib::get_class_type()));
   if (csa != (const ColorScaleAttrib *)NULL) {
     color_scale = csa->get_scale();
   }
@@ -430,7 +430,7 @@ convert_triangles(const GeomVertexData *vertex_data,
   bool has_color_override = false;
   bool has_color_off = false;
   Colorf color_override;
-  const ColorAttrib *ca = net_state->get_color();
+  const ColorAttrib *ca = DCAST(ColorAttrib, net_state->get_attrib(ColorAttrib::get_class_type()));
   if (ca != (const ColorAttrib *)NULL) {
     if (ca->get_color_type() == ColorAttrib::T_flat) {
       has_color_override = true;
@@ -447,7 +447,7 @@ convert_triangles(const GeomVertexData *vertex_data,
 
   // Check for a texture.
   EggTexture *egg_tex = (EggTexture *)NULL;
-  const TextureAttrib *ta = net_state->get_texture();
+  const TextureAttrib *ta = DCAST(TextureAttrib, net_state->get_attrib(TextureAttrib::get_class_type()));
   if (ta != (const TextureAttrib *)NULL) {
     egg_tex = get_egg_texture(ta->get_texture());
   }

+ 1 - 1
pandatool/src/bam/eggToBam.cxx

@@ -351,7 +351,7 @@ collect_textures(PandaNode *node) {
 ////////////////////////////////////////////////////////////////////
 void EggToBam::
 collect_textures(const RenderState *state) {
-  const TextureAttrib *tex_attrib = state->get_texture();
+  const TextureAttrib *tex_attrib = DCAST(TextureAttrib, state->get_attrib(TextureAttrib::get_class_type()));
   if (tex_attrib != (TextureAttrib *)NULL) {
     int num_on_stages = tex_attrib->get_num_on_stages();
     for (int i = 0; i < num_on_stages; ++i) {