浏览代码

Fixes for gcc 3.4

Josh Yelon 21 年之前
父节点
当前提交
f15dce600b

+ 14 - 10
panda/src/audiotraits/fmodAudioManager.cxx

@@ -255,7 +255,10 @@ get_sound(const string &file_name, bool positional) {
     // Add to the cache
     while (_sounds.size() >= (unsigned int)_cache_limit) {
       nassertr(is_valid(), NULL);
-      uncache_a_sound();
+      if (!uncache_a_sound()) {
+        audio_warning(_sounds.size()+1 << " sounds cached. Limit is " << _cache_limit );
+        break;
+      }
     }
 
     si = _sounds.insert(SoundMap::value_type(path, new_entry)).first;
@@ -386,22 +389,23 @@ uncache_sound(const string& file_name) {
 //       Access: Public
 //  Description: Uncaches the least recently used sound.
 ////////////////////////////////////////////////////////////////////
-void FmodAudioManager::
+bool FmodAudioManager::
 uncache_a_sound() {
   audio_debug("FmodAudioManager::uncache_a_sound()");
-  nassertv(is_valid());
+  nassertr(is_valid(), false);
   // uncache least recently used:
-  nassertv(_lru.size()>0);
-  LRU::reference path=_lru.front();
-  SoundMap::iterator i = _sounds.find(path);
-  nassertv(i != _sounds.end());
-  _lru.pop_front();
+  unsigned int orig_size = _lru.size();
 
-  if (i != _sounds.end()) {
+  for (LRU::iterator it = _lru.begin(); it != _lru.end(); it++) {
+    LRU::reference path=_lru.front();
+    SoundMap::iterator i = _sounds.find(path);
+    if (i == _sounds.end()) continue;
     audio_debug("  uncaching \""<<i->first<<"\"");
     uncache_sound(path);
+    nassertr(is_valid(), false);
+    if (_lru.size() < orig_size) return true;
   }
-  nassertv(is_valid());
+  return false;
 }
 
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/audiotraits/fmodAudioManager.h

@@ -54,7 +54,7 @@ public:
   void most_recently_used(const string& path);
 
   // Uncaches the least recently used sound.
-  void uncache_a_sound();
+  bool uncache_a_sound();
 
   virtual void set_volume(float);
   virtual float get_volume() const;

+ 1 - 0
panda/src/builder/builderFuncs.I

@@ -22,6 +22,7 @@
 #include "config_builder.h"
 #include "geom.h"
 #include "geomprimitives.h"
+#include "geomNode.h"
 
 #include <algorithm>
 

+ 14 - 14
panda/src/builder/builderVertexTempl.I

@@ -59,9 +59,9 @@ template <class VT, class NT, class TT, class CT>
 INLINE BuilderVertexTempl<VT, NT, TT, CT> &BuilderVertexTempl<VT, NT, TT, CT>::
 operator = (const BuilderVertexTempl<VT, NT, TT, CT> &copy) {
   BuilderAttribTempl<VT, NT, TT, CT>::operator = (copy);
-  _coord = copy._coord;
-  _texcoords = copy._texcoords;
-  _pixel_size = copy._pixel_size;
+  this->_coord = copy._coord;
+  this->_texcoords = copy._texcoords;
+  this->_pixel_size = copy._pixel_size;
 
   return *this;
 }
@@ -101,7 +101,7 @@ clear() {
 template <class VT, class NT, class TT, class CT>
 INLINE bool BuilderVertexTempl<VT, NT, TT, CT>::
 has_coord() const {
-  return _flags & BAF_coord;
+  return (this->_flags) & BAF_coord;
 }
 
 
@@ -128,8 +128,8 @@ get_coord() const {
 template <class VT, class NT, class TT, class CT>
 INLINE BuilderVertexTempl<VT, NT, TT, CT> &BuilderVertexTempl<VT, NT, TT, CT>::
 set_coord(const VType &c) {
-  _flags |= BAF_coord;
-  _coord = c;
+  this->_flags |= BAF_coord;
+  this->_coord = c;
   return *this;
 }
 
@@ -408,16 +408,16 @@ template <class VT, class NT, class TT, class CT>
 ostream &BuilderVertexTempl<VT, NT, TT, CT>::
 output(ostream &out) const {
   if (this!=NULL) {
-    if (has_coord()) {
-      out << get_coord();
+    if (this->has_coord()) {
+      out << this->get_coord();
     }
 
-    if (has_normal()) {
-      out << " normal " << get_normal();
+    if (this->has_normal()) {
+      out << " normal " << this->get_normal();
     }
 
-    if (has_color()) {
-      out << " color " << get_color();
+    if (this->has_color()) {
+      out << " color " << this->get_color();
     }
 
     TYPENAME TexCoords::const_iterator ti;
@@ -426,8 +426,8 @@ output(ostream &out) const {
       out << " texcoord \"" << name->get_name() << "\" " << (*ti).second;
     }
 
-    if (has_pixel_size()) {
-      out << " pixel_size " << get_pixel_size();
+    if (this->has_pixel_size()) {
+      out << " pixel_size " << this->get_pixel_size();
     }
   }
   return out;

+ 3 - 2
panda/src/builder/mesherTempl.I

@@ -53,8 +53,9 @@ add_prim(const Prim &prim, MesherStripOrigin origin) {
 
   // Get the common vertex pointers for the primitive's vertices.
   for (i = 0; i < num_verts; i++) {
-    TYPENAME Verts::iterator n =
-      _verts.insert(Verts::value_type(prim.get_vertex(i), EdgePtrs())).first;
+    TYPENAME Verts::value_type v(prim.get_vertex(i), EdgePtrs());
+    TYPENAME Verts::iterator n = _verts.insert(v).first;
+
     vptrs[i] = &(*n).first;
     eptrs[i] = &(*n).second;
 

+ 1 - 0
panda/src/downloader/bioPtr.h

@@ -23,6 +23,7 @@
 
 // This module is not compiled if OpenSSL is not available.
 #ifdef HAVE_SSL
+#define OPENSSL_NO_KRB5
 
 #include "referenceCount.h"
 #include <openssl/ssl.h>

+ 1 - 0
panda/src/downloader/bioStreamBuf.cxx

@@ -19,6 +19,7 @@
 #include "bioStreamBuf.h"
 #include "config_downloader.h"
 #include "ssl_utils.h"
+#include <errno.h>
 
 #ifdef HAVE_SSL
 

+ 1 - 0
panda/src/downloader/bioStreamBuf.h

@@ -23,6 +23,7 @@
 
 // This module is not compiled if OpenSSL is not available.
 #ifdef HAVE_SSL
+#define OPENSSL_NO_KRB5
 
 #include "bioPtr.h"
 #include "pointerTo.h"

+ 1 - 0
panda/src/downloader/bioStreamPtr.h

@@ -23,6 +23,7 @@
 
 // This module is not compiled if OpenSSL is not available.
 #ifdef HAVE_SSL
+#define OPENSSL_NO_KRB5
 
 #include "bioStream.h"
 #include "referenceCount.h"

+ 2 - 1
panda/src/downloader/httpChannel.h

@@ -27,6 +27,7 @@
 // communications.
 
 #ifdef HAVE_SSL
+#define OPENSSL_NO_KRB5
 
 #include "httpClient.h"
 #include "httpEnum.h"
@@ -146,7 +147,7 @@ PUBLISHED:
   INLINE double get_max_updates_per_second() const;
 
   INLINE void set_expected_file_size(size_t file_size);
-  INLINE size_t get_file_size() const;
+  size_t get_file_size() const;
   INLINE bool is_file_size_known() const;
 
   void write_headers(ostream &out) const;

+ 1 - 0
panda/src/downloader/httpClient.h

@@ -27,6 +27,7 @@
 // communications.
 
 #ifdef HAVE_SSL
+#define OPENSSL_NO_KRB5
 
 #include "urlSpec.h"
 #include "httpAuthorization.h"

+ 1 - 0
panda/src/downloader/ssl_utils.h

@@ -23,6 +23,7 @@
 
 // This module is not compiled if OpenSSL is not available.
 #ifdef HAVE_SSL
+#define OPENSSL_NO_KRB5
 
 #include <openssl/ssl.h>
 

+ 1 - 0
panda/src/egg/eggUtilities.I

@@ -18,6 +18,7 @@
 
 #include "eggGroup.h"
 #include "eggPrimitive.h"
+#include "eggVertexPool.h"
 
 #include <algorithm>
 

+ 10 - 10
panda/src/express/pointerTo.I

@@ -47,7 +47,7 @@ PointerTo(const PointerTo<T> &copy) :
 template<class T>
 INLINE TYPENAME PointerTo<T>::To &PointerTo<T>::
 operator *() const {
-  return *((To *)_void_ptr);
+  return *((To *)(this->_void_ptr));
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -58,7 +58,7 @@ operator *() const {
 template<class T>
 INLINE TYPENAME PointerTo<T>::To *PointerTo<T>::
 operator -> () const {
-  return (To *)_void_ptr;
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -74,7 +74,7 @@ operator -> () const {
 template<class T>
 INLINE PointerTo<T>::
 operator TYPENAME PointerToBase<T>::To *() const {
-  return (To *)_void_ptr;
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -87,7 +87,7 @@ operator TYPENAME PointerToBase<T>::To *() const {
 template<class T>
 INLINE TYPENAME PointerTo<T>::To *PointerTo<T>::
 p() const {
-  return (To *)_void_ptr;
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -121,8 +121,8 @@ operator = (const PointerTo<T> &copy) {
 ////////////////////////////////////////////////////////////////////
 template<class T>
 INLINE ConstPointerTo<T>::
-ConstPointerTo(const To *ptr) :
-  PointerToBase<T>((ConstPointerTo<T>::To *)ptr)
+ConstPointerTo(const TYPENAME ConstPointerTo<T>::To *ptr) :
+  PointerToBase<T>((TYPENAME ConstPointerTo<T>::To *)ptr)
 {
 }
 
@@ -158,7 +158,7 @@ ConstPointerTo(const ConstPointerTo<T> &copy) :
 template<class T>
 INLINE const TYPENAME ConstPointerTo<T>::To &ConstPointerTo<T>::
 operator *() const {
-  return *((To *)_void_ptr);
+  return *((To *)(this->_void_ptr));
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -169,7 +169,7 @@ operator *() const {
 template<class T>
 INLINE const TYPENAME ConstPointerTo<T>::To *ConstPointerTo<T>::
 operator -> () const {
-  return (To *)_void_ptr;
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -186,7 +186,7 @@ operator -> () const {
 template<class T>
 INLINE ConstPointerTo<T>::
 operator const TYPENAME PointerToBase<T>::To *() const {
-  return (To *)_void_ptr;
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -199,7 +199,7 @@ operator const TYPENAME PointerToBase<T>::To *() const {
 template<class T>
 INLINE const TYPENAME ConstPointerTo<T>::To *ConstPointerTo<T>::
 p() const {
-  return (To *)_void_ptr;
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////

+ 94 - 94
panda/src/express/pointerToArray.I

@@ -53,7 +53,7 @@ template<class Element>
 INLINE PointerToArray<Element>::
 PointerToArray(size_type n, const Element &value) :
   PointerToBase<RefCountObj<pvector<Element> > >(new RefCountObj<pvector<Element> >) {
-  ((To *)_void_ptr)->reserve(n);
+  ((To *)(this->_void_ptr))->reserve(n);
   insert(begin(), n, value);
 }
 
@@ -77,10 +77,10 @@ PointerToArray(const PointerToArray<Element> &copy) :
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::iterator PointerToArray<Element>::
 begin() const {
-  if (_void_ptr == NULL) {
+  if ((this->_void_ptr) == NULL) {
     return _empty_array.begin();
   }
-  return ((To *)_void_ptr)->begin();
+  return ((To *)(this->_void_ptr))->begin();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -91,10 +91,10 @@ begin() const {
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::iterator PointerToArray<Element>::
 end() const {
-  if (_void_ptr == NULL) {
+  if ((this->_void_ptr) == NULL) {
     return _empty_array.begin();
   }
-  return ((To *)_void_ptr)->end();
+  return ((To *)(this->_void_ptr))->end();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -105,10 +105,10 @@ end() const {
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::reverse_iterator PointerToArray<Element>::
 rbegin() const {
-  if (_void_ptr == NULL) {
+  if ((this->_void_ptr) == NULL) {
     return _empty_array.rbegin();
   }
-  return ((To *)_void_ptr)->rbegin();
+  return ((To *)(this->_void_ptr))->rbegin();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -119,10 +119,10 @@ rbegin() const {
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::reverse_iterator PointerToArray<Element>::
 rend() const {
-  if (_void_ptr == NULL) {
+  if ((this->_void_ptr) == NULL) {
     return _empty_array.rbegin();
   }
-  return ((To *)_void_ptr)->rend();
+  return ((To *)(this->_void_ptr))->rend();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -133,7 +133,7 @@ rend() const {
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::size_type PointerToArray<Element>::
 size() const {
-  return (_void_ptr == NULL) ? 0 : ((To *)_void_ptr)->size();
+  return ((this->_void_ptr) == NULL) ? 0 : ((To *)(this->_void_ptr))->size();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -144,10 +144,10 @@ size() const {
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::size_type PointerToArray<Element>::
 max_size() const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  return ((To *)_void_ptr)->max_size();
+  return ((To *)(this->_void_ptr))->max_size();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -158,7 +158,7 @@ max_size() const {
 template<class Element>
 INLINE bool PointerToArray<Element>::
 empty() const {
-  return (_void_ptr == NULL) ? true : ((To *)_void_ptr)->empty();
+  return ((this->_void_ptr) == NULL) ? true : ((To *)(this->_void_ptr))->empty();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -169,10 +169,10 @@ empty() const {
 template<class Element>
 INLINE void PointerToArray<Element>::
 reserve(TYPENAME PointerToArray<Element>::size_type n) {
-  if (_void_ptr == NULL) {
+  if ((this->_void_ptr) == NULL) {
     reassign(new RefCountObj<pvector<Element> >);
   }
-  ((To *)_void_ptr)->reserve(n);
+  ((To *)(this->_void_ptr))->reserve(n);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -183,8 +183,8 @@ reserve(TYPENAME PointerToArray<Element>::size_type n) {
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::size_type PointerToArray<Element>::
 capacity() const {
-  nassertr(_void_ptr != NULL, 0);
-  return ((To *)_void_ptr)->capacity();
+  nassertr((this->_void_ptr) != NULL, 0);
+  return ((To *)(this->_void_ptr))->capacity();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -195,13 +195,13 @@ capacity() const {
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::reference PointerToArray<Element>::
 front() const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  nassertd(!((To *)_void_ptr)->empty()) {
-    ((To *)_void_ptr)->push_back(Element());
+  nassertd(!((To *)(this->_void_ptr))->empty()) {
+    ((To *)(this->_void_ptr))->push_back(Element());
   }
-  return ((To *)_void_ptr)->front();
+  return ((To *)(this->_void_ptr))->front();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -212,13 +212,13 @@ front() const {
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::reference PointerToArray<Element>::
 back() const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  nassertd(!((To *)_void_ptr)->empty()) {
-    ((To *)_void_ptr)->push_back(Element());
+  nassertd(!((To *)(this->_void_ptr))->empty()) {
+    ((To *)(this->_void_ptr))->push_back(Element());
   }
-  return ((To *)_void_ptr)->back();
+  return ((To *)(this->_void_ptr))->back();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -229,10 +229,10 @@ back() const {
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::iterator PointerToArray<Element>::
 insert(iterator position, const Element &x) const {
-  nassertr(_void_ptr != NULL, position);
-  nassertr(position >= ((To *)_void_ptr)->begin() &&
-           position <= ((To *)_void_ptr)->end(), position);
-  return ((To *)_void_ptr)->insert(position, x);
+  nassertr((this->_void_ptr) != NULL, position);
+  nassertr(position >= ((To *)(this->_void_ptr))->begin() &&
+           position <= ((To *)(this->_void_ptr))->end(), position);
+  return ((To *)(this->_void_ptr))->insert(position, x);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -243,10 +243,10 @@ insert(iterator position, const Element &x) const {
 template<class Element>
 INLINE void PointerToArray<Element>::
 insert(iterator position, size_type n, const Element &x) const {
-  nassertv(_void_ptr != NULL);
-  nassertv(position >= ((To *)_void_ptr)->begin() &&
-           position <= ((To *)_void_ptr)->end());
-  ((To *)_void_ptr)->insert(position, n, x);
+  nassertv((this->_void_ptr) != NULL);
+  nassertv(position >= ((To *)(this->_void_ptr))->begin() &&
+           position <= ((To *)(this->_void_ptr))->end());
+  ((To *)(this->_void_ptr))->insert(position, n, x);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -257,12 +257,12 @@ insert(iterator position, size_type n, const Element &x) const {
 template<class Element>
 INLINE void PointerToArray<Element>::
 erase(iterator position) const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  nassertv(position >= ((To *)_void_ptr)->begin() &&
-           position <= ((To *)_void_ptr)->end());
-  ((To *)_void_ptr)->erase(position);
+  nassertv(position >= ((To *)(this->_void_ptr))->begin() &&
+           position <= ((To *)(this->_void_ptr))->end());
+  ((To *)(this->_void_ptr))->erase(position);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -273,12 +273,12 @@ erase(iterator position) const {
 template<class Element>
 INLINE void PointerToArray<Element>::
 erase(iterator first, iterator last) const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  nassertv(first >= ((To *)_void_ptr)->begin() && first <= ((To *)_void_ptr)->end());
-  nassertv(last >= ((To *)_void_ptr)->begin() && last <= ((To *)_void_ptr)->end());
-  ((To *)_void_ptr)->erase(first, last);
+  nassertv(first >= ((To *)(this->_void_ptr))->begin() && first <= ((To *)(this->_void_ptr))->end());
+  nassertv(last >= ((To *)(this->_void_ptr))->begin() && last <= ((To *)(this->_void_ptr))->end());
+  ((To *)(this->_void_ptr))->erase(first, last);
 }
 
 #if !defined(WIN32_VC)
@@ -290,14 +290,14 @@ erase(iterator first, iterator last) const {
 template<class Element>
 INLINE TYPENAME PointerToArray<Element>::reference PointerToArray<Element>::
 operator [](size_type n) const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  nassertd(!((To *)_void_ptr)->empty()) {
-    ((To *)_void_ptr)->push_back(Element());
+  nassertd(!((To *)(this->_void_ptr))->empty()) {
+    ((To *)(this->_void_ptr))->push_back(Element());
   }
-  nassertr(n < ((To *)_void_ptr)->size(), ((To *)_void_ptr)->operator[](0));
-  return ((To *)_void_ptr)->operator[](n);
+  nassertr(n < ((To *)(this->_void_ptr))->size(), ((To *)(this->_void_ptr))->operator[](0));
+  return ((To *)(this->_void_ptr))->operator[](n);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -339,7 +339,7 @@ get_element(size_type n) const {
 template<class Element>
 INLINE void PointerToArray<Element>::
 set_element(size_type n, const Element &value) {
-  nassertv(n < ((To *)_void_ptr)->size());
+  nassertv(n < ((To *)(this->_void_ptr))->size());
   (*this)[n] = value;
 }
 
@@ -351,10 +351,10 @@ set_element(size_type n, const Element &value) {
 template<class Element>
 INLINE void PointerToArray<Element>::
 push_back(const Element &x) {
-  if (_void_ptr == NULL) {
+  if ((this->_void_ptr) == NULL) {
     reassign(new RefCountObj<pvector<Element> >);
   }
-  ((To *)_void_ptr)->push_back(x);
+  ((To *)(this->_void_ptr))->push_back(x);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -365,11 +365,11 @@ push_back(const Element &x) {
 template<class Element>
 INLINE void PointerToArray<Element>::
 pop_back() {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  nassertv(!((To *)_void_ptr)->empty());
-  ((To *)_void_ptr)->pop_back();
+  nassertv(!((To *)(this->_void_ptr))->empty());
+  ((To *)(this->_void_ptr))->pop_back();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -382,11 +382,11 @@ pop_back() {
 template<class Element>
 INLINE void PointerToArray<Element>::
 make_empty() {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  nassertv(!((To *)_void_ptr)->empty());
-  ((To *)_void_ptr)->clear();
+  nassertv(!((To *)(this->_void_ptr))->empty());
+  ((To *)(this->_void_ptr))->clear();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -401,7 +401,7 @@ make_empty() {
 template<class Element>
 INLINE PointerToArray<Element>::
 operator Element *() const {
-  return (_void_ptr == NULL) ? (Element *)NULL : &(((To *)_void_ptr)->front());
+  return ((this->_void_ptr) == NULL) ? (Element *)NULL : &(((To *)(this->_void_ptr))->front());
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -414,7 +414,7 @@ operator Element *() const {
 template<class Element>
 INLINE Element *PointerToArray<Element>::
 p() const {
-  return (_void_ptr == NULL) ? (Element *)NULL : &(((To *)_void_ptr)->front());
+  return ((this->_void_ptr) == NULL) ? (Element *)NULL : &(((To *)(this->_void_ptr))->front());
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -426,14 +426,14 @@ p() const {
 template<class Element>
 INLINE pvector<Element> &PointerToArray<Element>::
 v() const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  return *((To *)_void_ptr);
+  return *((To *)(this->_void_ptr));
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: PointerToArray::get_void_ptr
+//     Function: PointerToArray::get(this->_void_ptr)
 //       Access: Public
 //  Description: Returns the reference to memory where the vector
 //               is stored.  To be used only with set_void_ptr
@@ -441,7 +441,7 @@ v() const {
 template<class Element>
 INLINE void *PointerToArray<Element>::
 get_void_ptr() const {
-  return _void_ptr;
+  return (this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -463,7 +463,7 @@ set_void_ptr(void *p) {
 template<class Element>
 INLINE int PointerToArray<Element>::
 get_ref_count() const {
-  return (_void_ptr == NULL) ? 0 : ((To *)_void_ptr)->get_ref_count();
+  return ((this->_void_ptr) == NULL) ? 0 : ((To *)(this->_void_ptr))->get_ref_count();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -549,10 +549,10 @@ ConstPointerToArray(const ConstPointerToArray<Element> &copy) :
 template<class Element>
 INLINE TYPENAME ConstPointerToArray<Element>::iterator ConstPointerToArray<Element>::
 begin() const {
-  if (_void_ptr == NULL) {
+  if ((this->_void_ptr) == NULL) {
     return _empty_array.begin();
   }
-  return ((To *)_void_ptr)->begin();
+  return ((To *)(this->_void_ptr))->begin();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -563,10 +563,10 @@ begin() const {
 template<class Element>
 INLINE TYPENAME ConstPointerToArray<Element>::iterator ConstPointerToArray<Element>::
 end() const {
-  if (_void_ptr == NULL) {
+  if ((this->_void_ptr) == NULL) {
     return _empty_array.begin();
   }
-  return ((To *)_void_ptr)->end();
+  return ((To *)(this->_void_ptr))->end();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -577,10 +577,10 @@ end() const {
 template<class Element>
 INLINE TYPENAME ConstPointerToArray<Element>::reverse_iterator ConstPointerToArray<Element>::
 rbegin() const {
-  if (_void_ptr == NULL) {
+  if ((this->_void_ptr) == NULL) {
     return _empty_array.rbegin();
   }
-  return ((To *)_void_ptr)->rbegin();
+  return ((To *)(this->_void_ptr))->rbegin();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -591,10 +591,10 @@ rbegin() const {
 template<class Element>
 INLINE TYPENAME ConstPointerToArray<Element>::reverse_iterator ConstPointerToArray<Element>::
 rend() const {
-  if (_void_ptr == NULL) {
+  if ((this->_void_ptr) == NULL) {
     return _empty_array.rbegin();
   }
-  return ((To *)_void_ptr)->rend();
+  return ((To *)(this->_void_ptr))->rend();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -605,7 +605,7 @@ rend() const {
 template<class Element>
 INLINE TYPENAME ConstPointerToArray<Element>::size_type ConstPointerToArray<Element>::
 size() const {
-  return (_void_ptr == NULL) ? 0 : ((To *)_void_ptr)->size();
+  return ((this->_void_ptr) == NULL) ? 0 : ((To *)(this->_void_ptr))->size();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -616,10 +616,10 @@ size() const {
 template<class Element>
 INLINE TYPENAME ConstPointerToArray<Element>::size_type ConstPointerToArray<Element>::
 max_size() const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  return ((To *)_void_ptr)->max_size();
+  return ((To *)(this->_void_ptr))->max_size();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -630,7 +630,7 @@ max_size() const {
 template<class Element>
 INLINE bool ConstPointerToArray<Element>::
 empty() const {
-  return (_void_ptr == NULL) ? true : ((To *)_void_ptr)->empty();
+  return ((this->_void_ptr) == NULL) ? true : ((To *)(this->_void_ptr))->empty();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -641,10 +641,10 @@ empty() const {
 template<class Element>
 INLINE TYPENAME ConstPointerToArray<Element>::size_type ConstPointerToArray<Element>::
 capacity() const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  return ((To *)_void_ptr)->capacity();
+  return ((To *)(this->_void_ptr))->capacity();
 }
 
 #ifndef WIN32_VC
@@ -656,14 +656,14 @@ capacity() const {
 template<class Element>
 INLINE TYPENAME ConstPointerToArray<Element>::reference ConstPointerToArray<Element>::
 operator [](size_type n) const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  nassertd(!((To *)_void_ptr)->empty()) {
-    ((To *)_void_ptr)->push_back(Element());
+  nassertd(!((To *)(this->_void_ptr))->empty()) {
+    ((To *)(this->_void_ptr))->push_back(Element());
   }
-  nassertr(n < ((To *)_void_ptr)->size(), ((To *)_void_ptr)->operator[](0));
-  return ((To *)_void_ptr)->operator[](n);
+  nassertr(n < ((To *)(this->_void_ptr))->size(), ((To *)(this->_void_ptr))->operator[](0));
+  return ((To *)(this->_void_ptr))->operator[](n);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -686,13 +686,13 @@ operator [](int n) const {
 template<class Element>
 INLINE TYPENAME ConstPointerToArray<Element>::reference ConstPointerToArray<Element>::
 front() const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  nassertd(!((To *)_void_ptr)->empty()) {
-    ((To *)_void_ptr)->push_back(Element());
+  nassertd(!((To *)(this->_void_ptr))->empty()) {
+    ((To *)(this->_void_ptr))->push_back(Element());
   }
-  return ((To *)_void_ptr)->front();
+  return ((To *)(this->_void_ptr))->front();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -703,13 +703,13 @@ front() const {
 template<class Element>
 INLINE TYPENAME ConstPointerToArray<Element>::reference ConstPointerToArray<Element>::
 back() const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  nassertd(!((To *)_void_ptr)->empty()) {
-    ((To *)_void_ptr)->push_back(Element());
+  nassertd(!((To *)(this->_void_ptr))->empty()) {
+    ((To *)(this->_void_ptr))->push_back(Element());
   }
-  return ((To *)_void_ptr)->back();
+  return ((To *)(this->_void_ptr))->back();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -724,7 +724,7 @@ back() const {
 template<class Element>
 INLINE ConstPointerToArray<Element>::
 operator const Element *() const {
-  return (_void_ptr == NULL) ? (const Element *)NULL : &(((To *)_void_ptr)->front());
+  return ((this->_void_ptr) == NULL) ? (const Element *)NULL : &(((To *)(this->_void_ptr))->front());
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -737,7 +737,7 @@ operator const Element *() const {
 template<class Element>
 INLINE const Element *ConstPointerToArray<Element>::
 p() const {
-  return (_void_ptr == NULL) ? (const Element *)NULL : &(((To *)_void_ptr)->front());
+  return ((this->_void_ptr) == NULL) ? (const Element *)NULL : &(((To *)(this->_void_ptr))->front());
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -749,10 +749,10 @@ p() const {
 template<class Element>
 INLINE const pvector<Element> &ConstPointerToArray<Element>::
 v() const {
-  nassertd(_void_ptr != NULL) {
+  nassertd((this->_void_ptr) != NULL) {
     ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
   }
-  return *(To *)_void_ptr;
+  return *(To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -763,7 +763,7 @@ v() const {
 template<class Element>
 INLINE int ConstPointerToArray<Element>::
 get_ref_count() const {
-  return (_void_ptr == NULL) ? 0 : ((To *)_void_ptr)->get_ref_count();
+  return ((this->_void_ptr) == NULL) ? 0 : ((To *)(this->_void_ptr))->get_ref_count();
 }
 
 ////////////////////////////////////////////////////////////////////

+ 18 - 18
panda/src/express/weakPointerTo.I

@@ -59,8 +59,8 @@ WeakPointerTo(const WeakPointerTo<T> &copy) :
 template<class T>
 INLINE TYPENAME WeakPointerTo<T>::To &WeakPointerTo<T>::
 operator *() const {
-  nassertr(!was_deleted(), *((To *)NULL));
-  return *((To *)_void_ptr);
+  nassertr(!is_null(), *((To *)NULL));
+  return *((To *)(this->_void_ptr));
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -71,8 +71,8 @@ operator *() const {
 template<class T>
 INLINE TYPENAME WeakPointerTo<T>::To *WeakPointerTo<T>::
 operator -> () const {
-  nassertr(!was_deleted(), (To *)NULL);
-  return (To *)_void_ptr;
+  nassertr(!is_null(), (To *)NULL);
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -88,8 +88,8 @@ operator -> () const {
 template<class T>
 INLINE WeakPointerTo<T>::
 operator TYPENAME WeakPointerToBase<T>::To *() const {
-  nassertr(!was_deleted(), (To *)NULL);
-  return (To *)_void_ptr;
+  nassertr(!is_null(), (To *)NULL);
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -102,8 +102,8 @@ operator TYPENAME WeakPointerToBase<T>::To *() const {
 template<class T>
 INLINE TYPENAME WeakPointerTo<T>::To *WeakPointerTo<T>::
 p() const {
-  nassertr(!was_deleted(), (To *)NULL);
-  return (To *)_void_ptr;
+  nassertr(!is_null(), (To *)NULL);
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -149,8 +149,8 @@ operator = (const WeakPointerTo<T> &copy) {
 ////////////////////////////////////////////////////////////////////
 template<class T>
 INLINE WeakConstPointerTo<T>::
-WeakConstPointerTo(const To *ptr) :
-  WeakPointerToBase<T>((WeakConstPointerTo<T>::To *)ptr)
+WeakConstPointerTo(const TYPENAME WeakConstPointerTo<T>::To *ptr) :
+  WeakPointerToBase<T>((TYPENAME WeakConstPointerTo<T>::To *)ptr)
 {
 }
 
@@ -210,8 +210,8 @@ WeakConstPointerTo(const WeakConstPointerTo<T> &copy) :
 template<class T>
 INLINE const TYPENAME WeakConstPointerTo<T>::To &WeakConstPointerTo<T>::
 operator *() const {
-  nassertr(!was_deleted(), *((To *)NULL));
-  return *((To *)_void_ptr);
+  nassertr(!is_null(), *((To *)NULL));
+  return *((To *)(this->_void_ptr));
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -222,8 +222,8 @@ operator *() const {
 template<class T>
 INLINE const TYPENAME WeakConstPointerTo<T>::To *WeakConstPointerTo<T>::
 operator -> () const {
-  nassertr(!was_deleted(), (To *)NULL);
-  return (To *)_void_ptr;
+  nassertr(!is_null(), (To *)NULL);
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -240,8 +240,8 @@ operator -> () const {
 template<class T>
 INLINE WeakConstPointerTo<T>::
 operator const TYPENAME WeakPointerToBase<T>::To *() const {
-  nassertr(!was_deleted(), (To *)NULL);
-  return (To *)_void_ptr;
+  nassertr(!is_null(), (To *)NULL);
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -254,8 +254,8 @@ operator const TYPENAME WeakPointerToBase<T>::To *() const {
 template<class T>
 INLINE const TYPENAME WeakConstPointerTo<T>::To *WeakConstPointerTo<T>::
 p() const {
-  nassertr(!was_deleted(), (To *)NULL);
-  return (To *)_void_ptr;
+  nassertr(!is_null(), (To *)NULL);
+  return (To *)(this->_void_ptr);
 }
 
 ////////////////////////////////////////////////////////////////////

+ 12 - 0
panda/src/glxdisplay/glxGraphicsPipe.h

@@ -53,6 +53,18 @@ typedef int XIC;
 // below.
 #include "glxext.h"
 
+// drose: the version of GL/glx.h that ships with Fedora Core 2 seems
+// to define GLX_VERSION_1_4, but for some reason does not define
+// GLX_SAMPLE_BUFFERS or GLX_SAMPLES.  We work around that here.
+
+#ifndef GLX_SAMPLE_BUFFERS
+#define GLX_SAMPLE_BUFFERS                 100000
+#endif
+#ifndef GLX_SAMPLES
+#define GLX_SAMPLES                        100001
+#endif
+
+
 #if !defined(HAVE_GLXFBCONFIG) && defined(GLX_SGIX_fbconfig) && defined(GLX_SGIX_pbuffer)
   // If the system glx version isn't 1.3, but these were defined as
   // extensions, we can work with that.

+ 11 - 0
panda/src/glxdisplay/glxGraphicsStateGuardian.h

@@ -30,6 +30,17 @@
 // includes gl.h).
 #include "glxext.h"
 
+// drose: the version of GL/glx.h that ships with Fedora Core 2 seems
+// to define GLX_VERSION_1_4, but for some reason does not define
+// GLX_SAMPLE_BUFFERS or GLX_SAMPLES.  We work around that here.
+
+#ifndef GLX_SAMPLE_BUFFERS
+#define GLX_SAMPLE_BUFFERS                 100000
+#endif
+#ifndef GLX_SAMPLES
+#define GLX_SAMPLES                        100001
+#endif
+
 // These typedefs are declared in glxext.h, but we must repeat them
 // here, mainly because they will not be included from glxext.h if the
 // system GLX version matches or exceeds the GLX version in which

+ 1 - 1
panda/src/lerp/lerpfunctor.h

@@ -283,7 +283,7 @@ SimpleQueryLerpFunctor<value>::operator=(const SimpleQueryLerpFunctor& c) {
 
 template <class value>
 void SimpleQueryLerpFunctor<value>::operator()(float t) {
-  _save = interpolate(t);
+  _save = this->interpolate(t);
 }
 
 template <class value>

+ 10 - 24
panda/src/pgraph/texGenAttrib.cxx

@@ -258,8 +258,6 @@ compose_impl(const RenderAttrib *other) const {
   // when a stage is in both attribs, we compose the stages.
 
   TexGenAttrib *attrib = new TexGenAttrib;
-  insert_iterator<Stages> result = 
-    inserter(attrib->_stages, attrib->_stages.end());
 
   Stages::const_iterator ai, bi;
   ai = _stages.begin();
@@ -267,37 +265,32 @@ compose_impl(const RenderAttrib *other) const {
   while (ai != _stages.end() && bi != ta->_stages.end()) {
     if ((*ai).first < (*bi).first) {
       // This stage is in a but not in b.
-      *result = *ai;
+      attrib->_stages.insert(attrib->_stages.end(), *ai);
       ++ai;
-      ++result;
 
     } else if ((*bi).first < (*ai).first) {
       // This stage is in b but not in a.
-      *result = *bi;
+      attrib->_stages.insert(attrib->_stages.end(), *bi);
       ++bi;
-      ++result;
 
     } else {
       // This stage is in both; b wins.
-      *result = *bi;
+      attrib->_stages.insert(attrib->_stages.end(), *bi);
       ++bi;
       ++ai;
-      ++result;
     }
   }
 
   while (ai != _stages.end()) {
     // This stage is in a but not in b.
-    *result = *ai;
+    attrib->_stages.insert(attrib->_stages.end(), *ai);
     ++ai;
-    ++result;
   }
 
   while (bi != ta->_stages.end()) {
     // This stage is in b but not in a.
-    *result = *bi;
+    attrib->_stages.insert(attrib->_stages.end(), *bi);
     ++bi;
-    ++result;
   }
 
   // Now copy from _stages to _no_texcoords.
@@ -329,8 +322,6 @@ invert_compose_impl(const RenderAttrib *other) const {
   // we invert the ai stages.
 
   TexGenAttrib *attrib = new TexGenAttrib;
-  insert_iterator<Stages> result = 
-    inserter(attrib->_stages, attrib->_stages.end());
 
   Stages::const_iterator ai, bi;
   ai = _stages.begin();
@@ -338,37 +329,32 @@ invert_compose_impl(const RenderAttrib *other) const {
   while (ai != _stages.end() && bi != ta->_stages.end()) {
     if ((*ai).first < (*bi).first) {
       // This stage is in a but not in b.  Turn a off.
-      *result = Stages::value_type((*ai).first, M_off);
+      attrib->_stages.insert(attrib->_stages.end(), Stages::value_type((*ai).first, M_off));
       ++ai;
-      ++result;
 
     } else if ((*bi).first < (*ai).first) {
       // This stage is in b but not in a.
-      *result = *bi;
+      attrib->_stages.insert(attrib->_stages.end(), *bi);
       ++bi;
-      ++result;
 
     } else {
       // This stage is in both; b wins.
-      *result = *bi;
+      attrib->_stages.insert(attrib->_stages.end(), *bi);
       ++bi;
       ++ai;
-      ++result;
     }
   }
 
   while (ai != _stages.end()) {
     // This stage is in a but not in b.
-    *result = Stages::value_type((*ai).first, M_off);
+    attrib->_stages.insert(attrib->_stages.end(), Stages::value_type((*ai).first, M_off));
     ++ai;
-    ++result;
   }
 
   while (bi != ta->_stages.end()) {
     // This stage is in b but not in a.
-    *result = *bi;
+    attrib->_stages.insert(attrib->_stages.end(), *bi);
     ++bi;
-    ++result;
   }
 
   // Now copy from _stages to _no_texcoords.

+ 10 - 24
panda/src/pgraph/texMatrixAttrib.cxx

@@ -333,8 +333,6 @@ compose_impl(const RenderAttrib *other) const {
   // when a stage is in both attribs, we compose the stages.
 
   TexMatrixAttrib *attrib = new TexMatrixAttrib;
-  insert_iterator<Stages> result = 
-    inserter(attrib->_stages, attrib->_stages.end());
 
   Stages::const_iterator ai, bi;
   ai = _stages.begin();
@@ -342,38 +340,33 @@ compose_impl(const RenderAttrib *other) const {
   while (ai != _stages.end() && bi != ta->_stages.end()) {
     if ((*ai).first < (*bi).first) {
       // This stage is in a but not in b.
-      *result = *ai;
+      attrib->_stages.insert(attrib->_stages.end(), *ai);
       ++ai;
-      ++result;
 
     } else if ((*bi).first < (*ai).first) {
       // This stage is in b but not in a.
-      *result = *bi;
+      attrib->_stages.insert(attrib->_stages.end(), *bi);
       ++bi;
-      ++result;
 
     } else {
       // This stage is in both; compose the stages.
       CPT(TransformState) new_transform = (*ai).second->compose((*bi).second);
-      *result = Stages::value_type((*ai).first, new_transform);
+      attrib->_stages.insert(attrib->_stages.end(), Stages::value_type((*ai).first, new_transform));
       ++ai;
       ++bi;
-      ++result;
     }
   }
 
   while (ai != _stages.end()) {
     // This stage is in a but not in b.
-    *result = *ai;
+    attrib->_stages.insert(attrib->_stages.end(), *ai);
     ++ai;
-    ++result;
   }
 
   while (bi != ta->_stages.end()) {
     // This stage is in b but not in a.
-    *result = *bi;
+    attrib->_stages.insert(attrib->_stages.end(), *bi);
     ++bi;
-    ++result;
   }
 
   return return_new(attrib);
@@ -397,8 +390,6 @@ invert_compose_impl(const RenderAttrib *other) const {
   // we invert the ai stages.
 
   TexMatrixAttrib *attrib = new TexMatrixAttrib;
-  insert_iterator<Stages> result = 
-    inserter(attrib->_stages, attrib->_stages.end());
 
   Stages::const_iterator ai, bi;
   ai = _stages.begin();
@@ -408,24 +399,21 @@ invert_compose_impl(const RenderAttrib *other) const {
       // This stage is in a but not in b.
       CPT(TransformState) inv_a = 
         (*ai).second->invert_compose(TransformState::make_identity());
-      *result = Stages::value_type((*ai).first, inv_a);
+      attrib->_stages.insert(attrib->_stages.end(), Stages::value_type((*ai).first, inv_a));
       ++ai;
-      ++result;
 
     } else if ((*bi).first < (*ai).first) {
       // This stage is in b but not in a.
-      *result = *bi;
+      attrib->_stages.insert(attrib->_stages.end(), *bi);
       ++bi;
-      ++result;
 
     } else {
       // This stage is in both; compose the stages.
       CPT(TransformState) new_transform = 
         (*ai).second->invert_compose((*bi).second);
-      *result = Stages::value_type((*ai).first, new_transform);
+      attrib->_stages.insert(attrib->_stages.end(), Stages::value_type((*ai).first, new_transform));
       ++ai;
       ++bi;
-      ++result;
     }
   }
 
@@ -433,16 +421,14 @@ invert_compose_impl(const RenderAttrib *other) const {
     // This stage is in a but not in b.
     CPT(TransformState) inv_a = 
       (*ai).second->invert_compose(TransformState::make_identity());
-    *result = Stages::value_type((*ai).first, inv_a);
+    attrib->_stages.insert(attrib->_stages.end(), Stages::value_type((*ai).first, inv_a));
     ++ai;
-    ++result;
   }
 
   while (bi != ta->_stages.end()) {
     // This stage is in b but not in a.
-    *result = *bi;
+    attrib->_stages.insert(attrib->_stages.end(), *bi);
     ++bi;
-    ++result;
   }
 
   return return_new(attrib);

+ 9 - 20
panda/src/pgraph/textureAttrib.cxx

@@ -498,8 +498,6 @@ compose_impl(const RenderAttrib *other) const {
 
   // Create a new TextureAttrib that will hold the result.
   TextureAttrib *new_attrib = new TextureAttrib;
-  insert_iterator<OnTextures> result = 
-    inserter(new_attrib->_on_textures, new_attrib->_on_textures.end());
 
   while (ai != _on_textures.end() && 
          bi != ta->_on_textures.end() && 
@@ -508,10 +506,9 @@ compose_impl(const RenderAttrib *other) const {
       if ((*ai).first < (*ci)) {
         // Here is a stage that we have in the original, which is not
         // present in the secondary.
-        *result = *ai;
+	new_attrib->_on_textures.insert(new_attrib->_on_textures.end(), *ai);
         new_attrib->_on_stages.push_back((*ai).first);
         ++ai;
-        ++result;
 
       } else if ((*ci) < (*ai).first) {
         // Here is a stage that is turned off in the secondary, but
@@ -528,18 +525,16 @@ compose_impl(const RenderAttrib *other) const {
     } else if ((*bi).first < (*ai).first) {
       // Here is a new stage we have in the secondary, that was not
       // present in the original.
-      *result = *bi;
+      new_attrib->_on_textures.insert(new_attrib->_on_textures.end(), *bi);
       new_attrib->_on_stages.push_back((*bi).first);
       ++bi;
-      ++result;
 
     } else {  // (*bi).first == (*ai).first
       // Here is a stage we have in both.
-      *result = *bi;
+      new_attrib->_on_textures.insert(new_attrib->_on_textures.end(), *bi);
       new_attrib->_on_stages.push_back((*ai).first);
       ++ai;
       ++bi;
-      ++result;
     }
   }
 
@@ -547,26 +542,23 @@ compose_impl(const RenderAttrib *other) const {
     if ((*ai).first < (*bi).first) {
       // Here is a stage that we have in the original, which is not
       // present in the secondary.
-      *result = *ai;
+      new_attrib->_on_textures.insert(new_attrib->_on_textures.end(), *ai);
       new_attrib->_on_stages.push_back((*ai).first);
       ++ai;
-      ++result;
 
     } else if ((*bi).first < (*ai).first) {
       // Here is a new stage we have in the secondary, that was not
       // present in the original.
-      *result = *bi;
+      new_attrib->_on_textures.insert(new_attrib->_on_textures.end(), *bi);
       new_attrib->_on_stages.push_back((*bi).first);
       ++bi;
-      ++result;
 
     } else {
       // Here is a stage we have in both.
-      *result = *bi;
+      new_attrib->_on_textures.insert(new_attrib->_on_textures.end(), *bi);
       new_attrib->_on_stages.push_back((*ai).first);
       ++ai;
       ++bi;
-      ++result;
     }
   }
 
@@ -574,10 +566,9 @@ compose_impl(const RenderAttrib *other) const {
     if ((*ai).first < (*ci)) {
       // Here is a stage that we have in the original, which is not
       // present in the secondary.
-      *result = *ai;
+      new_attrib->_on_textures.insert(new_attrib->_on_textures.end(), *ai);
       new_attrib->_on_stages.push_back((*ai).first);
       ++ai;
-      ++result;
       
     } else if ((*ci) < (*ai).first) {
       // Here is a stage that is turned off in the secondary, but
@@ -593,17 +584,15 @@ compose_impl(const RenderAttrib *other) const {
   }
 
   while (ai != _on_textures.end()) {
-    *result = *ai;
+    new_attrib->_on_textures.insert(new_attrib->_on_textures.end(), *ai);
     new_attrib->_on_stages.push_back((*ai).first);
     ++ai;
-    ++result;
   }
 
   while (bi != ta->_on_textures.end()) {
-    *result = *bi;
+    new_attrib->_on_textures.insert(new_attrib->_on_textures.end(), *bi);
     new_attrib->_on_stages.push_back((*bi).first);
     ++bi;
-    ++result;
   }
 
   return return_new(new_attrib);