Commit 5bc1bdc1 authored by hybrid's avatar hybrid

Merged from 1.4 branch revisions 1198:1217

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1218 dfc29bdd-3216-0410-991c-e03cc46cb475
parent a3a41d80
-------------------------------------------
Changes in version 1.5 (... 2008) Changes in version 1.5 (... 2008)
- Added volume light scene node - Added volume light scene node
...@@ -43,9 +42,52 @@ Changes in version 1.5 (... 2008) ...@@ -43,9 +42,52 @@ Changes in version 1.5 (... 2008)
- Modal screens no longer flash invisible children when rejecting a focus change. - Modal screens no longer flash invisible children when rejecting a focus change.
- Finally added StarSonata patch with table element and TabControl additions. Table is based on MultiColor listbox by Acki, and has loads of changes by CuteAlien. - Finally added StarSonata patch with table element and TabControl additions. Table is based on MultiColor listbox by Acki, and has loads of changes by CuteAlien.
------------------------------------------- -------------------------------------------
Changes in version 1.4.1 (??? 2008)
- Fixed the FollowSpline animator to avoid crashes when only one waypoint is given.
- OpenGL VolumeShadow now uses glPolygonOffset to avoid zbuffer artifacts.
- Fixed meshbuffer corruption in append methods.
- Fixed mem leaks in irrArray.
- Fixed minor bugs in ISceneNode and ISceneManager.
- Fixed the MeshCache handling of GeometryCreator meshes.
- Terrain LOD bugfix.
- Some Collada 1.3 loader enhancements and bug fixes.
- Fixed a bug in CGUISpriteBank which caused a crash when a non-looping animated sprite reached the end of its animation.
- Enhanced the .obj loader with the patch from ryanclark. This allows for recalculation of smoothed normals of the mesh, also should decrease the tri count on some meshes.
- Avoid the global Logger to be destroyed too early.
- Function setbit was renamed to setbit_cond to avoid name clashes.
- Fixed .x animations with multiple references to the same joint from different meshes.
- Support for Milkshape 1.8 files, also with multiple weights per joint.
- The config file now also supports _IRR_OSX_PLATFORM_ and _IRR_USE_OSX_DEVICE_. This allows to use the Linux device (X11 support) on OSX.
- Avoid terrain scene node crash when heightmap cannot be loaded.
- Speed improvements for WaterSceneNode.
- FlyCircle animator now also works for upvectors (Direction parameter) which are not (0,1,0). Is also faster now, since most calculations are done on init. Thanks to Dorth for working on this.
- The 3ds loader correctly creates a texture matrix when texture tiling properties are found in the file.
- Fix for S3DVertex comparison operators. Used some wrong logic.
- Bugfix getCurrentRenderTargetSize in D3D drivers. Due to signature differences a wrong virtual method was chosen. Thanks to Jiang for finding it.
-------------------------------------------
Changes in version 1.4 (30.11.2007) Changes in version 1.4 (30.11.2007)
- Major API change: All material properties which are available per texture layer (curently texture, texture matrix, texture filters, and texture wrap mode) are separated into a new struct SMaterialLayer. You can access them via the array TextureLayer[] in SMaterial. The texture matrix methods in SMaterial are still alive, and also textures can be accessed via methods in SMaterial now. But still, many places in user code need some update (usually changing material.Textures[i] to material.TextureLayer[i].Texture etc.) - Major API change: All material properties which are available per texture layer (curently texture, texture matrix, texture filters, and texture wrap mode) are separated into a new struct SMaterialLayer. You can access them via the array TextureLayer[] in SMaterial. The texture matrix methods in SMaterial are still alive, and also textures can be accessed via methods in SMaterial now. But still, many places in user code need some update (usually changing material.Textures[i] to material.TextureLayer[i].Texture etc.)
...@@ -431,7 +473,6 @@ GUI Editor: ...@@ -431,7 +473,6 @@ GUI Editor:
- Added CGUIPanel, a container with optional scrollbars. Originally submitted by Asger Feldthaus - Added CGUIPanel, a container with optional scrollbars. Originally submitted by Asger Feldthaus
------------------------------------------- -------------------------------------------
Changes in version 1.3 (15 Mar 2007) Changes in version 1.3 (15 Mar 2007)
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef __E_GUI_ELEMENT_TYPES_H_INCLUDED__ #ifndef __E_GUI_ELEMENT_TYPES_H_INCLUDED__
#define __E_GUI_ELEMENT_TYPES_H_INCLUDED__ #define __E_GUI_ELEMENT_TYPES_H_INCLUDED__
#include "irrTypes.h"
namespace irr namespace irr
{ {
namespace gui namespace gui
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef __E_MESH_WRITER_ENUMS_H_INCLUDED__ #ifndef __E_MESH_WRITER_ENUMS_H_INCLUDED__
#define __E_MESH_WRITER_ENUMS_H_INCLUDED__ #define __E_MESH_WRITER_ENUMS_H_INCLUDED__
#include "irrTypes.h"
namespace irr namespace irr
{ {
namespace scene namespace scene
......
...@@ -998,11 +998,10 @@ namespace scene ...@@ -998,11 +998,10 @@ namespace scene
//! Creates a follow spline animator. //! Creates a follow spline animator.
/** The animator modifies the position of /** The animator modifies the position of
the attached scene node to make it follow a hermite spline. the attached scene node to make it follow a hermite spline.
The code of the is based on a scene node It uses a subset of hermite splines: either cardinal splines
Matthias Gall sent in. Thanks! I adapted the code just a little bit. Matthias (tightness != 0.5) or catmull-rom-splines (tightness == 0.5).
wrote: The animator moves from one control point to the next in
Uses a subset of hermite splines: either cardinal splines (tightness != 0.5) or catmull-rom-splines (tightness == 0.5) 1/speed seconds. This code was sent in by Matthias Gall. */
but this is just my understanding of this stuff, I'm not a mathematician, so this might be wrong ;) */
virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime, virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime,
const core::array< core::vector3df >& points, const core::array< core::vector3df >& points,
f32 speed = 1.0f, f32 tightness = 0.5f) = 0; f32 speed = 1.0f, f32 tightness = 0.5f) = 0;
...@@ -1208,7 +1207,7 @@ namespace scene ...@@ -1208,7 +1207,7 @@ namespace scene
//! Loads a scene. Note that the current scene is not cleared before. //! Loads a scene. Note that the current scene is not cleared before.
/** The scene is usually load from an .irr file, an xml based format. .irr files can /** The scene is usually load from an .irr file, an xml based format. .irr files can
Be edited with the Irrlicht Engine Editor, irrEdit (http://irredit.irrlicht3d.org) or Be edited with the Irrlicht Engine Editor, irrEdit (http://irredit.irrlicht3d.org) or
saved directly by the engine using ISceneManager::saveScene(). saved directly by the engine using ISceneManager::saveScene().
\param filename: Name of the file. \param filename: Name of the file.
\param userDataSerializer: If you want to load user data possibily saved in that file for \param userDataSerializer: If you want to load user data possibily saved in that file for
some scene nodes in the file, implement the ISceneUserDataSerializer interface and provide it as parameter here. some scene nodes in the file, implement the ISceneUserDataSerializer interface and provide it as parameter here.
...@@ -1219,13 +1218,13 @@ namespace scene ...@@ -1219,13 +1218,13 @@ namespace scene
//! Loads a scene. Note that the current scene is not cleared before. //! Loads a scene. Note that the current scene is not cleared before.
/** The scene is usually load from an .irr file, an xml based format. .irr files can /** The scene is usually load from an .irr file, an xml based format. .irr files can
Be edited with the Irrlicht Engine Editor, irrEdit (http://irredit.irrlicht3d.org) or Be edited with the Irrlicht Engine Editor, irrEdit (http://irredit.irrlicht3d.org) or
saved directly by the engine using ISceneManager::saveScene(). saved directly by the engine using ISceneManager::saveScene().
\param file: File where the scene is going to be saved into. \param file: File where the scene is going to be saved into.
\param userDataSerializer: If you want to load user data possibily saved in that file for \param userDataSerializer: If you want to load user data possibily saved in that file for
some scene nodes in the file, implement the ISceneUserDataSerializer interface and provide it as parameter here. some scene nodes in the file, implement the ISceneUserDataSerializer interface and provide it as parameter here.
Otherwise, simply specify 0 as this parameter. Otherwise, simply specify 0 as this parameter.
\return Returns true if successful. */ \return Returns true if successful. */
virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0) = 0; virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0) = 0;
//! Returns a mesh writer implementation if available //! Returns a mesh writer implementation if available
/** Note: You need to drop() the pointer after use again, see IReferenceCounted::drop() /** Note: You need to drop() the pointer after use again, see IReferenceCounted::drop()
......
...@@ -63,6 +63,11 @@ namespace core ...@@ -63,6 +63,11 @@ namespace core
return dimension2d<T>(Width*scale, Height*scale); return dimension2d<T>(Width*scale, Height*scale);
} }
T getArea() const
{
return Width*Height;
}
T Width, Height; T Width, Height;
}; };
......
...@@ -324,21 +324,18 @@ ITexture* CNullDriver::getTexture(const c8* filename) ...@@ -324,21 +324,18 @@ ITexture* CNullDriver::getTexture(const c8* filename)
addTexture(texture); addTexture(texture);
texture->drop(); // drop it because we created it, one grab too much texture->drop(); // drop it because we created it, one grab too much
} }
else
os::Printer::log("Could not load texture", filename, ELL_ERROR);
return texture;
} }
else else
{ {
os::Printer::log("Could not open file of texture", filename, ELL_WARNING); os::Printer::log("Could not open file of texture", filename, ELL_WARNING);
return texture; return 0;
} }
if (!texture)
os::Printer::log("Could not load texture", filename, ELL_WARNING);
return texture;
} }
//! loads a Texture //! loads a Texture
ITexture* CNullDriver::getTexture(io::IReadFile* file) ITexture* CNullDriver::getTexture(io::IReadFile* file)
{ {
...@@ -367,7 +364,6 @@ ITexture* CNullDriver::getTexture(io::IReadFile* file) ...@@ -367,7 +364,6 @@ ITexture* CNullDriver::getTexture(io::IReadFile* file)
} }
//! opens the file and loads it into the surface //! opens the file and loads it into the surface
video::ITexture* CNullDriver::loadTextureFromFile(io::IReadFile* file, const c8 *hashName ) video::ITexture* CNullDriver::loadTextureFromFile(io::IReadFile* file, const c8 *hashName )
{ {
......
...@@ -2068,6 +2068,8 @@ void COpenGLDriver::drawStencilShadowVolume(const core::vector3df* triangles, s3 ...@@ -2068,6 +2068,8 @@ void COpenGLDriver::drawStencilShadowVolume(const core::vector3df* triangles, s3
glDepthMask(GL_FALSE); // no depth buffer writing glDepthMask(GL_FALSE); // no depth buffer writing
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE ); // no color buffer drawing glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE ); // no color buffer drawing
glEnable(GL_STENCIL_TEST); glEnable(GL_STENCIL_TEST);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(0.0f, 1.0f);
glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3,GL_FLOAT,sizeof(core::vector3df),&triangles[0]); glVertexPointer(3,GL_FLOAT,sizeof(core::vector3df),&triangles[0]);
......
...@@ -21,7 +21,6 @@ CSceneNodeAnimatorFollowSpline::CSceneNodeAnimatorFollowSpline(u32 time, ...@@ -21,7 +21,6 @@ CSceneNodeAnimatorFollowSpline::CSceneNodeAnimatorFollowSpline(u32 time,
} }
inline s32 CSceneNodeAnimatorFollowSpline::clamp(s32 idx, s32 size) inline s32 CSceneNodeAnimatorFollowSpline::clamp(s32 idx, s32 size)
{ {
return ( idx<0 ? size+idx : ( idx>=size ? idx-size : idx ) ); return ( idx<0 ? size+idx : ( idx>=size ? idx-size : idx ) );
...@@ -34,6 +33,11 @@ void CSceneNodeAnimatorFollowSpline::animateNode(ISceneNode* node, u32 timeMs) ...@@ -34,6 +33,11 @@ void CSceneNodeAnimatorFollowSpline::animateNode(ISceneNode* node, u32 timeMs)
const u32 pSize = Points.size(); const u32 pSize = Points.size();
if (pSize==0) if (pSize==0)
return; return;
if (pSize==1)
{
node->setPosition(Points[0]);
return;
}
const f32 dt = ( (timeMs-StartTime) * Speed * 0.001f ); const f32 dt = ( (timeMs-StartTime) * Speed * 0.001f );
const f32 u = core::fract ( dt ); const f32 u = core::fract ( dt );
...@@ -41,8 +45,8 @@ void CSceneNodeAnimatorFollowSpline::animateNode(ISceneNode* node, u32 timeMs) ...@@ -41,8 +45,8 @@ void CSceneNodeAnimatorFollowSpline::animateNode(ISceneNode* node, u32 timeMs)
//const f32 u = 0.001f * fmodf( dt, 1000.0f ); //const f32 u = 0.001f * fmodf( dt, 1000.0f );
const core::vector3df& p0 = Points[ clamp( idx - 1, pSize ) ]; const core::vector3df& p0 = Points[ clamp( idx - 1, pSize ) ];
const core::vector3df& p1 = Points[ clamp( idx + 0, pSize ) ]; const core::vector3df& p1 = Points[ clamp( idx + 0, pSize ) ]; // starting point
const core::vector3df& p2 = Points[ clamp( idx + 1, pSize ) ]; const core::vector3df& p2 = Points[ clamp( idx + 1, pSize ) ]; // end point
const core::vector3df& p3 = Points[ clamp( idx + 2, pSize ) ]; const core::vector3df& p3 = Points[ clamp( idx + 2, pSize ) ];
// hermite polynomials // hermite polynomials
......
...@@ -1151,7 +1151,7 @@ namespace scene ...@@ -1151,7 +1151,7 @@ namespace scene
s32 X(core::floor32( pos.X )); s32 X(core::floor32( pos.X ));
s32 Z(core::floor32( pos.Z )); s32 Z(core::floor32( pos.Z ));
if( X >= 0 && X < TerrainData.Size && Z >= 0 && Z <= TerrainData.Size ) if( X >= 0 && X < TerrainData.Size && Z >= 0 && Z < TerrainData.Size )
{ {
const video::S3DVertex2TCoords* Vertices = (const video::S3DVertex2TCoords*)Mesh.getMeshBuffer( 0 )->getVertices(); const video::S3DVertex2TCoords* Vertices = (const video::S3DVertex2TCoords*)Mesh.getMeshBuffer( 0 )->getVertices();
const core::vector3df& a = Vertices[ X * TerrainData.Size + Z ].Pos; const core::vector3df& a = Vertices[ X * TerrainData.Size + Z ].Pos;
......
...@@ -1256,7 +1256,7 @@ bool CXMeshFileLoader::parseDataObjectMaterial(video::SMaterial& material) ...@@ -1256,7 +1256,7 @@ bool CXMeshFileLoader::parseDataObjectMaterial(video::SMaterial& material)
return false; return false;
// original name // original name
SceneManager->getVideoDriver()->getTexture ( TextureFileName.c_str() ); material.setTexture(0, SceneManager->getVideoDriver()->getTexture ( TextureFileName.c_str() ));
// mesh path // mesh path
if (!material.getTexture(0)) if (!material.getTexture(0))
{ {
...@@ -1265,7 +1265,7 @@ bool CXMeshFileLoader::parseDataObjectMaterial(video::SMaterial& material) ...@@ -1265,7 +1265,7 @@ bool CXMeshFileLoader::parseDataObjectMaterial(video::SMaterial& material)
} }
// working directory // working directory
if (!material.getTexture(0)) if (!material.getTexture(0))
SceneManager->getVideoDriver()->getTexture ( stripPathFromString(TextureFileName,false).c_str() ); material.setTexture(0, SceneManager->getVideoDriver()->getTexture ( stripPathFromString(TextureFileName,false).c_str() ));
} }
else else
{ {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment