2007-05-27 12:01:53 -04:00
|
|
|
// $Id$
|
|
|
|
//
|
|
|
|
// SuperTuxKart - a fun racing game with go-kart
|
|
|
|
// Copyright (C) 2004 Steve Baker <sjbaker1@airmail.net>
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-06-12 20:53:52 -04:00
|
|
|
// as published by the Free Software Foundation; either version 3
|
2007-05-27 12:01:53 -04:00
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
2009-03-26 19:31:00 -04:00
|
|
|
#ifndef HEADER_MATERIAL_MANAGER_HPP
|
2009-01-23 00:23:22 -05:00
|
|
|
#define HEADER_MATERIAL_MANAGER_HPP
|
2007-05-27 12:01:53 -04:00
|
|
|
|
2010-09-08 20:30:58 -04:00
|
|
|
#include "utils/no_copy.hpp"
|
|
|
|
|
2009-03-26 19:31:00 -04:00
|
|
|
#include "irrlicht.h"
|
|
|
|
using namespace irr;
|
|
|
|
|
2007-05-27 12:01:53 -04:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class Material;
|
2009-02-26 19:15:09 -05:00
|
|
|
class XMLReader;
|
2007-05-27 12:01:53 -04:00
|
|
|
|
2010-04-23 16:36:13 -04:00
|
|
|
/**
|
|
|
|
* \ingroup graphics
|
|
|
|
*/
|
2010-09-08 20:30:58 -04:00
|
|
|
class MaterialManager : public NoCopy
|
2007-05-27 12:01:53 -04:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2008-02-28 22:26:07 -05:00
|
|
|
void parseMaterialFile(const std::string& filename);
|
|
|
|
int m_shared_material_index;
|
2007-05-27 12:01:53 -04:00
|
|
|
|
|
|
|
std::vector<Material*> m_materials;
|
|
|
|
public:
|
2010-07-05 19:03:19 -04:00
|
|
|
MaterialManager();
|
|
|
|
~MaterialManager();
|
2008-03-04 21:09:50 -05:00
|
|
|
void loadMaterial ();
|
|
|
|
void reInit ();
|
2009-03-26 19:31:00 -04:00
|
|
|
void setAllMaterialFlags(video::ITexture* t,
|
|
|
|
scene::IMeshBuffer *mb) const;
|
2010-02-22 19:09:09 -05:00
|
|
|
|
2009-12-17 19:36:35 -05:00
|
|
|
void setAllUntexturedMaterialFlags(scene::IMeshBuffer *mb) const;
|
2010-02-22 19:09:09 -05:00
|
|
|
|
2008-03-04 21:09:50 -05:00
|
|
|
int addEntity (Material *m);
|
2008-11-18 21:08:00 -05:00
|
|
|
Material *getMaterial (const std::string& t, bool is_full_path=false,
|
|
|
|
bool make_permanent=false);
|
2008-03-04 21:09:50 -05:00
|
|
|
void addSharedMaterial(const std::string& filename);
|
|
|
|
bool pushTempMaterial (const std::string& filename);
|
|
|
|
void popTempMaterial ();
|
2011-01-06 21:25:34 -05:00
|
|
|
|
|
|
|
bool hasMaterial(const std::string& fname);
|
2007-05-27 12:01:53 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
extern MaterialManager *material_manager;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* EOF */
|