20#ifndef HEADER_MATERIAL_MANAGER_HPP
21#define HEADER_MATERIAL_MANAGER_HPP
23#include "utils/no_copy.hpp"
27 namespace video {
class ITexture; }
28 namespace scene {
class IMeshBuffer;
class ISceneNode; }
35#include <EMaterialTypes.h>
48 void parseMaterialFile(
const std::string& filename);
49 int m_shared_material_index;
51 std::vector<Material*> m_materials;
53 std::map<std::string, Material*> m_default_sp_materials;
59 Material* getMaterialFor(video::ITexture* t,
60 scene::IMeshBuffer *mb);
61 Material* getMaterialFor(video::ITexture* t,
62 video::E_MATERIAL_TYPE material_type);
63 Material* getMaterialFor(video::ITexture* t);
64 Material* getMaterialSPM(std::string lay_one_tex_lc,
65 std::string lay_two_tex_lc,
66 const std::string& def_shader_name =
"solid");
68 scene::IMeshBuffer *mb);
69 void setAllUntexturedMaterialFlags(scene::IMeshBuffer *mb);
73 bool is_full_path=
false,
74 bool make_permanent=
false,
75 bool complain_if_not_found=
true,
76 bool strip_path=
true,
bool install=
true,
bool create_if_not_found=
true);
77 void addSharedMaterial(
const std::string& filename,
bool deprecated =
false);
78 bool pushTempMaterial (
const std::string& filename,
bool deprecated =
false);
79 bool pushTempMaterial (
const XMLNode *root,
const std::string& filename,
bool deprecated =
false);
80 void popTempMaterial ();
82 bool hasMaterial(
const std::string& fname);
84 void unloadAllTextures();
86 Material* getDefaultSPMaterial(
const std::string& shader_name,
87 const std::string& layer_one_lc =
"",
88 bool full_path =
false);
89 Material* getLatestMaterial() {
return m_materials[m_materials.size()-1]; }
Definition: material_manager.hpp:45
~MaterialManager()
Frees all allocated data structures.
Definition: material_manager.cpp:58
void setAllMaterialFlags(video::ITexture *t, scene::IMeshBuffer *mb)
Searches for the material in the given texture, and calls a function in the material to set the irrli...
Definition: material_manager.cpp:205
void makeMaterialsPermanent()
Makes all materials permanent.
Definition: material_manager.cpp:414
Material * getMaterial(const std::string &t, bool is_full_path=false, bool make_permanent=false, bool complain_if_not_found=true, bool strip_path=true, bool install=true, bool create_if_not_found=true)
Returns the material of a given name, if it doesn't exist, it is loaded.
Definition: material_manager.cpp:362
Definition: material.hpp:48
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:26
utility class used to parse XML files
Definition: xml_node.hpp:48