Avoid destructor on md3 substructures which causes crash due to non-constructed array elements. Fixed color writing in irr mesh writer.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@928 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
8a3a2a2ad5
commit
39fc2a426b
|
@ -180,10 +180,10 @@ namespace scene
|
|||
}
|
||||
|
||||
// construct from a position and euler angles in degrees
|
||||
SMD3QuaterionTag ( const core::vector3df&pos, const core::vector3df &angle )
|
||||
SMD3QuaterionTag ( const core::vector3df &pos, const core::vector3df &angle )
|
||||
{
|
||||
position = pos;
|
||||
rotation.set ( angle.X * core::DEGTORAD, angle.Y * core::DEGTORAD, angle.Z * core::DEGTORAD );
|
||||
rotation.set ( angle * core::DEGTORAD );
|
||||
}
|
||||
|
||||
core::stringc Name;
|
||||
|
@ -199,6 +199,8 @@ namespace scene
|
|||
// holds a assoziative list of named quaternions
|
||||
struct SMD3QuaterionTagList : public virtual IReferenceCounted
|
||||
{
|
||||
~SMD3QuaterionTagList() {}
|
||||
|
||||
SMD3QuaterionTag* get ( const core::stringc& name )
|
||||
{
|
||||
SMD3QuaterionTag search ( name );
|
||||
|
|
|
@ -71,6 +71,9 @@ class quaternion
|
|||
//! sets new quaternion based on euler angles (radians)
|
||||
inline void set(f32 x, f32 y, f32 z);
|
||||
|
||||
//! sets new quaternion based on euler angles (radians)
|
||||
inline void set(const core::vector3df& vec);
|
||||
|
||||
//! normalizes the quaternion
|
||||
inline quaternion& normalize();
|
||||
|
||||
|
@ -397,6 +400,12 @@ inline void quaternion::set(f32 x, f32 y, f32 z)
|
|||
normalize();
|
||||
}
|
||||
|
||||
//! sets new quaternion based on euler angles
|
||||
inline void quaternion::set(const core::vector3df& vec)
|
||||
{
|
||||
set(vec.X, vec.Y, vec.Z);
|
||||
}
|
||||
|
||||
//! normalizes the quaternion
|
||||
inline quaternion& quaternion::normalize()
|
||||
{
|
||||
|
|
|
@ -79,8 +79,8 @@ namespace scene
|
|||
|
||||
|
||||
private:
|
||||
//! animates one frame
|
||||
inline void Animate (u32 frame);
|
||||
//! animates one frame
|
||||
inline void Animate (u32 frame);
|
||||
|
||||
video::SMaterial Material;
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ void CIrrMeshWriter::writeMeshBuffer(const scene::IMeshBuffer* buffer)
|
|||
str += getVectorAsStringLine(vtx[j].Normal);
|
||||
|
||||
char tmp[12];
|
||||
sprintf(tmp, " %08x ", vtx[j].Color);
|
||||
sprintf(tmp, " %08x ", vtx[j].Color.color);
|
||||
str += tmp;
|
||||
|
||||
str += getVectorAsStringLine(vtx[j].TCoords);
|
||||
|
@ -204,7 +204,7 @@ void CIrrMeshWriter::writeMeshBuffer(const scene::IMeshBuffer* buffer)
|
|||
str += getVectorAsStringLine(vtx[j].Normal);
|
||||
|
||||
char tmp[12];
|
||||
sprintf(tmp, " %08x ", vtx[j].Color);
|
||||
sprintf(tmp, " %08x ", vtx[j].Color.color);
|
||||
str += tmp;
|
||||
|
||||
str += getVectorAsStringLine(vtx[j].TCoords);
|
||||
|
@ -226,7 +226,7 @@ void CIrrMeshWriter::writeMeshBuffer(const scene::IMeshBuffer* buffer)
|
|||
str += getVectorAsStringLine(vtx[j].Normal);
|
||||
|
||||
char tmp[12];
|
||||
sprintf(tmp, " %08x ", vtx[j].Color);
|
||||
sprintf(tmp, " %08x ", vtx[j].Color.color);
|
||||
str += tmp;
|
||||
|
||||
str += getVectorAsStringLine(vtx[j].TCoords);
|
||||
|
|
|
@ -281,7 +281,7 @@ ITexture* CNullDriver::getTexture(const c8* filename)
|
|||
if (texture)
|
||||
{
|
||||
addTexture(texture);
|
||||
texture->drop(); // drop it becaus we created it, one grab too much
|
||||
texture->drop(); // drop it because we created it, one grab too much
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -41,7 +41,6 @@ namespace video
|
|||
|
||||
class COpenGLDriver;
|
||||
class IShaderConstantSetCallBack;
|
||||
class IMaterialRenderer;
|
||||
|
||||
//! Class for using GLSL shaders with OpenGL
|
||||
//! Please note: This renderer implements its own IMaterialRendererServices
|
||||
|
|
Loading…
Reference in New Issue