X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=Objects%2Fmaterial.hxx;h=d8b4c9705ef5ead6db28dcaa1a0cac509dc63e79;hb=18b093927f4a72b2e0bd9be8bc29dafa0e8db993;hp=e45b7c1fd53f6e13bb97a65e84b5c926a370a384;hpb=71b78dc87c1ae94c6f01e244aba46c4665b2aed5;p=flightgear.git diff --git a/Objects/material.hxx b/Objects/material.hxx index e45b7c1fd..d8b4c9705 100644 --- a/Objects/material.hxx +++ b/Objects/material.hxx @@ -48,6 +48,7 @@ extern "C" void *memset(void *, int, size_t); #include // Standard C++ string library #include // STL associative "array" +#include // STL "array" #ifdef NEEDNAMESPACESTD using namespace std; @@ -57,7 +58,13 @@ using namespace std; class fgFRAGMENT; -#define FG_MAX_MATERIAL_FRAGS 800 +// convenience types +typedef vector < fgFRAGMENT * > frag_list_type; +typedef frag_list_type::iterator frag_list_iterator; +typedef frag_list_type::const_iterator frag_list_const_iterator; + + +// #define FG_MAX_MATERIAL_FRAGS 800 // Material property class @@ -79,23 +86,26 @@ private: // transient list of objects with this material type (used for sorting // by material to reduce GL state changes when rendering the scene - fgFRAGMENT * list[FG_MAX_MATERIAL_FRAGS]; - size_t list_size; + frag_list_type list; + // size_t list_size; public: // Constructor fgMATERIAL ( void ); - size_t size() const { return list_size; } - bool empty() const { return list_size == 0; } + int size() const { return list.size(); } + bool empty() const { return list.size() == 0; } // Sorting routines void init_sort_list( void ) { - list_size = 0; + list.erase( list.begin(), list.end() ); } - int append_sort_list( fgFRAGMENT *object ); + bool append_sort_list( fgFRAGMENT *object ) { + list.push_back( object ); + return true; + } void render_fragments(); @@ -160,6 +170,9 @@ extern fgMATERIAL_MGR material_mgr; // $Log$ +// Revision 1.5 1998/10/12 23:49:18 curt +// Changes from NHV to make the code more dynamic with fewer hard coded limits. +// // Revision 1.4 1998/09/17 18:35:53 curt // Tweaks and optimizations by Norman Vine. //