Add newline at end of files to reduce gcc warnings
This commit is contained in:
74
include/MaterialMap.h
Normal file
74
include/MaterialMap.h
Normal file
@ -0,0 +1,74 @@
|
||||
#ifndef __MATERIALMAP_H__
|
||||
#define __MATERIALMAP_H__
|
||||
|
||||
#include <OgreResourceManager.h>
|
||||
|
||||
namespace Ogre
|
||||
{
|
||||
class 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
|
31
include/MaterialMapManager.h
Normal file
31
include/MaterialMapManager.h
Normal file
@ -0,0 +1,31 @@
|
||||
#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
|
26
include/MaterialMapSerializer.h
Normal file
26
include/MaterialMapSerializer.h
Normal file
@ -0,0 +1,26 @@
|
||||
#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
|
@ -32,4 +32,4 @@ namespace Ogre
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* __SurfacePatch_H__ */
|
||||
#endif /* __SurfacePatch_H__ */
|
||||
|
@ -26,4 +26,4 @@ namespace Ogre
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* __SurfacePatchRenderable_H__ */
|
||||
#endif /* __SurfacePatchRenderable_H__ */
|
||||
|
30
include/VolumeManager.h
Normal file
30
include/VolumeManager.h
Normal file
@ -0,0 +1,30 @@
|
||||
#ifndef __VOLUMEMANAGER_H__
|
||||
#define __VOLUMEMANAGER_H__
|
||||
|
||||
#include <OgreResourceManager.h>
|
||||
#include "Volume.h"
|
||||
|
||||
namespace Ogre
|
||||
{
|
||||
class VOXEL_SCENE_MANAGER_API VolumeManager : public Ogre::ResourceManager, public Ogre::Singleton<VolumeManager>
|
||||
{
|
||||
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:
|
||||
|
||||
VolumeManager ();
|
||||
virtual ~VolumeManager ();
|
||||
|
||||
virtual VolumePtr load (const Ogre::String &name, const Ogre::String &group);
|
||||
|
||||
static VolumeManager &getSingleton ();
|
||||
static VolumeManager *getSingletonPtr ();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
21
include/VolumeSerializer.h
Normal file
21
include/VolumeSerializer.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef __VOLUMESERIALIZER_H__
|
||||
#define __VOLUMESERIALIZER_H__
|
||||
|
||||
#include <OgreSerializer.h>
|
||||
|
||||
namespace Ogre
|
||||
{
|
||||
class Volume; // forward declaration
|
||||
|
||||
class VolumeSerializer : public Ogre::Serializer
|
||||
{
|
||||
public:
|
||||
VolumeSerializer ();
|
||||
virtual ~VolumeSerializer ();
|
||||
|
||||
//void exportVolume (const Volume *pText, const Ogre::String &fileName);
|
||||
void importVolume (Ogre::DataStreamPtr &stream, Volume *pDest);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user