Merge revisions r5525 through r5530 from trunk to ogl-es

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5531 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-08-24 14:11:29 +00:00
parent c20dc5cc6f
commit 5450247e6b
5 changed files with 94 additions and 66 deletions

View File

@ -185,6 +185,9 @@ should now be fps independentn
--------------------------
Changes in 1.8.5
- CFileSystem::getAbsolutePath no longer wrongly converts an empty filename to "/" on unix platforms.
This fixes the bug that CFileSystem::createAndOpenFile("") returned a (strange behaving) non-null file pointer.
Additional check also added in createAndOpenFile to early out on empty names.
- Fix bug in cursor positions when compiled with newer Windows SDK's (v110 in VS2012) and running on Systems >= Windows Vista in windowed mode.
Thanks @Mustapha Tachouct for the bugreport and patch proposal. Also thanks @BakeMyCake for an earlier report.
- IOSOperator::getSysteMemory() no longer returns incorrect values with >2GB. Thanks @Eduline - human development for report and patch.

View File

@ -13,12 +13,12 @@
#include "plane3d.h"
#include "dimension2d.h"
#include "position2d.h"
#include "SMaterial.h"
#include "IMeshBuffer.h"
#include "triangle3d.h"
#include "EDriverTypes.h"
#include "EDriverFeatures.h"
#include "SExposedVideoData.h"
#include "SOverrideMaterial.h"
namespace irr
{
@ -156,71 +156,6 @@ namespace video
0
};
struct SOverrideMaterial
{
//! The Material values
SMaterial Material;
//! Which values are taken for override
/** OR'ed values from E_MATERIAL_FLAGS. */
u32 EnableFlags;
//! Set in which render passes the material override is active.
/** OR'ed values from E_SCENE_NODE_RENDER_PASS. */
u16 EnablePasses;
//! Global enable flag, overwritten by the SceneManager in each pass
/** The Scenemanager uses the EnablePass array and sets Enabled to
true if the Override material is enabled in the current pass. */
bool Enabled;
//! Default constructor
SOverrideMaterial() : EnableFlags(0), EnablePasses(0), Enabled(false) {}
//! Apply the enabled overrides
void apply(SMaterial& material)
{
if (Enabled)
{
for (u32 i=0; i<32; ++i)
{
const u32 num=(1<<i);
if (EnableFlags & num)
{
switch (num)
{
case EMF_WIREFRAME: material.Wireframe = Material.Wireframe; break;
case EMF_POINTCLOUD: material.PointCloud = Material.PointCloud; break;
case EMF_GOURAUD_SHADING: material.GouraudShading = Material.GouraudShading; break;
case EMF_LIGHTING: material.Lighting = Material.Lighting; break;
case EMF_ZBUFFER: material.ZBuffer = Material.ZBuffer; break;
case EMF_ZWRITE_ENABLE: material.ZWriteEnable = Material.ZWriteEnable; break;
case EMF_BACK_FACE_CULLING: material.BackfaceCulling = Material.BackfaceCulling; break;
case EMF_FRONT_FACE_CULLING: material.FrontfaceCulling = Material.FrontfaceCulling; break;
case EMF_BILINEAR_FILTER: material.TextureLayer[0].BilinearFilter = Material.TextureLayer[0].BilinearFilter; break;
case EMF_TRILINEAR_FILTER: material.TextureLayer[0].TrilinearFilter = Material.TextureLayer[0].TrilinearFilter; break;
case EMF_ANISOTROPIC_FILTER: material.TextureLayer[0].AnisotropicFilter = Material.TextureLayer[0].AnisotropicFilter; break;
case EMF_FOG_ENABLE: material.FogEnable = Material.FogEnable; break;
case EMF_NORMALIZE_NORMALS: material.NormalizeNormals = Material.NormalizeNormals; break;
case EMF_TEXTURE_WRAP:
material.TextureLayer[0].TextureWrapU = Material.TextureLayer[0].TextureWrapU;
material.TextureLayer[0].TextureWrapV = Material.TextureLayer[0].TextureWrapV;
material.TextureLayer[0].TextureWrapW = Material.TextureLayer[0].TextureWrapW;
break;
case EMF_ANTI_ALIASING: material.AntiAliasing = Material.AntiAliasing; break;
case EMF_COLOR_MASK: material.ColorMask = Material.ColorMask; break;
case EMF_COLOR_MATERIAL: material.ColorMaterial = Material.ColorMaterial; break;
case EMF_USE_MIP_MAPS: material.UseMipMaps = Material.UseMipMaps; break;
case EMF_BLEND_OPERATION: material.BlendOperation = Material.BlendOperation; break;
case EMF_BLEND_FACTOR: material.BlendFactor = Material.BlendFactor; break;
case EMF_POLYGON_OFFSET:
material.PolygonOffsetDirection = Material.PolygonOffsetDirection;
material.PolygonOffsetFactor = Material.PolygonOffsetFactor; break;
}
}
}
}
}
};
//! Interface to driver which is able to perform 2d and 3d graphics functions.
/** This interface is one of the most important interfaces of
the Irrlicht Engine: All rendering and texture manipulation is done with

View File

@ -0,0 +1,84 @@
// Copyright (C) 2017 Michael Zeilfelder
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __S_OVERRIDE_MATERIAL_H_INCLUDED__
#define __S_OVERRIDE_MATERIAL_H_INCLUDED__
#include "SMaterial.h"
namespace irr
{
namespace video
{
struct SOverrideMaterial
{
//! The Material values
SMaterial Material;
//! Which values are taken for override
/** OR'ed values from E_MATERIAL_FLAGS. */
u32 EnableFlags;
//! Set in which render passes the material override is active.
/** OR'ed values from E_SCENE_NODE_RENDER_PASS. */
u16 EnablePasses;
//! Global enable flag, overwritten by the SceneManager in each pass
/** The Scenemanager uses the EnablePass array and sets Enabled to
true if the Override material is enabled in the current pass. */
bool Enabled;
//! Default constructor
SOverrideMaterial() : EnableFlags(0), EnablePasses(0), Enabled(false) {}
//! Apply the enabled overrides
void apply(SMaterial& material)
{
if (Enabled)
{
for (u32 i=0; i<32; ++i)
{
const u32 num=(1<<i);
if (EnableFlags & num)
{
switch (num)
{
case EMF_WIREFRAME: material.Wireframe = Material.Wireframe; break;
case EMF_POINTCLOUD: material.PointCloud = Material.PointCloud; break;
case EMF_GOURAUD_SHADING: material.GouraudShading = Material.GouraudShading; break;
case EMF_LIGHTING: material.Lighting = Material.Lighting; break;
case EMF_ZBUFFER: material.ZBuffer = Material.ZBuffer; break;
case EMF_ZWRITE_ENABLE: material.ZWriteEnable = Material.ZWriteEnable; break;
case EMF_BACK_FACE_CULLING: material.BackfaceCulling = Material.BackfaceCulling; break;
case EMF_FRONT_FACE_CULLING: material.FrontfaceCulling = Material.FrontfaceCulling; break;
case EMF_BILINEAR_FILTER: material.TextureLayer[0].BilinearFilter = Material.TextureLayer[0].BilinearFilter; break;
case EMF_TRILINEAR_FILTER: material.TextureLayer[0].TrilinearFilter = Material.TextureLayer[0].TrilinearFilter; break;
case EMF_ANISOTROPIC_FILTER: material.TextureLayer[0].AnisotropicFilter = Material.TextureLayer[0].AnisotropicFilter; break;
case EMF_FOG_ENABLE: material.FogEnable = Material.FogEnable; break;
case EMF_NORMALIZE_NORMALS: material.NormalizeNormals = Material.NormalizeNormals; break;
case EMF_TEXTURE_WRAP:
material.TextureLayer[0].TextureWrapU = Material.TextureLayer[0].TextureWrapU;
material.TextureLayer[0].TextureWrapV = Material.TextureLayer[0].TextureWrapV;
material.TextureLayer[0].TextureWrapW = Material.TextureLayer[0].TextureWrapW;
break;
case EMF_ANTI_ALIASING: material.AntiAliasing = Material.AntiAliasing; break;
case EMF_COLOR_MASK: material.ColorMask = Material.ColorMask; break;
case EMF_COLOR_MATERIAL: material.ColorMaterial = Material.ColorMaterial; break;
case EMF_USE_MIP_MAPS: material.UseMipMaps = Material.UseMipMaps; break;
case EMF_BLEND_OPERATION: material.BlendOperation = Material.BlendOperation; break;
case EMF_BLEND_FACTOR: material.BlendFactor = Material.BlendFactor; break;
case EMF_POLYGON_OFFSET:
material.PolygonOffsetDirection = Material.PolygonOffsetDirection;
material.PolygonOffsetFactor = Material.PolygonOffsetFactor; break;
}
}
}
}
}
};
} // end namespace video
} // end namespace irr
#endif // __S_OVERRIDE_MATERIAL_H_INCLUDED__

View File

@ -111,6 +111,9 @@ CFileSystem::~CFileSystem()
//! opens a file for read access
IReadFile* CFileSystem::createAndOpenFile(const io::path& filename)
{
if ( filename.empty() )
return 0;
IReadFile* file = 0;
u32 i;
@ -610,6 +613,8 @@ bool CFileSystem::changeWorkingDirectoryTo(const io::path& newDirectory)
io::path CFileSystem::getAbsolutePath(const io::path& filename) const
{
if ( filename.empty() )
return filename;
#if defined(_IRR_WINDOWS_API_)
fschar_t *p=0;
fschar_t fpath[_MAX_PATH];

View File

@ -558,6 +558,7 @@
<Unit filename="../../include/SMeshBuffer.h" />
<Unit filename="../../include/SMeshBufferLightMap.h" />
<Unit filename="../../include/SMeshBufferTangents.h" />
<Unit filename="../../include/SOverrideMaterial.h" />
<Unit filename="../../include/SParticle.h" />
<Unit filename="../../include/SSharedMeshBuffer.h" />
<Unit filename="../../include/SSkinMeshBuffer.h" />