forked from Mirrorlandia_minetest/irrlicht
Remove deprecated functionality of SMaterial
This commit is contained in:
parent
364cb37698
commit
00dd1f8ef3
@ -228,19 +228,6 @@ namespace video
|
||||
ECM_DIFFUSE_AND_AMBIENT
|
||||
};
|
||||
|
||||
//! DEPRECATED. Will be removed after Irrlicht 1.9.
|
||||
/** Flags for the definition of the polygon offset feature. These flags define whether the offset should be into the screen, or towards the eye. */
|
||||
enum E_POLYGON_OFFSET
|
||||
{
|
||||
//! Push pixel towards the far plane, away from the eye
|
||||
/** This is typically used for rendering inner areas. */
|
||||
EPO_BACK=0,
|
||||
//! Pull pixels towards the camera.
|
||||
/** This is typically used for polygons which should appear on top
|
||||
of other elements, such as decals. */
|
||||
EPO_FRONT=1
|
||||
};
|
||||
|
||||
//! Names for polygon offset direction
|
||||
const c8* const PolygonOffsetDirectionNames[] =
|
||||
{
|
||||
@ -289,17 +276,17 @@ namespace video
|
||||
{
|
||||
public:
|
||||
//! Default constructor. Creates a solid, lit material with white colors
|
||||
SMaterial()
|
||||
: MaterialType(EMT_SOLID), AmbientColor(255,255,255,255), DiffuseColor(255,255,255,255),
|
||||
EmissiveColor(0,0,0,0), SpecularColor(255,255,255,255),
|
||||
Shininess(0.0f), MaterialTypeParam(0.0f), Thickness(1.0f),
|
||||
ZBuffer(ECFN_LESSEQUAL), AntiAliasing(EAAM_SIMPLE), ColorMask(ECP_ALL),
|
||||
ColorMaterial(ECM_DIFFUSE), BlendOperation(EBO_NONE), BlendFactor(0.0f),
|
||||
PolygonOffsetFactor(0), PolygonOffsetDirection(EPO_FRONT),
|
||||
PolygonOffsetDepthBias(0.f), PolygonOffsetSlopeScale(0.f),
|
||||
Wireframe(false), PointCloud(false), GouraudShading(true),
|
||||
Lighting(true), ZWriteEnable(EZW_AUTO), BackfaceCulling(true), FrontfaceCulling(false),
|
||||
FogEnable(false), NormalizeNormals(false), UseMipMaps(true)
|
||||
SMaterial() :
|
||||
MaterialType(EMT_SOLID), AmbientColor(255, 255, 255, 255),
|
||||
DiffuseColor(255, 255, 255, 255), EmissiveColor(0, 0, 0, 0),
|
||||
SpecularColor(255, 255, 255, 255), Shininess(0.0f),
|
||||
MaterialTypeParam(0.0f), Thickness(1.0f), ZBuffer(ECFN_LESSEQUAL),
|
||||
AntiAliasing(EAAM_SIMPLE), ColorMask(ECP_ALL), ColorMaterial(ECM_DIFFUSE),
|
||||
BlendOperation(EBO_NONE), BlendFactor(0.0f), PolygonOffsetDepthBias(0.f),
|
||||
PolygonOffsetSlopeScale(0.f), Wireframe(false), PointCloud(false),
|
||||
GouraudShading(true), Lighting(true), ZWriteEnable(EZW_AUTO),
|
||||
BackfaceCulling(true), FrontfaceCulling(false), FogEnable(false),
|
||||
NormalizeNormals(false), UseMipMaps(true)
|
||||
{ }
|
||||
|
||||
//! Texture layer array.
|
||||
@ -395,18 +382,6 @@ namespace video
|
||||
(setting it to EBO_ADD is probably the most common one value). */
|
||||
f32 BlendFactor;
|
||||
|
||||
//! DEPRECATED. Will be removed after Irrlicht 1.9. Please use PolygonOffsetDepthBias instead.
|
||||
/** Factor specifying how far the polygon offset should be made.
|
||||
Specifying 0 disables the polygon offset. The direction is specified separately.
|
||||
The factor can be from 0 to 7.
|
||||
Note: This probably never worked on Direct3D9 (was coded for D3D8 which had different value ranges) */
|
||||
u8 PolygonOffsetFactor:3;
|
||||
|
||||
//! DEPRECATED. Will be removed after Irrlicht 1.9.
|
||||
/** Flag defining the direction the polygon offset is applied to.
|
||||
Can be to front or to back, specified by values from E_POLYGON_OFFSET. */
|
||||
E_POLYGON_OFFSET PolygonOffsetDirection:1;
|
||||
|
||||
//! A constant z-buffer offset for a polygon/line/point
|
||||
/** The range of the value is driver specific.
|
||||
On OpenGL you get units which are multiplied by the smallest value that is guaranteed to produce a resolvable offset.
|
||||
@ -546,8 +521,6 @@ namespace video
|
||||
ColorMaterial != b.ColorMaterial ||
|
||||
BlendOperation != b.BlendOperation ||
|
||||
BlendFactor != b.BlendFactor ||
|
||||
PolygonOffsetFactor != b.PolygonOffsetFactor ||
|
||||
PolygonOffsetDirection != b.PolygonOffsetDirection ||
|
||||
PolygonOffsetDepthBias != b.PolygonOffsetDepthBias ||
|
||||
PolygonOffsetSlopeScale != b.PolygonOffsetSlopeScale ||
|
||||
UseMipMaps != b.UseMipMaps
|
||||
|
@ -151,8 +151,6 @@ namespace video
|
||||
case EMP_BLEND_OPERATION: material.BlendOperation = Material.BlendOperation; break;
|
||||
case EMP_BLEND_FACTOR: material.BlendFactor = Material.BlendFactor; break;
|
||||
case EMP_POLYGON_OFFSET:
|
||||
material.PolygonOffsetDirection = Material.PolygonOffsetDirection;
|
||||
material.PolygonOffsetFactor = Material.PolygonOffsetFactor;
|
||||
material.PolygonOffsetDepthBias = Material.PolygonOffsetDepthBias;
|
||||
material.PolygonOffsetSlopeScale = Material.PolygonOffsetSlopeScale;
|
||||
break;
|
||||
|
@ -2523,8 +2523,6 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
|
||||
|
||||
// Polygon Offset
|
||||
if (queryFeature(EVDF_POLYGON_OFFSET) && (resetAllRenderStates ||
|
||||
lastmaterial.PolygonOffsetDirection != material.PolygonOffsetDirection ||
|
||||
lastmaterial.PolygonOffsetFactor != material.PolygonOffsetFactor ||
|
||||
lastmaterial.PolygonOffsetSlopeScale != material.PolygonOffsetSlopeScale ||
|
||||
lastmaterial.PolygonOffsetDepthBias != material.PolygonOffsetDepthBias ))
|
||||
{
|
||||
@ -2535,15 +2533,6 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
|
||||
|
||||
glPolygonOffset(material.PolygonOffsetSlopeScale, material.PolygonOffsetDepthBias);
|
||||
}
|
||||
else if (material.PolygonOffsetFactor)
|
||||
{
|
||||
glEnable(material.Wireframe?GL_POLYGON_OFFSET_LINE:material.PointCloud?GL_POLYGON_OFFSET_POINT:GL_POLYGON_OFFSET_FILL);
|
||||
|
||||
if (material.PolygonOffsetDirection==EPO_BACK)
|
||||
glPolygonOffset(1.0f, (GLfloat)material.PolygonOffsetFactor);
|
||||
else
|
||||
glPolygonOffset(-1.0f, (GLfloat)-material.PolygonOffsetFactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
glPolygonOffset(0.0f, 0.f);
|
||||
|
Loading…
Reference in New Issue
Block a user