From f7a3dbc5ed76217e513ca4ab4da4f9ef0470c814 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 16 May 2003 11:40:07 +0000 Subject: [PATCH] I missed committing t hese changes yesterday. --- simgear/scene/material/mat.cxx | 1 - simgear/scene/material/mat.hxx | 1 - simgear/scene/material/matmodel.cxx | 44 ++++++++++++++--------------- simgear/scene/material/matmodel.hxx | 10 +++---- 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/simgear/scene/material/mat.cxx b/simgear/scene/material/mat.cxx index 2c45c322..480c7f7e 100644 --- a/simgear/scene/material/mat.cxx +++ b/simgear/scene/material/mat.cxx @@ -40,7 +40,6 @@ SG_USING_STD(map); #include #include #include -#include #include "mat.hxx" diff --git a/simgear/scene/material/mat.hxx b/simgear/scene/material/mat.hxx index fea29c55..c98da2df 100644 --- a/simgear/scene/material/mat.hxx +++ b/simgear/scene/material/mat.hxx @@ -38,7 +38,6 @@ #include #include -#include #include "matmodel.hxx" diff --git a/simgear/scene/material/matmodel.cxx b/simgear/scene/material/matmodel.cxx index 6bc8f6b4..db47a66b 100644 --- a/simgear/scene/material/matmodel.cxx +++ b/simgear/scene/material/matmodel.cxx @@ -1,6 +1,6 @@ // matmodel.cxx -- class to handle models tied to a material property // -// Written by Curtis Olson, started May 1998. +// Written by David Megginson, started May 1998. // // Copyright (C) 1998 - 2003 Curtis L. Olson - curt@flightgear.org // @@ -117,26 +117,26 @@ SGMatModel::~SGMatModel () } int -SGMatModel::get_model_count( SGModelLib *loader, - const string &fg_root, - SGPropertyNode *prop_root, - double sim_time_sec ) +SGMatModel::get_model_count( SGModelLib *modellib, + const string &fg_root, + SGPropertyNode *prop_root, + double sim_time_sec ) { - load_models( loader, fg_root, prop_root, sim_time_sec ); + load_models( modellib, fg_root, prop_root, sim_time_sec ); return _models.size(); } inline void -SGMatModel::load_models ( SGModelLib *loader, - const string &fg_root, - SGPropertyNode *prop_root, - double sim_time_sec ) +SGMatModel::load_models ( SGModelLib *modellib, + const string &fg_root, + SGPropertyNode *prop_root, + double sim_time_sec ) { // Load model only on demand if (!_models_loaded) { for (unsigned int i = 0; i < _paths.size(); i++) { - ssgEntity *entity = loader->load_model( fg_root, _paths[i], - prop_root, sim_time_sec ); + ssgEntity *entity = modellib->load_model( fg_root, _paths[i], + prop_root, sim_time_sec ); if (entity != 0) { // FIXME: this stuff can be handled // in the XML wrapper as well (at least, @@ -164,22 +164,22 @@ SGMatModel::load_models ( SGModelLib *loader, ssgEntity * SGMatModel::get_model( int index, - SGModelLib *loader, - const string &fg_root, - SGPropertyNode *prop_root, - double sim_time_sec ) + SGModelLib *modellib, + const string &fg_root, + SGPropertyNode *prop_root, + double sim_time_sec ) { - load_models( loader, fg_root, prop_root, sim_time_sec ); // comment this out if preloading models + load_models( modellib, fg_root, prop_root, sim_time_sec ); // comment this out if preloading models return _models[index]; } ssgEntity * -SGMatModel::get_random_model( SGModelLib *loader, - const string &fg_root, - SGPropertyNode *prop_root, - double sim_time_sec ) +SGMatModel::get_random_model( SGModelLib *modellib, + const string &fg_root, + SGPropertyNode *prop_root, + double sim_time_sec ) { - load_models( loader, fg_root, prop_root, sim_time_sec ); // comment this out if preloading models + load_models( modellib, fg_root, prop_root, sim_time_sec ); // comment this out if preloading models int nModels = _models.size(); int index = int(sg_random() * nModels); if (index >= nModels) diff --git a/simgear/scene/material/matmodel.hxx b/simgear/scene/material/matmodel.hxx index a1922596..a0fba3ad 100644 --- a/simgear/scene/material/matmodel.hxx +++ b/simgear/scene/material/matmodel.hxx @@ -36,12 +36,12 @@ #include #include -#include SG_USING_STD(string); class SGMatModelGroup; +class SGModelLib; /** @@ -71,7 +71,7 @@ public: * * @return The number of variant models. */ - int get_model_count( SGModelLib *loader, + int get_model_count( SGModelLib *modellib, const string &fg_root, SGPropertyNode *prop_root, double sim_time_sec ); @@ -84,7 +84,7 @@ public: * @return The model. */ ssgEntity *get_model( int index, - SGModelLib *loader, + SGModelLib *modellib, const string &fg_root, SGPropertyNode *prop_root, double sim_time_sec ); @@ -95,7 +95,7 @@ public: * * @return A randomly select model from the variants. */ - ssgEntity *get_random_model( SGModelLib *loader, + ssgEntity *get_random_model( SGModelLib *modellib, const string &fg_root, SGPropertyNode *prop_root, double sim_time_sec ); @@ -132,7 +132,7 @@ private: * This class uses lazy loading so that models won't be held * in memory for materials that are never referenced. */ - void load_models( SGModelLib *loader, + void load_models( SGModelLib *modellib, const string &fg_root, SGPropertyNode *prop_root, double sim_time_sec ); -- 2.39.5