Put the dmf stuff into irr namespace as suggested by Piraaate.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2455 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
af6ec8b2a4
commit
2abda10ebd
|
@ -184,8 +184,8 @@ IAnimatedMesh* CDMFLoader::createMesh(io::IReadFile* file)
|
|||
path += ('/');
|
||||
|
||||
//texture and lightmap
|
||||
ITexture *tex = 0;
|
||||
ITexture *lig = 0;
|
||||
video::ITexture *tex = 0;
|
||||
video::ITexture *lig = 0;
|
||||
|
||||
//current buffer to apply material
|
||||
SMeshBufferLightMap* buffer = (SMeshBufferLightMap*)mesh->getMeshBuffer(i);
|
||||
|
@ -194,7 +194,7 @@ IAnimatedMesh* CDMFLoader::createMesh(io::IReadFile* file)
|
|||
if (materiali[i].textureFlag==0)
|
||||
{
|
||||
if (materiali[i].textureBlend==4)
|
||||
driver->setTextureCreationFlag(ETCF_ALWAYS_32_BIT,true);
|
||||
driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT,true);
|
||||
if (FileSystem->existFile(path+materiali[i].textureName))
|
||||
tex = driver->getTexture((path+materiali[i].textureName));
|
||||
else if (FileSystem->existFile(path+FileSystem->getFileBasename(materiali[i].textureName)))
|
||||
|
@ -211,14 +211,14 @@ IAnimatedMesh* CDMFLoader::createMesh(io::IReadFile* file)
|
|||
//Primary texture is just a colour
|
||||
else if(materiali[i].textureFlag==1)
|
||||
{
|
||||
SColor color(axtoi(materiali[i].textureName.c_str()));
|
||||
video::SColor color(axtoi(materiali[i].textureName.c_str()));
|
||||
|
||||
//just for compatibility with older Irrlicht versions
|
||||
//to support transparent materials
|
||||
if (color.getAlpha()!=255 && materiali[i].textureBlend==4)
|
||||
driver->setTextureCreationFlag(ETCF_ALWAYS_32_BIT,true);
|
||||
driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT,true);
|
||||
|
||||
CImage *immagine= new CImage(ECF_A8R8G8B8,
|
||||
video::CImage *immagine= new video::CImage(video::ECF_A8R8G8B8,
|
||||
core::dimension2d<u32>(8,8));
|
||||
immagine->fill(color);
|
||||
tex = driver->addTexture("", immagine);
|
||||
|
@ -239,7 +239,7 @@ IAnimatedMesh* CDMFLoader::createMesh(io::IReadFile* file)
|
|||
{
|
||||
buffer->Material.MaterialType = video::EMT_SOLID;
|
||||
const f32 mult = 100.0f - header.dmfShadow;
|
||||
buffer->Material.AmbientColor=header.dmfAmbient.getInterpolated(SColor(255,0,0,0),mult/100.f);
|
||||
buffer->Material.AmbientColor=header.dmfAmbient.getInterpolated(video::SColor(255,0,0,0),mult/100.f);
|
||||
}
|
||||
|
||||
if (materiali[i].textureBlend==4)
|
||||
|
|
|
@ -20,11 +20,13 @@
|
|||
#ifndef __DMF_SUPPORT_H_INCLUDED__
|
||||
#define __DMF_SUPPORT_H_INCLUDED__
|
||||
|
||||
using namespace irr;
|
||||
using namespace video;
|
||||
|
||||
#include "irrString.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
/** A structure representing some DeleD infos.
|
||||
This structure contains data about DeleD level file like: version, ambient colour, number of objects etc...*/
|
||||
struct dmfHeader
|
||||
|
@ -32,7 +34,7 @@ struct dmfHeader
|
|||
//main file header
|
||||
core::stringc dmfName; //!<Scene name
|
||||
f32 dmfVersion; //!<File version
|
||||
SColor dmfAmbient; //!<Ambient color
|
||||
video::SColor dmfAmbient; //!<Ambient color
|
||||
f32 dmfShadow; //!<Shadow intensity
|
||||
u32 numObjects; //!<Number of objects in this scene
|
||||
u32 numMaterials; //!<Number of materials in this scene
|
||||
|
@ -83,8 +85,8 @@ This structure contains light position coordinates, diffuse colour, specular col
|
|||
struct dmfLight
|
||||
{
|
||||
core::vector3df pos;//!<Position of this light.
|
||||
SColorf diffuseColor;//!<Diffuse color.
|
||||
SColorf specularColor;//!<Specular color.
|
||||
video::SColorf diffuseColor;//!<Diffuse color.
|
||||
video::SColorf specularColor;//!<Specular color.
|
||||
f32 radius;//!<Maximum radius of light.
|
||||
};
|
||||
|
||||
|
@ -595,12 +597,12 @@ bool GetDMFLights(const StringList& RawFile/**<StringList representing a DMF fil
|
|||
(float)atof(temp[6].c_str()),
|
||||
(float)-atof(temp[7].c_str()));
|
||||
|
||||
lights[d_lit].diffuseColor = SColorf(
|
||||
SColor(255, atoi(temp[10].c_str()), atoi(temp[11].c_str()),
|
||||
lights[d_lit].diffuseColor = video::SColorf(
|
||||
video::SColor(255, atoi(temp[10].c_str()), atoi(temp[11].c_str()),
|
||||
atoi(temp[12].c_str())));
|
||||
|
||||
lights[d_lit].specularColor = SColorf(
|
||||
SColor(255, atoi(temp[13].c_str()), atoi(temp[14].c_str()),
|
||||
lights[d_lit].specularColor = video::SColorf(
|
||||
video::SColor(255, atoi(temp[13].c_str()), atoi(temp[14].c_str()),
|
||||
atoi(temp[15].c_str())));
|
||||
|
||||
d_lit++;
|
||||
|
@ -751,5 +753,8 @@ bool GetDMFWaterPlanes(const StringList& RawFile/**<StringList representing a DM
|
|||
return true;
|
||||
}
|
||||
|
||||
} // end namespace
|
||||
} // end namespace
|
||||
|
||||
#endif /* __DMF_SUPPORT_H__ */
|
||||
|
||||
|
|
Loading…
Reference in New Issue