[tubras] r1911 committed - .irrbmesh material fixes.

7 views
Skip to first unread message

tub...@googlecode.com

unread,
Feb 15, 2012, 3:34:27 PM2/15/12
to tubras-s...@googlegroups.com
Revision: 1911
Author: pc0der
Date: Wed Feb 15 12:33:26 2012
Log: .irrbmesh material fixes.

http://code.google.com/p/tubras/source/detail?r=1911

Modified:
/trunk/tools/irrlicht/extensions/CIrrBMeshFileLoader.cpp
/trunk/tools/irrlicht/extensions/CIrrBMeshWriter.cpp
/trunk/tools/irrlicht/extensions/CIrrBMeshWriter.h

=======================================
--- /trunk/tools/irrlicht/extensions/CIrrBMeshFileLoader.cpp Tue Feb 8
10:32:37 2011
+++ /trunk/tools/irrlicht/extensions/CIrrBMeshFileLoader.cpp Wed Feb 15
12:33:26 2012
@@ -266,17 +266,13 @@
material.TextureLayer[layerNumber].BilinearFilter =
layer.mBilinearFilter;
material.TextureLayer[layerNumber].TrilinearFilter =
layer.mTrilinearFilter;
material.TextureLayer[layerNumber].AnisotropicFilter =
layer.mAnisotropicFilter;
-#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 6
- material.TextureLayer[layerNumber].TextureWrap =
(irr::video::E_TEXTURE_CLAMP)layer.mTextureWrapU;
-#elif IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR == 7
+ material.TextureLayer[layerNumber].LODBias = layer.mLODBias;
material.TextureLayer[layerNumber].TextureWrapU =
(irr::video::E_TEXTURE_CLAMP)layer.mTextureWrapU;
material.TextureLayer[layerNumber].TextureWrapV =
(irr::video::E_TEXTURE_CLAMP)layer.mTextureWrapV;
-#endif
irr::core::matrix4 mat4;
memcpy(mat4.pointer(),&layer.mMatrix,sizeof(u16)*16);
material.TextureLayer[layerNumber].setTextureMatrix(mat4);
}
-
}

void CIrrBMeshFileLoader::setMaterial(video::SMaterial& material, struct
IrrbMaterial& mat)
@@ -301,6 +297,9 @@
material.ColorMask = mat.mColorMask;
material.ColorMaterial = mat.mColorMaterial;
material.UseMipMaps = mat.mUseMipMaps;
+ material.PolygonOffsetDirection =
(irr::video::E_POLYGON_OFFSET)mat.mPolygonOffsetDirection;
+ material.PolygonOffsetFactor = mat.mPolygonOffsetFactor;
+ material.BlendOperation =
(irr::video::E_BLEND_OPERATION)mat.mBlendOperation;
}


=======================================
--- /trunk/tools/irrlicht/extensions/CIrrBMeshWriter.cpp Tue Feb 8
10:32:37 2011
+++ /trunk/tools/irrlicht/extensions/CIrrBMeshWriter.cpp Wed Feb 15
12:33:26 2012
@@ -485,13 +485,9 @@
layer.mBilinearFilter =
material.TextureLayer[layerNumber].BilinearFilter;
layer.mTrilinearFilter =
material.TextureLayer[layerNumber].TrilinearFilter;
layer.mAnisotropicFilter =
material.TextureLayer[layerNumber].AnisotropicFilter;
-#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 6
- layer.mTextureWrapU =
material.TextureLayer[layerNumber].TextureWrap;
- layer.mTextureWrapV = layer.mTextureWrapU;
-#elif IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR == 7
layer.mTextureWrapU =
material.TextureLayer[layerNumber].TextureWrapU;
layer.mTextureWrapV =
material.TextureLayer[layerNumber].TextureWrapV;
-#endif
+ layer.mLODBias = material.TextureLayer[layerNumber].LODBias;

memcpy(&layer.mMatrix,material.TextureLayer[layerNumber].getTextureMatrix().pointer(),sizeof(f32)*16);
}

@@ -511,7 +507,11 @@
mat.mThickness = material.Thickness;
mat.mZBuffer = material.ZBuffer;
mat.mAntiAliasing = material.AntiAliasing;
- mat.mColorMask = material.ColorMask;
+ mat.mColorMask = material.ColorMask;
+ mat.mColorMaterial = material.ColorMaterial;
+ mat.mBlendOperation = material.BlendOperation;
+ mat.mPolygonOffsetFactor = material.PolygonOffsetFactor;
+ mat.mPolygonOffsetDirection = material.PolygonOffsetDirection;

mat.mWireframe = material.Wireframe;
mat.mPointCloud = material.PointCloud;
@@ -522,6 +522,7 @@
mat.mFrontfaceCulling = material.FrontfaceCulling;
mat.mFogEnable = material.FogEnable;
mat.mNormalizeNormals = material.NormalizeNormals;
+ mat.mUseMipMaps = material.UseMipMaps;
}
} // end namespace
} // end namespace
=======================================
--- /trunk/tools/irrlicht/extensions/CIrrBMeshWriter.h Tue Feb 8 10:32:37
2011
+++ /trunk/tools/irrlicht/extensions/CIrrBMeshWriter.h Wed Feb 15 12:33:26
2012
@@ -165,6 +165,9 @@
u8 mAntiAliasing;
u8 mColorMask;
u8 mColorMaterial;
+ u8 mBlendOperation;
+ u8 mPolygonOffsetFactor;
+ u8 mPolygonOffsetDirection;
u8 mLayerCount;
bool mWireframe:1;
bool mPointCloud:1;

Reply all
Reply to author
Forward
0 new messages