X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fmaterial%2Fmat.hxx;h=a32bde3220cd450a9b1bbe22b9d2d31fcad3d1d3;hb=7fc8c026884b2d0a1b683765c089a9bef5ac47c8;hp=c98da2df5091be51a9ba96a830a95448ef2f5097;hpb=f7a3dbc5ed76217e513ca4ab4da4f9ef0470c814;p=simgear.git diff --git a/simgear/scene/material/mat.hxx b/simgear/scene/material/mat.hxx index c98da2df..a32bde32 100644 --- a/simgear/scene/material/mat.hxx +++ b/simgear/scene/material/mat.hxx @@ -4,7 +4,7 @@ // Written by Curtis Olson, started May 1998. // Overhauled by David Megginson, December 2001 // -// Copyright (C) 1998 - 2000 Curtis L. Olson - curt@flightgear.org +// Copyright (C) 1998 - 2000 Curtis L. Olson - http://www.flightgear.org/~curt // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -33,6 +33,7 @@ #include #include STL_STRING // Standard C++ string library +#include #include #include @@ -42,6 +43,7 @@ #include "matmodel.hxx" SG_USING_STD(string); +SG_USING_STD(vector); /** @@ -109,13 +111,19 @@ public: * @return true if the texture loaded, false if it was loaded * already. */ - virtual bool load_texture (); + virtual bool load_texture (int n = -1); /** * Get the textured state. */ - virtual inline ssgSimpleState *get_state () const { return state; } + virtual ssgSimpleState *get_state (int n = -1) const; + + + /** + * Get the number of textures assigned to this material. + */ + virtual inline int get_num() const { return _status.size(); } /** @@ -188,6 +196,15 @@ protected: */ virtual void init(); +protected: + + struct _internal_state { + _internal_state( ssgSimpleState *s, const string &t, bool l ) + : state(s), texture_path(t), texture_loaded(l) {} + ssgSimpleState *state; + string texture_path; + bool texture_loaded; + }; private: @@ -196,11 +213,11 @@ private: // Internal state. //////////////////////////////////////////////////////////////////// - // names - string texture_path; + // texture status + vector<_internal_state> _status; - // pointers to ssg states - ssgSimpleState *state; + // Round-robin counter + unsigned int _current_ptr; // texture size double xsize, ysize; @@ -218,9 +235,6 @@ private: sgVec4 ambient, diffuse, specular, emission; double shininess; - // true if texture loading deferred, and not yet loaded - bool texture_loaded; - vector object_groups; // ref count so we can properly delete if we have multiple