Browse Source

make room for polylight object

Asad M. Zaman 21 years ago
parent
commit
67a0fd47db
4 changed files with 34 additions and 0 deletions
  1. 24 0
      panda/src/egg/eggGroup.I
  2. 4 0
      panda/src/egg/eggGroup.cxx
  3. 4 0
      panda/src/egg/eggGroup.h
  4. 2 0
      panda/src/egg/parser.yxx

+ 24 - 0
panda/src/egg/eggGroup.I

@@ -490,6 +490,30 @@ get_portal_flag() const {
   return ((_flags2 & F2_portal_flag) != 0);
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: EggGroup::set_polylight_flag
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void EggGroup::
+set_polylight_flag(bool flag) {
+  if (flag) {
+    _flags2 |= F2_polylight_flag;
+  } else {
+    _flags2 &= ~F2_polylight_flag;
+  }
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: EggGroup::get_polylight_flag
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE bool EggGroup::
+get_polylight_flag() const {
+  return ((_flags2 & F2_polylight_flag) != 0);
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroup::set_collide_mask
 //       Access: Public

+ 4 - 0
panda/src/egg/eggGroup.cxx

@@ -213,6 +213,10 @@ write(ostream &out, int indent_level) const {
     indent(out, indent_level) << "<Portal> { 1 }\n";
   }
 
+  if (get_polylight_flag()) {
+    indent(out, indent_level) << "<Polylight> { 1 }\n";
+  }
+
   // We have to write the children nodes before we write the vertex
   // references, since we might be referencing a vertex that's defined
   // in one of those children nodes!

+ 4 - 0
panda/src/egg/eggGroup.h

@@ -177,6 +177,9 @@ PUBLISHED:
   INLINE void set_portal_flag(bool flag);
   INLINE bool get_portal_flag() const;
 
+  INLINE void set_polylight_flag(bool flag);
+  INLINE bool get_polylight_flag() const;
+
   INLINE void set_collide_mask(CollideMask mask);
   INLINE void clear_collide_mask();
   INLINE bool has_collide_mask() const;
@@ -268,6 +271,7 @@ private:
 
     F2_dcs_type              = 0x00000030,
     F2_portal_flag           = 0x00000040,
+    F2_polylight_flag        = 0x00000080,
   };
 
   int _flags;

+ 2 - 0
panda/src/egg/parser.yxx

@@ -970,6 +970,8 @@ group_body:
     group->set_into_collide_mask(group->get_into_collide_mask() | ulong_value);
   } else if (cmp_nocase_uh(name, "portal") == 0) {
     group->set_portal_flag(value != 0);
+  } else if (cmp_nocase_uh(name, "polylight") == 0) {
+    group->set_polylight_flag(value != 0);
   } else {
     eggyywarning("Unknown group scalar " + name);
   }