Merged revisions 2349:2403 from 1.5 branch. Added defines for version handling, added method to check for drivers. Fix bugs in Joystick handler, filename handler, and byteswap.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2439 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
7d00cc91d1
commit
8e9c3de276
|
@ -19,9 +19,9 @@ namespace video
|
||||||
EDT_NULL,
|
EDT_NULL,
|
||||||
|
|
||||||
//! The Irrlicht Engine Software renderer.
|
//! The Irrlicht Engine Software renderer.
|
||||||
/** Runs on all platforms, with every hardware. It should only be used for
|
/** Runs on all platforms, with every hardware. It should only
|
||||||
2d graphics, but it can also perform some primitive 3d
|
be used for 2d graphics, but it can also perform some primitive
|
||||||
functions. These 3d drawing functions are quite fast, but
|
3d functions. These 3d drawing functions are quite fast, but
|
||||||
very inaccurate, and don't even support clipping in 3D mode. */
|
very inaccurate, and don't even support clipping in 3D mode. */
|
||||||
EDT_SOFTWARE,
|
EDT_SOFTWARE,
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,6 @@ namespace scene
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Destructor
|
|
||||||
virtual ~ISceneCollisionManager() {}
|
|
||||||
|
|
||||||
//! Finds the collision point of a line and lots of triangles, if there is one.
|
//! Finds the collision point of a line and lots of triangles, if there is one.
|
||||||
/** \param ray: Line with witch collisions are tested.
|
/** \param ray: Line with witch collisions are tested.
|
||||||
\param selector: TriangleSelector containing the triangles. It
|
\param selector: TriangleSelector containing the triangles. It
|
||||||
|
@ -112,6 +109,8 @@ namespace scene
|
||||||
\param idBitMask: Only scene nodes with an id with bits set
|
\param idBitMask: Only scene nodes with an id with bits set
|
||||||
like in this mask will be tested. If the BitMask is 0, this
|
like in this mask will be tested. If the BitMask is 0, this
|
||||||
feature is disabled.
|
feature is disabled.
|
||||||
|
Please note that the default node id of -1 will match with
|
||||||
|
every bitmask != 0
|
||||||
\param bNoDebugObjects: Doesn't take debug objects into account
|
\param bNoDebugObjects: Doesn't take debug objects into account
|
||||||
when true. These are scene nodes with IsDebugObject() = true.
|
when true. These are scene nodes with IsDebugObject() = true.
|
||||||
\param root If different from 0, the search is limited to the children of this node.
|
\param root If different from 0, the search is limited to the children of this node.
|
||||||
|
@ -147,6 +146,8 @@ namespace scene
|
||||||
bits contained in this mask will be tested. However, if this parameter is 0, then
|
bits contained in this mask will be tested. However, if this parameter is 0, then
|
||||||
all nodes are checked.
|
all nodes are checked.
|
||||||
feature is disabled.
|
feature is disabled.
|
||||||
|
Please note that the default node id of -1 will match with
|
||||||
|
every bitmask != 0
|
||||||
\param bNoDebugObjects: Doesn't take debug objects into account
|
\param bNoDebugObjects: Doesn't take debug objects into account
|
||||||
when true. These are scene nodes with IsDebugObject() = true.
|
when true. These are scene nodes with IsDebugObject() = true.
|
||||||
\return Scene node nearest to the camera, which collides with
|
\return Scene node nearest to the camera, which collides with
|
||||||
|
|
|
@ -6,7 +6,13 @@
|
||||||
#define __IRR_COMPILE_CONFIG_H_INCLUDED__
|
#define __IRR_COMPILE_CONFIG_H_INCLUDED__
|
||||||
|
|
||||||
//! Irrlicht SDK Version
|
//! Irrlicht SDK Version
|
||||||
#define IRRLICHT_SDK_VERSION "1.6 SVN"
|
#define IRRLICHT_VERSION_MAJOR 1
|
||||||
|
#define IRRLICHT_VERSION_MINOR 6
|
||||||
|
#define IRRLICHT_VERSION_REVISION 0
|
||||||
|
// This flag will be defined only in SVN, the official release code will have
|
||||||
|
// it undefined
|
||||||
|
#define IRRLICHT_VERSION_SVN
|
||||||
|
#define IRRLICHT_SDK_VERSION "1.6-SVN"
|
||||||
|
|
||||||
#include <stdio.h> // TODO: Although included elsewhere this is required at least for mingw
|
#include <stdio.h> // TODO: Although included elsewhere this is required at least for mingw
|
||||||
|
|
||||||
|
@ -112,7 +118,7 @@ headers, e.g. Summer 2004. This is a Microsoft issue, not an Irrlicht one.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! Define _IRR_COMPILE_WITH_OPENGL_ to compile the Irrlicht engine with OpenGL.
|
//! Define _IRR_COMPILE_WITH_OPENGL_ to compile the Irrlicht engine with OpenGL.
|
||||||
/** If you do not wish the engine to be compiled with OpengGL, comment this
|
/** If you do not wish the engine to be compiled with OpenGL, comment this
|
||||||
define out. */
|
define out. */
|
||||||
#define _IRR_COMPILE_WITH_OPENGL_
|
#define _IRR_COMPILE_WITH_OPENGL_
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,10 @@ namespace irr
|
||||||
} // end namespace scene
|
} // end namespace scene
|
||||||
|
|
||||||
//! The Irrlicht device. You can create it with createDevice() or createDeviceEx().
|
//! The Irrlicht device. You can create it with createDevice() or createDeviceEx().
|
||||||
/** This is the most important class of the Irrlicht Engine. You can access everything
|
/** This is the most important class of the Irrlicht Engine. You can
|
||||||
in the engine if you have a pointer to an instance of this class.
|
access everything in the engine if you have a pointer to an instance of
|
||||||
There should be only one instance of this class at any time.
|
this class. There should be only one instance of this class at any
|
||||||
|
time.
|
||||||
*/
|
*/
|
||||||
class IrrlichtDevice : public virtual IReferenceCounted
|
class IrrlichtDevice : public virtual IReferenceCounted
|
||||||
{
|
{
|
||||||
|
@ -229,6 +230,50 @@ namespace irr
|
||||||
virtual bool getGammaRamp(f32 &red, f32 &green, f32 &blue,
|
virtual bool getGammaRamp(f32 &red, f32 &green, f32 &blue,
|
||||||
f32 &brightness, f32 &contrast) =0;
|
f32 &brightness, f32 &contrast) =0;
|
||||||
|
|
||||||
|
|
||||||
|
//! Allows to check which drivers are supported by the engine.
|
||||||
|
/** Even if true is returned the driver needs not be available
|
||||||
|
for an actual configuration requested upon device creation. */
|
||||||
|
static bool isDriverSupported(video::E_DRIVER_TYPE driver)
|
||||||
|
{
|
||||||
|
switch (driver)
|
||||||
|
{
|
||||||
|
case video::EDT_NULL:
|
||||||
|
return true;
|
||||||
|
case video::EDT_SOFTWARE:
|
||||||
|
#ifdef _IRR_COMPILE_WITH_SOFTWARE_
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
case video::EDT_BURNINGSVIDEO:
|
||||||
|
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
case video::EDT_DIRECT3D8:
|
||||||
|
#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
case video::EDT_DIRECT3D9:
|
||||||
|
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
case video::EDT_OPENGL:
|
||||||
|
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace irr
|
} // end namespace irr
|
||||||
|
|
|
@ -398,10 +398,14 @@ core::string<c16> CFileSystem::getFileBasename(const core::string<c16>& filename
|
||||||
s32 lastSlash = filename.findLast('/');
|
s32 lastSlash = filename.findLast('/');
|
||||||
const s32 lastBackSlash = filename.findLast('\\');
|
const s32 lastBackSlash = filename.findLast('\\');
|
||||||
lastSlash = core::max_(lastSlash, lastBackSlash);
|
lastSlash = core::max_(lastSlash, lastBackSlash);
|
||||||
|
|
||||||
|
// get number of chars after last dot
|
||||||
s32 end = 0;
|
s32 end = 0;
|
||||||
if (!keepExtension)
|
if (!keepExtension)
|
||||||
{
|
{
|
||||||
end = filename.findLast('.');
|
// take care to search only after last slash to check only for
|
||||||
|
// dots in the filename
|
||||||
|
end = filename.findLast('.', lastSlash);
|
||||||
if (end == -1)
|
if (end == -1)
|
||||||
end=0;
|
end=0;
|
||||||
else
|
else
|
||||||
|
|
|
@ -26,6 +26,10 @@ CGUISpinBox::CGUISpinBox(const wchar_t* text, bool border,IGUIEnvironment* envir
|
||||||
RangeMin(-FLT_MAX), RangeMax(FLT_MAX), FormatString(L"%f"),
|
RangeMin(-FLT_MAX), RangeMax(FLT_MAX), FormatString(L"%f"),
|
||||||
DecimalPlaces(-1)
|
DecimalPlaces(-1)
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
setDebugName("CGUISpinBox");
|
||||||
|
#endif
|
||||||
|
|
||||||
s32 ButtonWidth = 16;
|
s32 ButtonWidth = 16;
|
||||||
IGUISpriteBank *sb = 0;
|
IGUISpriteBank *sb = 0;
|
||||||
if (environment && environment->getSkin())
|
if (environment && environment->getSkin())
|
||||||
|
|
|
@ -17,6 +17,10 @@ namespace gui
|
||||||
CGUISpriteBank::CGUISpriteBank(IGUIEnvironment* env) :
|
CGUISpriteBank::CGUISpriteBank(IGUIEnvironment* env) :
|
||||||
Environment(env), Driver(0)
|
Environment(env), Driver(0)
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
setDebugName("CGUISpriteBank");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (Environment)
|
if (Environment)
|
||||||
{
|
{
|
||||||
Driver = Environment->getVideoDriver();
|
Driver = Environment->getVideoDriver();
|
||||||
|
|
|
@ -1038,6 +1038,9 @@ namespace video
|
||||||
CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size)
|
CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size)
|
||||||
:Data(0), Size(size), Format(format), DeleteMemory(true)
|
:Data(0), Size(size), Format(format), DeleteMemory(true)
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
setDebugName("CImage");
|
||||||
|
#endif
|
||||||
initData();
|
initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,10 @@ static const u32 WORD_BUFFER_LENGTH = 512;
|
||||||
COBJMeshFileLoader::COBJMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs)
|
COBJMeshFileLoader::COBJMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs)
|
||||||
: SceneManager(smgr), FileSystem(fs)
|
: SceneManager(smgr), FileSystem(fs)
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
setDebugName("COBJMeshFileLoader");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (FileSystem)
|
if (FileSystem)
|
||||||
FileSystem->grab();
|
FileSystem->grab();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,9 @@ namespace irr
|
||||||
CParticleScaleAffector::CParticleScaleAffector(const core::dimension2df& scaleTo)
|
CParticleScaleAffector::CParticleScaleAffector(const core::dimension2df& scaleTo)
|
||||||
: ScaleTo(scaleTo)
|
: ScaleTo(scaleTo)
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
setDebugName("CParticleScaleAffector");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -70,9 +70,9 @@ ISceneNode* CSceneCollisionManager::getSceneNodeFromRayBB(const core::line3d<f32
|
||||||
|
|
||||||
|
|
||||||
//! recursive method for going through all scene nodes
|
//! recursive method for going through all scene nodes
|
||||||
void CSceneCollisionManager::getPickedNodeBB(ISceneNode* root, core::line3df& ray,
|
void CSceneCollisionManager::getPickedNodeBB(ISceneNode* root,
|
||||||
s32 bits, bool bNoDebugObjects,
|
core::line3df& ray, s32 bits, bool bNoDebugObjects,
|
||||||
f32& outbestdistance, ISceneNode*& outbestnode)
|
f32& outbestdistance, ISceneNode*& outbestnode)
|
||||||
{
|
{
|
||||||
const core::list<ISceneNode*>& children = root->getChildren();
|
const core::list<ISceneNode*>& children = root->getChildren();
|
||||||
const core::vector3df rayVector = ray.getVector().normalize();
|
const core::vector3df rayVector = ray.getVector().normalize();
|
||||||
|
@ -782,7 +782,7 @@ core::vector3df CSceneCollisionManager::collideWithWorld(s32 recursionDepth,
|
||||||
return pos + vel;
|
return pos + vel;
|
||||||
|
|
||||||
// original destination point
|
// original destination point
|
||||||
core::vector3df destinationPoint = pos + vel;
|
const core::vector3df destinationPoint = pos + vel;
|
||||||
core::vector3df newBasePoint = pos;
|
core::vector3df newBasePoint = pos;
|
||||||
|
|
||||||
// only update if we are not already very close
|
// only update if we are not already very close
|
||||||
|
@ -800,9 +800,8 @@ core::vector3df CSceneCollisionManager::collideWithWorld(s32 recursionDepth,
|
||||||
|
|
||||||
// calculate sliding plane
|
// calculate sliding plane
|
||||||
|
|
||||||
core::vector3df slidePlaneOrigin = colData.intersectionPoint;
|
const core::vector3df slidePlaneOrigin = colData.intersectionPoint;
|
||||||
core::vector3df slidePlaneNormal = newBasePoint - colData.intersectionPoint;
|
const core::vector3df slidePlaneNormal = (newBasePoint - colData.intersectionPoint).normalize();
|
||||||
slidePlaneNormal.normalize();
|
|
||||||
core::plane3d<f32> slidingPlane(slidePlaneOrigin, slidePlaneNormal);
|
core::plane3d<f32> slidingPlane(slidePlaneOrigin, slidePlaneNormal);
|
||||||
|
|
||||||
core::vector3df newDestinationPoint =
|
core::vector3df newDestinationPoint =
|
||||||
|
@ -811,7 +810,7 @@ core::vector3df CSceneCollisionManager::collideWithWorld(s32 recursionDepth,
|
||||||
|
|
||||||
// generate slide vector
|
// generate slide vector
|
||||||
|
|
||||||
core::vector3df newVelocityVector = newDestinationPoint -
|
const core::vector3df newVelocityVector = newDestinationPoint -
|
||||||
colData.intersectionPoint;
|
colData.intersectionPoint;
|
||||||
|
|
||||||
if (newVelocityVector.getLength() < veryCloseDistance)
|
if (newVelocityVector.getLength() < veryCloseDistance)
|
||||||
|
|
|
@ -1342,10 +1342,10 @@ void CIrrDeviceMacOSX::pollJoysticks()
|
||||||
result = (*(ActiveJoysticks[joystick].interface))->getElementValue(ActiveJoysticks[joystick].interface, ActiveJoysticks[joystick].axisComp[n].cookie, &hidEvent);
|
result = (*(ActiveJoysticks[joystick].interface))->getElementValue(ActiveJoysticks[joystick].interface, ActiveJoysticks[joystick].axisComp[n].cookie, &hidEvent);
|
||||||
if (kIOReturnSuccess == result)
|
if (kIOReturnSuccess == result)
|
||||||
{
|
{
|
||||||
f32 min = -32768.0f;
|
const f32 min = -32768.0f;
|
||||||
f32 max = 32768.0f;
|
const f32 max = 32767.0f;
|
||||||
f32 deviceScale = max - min;
|
const f32 deviceScale = max - min;
|
||||||
f32 readScale = (f32)ActiveJoysticks[joystick].axisComp[n].maxRead - (f32)ActiveJoysticks[joystick].axisComp[n].minRead;
|
const f32 readScale = (f32)ActiveJoysticks[joystick].axisComp[n].maxRead - (f32)ActiveJoysticks[joystick].axisComp[n].minRead;
|
||||||
|
|
||||||
if (hidEvent.value < ActiveJoysticks[joystick].axisComp[n].minRead)
|
if (hidEvent.value < ActiveJoysticks[joystick].axisComp[n].minRead)
|
||||||
ActiveJoysticks[joystick].axisComp[n].minRead = hidEvent.value;
|
ActiveJoysticks[joystick].axisComp[n].minRead = hidEvent.value;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
VERSION = 1.5
|
VERSION = 1.6.0-SVN
|
||||||
# Irrlicht Engine 1.5
|
# Irrlicht Engine 1.6.0-SVN
|
||||||
# Makefile for Linux
|
# Makefile for Linux
|
||||||
#
|
#
|
||||||
# To use, just run:
|
# To use, just run:
|
||||||
|
|
|
@ -11,30 +11,23 @@
|
||||||
#include <SDL/SDL_endian.h>
|
#include <SDL/SDL_endian.h>
|
||||||
#define bswap_16(X) SDL_Swap16(X)
|
#define bswap_16(X) SDL_Swap16(X)
|
||||||
#define bswap_32(X) SDL_Swap32(X)
|
#define bswap_32(X) SDL_Swap32(X)
|
||||||
#elif defined(_IRR_WINDOWS_API_)
|
#elif defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER > 1298)
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER > 1298))
|
#include <stdlib.h>
|
||||||
#include <stdlib.h>
|
#define bswap_16(X) _byteswap_ushort(X)
|
||||||
#define bswap_16(X) _byteswap_ushort(X)
|
#define bswap_32(X) _byteswap_ulong(X)
|
||||||
#define bswap_32(X) _byteswap_ulong(X)
|
#elif defined(_IRR_OSX_PLATFORM_)
|
||||||
#else
|
#include <libkern/OSByteOrder.h>
|
||||||
#define bswap_16(X) ((((X)&0xFF) << 8) | (((X)&=0xFF00) >> 8))
|
#define bswap_16(X) OSReadSwapInt16(&X,0)
|
||||||
#define bswap_32(X) ( (((X)&0x000000FF)<<24) | (((X)&0xFF000000) >> 24) | (((X)&0x0000FF00) << 8) | (((X) &0x00FF0000) >> 8))
|
#define bswap_32(X) OSReadSwapInt32(&X,0)
|
||||||
#endif
|
#elif defined(__FreeBSD__)
|
||||||
|
#include <sys/endian.h>
|
||||||
|
#define bswap_16(X) bswap16(X)
|
||||||
|
#define bswap_32(X) bswap32(X)
|
||||||
|
#elif !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__PPC__) && !defined(_IRR_WINDOWS_API_)
|
||||||
|
#include <byteswap.h>
|
||||||
#else
|
#else
|
||||||
#if defined(_IRR_OSX_PLATFORM_)
|
#define bswap_16(X) ((((X)&0xFF) << 8) | (((X)&0xFF00) >> 8))
|
||||||
#include <libkern/OSByteOrder.h>
|
#define bswap_32(X) ( (((X)&0x000000FF)<<24) | (((X)&0xFF000000) >> 24) | (((X)&0x0000FF00) << 8) | (((X) &0x00FF0000) >> 8))
|
||||||
#define bswap_16(X) OSReadSwapInt16(&X,0)
|
|
||||||
#define bswap_32(X) OSReadSwapInt32(&X,0)
|
|
||||||
#elif defined(__FreeBSD__)
|
|
||||||
#include <sys/endian.h>
|
|
||||||
#define bswap_16(X) bswap16(X)
|
|
||||||
#define bswap_32(X) bswap32(X)
|
|
||||||
#elif !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__PPC__)
|
|
||||||
#include <byteswap.h>
|
|
||||||
#else
|
|
||||||
#define bswap_16(X) ((((X)&0xFF) << 8) | (((X)&=0xFF00) >> 8))
|
|
||||||
#define bswap_32(X) ( (((X)&0x000000FF)<<24) | (((X)&0xFF000000) >> 24) | (((X)&0x0000FF00) << 8) | (((X) &0x00FF0000) >> 8))
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
|
|
Loading…
Reference in New Issue