Removed MaterialMap.

This commit is contained in:
David Williams
2008-01-29 21:04:13 +00:00
parent 7b8e035bd1
commit e5fbb59db2
9 changed files with 0 additions and 346 deletions

View File

@ -1,76 +0,0 @@
#ifndef __MATERIALMAP_H__
#define __MATERIALMAP_H__
#include <OgreResourceManager.h>
#include "TypeDef.h"
namespace Ogre
{
class VOXEL_SCENE_MANAGER_API MaterialMap : public Ogre::Resource
{
String mMaterials[256];
protected:
// must implement these from the Ogre::Resource interface
void loadImpl ();
void unloadImpl ();
size_t calculateSize () const;
public:
MaterialMap (Ogre::ResourceManager *creator, const Ogre::String &name,
Ogre::ResourceHandle handle, const Ogre::String &group, bool isManual = false,
Ogre::ManualResourceLoader *loader = 0);
virtual ~MaterialMap ();
void clearMaterials();
String getMaterialAtIndex(uchar uIndex);
void setMaterialAtIndex(uchar uIndex, const String& materialName);
/*void setString (const Ogre::String &str);
const Ogre::String &getString () const;*/
};
class MaterialMapPtr : public Ogre::SharedPtr<MaterialMap>
{
public:
MaterialMapPtr () : Ogre::SharedPtr<MaterialMap> () {}
explicit MaterialMapPtr (MaterialMap *rep) : Ogre::SharedPtr<MaterialMap> (rep) {}
MaterialMapPtr (const MaterialMapPtr &r) : Ogre::SharedPtr<MaterialMap> (r) {}
MaterialMapPtr (const Ogre::ResourcePtr &r) : Ogre::SharedPtr<MaterialMap> ()
{
// lock & copy other mutex pointer
OGRE_LOCK_MUTEX (*r.OGRE_AUTO_MUTEX_NAME)
OGRE_COPY_AUTO_SHARED_MUTEX (r.OGRE_AUTO_MUTEX_NAME)
pRep = static_cast<MaterialMap*> (r.getPointer ());
pUseCount = r.useCountPointer ();
if (pUseCount)
{
++ (*pUseCount);
}
}
/// Operator used to convert a ResourcePtr to a TextFilePtr
MaterialMapPtr& operator=(const Ogre::ResourcePtr& r)
{
if (pRep == static_cast<MaterialMap*> (r.getPointer ()))
return *this;
release ();
// lock & copy other mutex pointer
OGRE_LOCK_MUTEX (*r.OGRE_AUTO_MUTEX_NAME)
OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
pRep = static_cast<MaterialMap*> (r.getPointer());
pUseCount = r.useCountPointer ();
if (pUseCount)
{
++ (*pUseCount);
}
return *this;
}
};
}
#endif

View File

@ -1,31 +0,0 @@
#ifndef __MATERIALMAPMANAGER_H__
#define __MATERIALMAPMANAGER_H__
#include <OgreResourceManager.h>
#include "MaterialMap.h"
#include "TypeDef.h"
namespace Ogre
{
class VOXEL_SCENE_MANAGER_API MaterialMapManager : public Ogre::ResourceManager, public Ogre::Singleton<MaterialMapManager>
{
protected:
// must implement this from ResourceManager's interface
Ogre::Resource *createImpl(const Ogre::String &name, Ogre::ResourceHandle handle,
const Ogre::String &group, bool isManual, Ogre::ManualResourceLoader *loader,
const Ogre::NameValuePairList *createParams);
public:
MaterialMapManager ();
virtual ~MaterialMapManager ();
virtual MaterialMapPtr load (const Ogre::String &name, const Ogre::String &group);
static MaterialMapManager &getSingleton ();
static MaterialMapManager *getSingletonPtr ();
};
}
#endif

View File

@ -1,26 +0,0 @@
#ifndef __MATERIALMAPSERIALIZER_H__
#define __MATERIALMAPSERIALIZER_H__
#include <OgreSerializer.h>
#include <OgreString.h>
#include <vector>
namespace Ogre
{
class MaterialMap; // forward declaration
class MaterialMapSerializer : public Ogre::Serializer
{
public:
MaterialMapSerializer ();
virtual ~MaterialMapSerializer ();
void importMaterialMap (Ogre::DataStreamPtr &stream, MaterialMap *pDest);
private:
void tokenize(const String& str, std::vector<String>& tokens, const String& delimiters = " ");
};
}
#endif

View File

@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "Constants.h"
#include "IndexedSurfacePatch.h"
#include "MaterialMap.h"
#include "SurfacePatchRenderable.h"
#include "SurfaceTriangle.h"
//#include "AbstractSurfacePatch.h"
@ -105,7 +104,6 @@ namespace Ogre
NormalGenerationMethod m_normalGenerationMethod;
VolumePtr volumeData;
MaterialMapPtr materialMap;
bool m_bHaveGeneratedMeshes;