// 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
#include <simgear/compiler.h>
#include STL_STRING // Standard C++ string library
+#include <vector>
#include <plib/sg.h>
#include <plib/ssg.h>
#include "matmodel.hxx"
SG_USING_STD(string);
+SG_USING_STD(vector);
/**
* @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(); }
/**
*/
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:
// 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;
sgVec4 ambient, diffuse, specular, emission;
double shininess;
- // true if texture loading deferred, and not yet loaded
- bool texture_loaded;
-
vector<SGMatModelGroup *> object_groups;
// ref count so we can properly delete if we have multiple