diff --git a/panda/src/audiotraits/fmodAudioManager.cxx b/panda/src/audiotraits/fmodAudioManager.cxx index 7037d76262..933222da58 100644 --- a/panda/src/audiotraits/fmodAudioManager.cxx +++ b/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 \""<first<<"\""); uncache_sound(path); + nassertr(is_valid(), false); + if (_lru.size() < orig_size) return true; } - nassertv(is_valid()); + return false; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/audiotraits/fmodAudioManager.h b/panda/src/audiotraits/fmodAudioManager.h index 68e8e36925..04895bec80 100644 --- a/panda/src/audiotraits/fmodAudioManager.h +++ b/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; diff --git a/panda/src/builder/builderFuncs.I b/panda/src/builder/builderFuncs.I index 1ffe0f064b..518fb33230 100644 --- a/panda/src/builder/builderFuncs.I +++ b/panda/src/builder/builderFuncs.I @@ -22,6 +22,7 @@ #include "config_builder.h" #include "geom.h" #include "geomprimitives.h" +#include "geomNode.h" #include diff --git a/panda/src/builder/builderVertexTempl.I b/panda/src/builder/builderVertexTempl.I index 65e452a6f1..a299447af8 100644 --- a/panda/src/builder/builderVertexTempl.I +++ b/panda/src/builder/builderVertexTempl.I @@ -59,9 +59,9 @@ template INLINE BuilderVertexTempl &BuilderVertexTempl:: operator = (const BuilderVertexTempl ©) { BuilderAttribTempl::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 INLINE bool BuilderVertexTempl:: has_coord() const { - return _flags & BAF_coord; + return (this->_flags) & BAF_coord; } @@ -128,8 +128,8 @@ get_coord() const { template INLINE BuilderVertexTempl &BuilderVertexTempl:: set_coord(const VType &c) { - _flags |= BAF_coord; - _coord = c; + this->_flags |= BAF_coord; + this->_coord = c; return *this; } @@ -408,16 +408,16 @@ template ostream &BuilderVertexTempl:: 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; diff --git a/panda/src/builder/mesherTempl.I b/panda/src/builder/mesherTempl.I index 36df13d974..9078002248 100644 --- a/panda/src/builder/mesherTempl.I +++ b/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; diff --git a/panda/src/downloader/bioPtr.h b/panda/src/downloader/bioPtr.h index 8deba7bbeb..946c3f2521 100644 --- a/panda/src/downloader/bioPtr.h +++ b/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 diff --git a/panda/src/downloader/bioStreamBuf.cxx b/panda/src/downloader/bioStreamBuf.cxx index 26f033933c..1215151f96 100644 --- a/panda/src/downloader/bioStreamBuf.cxx +++ b/panda/src/downloader/bioStreamBuf.cxx @@ -19,6 +19,7 @@ #include "bioStreamBuf.h" #include "config_downloader.h" #include "ssl_utils.h" +#include #ifdef HAVE_SSL diff --git a/panda/src/downloader/bioStreamBuf.h b/panda/src/downloader/bioStreamBuf.h index 5680d7b145..43cae6d08b 100644 --- a/panda/src/downloader/bioStreamBuf.h +++ b/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" diff --git a/panda/src/downloader/bioStreamPtr.h b/panda/src/downloader/bioStreamPtr.h index a20b8d92ca..ca4f871e63 100644 --- a/panda/src/downloader/bioStreamPtr.h +++ b/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" diff --git a/panda/src/downloader/httpChannel.h b/panda/src/downloader/httpChannel.h index 64ca1a2902..3254f4c846 100644 --- a/panda/src/downloader/httpChannel.h +++ b/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; diff --git a/panda/src/downloader/httpClient.h b/panda/src/downloader/httpClient.h index 66d9b3e4e0..ff15955470 100644 --- a/panda/src/downloader/httpClient.h +++ b/panda/src/downloader/httpClient.h @@ -27,6 +27,7 @@ // communications. #ifdef HAVE_SSL +#define OPENSSL_NO_KRB5 #include "urlSpec.h" #include "httpAuthorization.h" diff --git a/panda/src/downloader/ssl_utils.h b/panda/src/downloader/ssl_utils.h index 9218dcbd01..897a9bf928 100644 --- a/panda/src/downloader/ssl_utils.h +++ b/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 diff --git a/panda/src/egg/eggUtilities.I b/panda/src/egg/eggUtilities.I index 593feded96..23a2cff43c 100644 --- a/panda/src/egg/eggUtilities.I +++ b/panda/src/egg/eggUtilities.I @@ -18,6 +18,7 @@ #include "eggGroup.h" #include "eggPrimitive.h" +#include "eggVertexPool.h" #include diff --git a/panda/src/express/pointerTo.I b/panda/src/express/pointerTo.I index c65d12a0c0..3d7d4568cb 100644 --- a/panda/src/express/pointerTo.I +++ b/panda/src/express/pointerTo.I @@ -47,7 +47,7 @@ PointerTo(const PointerTo ©) : template INLINE TYPENAME PointerTo::To &PointerTo:: operator *() const { - return *((To *)_void_ptr); + return *((To *)(this->_void_ptr)); } //////////////////////////////////////////////////////////////////// @@ -58,7 +58,7 @@ operator *() const { template INLINE TYPENAME PointerTo::To *PointerTo:: operator -> () const { - return (To *)_void_ptr; + return (To *)(this->_void_ptr); } //////////////////////////////////////////////////////////////////// @@ -74,7 +74,7 @@ operator -> () const { template INLINE PointerTo:: operator TYPENAME PointerToBase::To *() const { - return (To *)_void_ptr; + return (To *)(this->_void_ptr); } //////////////////////////////////////////////////////////////////// @@ -87,7 +87,7 @@ operator TYPENAME PointerToBase::To *() const { template INLINE TYPENAME PointerTo::To *PointerTo:: p() const { - return (To *)_void_ptr; + return (To *)(this->_void_ptr); } //////////////////////////////////////////////////////////////////// @@ -121,8 +121,8 @@ operator = (const PointerTo ©) { //////////////////////////////////////////////////////////////////// template INLINE ConstPointerTo:: -ConstPointerTo(const To *ptr) : - PointerToBase((ConstPointerTo::To *)ptr) +ConstPointerTo(const TYPENAME ConstPointerTo::To *ptr) : + PointerToBase((TYPENAME ConstPointerTo::To *)ptr) { } @@ -158,7 +158,7 @@ ConstPointerTo(const ConstPointerTo ©) : template INLINE const TYPENAME ConstPointerTo::To &ConstPointerTo:: operator *() const { - return *((To *)_void_ptr); + return *((To *)(this->_void_ptr)); } //////////////////////////////////////////////////////////////////// @@ -169,7 +169,7 @@ operator *() const { template INLINE const TYPENAME ConstPointerTo::To *ConstPointerTo:: operator -> () const { - return (To *)_void_ptr; + return (To *)(this->_void_ptr); } //////////////////////////////////////////////////////////////////// @@ -186,7 +186,7 @@ operator -> () const { template INLINE ConstPointerTo:: operator const TYPENAME PointerToBase::To *() const { - return (To *)_void_ptr; + return (To *)(this->_void_ptr); } //////////////////////////////////////////////////////////////////// @@ -199,7 +199,7 @@ operator const TYPENAME PointerToBase::To *() const { template INLINE const TYPENAME ConstPointerTo::To *ConstPointerTo:: p() const { - return (To *)_void_ptr; + return (To *)(this->_void_ptr); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/express/pointerToArray.I b/panda/src/express/pointerToArray.I index b95630da9b..c4c17fd501 100644 --- a/panda/src/express/pointerToArray.I +++ b/panda/src/express/pointerToArray.I @@ -53,7 +53,7 @@ template INLINE PointerToArray:: PointerToArray(size_type n, const Element &value) : PointerToBase > >(new RefCountObj >) { - ((To *)_void_ptr)->reserve(n); + ((To *)(this->_void_ptr))->reserve(n); insert(begin(), n, value); } @@ -77,10 +77,10 @@ PointerToArray(const PointerToArray ©) : template INLINE TYPENAME PointerToArray::iterator PointerToArray:: 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 INLINE TYPENAME PointerToArray::iterator PointerToArray:: 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 INLINE TYPENAME PointerToArray::reverse_iterator PointerToArray:: 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 INLINE TYPENAME PointerToArray::reverse_iterator PointerToArray:: 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 INLINE TYPENAME PointerToArray::size_type PointerToArray:: 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 INLINE TYPENAME PointerToArray::size_type PointerToArray:: max_size() const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((PointerToArray *)this)->reassign(new RefCountObj >); } - return ((To *)_void_ptr)->max_size(); + return ((To *)(this->_void_ptr))->max_size(); } //////////////////////////////////////////////////////////////////// @@ -158,7 +158,7 @@ max_size() const { template INLINE bool PointerToArray:: 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 INLINE void PointerToArray:: reserve(TYPENAME PointerToArray::size_type n) { - if (_void_ptr == NULL) { + if ((this->_void_ptr) == NULL) { reassign(new RefCountObj >); } - ((To *)_void_ptr)->reserve(n); + ((To *)(this->_void_ptr))->reserve(n); } //////////////////////////////////////////////////////////////////// @@ -183,8 +183,8 @@ reserve(TYPENAME PointerToArray::size_type n) { template INLINE TYPENAME PointerToArray::size_type PointerToArray:: 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 INLINE TYPENAME PointerToArray::reference PointerToArray:: front() const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((PointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE TYPENAME PointerToArray::reference PointerToArray:: back() const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((PointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE TYPENAME PointerToArray::iterator PointerToArray:: 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 INLINE void PointerToArray:: 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 INLINE void PointerToArray:: erase(iterator position) const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((PointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE void PointerToArray:: erase(iterator first, iterator last) const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((PointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE TYPENAME PointerToArray::reference PointerToArray:: operator [](size_type n) const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((PointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE void PointerToArray:: 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 INLINE void PointerToArray:: push_back(const Element &x) { - if (_void_ptr == NULL) { + if ((this->_void_ptr) == NULL) { reassign(new RefCountObj >); } - ((To *)_void_ptr)->push_back(x); + ((To *)(this->_void_ptr))->push_back(x); } //////////////////////////////////////////////////////////////////// @@ -365,11 +365,11 @@ push_back(const Element &x) { template INLINE void PointerToArray:: pop_back() { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((PointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE void PointerToArray:: make_empty() { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((PointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE PointerToArray:: 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 INLINE Element *PointerToArray:: 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 INLINE pvector &PointerToArray:: v() const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((PointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE void *PointerToArray:: get_void_ptr() const { - return _void_ptr; + return (this->_void_ptr); } //////////////////////////////////////////////////////////////////// @@ -463,7 +463,7 @@ set_void_ptr(void *p) { template INLINE int PointerToArray:: 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 ©) : template INLINE TYPENAME ConstPointerToArray::iterator ConstPointerToArray:: 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 INLINE TYPENAME ConstPointerToArray::iterator ConstPointerToArray:: 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 INLINE TYPENAME ConstPointerToArray::reverse_iterator ConstPointerToArray:: 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 INLINE TYPENAME ConstPointerToArray::reverse_iterator ConstPointerToArray:: 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 INLINE TYPENAME ConstPointerToArray::size_type ConstPointerToArray:: 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 INLINE TYPENAME ConstPointerToArray::size_type ConstPointerToArray:: max_size() const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((ConstPointerToArray *)this)->reassign(new RefCountObj >); } - return ((To *)_void_ptr)->max_size(); + return ((To *)(this->_void_ptr))->max_size(); } //////////////////////////////////////////////////////////////////// @@ -630,7 +630,7 @@ max_size() const { template INLINE bool ConstPointerToArray:: 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 INLINE TYPENAME ConstPointerToArray::size_type ConstPointerToArray:: capacity() const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((ConstPointerToArray *)this)->reassign(new RefCountObj >); } - return ((To *)_void_ptr)->capacity(); + return ((To *)(this->_void_ptr))->capacity(); } #ifndef WIN32_VC @@ -656,14 +656,14 @@ capacity() const { template INLINE TYPENAME ConstPointerToArray::reference ConstPointerToArray:: operator [](size_type n) const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((ConstPointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE TYPENAME ConstPointerToArray::reference ConstPointerToArray:: front() const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((ConstPointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE TYPENAME ConstPointerToArray::reference ConstPointerToArray:: back() const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((ConstPointerToArray *)this)->reassign(new RefCountObj >); } - 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 INLINE ConstPointerToArray:: 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 INLINE const Element *ConstPointerToArray:: 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 INLINE const pvector &ConstPointerToArray:: v() const { - nassertd(_void_ptr != NULL) { + nassertd((this->_void_ptr) != NULL) { ((ConstPointerToArray *)this)->reassign(new RefCountObj >); } - return *(To *)_void_ptr; + return *(To *)(this->_void_ptr); } //////////////////////////////////////////////////////////////////// @@ -763,7 +763,7 @@ v() const { template INLINE int ConstPointerToArray:: 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(); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/express/weakPointerTo.I b/panda/src/express/weakPointerTo.I index c40f413521..6593a20879 100644 --- a/panda/src/express/weakPointerTo.I +++ b/panda/src/express/weakPointerTo.I @@ -59,8 +59,8 @@ WeakPointerTo(const WeakPointerTo ©) : template INLINE TYPENAME WeakPointerTo::To &WeakPointerTo:: 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 INLINE TYPENAME WeakPointerTo::To *WeakPointerTo:: 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 INLINE WeakPointerTo:: operator TYPENAME WeakPointerToBase::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::To *() const { template INLINE TYPENAME WeakPointerTo::To *WeakPointerTo:: 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 ©) { //////////////////////////////////////////////////////////////////// template INLINE WeakConstPointerTo:: -WeakConstPointerTo(const To *ptr) : - WeakPointerToBase((WeakConstPointerTo::To *)ptr) +WeakConstPointerTo(const TYPENAME WeakConstPointerTo::To *ptr) : + WeakPointerToBase((TYPENAME WeakConstPointerTo::To *)ptr) { } @@ -210,8 +210,8 @@ WeakConstPointerTo(const WeakConstPointerTo ©) : template INLINE const TYPENAME WeakConstPointerTo::To &WeakConstPointerTo:: 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 INLINE const TYPENAME WeakConstPointerTo::To *WeakConstPointerTo:: 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 INLINE WeakConstPointerTo:: operator const TYPENAME WeakPointerToBase::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::To *() const { template INLINE const TYPENAME WeakConstPointerTo::To *WeakConstPointerTo:: p() const { - nassertr(!was_deleted(), (To *)NULL); - return (To *)_void_ptr; + nassertr(!is_null(), (To *)NULL); + return (To *)(this->_void_ptr); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/glxdisplay/glxGraphicsPipe.h b/panda/src/glxdisplay/glxGraphicsPipe.h index 539f896483..c49111f831 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.h +++ b/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. diff --git a/panda/src/glxdisplay/glxGraphicsStateGuardian.h b/panda/src/glxdisplay/glxGraphicsStateGuardian.h index 78fb11d208..4fc3b550e5 100644 --- a/panda/src/glxdisplay/glxGraphicsStateGuardian.h +++ b/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 diff --git a/panda/src/lerp/lerpfunctor.h b/panda/src/lerp/lerpfunctor.h index 9506732faf..c1c04532ca 100644 --- a/panda/src/lerp/lerpfunctor.h +++ b/panda/src/lerp/lerpfunctor.h @@ -283,7 +283,7 @@ SimpleQueryLerpFunctor::operator=(const SimpleQueryLerpFunctor& c) { template void SimpleQueryLerpFunctor::operator()(float t) { - _save = interpolate(t); + _save = this->interpolate(t); } template diff --git a/panda/src/pgraph/texGenAttrib.cxx b/panda/src/pgraph/texGenAttrib.cxx index 7637c2ab5b..aa805832d9 100755 --- a/panda/src/pgraph/texGenAttrib.cxx +++ b/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 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 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. diff --git a/panda/src/pgraph/texMatrixAttrib.cxx b/panda/src/pgraph/texMatrixAttrib.cxx index 39d3f0805d..91646dcfa9 100644 --- a/panda/src/pgraph/texMatrixAttrib.cxx +++ b/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 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 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); diff --git a/panda/src/pgraph/textureAttrib.cxx b/panda/src/pgraph/textureAttrib.cxx index 086c19dadf..94eb9d7369 100644 --- a/panda/src/pgraph/textureAttrib.cxx +++ b/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 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);