aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/include/IMeshCache.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2013-01-13 18:54:10 +1000
committerDavid Walter Seikel2013-01-13 18:54:10 +1000
commit959831f4ef5a3e797f576c3de08cd65032c997ad (patch)
treee7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/include/IMeshCache.h
parentAdd info about changes to Irrlicht. (diff)
downloadSledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to '')
-rw-r--r--libraries/irrlicht-1.8/include/IMeshCache.h354
1 files changed, 177 insertions, 177 deletions
diff --git a/libraries/irrlicht-1.8/include/IMeshCache.h b/libraries/irrlicht-1.8/include/IMeshCache.h
index 083fc5b..2d2bfa0 100644
--- a/libraries/irrlicht-1.8/include/IMeshCache.h
+++ b/libraries/irrlicht-1.8/include/IMeshCache.h
@@ -1,177 +1,177 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine". 2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h 3// For conditions of distribution and use, see copyright notice in irrlicht.h
4 4
5#ifndef __I_MESH_CACHE_H_INCLUDED__ 5#ifndef __I_MESH_CACHE_H_INCLUDED__
6#define __I_MESH_CACHE_H_INCLUDED__ 6#define __I_MESH_CACHE_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "path.h" 9#include "path.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13 13
14namespace scene 14namespace scene
15{ 15{
16 class IMesh; 16 class IMesh;
17 class IAnimatedMesh; 17 class IAnimatedMesh;
18 class IAnimatedMeshSceneNode; 18 class IAnimatedMeshSceneNode;
19 class IMeshLoader; 19 class IMeshLoader;
20 20
21 //! The mesh cache stores already loaded meshes and provides an interface to them. 21 //! The mesh cache stores already loaded meshes and provides an interface to them.
22 /** You can access it using ISceneManager::getMeshCache(). All existing 22 /** You can access it using ISceneManager::getMeshCache(). All existing
23 scene managers will return a pointer to the same mesh cache, because it 23 scene managers will return a pointer to the same mesh cache, because it
24 is shared between them. With this interface, it is possible to manually 24 is shared between them. With this interface, it is possible to manually
25 add new loaded meshes (if ISceneManager::getMesh() is not sufficient), 25 add new loaded meshes (if ISceneManager::getMesh() is not sufficient),
26 to remove them and to iterate through already loaded meshes. */ 26 to remove them and to iterate through already loaded meshes. */
27 class IMeshCache : public virtual IReferenceCounted 27 class IMeshCache : public virtual IReferenceCounted
28 { 28 {
29 public: 29 public:
30 30
31 //! Destructor 31 //! Destructor
32 virtual ~IMeshCache() {} 32 virtual ~IMeshCache() {}
33 33
34 //! Adds a mesh to the internal list of loaded meshes. 34 //! Adds a mesh to the internal list of loaded meshes.
35 /** Usually, ISceneManager::getMesh() is called to load a mesh 35 /** Usually, ISceneManager::getMesh() is called to load a mesh
36 from a file. That method searches the list of loaded meshes if 36 from a file. That method searches the list of loaded meshes if
37 a mesh has already been loaded and returns a pointer to if it 37 a mesh has already been loaded and returns a pointer to if it
38 is in that list and already in memory. Otherwise it loads the 38 is in that list and already in memory. Otherwise it loads the
39 mesh. With IMeshCache::addMesh(), it is possible to pretend 39 mesh. With IMeshCache::addMesh(), it is possible to pretend
40 that a mesh already has been loaded. This method can be used 40 that a mesh already has been loaded. This method can be used
41 for example by mesh loaders who need to load more than one mesh 41 for example by mesh loaders who need to load more than one mesh
42 with one call. They can add additional meshes with this method 42 with one call. They can add additional meshes with this method
43 to the scene manager. The COLLADA loader for example uses this 43 to the scene manager. The COLLADA loader for example uses this
44 method. 44 method.
45 \param name Name of the mesh. When calling 45 \param name Name of the mesh. When calling
46 ISceneManager::getMesh() with this name it will return the mesh 46 ISceneManager::getMesh() with this name it will return the mesh
47 set by this method. 47 set by this method.
48 \param mesh Pointer to a mesh which will now be referenced by 48 \param mesh Pointer to a mesh which will now be referenced by
49 this name. */ 49 this name. */
50 virtual void addMesh(const io::path& name, IAnimatedMesh* mesh) = 0; 50 virtual void addMesh(const io::path& name, IAnimatedMesh* mesh) = 0;
51 51
52 //! Removes the mesh from the cache. 52 //! Removes the mesh from the cache.
53 /** After loading a mesh with getMesh(), the mesh can be 53 /** After loading a mesh with getMesh(), the mesh can be
54 removed from the cache using this method, freeing a lot of 54 removed from the cache using this method, freeing a lot of
55 memory. 55 memory.
56 \param mesh Pointer to the mesh which shall be removed. */ 56 \param mesh Pointer to the mesh which shall be removed. */
57 virtual void removeMesh(const IMesh* const mesh) = 0; 57 virtual void removeMesh(const IMesh* const mesh) = 0;
58 58
59 //! Returns amount of loaded meshes in the cache. 59 //! Returns amount of loaded meshes in the cache.
60 /** You can load new meshes into the cache using getMesh() and 60 /** You can load new meshes into the cache using getMesh() and
61 addMesh(). If you ever need to access the internal mesh cache, 61 addMesh(). If you ever need to access the internal mesh cache,
62 you can do this using removeMesh(), getMeshNumber(), 62 you can do this using removeMesh(), getMeshNumber(),
63 getMeshByIndex() and getMeshName(). 63 getMeshByIndex() and getMeshName().
64 \return Number of meshes in cache. */ 64 \return Number of meshes in cache. */
65 virtual u32 getMeshCount() const = 0; 65 virtual u32 getMeshCount() const = 0;
66 66
67 //! Returns current index number of the mesh or -1 when not found. 67 //! Returns current index number of the mesh or -1 when not found.
68 /** \param mesh Pointer to the mesh to search for. 68 /** \param mesh Pointer to the mesh to search for.
69 \return Index of the mesh in the cache, or -1 if not found. */ 69 \return Index of the mesh in the cache, or -1 if not found. */
70 virtual s32 getMeshIndex(const IMesh* const mesh) const = 0; 70 virtual s32 getMeshIndex(const IMesh* const mesh) const = 0;
71 71
72 //! Returns a mesh based on its index number. 72 //! Returns a mesh based on its index number.
73 /** \param index: Index of the mesh, number between 0 and 73 /** \param index: Index of the mesh, number between 0 and
74 getMeshCount()-1. 74 getMeshCount()-1.
75 Note that this number is only valid until a new mesh is loaded 75 Note that this number is only valid until a new mesh is loaded
76 or removed. 76 or removed.
77 \return Pointer to the mesh or 0 if there is none with this 77 \return Pointer to the mesh or 0 if there is none with this
78 number. */ 78 number. */
79 virtual IAnimatedMesh* getMeshByIndex(u32 index) = 0; 79 virtual IAnimatedMesh* getMeshByIndex(u32 index) = 0;
80 80
81 //! Returns a mesh based on its name (often a filename). 81 //! Returns a mesh based on its name (often a filename).
82 /** \deprecated Use getMeshByName() instead. This method may be removed by 82 /** \deprecated Use getMeshByName() instead. This method may be removed by
83 Irrlicht 1.9 */ 83 Irrlicht 1.9 */
84 _IRR_DEPRECATED_ IAnimatedMesh* getMeshByFilename(const io::path& filename) 84 _IRR_DEPRECATED_ IAnimatedMesh* getMeshByFilename(const io::path& filename)
85 { 85 {
86 return getMeshByName(filename); 86 return getMeshByName(filename);
87 } 87 }
88 88
89 //! Get the name of a loaded mesh, based on its index. (Name is often identical to the filename). 89 //! Get the name of a loaded mesh, based on its index. (Name is often identical to the filename).
90 /** \deprecated Use getMeshName() instead. This method may be removed by 90 /** \deprecated Use getMeshName() instead. This method may be removed by
91 Irrlicht 1.9 */ 91 Irrlicht 1.9 */
92 _IRR_DEPRECATED_ const io::path& getMeshFilename(u32 index) const 92 _IRR_DEPRECATED_ const io::path& getMeshFilename(u32 index) const
93 { 93 {
94 return getMeshName(index).getInternalName(); 94 return getMeshName(index).getInternalName();
95 } 95 }
96 96
97 //! Get the name of a loaded mesh, if there is any. (Name is often identical to the filename). 97 //! Get the name of a loaded mesh, if there is any. (Name is often identical to the filename).
98 /** \deprecated Use getMeshName() instead. This method may be removed by 98 /** \deprecated Use getMeshName() instead. This method may be removed by
99 Irrlicht 1.9 */ 99 Irrlicht 1.9 */
100 _IRR_DEPRECATED_ const io::path& getMeshFilename(const IMesh* const mesh) const 100 _IRR_DEPRECATED_ const io::path& getMeshFilename(const IMesh* const mesh) const
101 { 101 {
102 return getMeshName(mesh).getInternalName(); 102 return getMeshName(mesh).getInternalName();
103 } 103 }
104 104
105 //! Renames a loaded mesh. 105 //! Renames a loaded mesh.
106 /** \deprecated Use renameMesh() instead. This method may be removed by 106 /** \deprecated Use renameMesh() instead. This method may be removed by
107 Irrlicht 1.9 */ 107 Irrlicht 1.9 */
108 _IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename) 108 _IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename)
109 { 109 {
110 return renameMesh(index, filename); 110 return renameMesh(index, filename);
111 } 111 }
112 112
113 //! Renames a loaded mesh. 113 //! Renames a loaded mesh.
114 /** \deprecated Use renameMesh() instead. This method may be removed by 114 /** \deprecated Use renameMesh() instead. This method may be removed by
115 Irrlicht 1.9 */ 115 Irrlicht 1.9 */
116 _IRR_DEPRECATED_ bool setMeshFilename(const IMesh* const mesh, const io::path& filename) 116 _IRR_DEPRECATED_ bool setMeshFilename(const IMesh* const mesh, const io::path& filename)
117 { 117 {
118 return renameMesh(mesh, filename); 118 return renameMesh(mesh, filename);
119 } 119 }
120 120
121 //! Returns a mesh based on its name. 121 //! Returns a mesh based on its name.
122 /** \param name Name of the mesh. Usually a filename. 122 /** \param name Name of the mesh. Usually a filename.
123 \return Pointer to the mesh or 0 if there is none with this number. */ 123 \return Pointer to the mesh or 0 if there is none with this number. */
124 virtual IAnimatedMesh* getMeshByName(const io::path& name) = 0; 124 virtual IAnimatedMesh* getMeshByName(const io::path& name) = 0;
125 125
126 //! Get the name of a loaded mesh, based on its index. 126 //! Get the name of a loaded mesh, based on its index.
127 /** \param index: Index of the mesh, number between 0 and getMeshCount()-1. 127 /** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
128 \return The name if mesh was found and has a name, else the path is empty. */ 128 \return The name if mesh was found and has a name, else the path is empty. */
129 virtual const io::SNamedPath& getMeshName(u32 index) const = 0; 129 virtual const io::SNamedPath& getMeshName(u32 index) const = 0;
130 130
131 //! Get the name of the loaded mesh if there is any. 131 //! Get the name of the loaded mesh if there is any.
132 /** \param mesh Pointer to mesh to query. 132 /** \param mesh Pointer to mesh to query.
133 \return The name if mesh was found and has a name, else the path is empty. */ 133 \return The name if mesh was found and has a name, else the path is empty. */
134 virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0; 134 virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0;
135 135
136 //! Renames a loaded mesh. 136 //! Renames a loaded mesh.
137 /** Note that renaming meshes might change the ordering of the 137 /** Note that renaming meshes might change the ordering of the
138 meshes, and so the index of the meshes as returned by 138 meshes, and so the index of the meshes as returned by
139 getMeshIndex() or taken by some methods will change. 139 getMeshIndex() or taken by some methods will change.
140 \param index The index of the mesh in the cache. 140 \param index The index of the mesh in the cache.
141 \param name New name for the mesh. 141 \param name New name for the mesh.
142 \return True if mesh was renamed. */ 142 \return True if mesh was renamed. */
143 virtual bool renameMesh(u32 index, const io::path& name) = 0; 143 virtual bool renameMesh(u32 index, const io::path& name) = 0;
144 144
145 //! Renames the loaded mesh 145 //! Renames the loaded mesh
146 /** Note that renaming meshes might change the ordering of the 146 /** Note that renaming meshes might change the ordering of the
147 meshes, and so the index of the meshes as returned by 147 meshes, and so the index of the meshes as returned by
148 getMeshIndex() or taken by some methods will change. 148 getMeshIndex() or taken by some methods will change.
149 \param mesh Mesh to be renamed. 149 \param mesh Mesh to be renamed.
150 \param name New name for the mesh. 150 \param name New name for the mesh.
151 \return True if mesh was renamed. */ 151 \return True if mesh was renamed. */
152 virtual bool renameMesh(const IMesh* const mesh, const io::path& name) = 0; 152 virtual bool renameMesh(const IMesh* const mesh, const io::path& name) = 0;
153 153
154 //! Check if a mesh was already loaded. 154 //! Check if a mesh was already loaded.
155 /** \param name Name of the mesh. Usually a filename. 155 /** \param name Name of the mesh. Usually a filename.
156 \return True if the mesh has been loaded, else false. */ 156 \return True if the mesh has been loaded, else false. */
157 virtual bool isMeshLoaded(const io::path& name) = 0; 157 virtual bool isMeshLoaded(const io::path& name) = 0;
158 158
159 //! Clears the whole mesh cache, removing all meshes. 159 //! Clears the whole mesh cache, removing all meshes.
160 /** All meshes will be reloaded completely when using ISceneManager::getMesh() 160 /** All meshes will be reloaded completely when using ISceneManager::getMesh()
161 after calling this method. 161 after calling this method.
162 Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh() 162 Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh()
163 and you did not grab them, then they may become invalid. */ 163 and you did not grab them, then they may become invalid. */
164 virtual void clear() = 0; 164 virtual void clear() = 0;
165 165
166 //! Clears all meshes that are held in the mesh cache but not used anywhere else. 166 //! Clears all meshes that are held in the mesh cache but not used anywhere else.
167 /** Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh() 167 /** Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh()
168 and you did not grab them, then they may become invalid. */ 168 and you did not grab them, then they may become invalid. */
169 virtual void clearUnusedMeshes() = 0; 169 virtual void clearUnusedMeshes() = 0;
170 }; 170 };
171 171
172 172
173} // end namespace scene 173} // end namespace scene
174} // end namespace irr 174} // end namespace irr
175 175
176#endif 176#endif
177 177