Merge r4562-4570 from trunk:

Remove wrong _IRR_OVERRIDE_'s which prevented compiling on Linux.
Updated changes text file.
EMT_TRANSPARENT_ALPHA_CHANNEL_REF working again like in older Irrlicht versions (1.4 or so):
It uses again SMaterial::MaterialTypeParam instead of a hardcoded values and makes an exception when MaterialTypeParam is 0 (using it like 0.5 instead) to ensure it works by default. See http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=48940 for new discussion.
_IRR_OVERRIDE_ needed a few more checks on gcc to prevent compile warnings on some systems.


git-svn-id: http://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@4643 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2014-01-07 23:14:52 +00:00
parent eca637b727
commit 4abfd79c23
7 changed files with 26 additions and 15 deletions

View File

@ -3,7 +3,9 @@ Changes in 1.9 (not yet released)
- Removed VS6 .dsw / .dsp project files - VS6 is no longer supported.
- Added support for PVR textures. Loader offer support for compressed DXT1-5, PVRTC/PVRTC-II, ETC1/ETC2 texture formats.
- IGUIEnvironment::hasFocus has now a parameter checkSubElements as subelements are usually seen as part of an element. Default unfortunately must be false due to backward compatibility.
- Material renderers which offers blending feature (eg. EMT_TRANSPARENT_ALPHA_CHANNEL, EMT_ONETEXTURE_BLEND etc.) require SMaterial::BlendOperation set to other value than EBO_NONE.
- Removed support for built-in T&L variables in ASM/GLSL shaders (variables related to vertices eg. gl_MultiTexCoord0 are still supported). This change allow us to reduce CPU overhead in shader material renderers.
- IGUIEnvironment::hasFocus has now a parameter checkSubElements as subelements are usually seen as part of an element. Default unfortunately must be false due to backward compatibility.
- Add IGUIElement::isTrulyVisible which works like ISceneNode::isTrulyVisible and checks for parent visibility as well.
- Improved DDS loader and added support for DXTn (DXT1-5) compressed textures in OpenGL and Direct3D9 drivers.
- Add function ISceneNode::getTransformedBoundingBoxEdges.

View File

@ -101,7 +101,7 @@ namespace video
EMT_TRANSPARENT_ALPHA_CHANNEL,
//! Makes the material transparent based on the texture alpha channel.
/** If the alpha channel value is greater than 127, a
/** If the alpha channel value is greater than a certain value (default 127), a
pixel is written to the target, otherwise not. This
material does not use alpha blending and is a lot faster
than EMT_TRANSPARENT_ALPHA_CHANNEL. It is ideal for drawing
@ -109,7 +109,12 @@ namespace video
blurry but sharp. Only first texture is used. If you are
using this material with small textures and 3d object, it
is a good idea to load the texture in 32 bit mode
(video::IVideoDriver::setTextureCreationFlag()). */
(video::IVideoDriver::setTextureCreationFlag()).
By changing SMaterial::MaterialTypeParam you can control the value which is used
to seperate transparent and opaque pixels. The range is 0-1 (corresponding to 0-255 values
for the alpha-channel test). 0 is special and like 0.5 interpreted as 127
(if you really want no transparency at all use a very small value above 0)
*/
EMT_TRANSPARENT_ALPHA_CHANNEL_REF,
//! Makes the material transparent based on the vertex alpha value.

View File

@ -199,7 +199,7 @@ For functions: template<class T> _IRR_DEPRECATED_ void test4(void) {}
/** Usage in a derived class:
virtual void somefunc() _IRR_OVERRIDE_;
*/
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 7)
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 7 && (defined(__GXX_EXPERIMENTAL_CXX0X) || __cplusplus >= 201103L) )
#define _IRR_OVERRIDE_ override
#elif (_MSC_VER >= 1600 ) /* supported since MSVC 2010 */
#define _IRR_OVERRIDE_ override

View File

@ -350,7 +350,9 @@ public:
{
services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates);
if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates)
if (material.MaterialType != lastMaterial.MaterialType
|| material.MaterialTypeParam != lastMaterial.MaterialTypeParam
|| resetAllRenderstates)
{
setTextureColorStage(pID3DDevice, 0,
D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT);
@ -360,8 +362,7 @@ public:
pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
// 127 is required by EMT_TRANSPARENT_ALPHA_CHANNEL_REF
pID3DDevice->SetRenderState(D3DRS_ALPHAREF, 127);
pID3DDevice->SetRenderState(D3DRS_ALPHAREF, material.MaterialTypeParam == 0 ? 127 : material.MaterialTypeParam * 255.f);
pID3DDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
}

View File

@ -381,7 +381,9 @@ public:
{
services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates);
if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates)
if (material.MaterialType != lastMaterial.MaterialType
|| material.MaterialTypeParam != lastMaterial.MaterialTypeParam
|| resetAllRenderstates)
{
setTextureColorStage(pID3DDevice, 0,
D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT);
@ -391,8 +393,7 @@ public:
pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
// 127 is required by EMT_TRANSPARENT_ALPHA_CHANNEL_REF
pID3DDevice->SetRenderState(D3DRS_ALPHAREF, 127);
pID3DDevice->SetRenderState(D3DRS_ALPHAREF, material.MaterialTypeParam == 0 ? 127 : material.MaterialTypeParam * 255.f);
pID3DDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
}

View File

@ -115,11 +115,11 @@ namespace irr
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
virtual const c8* getTextFromClipboard() const _IRR_OVERRIDE_;
virtual const c8* getTextFromClipboard() const;
//! copies text to the clipboard
//! This sets the clipboard selection and _not_ the primary selection which you have on X on the middle mouse button.
virtual void copyToClipboard(const c8* text) const _IRR_OVERRIDE_;
virtual void copyToClipboard(const c8* text) const;
//! Remove all messages pending in the system message loop
virtual void clearSystemMessages() _IRR_OVERRIDE_;

View File

@ -495,10 +495,12 @@ public:
Driver->disableTextures(1);
Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates);
if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates)
if (material.MaterialType != lastMaterial.MaterialType
|| material.MaterialTypeParam != lastMaterial.MaterialTypeParam
|| resetAllRenderstates)
{
Driver->getBridgeCalls()->setAlphaTest(true);
Driver->getBridgeCalls()->setAlphaFunc(GL_GREATER, 0.5f);
Driver->getBridgeCalls()->setAlphaFunc(GL_GREATER, material.MaterialTypeParam == 0 ? 0.5 : material.MaterialTypeParam);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
}
@ -506,7 +508,7 @@ public:
virtual void OnSetBaseMaterial(const SMaterial& material) _IRR_OVERRIDE_
{
Driver->getBridgeCalls()->setAlphaTest(true);
Driver->getBridgeCalls()->setAlphaFunc(GL_GREATER, 0.5f);
Driver->getBridgeCalls()->setAlphaFunc(GL_GREATER, material.MaterialTypeParam == 0 ? 0.5 : material.MaterialTypeParam);
}
virtual void OnUnsetMaterial() _IRR_OVERRIDE_