X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fmaterial%2Fmat.hxx;h=a32bde3220cd450a9b1bbe22b9d2d31fcad3d1d3;hb=7fc8c026884b2d0a1b683765c089a9bef5ac47c8;hp=fea29c55807634c892f2dd0eb598f903f6965edd;hpb=1f3947ea4c747c89c03fc7d725087982fe44431f;p=simgear.git diff --git a/simgear/scene/material/mat.hxx b/simgear/scene/material/mat.hxx index fea29c55..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,16 +33,17 @@ #include #include STL_STRING // Standard C++ string library +#include #include #include #include -#include #include "matmodel.hxx" SG_USING_STD(string); +SG_USING_STD(vector); /** @@ -110,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(); } /** @@ -189,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: @@ -197,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; @@ -219,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