Commit 451d5bca authored by hybrid's avatar hybrid

Merged from 1.4 branch revisions 1251:1271

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1272 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 89aa5dab
......@@ -14,11 +14,11 @@ namespace scene
{
//! Scene node which is a dynamic light.
/** You can switch the light on and off by
making it visible or not, and let it be animated by ordinary scene node animators.
If you set the light type to be directional, you will need to set the direction of the
light source manually in the SLight structure, the position of the scene node will have no
effect on this direction.
/** You can switch the light on and off by making it visible or not. It can be
animated by ordinary scene node animators.
If the light type is directional or spot, the direction of the light source
is defined by the rotation of the scene node (assuming (0,0,1) as the local
direction of the light).
*/
class ILightSceneNode : public ISceneNode
{
......@@ -30,6 +30,7 @@ public:
: ISceneNode(parent, mgr, id, position) {}
//! Sets the light data associated with this ILightSceneNode
//! \param light The new light data.
virtual void setLightData(const video::SLight& light) = 0;
//! Gets the light data associated with this ILightSceneNode
......
This diff is collapsed.
......@@ -37,26 +37,26 @@ const c8* const LightTypeNames[] =
*/
struct SLight
{
SLight() : AmbientColor(0.0f,0.0f,0.0f), DiffuseColor(1.0f,1.0f,1.0f),
SpecularColor(1.0f,1.0f,1.0f), Attenuation(1.0f,0.0f,0.0f),
Radius(100.0f), OuterCone(45.0f), InnerCone(0.0f),
Falloff(2.0f), CastShadows(true), Type(ELT_POINT),
Position(0.0f,0.0f,0.0f), Direction(0.0f,0.0f,1.0f)
SLight() : AmbientColor(0.f,0.f,0.f), DiffuseColor(1.f,1.f,1.f),
SpecularColor(1.f,1.f,1.f), Attenuation(1.f,0.f,0.f),
Radius(100.f), OuterCone(45.f), InnerCone(0.f), Falloff(2.f),
Position(0.f,0.f,0.f), Direction(0.f,0.f,1.f),
Type(ELT_POINT), CastShadows(true)
{};
//! Ambient color emitted by the light
SColorf AmbientColor;
//! Diffuse color emitted by the light.
/** This is the primary color you might want to set. */
//! This is the primary color you want to set.
SColorf DiffuseColor;
//! Specular color emitted by the light.
/** For details how to use specular highlights, see SMaterial::Shininess */
//! For details how to use specular highlights, see SMaterial::Shininess
SColorf SpecularColor;
//! Attenuation factors (constant, linear, quadratic)
/** Changes the light strength fading over distance */
//! Changes the light strength fading over distance
core::vector3df Attenuation;
//! Radius of light. Everything within this radius be be lighted.
......@@ -71,17 +71,19 @@ struct SLight
//! The light strength's decrease between Outer and Inner cone.
f32 Falloff;
//! Does the light cast shadows?
bool CastShadows;
//! Read-ONLY! Position of the light. If Type is ELT_DIRECTIONAL,
//! it is ignored. Changed via light scene node's position.
core::vector3df Position;
//! Read-ONLY! Direction of the light. If Type is ELT_POINT,
//! it is ignored. Changed via light scene node's rotation.
core::vector3df Direction;
//! Type of the light. Default: ELT_POINT
E_LIGHT_TYPE Type;
//! Read-ONLY! Position of the light. If Type is ELT_DIRECTIONAL, this is ignored.
core::vector3df Position;
//! Read-ONLY! Direction of the light. If Type is ELT_POINT, this is ignored.
core::vector3df Direction;
//! Does the light cast shadows?
bool CastShadows;
};
} // end namespace video
......
......@@ -49,7 +49,7 @@ namespace scene
// reverse search
virtual IMeshBuffer* getMeshBuffer( const video::SMaterial & material) const
{
for (s32 i = (s32) MeshBuffers.size(); --i >= 0; )
for (s32 i = (s32)MeshBuffers.size()-1; i >= 0; --i)
{
if ( material == MeshBuffers[i]->getMaterial())
return MeshBuffers[i];
......
......@@ -556,11 +556,11 @@ public:
}
//! finds first occurrence of a character of a list in string
/** \param c: List of strings to find. For example if the method
/** \param c: List of characters to find. For example if the method
should find the first occurrence of 'a' or 'b', this parameter should be "ab".
\param count: Amount of characters in the list. Ususally,
this should be strlen(ofParameter1)
\return Returns position where one of the character has been found,
\param count: Amount of characters in the list. Usually,
this should be strlen(c)
\return Returns position where one of the characters has been found,
or -1 if not found. */
s32 findFirstChar(const T* const c, u32 count) const
{
......@@ -579,8 +579,8 @@ public:
//! Finds first position of a character not in a given list.
/** \param c: List of characters not to find. For example if the method
should find the first occurrence of a character not 'a' or 'b', this parameter should be "ab".
\param count: Amount of characters in the list. Ususally,
this should be strlen(ofParameter1)
\param count: Amount of characters in the list. Usually,
this should be strlen(c)
\return Returns position where the character has been found,
or -1 if not found. */
template <class B>
......@@ -603,8 +603,8 @@ public:
//! Finds last position of a character not in a given list.
/** \param c: List of characters not to find. For example if the method
should find the first occurrence of a character not 'a' or 'b', this parameter should be "ab".
\param count: Amount of characters in the list. Ususally,
this should be strlen(ofParameter1)
\param count: Amount of characters in the list. Usually,
this should be strlen(c)
\return Returns position where the character has been found,
or -1 if not found. */
template <class B>
......@@ -654,6 +654,27 @@ public:
return -1;
}
//! finds last occurrence of a character of a list in string
/** \param c: List of strings to find. For example if the method
should find the last occurrence of 'a' or 'b', this parameter should be "ab".
\param count: Amount of characters in the list. Usually,
this should be strlen(c)
\return Returns position where one of the characters has been found,
or -1 if not found. */
s32 findLastChar(const T* const c, u32 count) const
{
if (!c)
return -1;
for (u32 i=(used-1); i>=0; --i)
for (u32 j=0; j<count; ++j)
if (array[i] == c[j])
return i;
return -1;
}
//! finds another string in this string
//! \param str: Another string
//! \return Returns positions where the string has been found,
......
......@@ -402,10 +402,9 @@ void CAnimatedMeshMD2::updateInterpolationBuffer(s32 frame, s32 startFrameLoop,
video::S3DVertex* first = FrameList[firstFrame].pointer();
video::S3DVertex* second = FrameList[secondFrame].pointer();
s32 count = FrameList[firstFrame].size();
// interpolate both frames
for (s32 i=0; i<count; ++i)
const u32 count = FrameList[firstFrame].size();
for (u32 i=0; i<count; ++i)
{
target->Pos = (second->Pos - first->Pos) * div + first->Pos;
target->Normal = (second->Normal - first->Normal) * div + first->Normal;
......@@ -722,7 +721,8 @@ void CAnimatedMeshMD2::getFrameLoop(EMD2_ANIMATION_TYPE l,
bool CAnimatedMeshMD2::getFrameLoop(const c8* name,
s32& outBegin, s32&outEnd, s32& outFPS) const
{
for (s32 i=0; i<(s32)FrameData.size(); ++i)
for (u32 i=0; i<FrameData.size(); ++i)
{
if (FrameData[i].name == name)
{
outBegin = FrameData[i].begin << MD2_FRAME_SHIFT;
......@@ -731,6 +731,7 @@ bool CAnimatedMeshMD2::getFrameLoop(const c8* name,
outFPS = FrameData[i].fps << MD2_FRAME_SHIFT;
return true;
}
}
return false;
}
......@@ -746,7 +747,7 @@ s32 CAnimatedMeshMD2::getAnimationCount() const
//! Returns name of md2 animation.
const c8* CAnimatedMeshMD2::getAnimationName(s32 nr) const
{
if (nr < 0 || nr >= (s32)FrameData.size())
if ((u32)nr >= FrameData.size())
return 0;
return FrameData[nr].name.c_str();
......
......@@ -260,20 +260,7 @@ void CAnimatedMeshSceneNode::render()
}
m=skinnedMesh;
if (m)
{
for (u32 g=0; g< m->getMeshBufferCount(); ++g)
{
const IMeshBuffer* mb = m->getMeshBuffer(g);
const core::matrix4 mat = AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation;
core::aabbox3df tmpbox(mb->getBoundingBox());
mat.transformBox(tmpbox);
if (g==0)
Box = tmpbox;
else
Box.addInternalBox(tmpbox);
}
}
}
if ( 0 == m )
......@@ -298,14 +285,15 @@ void CAnimatedMeshSceneNode::render()
// overwrite half transparency
if ( DebugDataVisible & scene::EDS_HALF_TRANSPARENCY )
{
if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::matrix4() );
for (u32 i=0; i<m->getMeshBufferCount(); ++i)
{
scene::IMeshBuffer* mb = m->getMeshBuffer(i);
mat = Materials[i];
mat.MaterialType = video::EMT_TRANSPARENT_ADD_COLOR;
if (Mesh->getMeshType() == EAMT_SKINNED)
mat.MaterialType = video::EMT_TRANSPARENT_ADD_COLOR;
if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::matrix4() );
else if (Mesh->getMeshType() == EAMT_SKINNED)
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation);
driver->setMaterial(mat);
......@@ -318,8 +306,7 @@ void CAnimatedMeshSceneNode::render()
// render original meshes
if ( renderMeshes )
{
if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::matrix4() );
for (u32 i=0; i<m->getMeshBufferCount(); ++i)
{
video::IMaterialRenderer* rnd = driver->getMaterialRenderer(Materials[i].MaterialType);
......@@ -330,8 +317,10 @@ void CAnimatedMeshSceneNode::render()
if (transparent == isTransparentPass)
{
scene::IMeshBuffer* mb = m->getMeshBuffer(i);
if (Mesh->getMeshType() == EAMT_SKINNED)
if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::matrix4() );
else if (Mesh->getMeshType() == EAMT_SKINNED)
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation);
driver->setMaterial(Materials[i]);
......@@ -402,11 +391,11 @@ void CAnimatedMeshSceneNode::render()
// show bounding box
if ( DebugDataVisible & scene::EDS_BBOX_BUFFERS )
{
if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::matrix4() );
for (u32 g=0; g< m->getMeshBufferCount(); ++g)
{
const IMeshBuffer* mb = m->getMeshBuffer(g);
const IMeshBuffer* mb = m->getMeshBuffer(g);
if (Mesh->getMeshType() == EAMT_SKINNED)
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation);
driver->draw3DBox( mb->getBoundingBox(),
......@@ -483,12 +472,13 @@ void CAnimatedMeshSceneNode::render()
mat.ZBuffer = true;
driver->setMaterial(mat);
if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::matrix4() );
for (u32 g=0; g<m->getMeshBufferCount(); ++g)
{
const IMeshBuffer* mb = m->getMeshBuffer(g);
if (Mesh->getMeshType() == EAMT_SKINNED)
const IMeshBuffer* mb = m->getMeshBuffer(g);
if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::matrix4() );
else if (Mesh->getMeshType() == EAMT_SKINNED)
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation);
driver->drawMeshBuffer(mb);
}
......
......@@ -21,8 +21,7 @@ CGUIButton::CGUIButton(IGUIEnvironment* environment, IGUIElement* parent,
s32 id, core::rect<s32> rectangle, bool noclip)
: IGUIButton(environment, parent, id, rectangle), Pressed(false),
IsPushButton(false), UseAlphaChannel(false), Border(true),
MouseOverTime(0), FocusTime(0), ClickTime(0), SpriteBank(0),
OverrideFont(0), Image(0), PressedImage(0)
ClickTime(0), SpriteBank(0), OverrideFont(0), Image(0), PressedImage(0)
{
#ifdef _DEBUG
setDebugName("CGUIButton");
......@@ -39,7 +38,6 @@ CGUIButton::CGUIButton(IGUIEnvironment* environment, IGUIElement* parent,
}
//! destructor
CGUIButton::~CGUIButton()
{
......@@ -56,12 +54,14 @@ CGUIButton::~CGUIButton()
SpriteBank->drop();
}
//! Sets if the button should use the skin to draw its border
void CGUIButton::setDrawBorder(bool border)
{
Border = border;
}
void CGUIButton::setSpriteBank(IGUISpriteBank* sprites)
{
if (sprites)
......@@ -73,6 +73,7 @@ void CGUIButton::setSpriteBank(IGUISpriteBank* sprites)
SpriteBank = sprites;
}
void CGUIButton::setSprite(EGUI_BUTTON_STATE state, s32 index, video::SColor color, bool loop)
{
if (SpriteBank)
......@@ -87,6 +88,7 @@ void CGUIButton::setSprite(EGUI_BUTTON_STATE state, s32 index, video::SColor col
}
}
//! called if an event happened.
bool CGUIButton::OnEvent(const SEvent& event)
{
......@@ -199,7 +201,6 @@ bool CGUIButton::OnEvent(const SEvent& event)
}
//! draws the element and its children
void CGUIButton::draw()
{
......@@ -287,7 +288,6 @@ void CGUIButton::draw()
}
//! sets another skin independent font. if this is set to zero, the button uses the font of the skin.
void CGUIButton::setOverrideFont(IGUIFont* font)
{
......@@ -318,6 +318,7 @@ void CGUIButton::setImage(video::ITexture* image)
setPressedImage(Image);
}
//! Sets the image which should be displayed on the button when it is in its normal state.
void CGUIButton::setImage(video::ITexture* image, const core::rect<s32>& pos)
{
......@@ -334,6 +335,7 @@ void CGUIButton::setImage(video::ITexture* image, const core::rect<s32>& pos)
setPressedImage(Image, pos);
}
//! Sets an image which should be displayed on the button when it is in pressed state.
void CGUIButton::setPressedImage(video::ITexture* image)
{
......@@ -348,6 +350,7 @@ void CGUIButton::setPressedImage(video::ITexture* image)
PressedImage->grab();
}
//! Sets the image which should be displayed on the button when it is in its pressed state.
void CGUIButton::setPressedImage(video::ITexture* image, const core::rect<s32>& pos)
{
......@@ -378,6 +381,7 @@ bool CGUIButton::isPressed() const
return Pressed;
}
//! Sets the pressed state of the button if this is a pushbutton
void CGUIButton::setPressed(bool pressed)
{
......@@ -388,6 +392,7 @@ void CGUIButton::setPressed(bool pressed)
}
}
//! Returns whether the button is a push button
bool CGUIButton::isPushButton() const
{
......@@ -395,12 +400,14 @@ bool CGUIButton::isPushButton() const
return IsPushButton;
}
//! Sets if the alpha channel should be used for drawing images on the button (default is false)
void CGUIButton::setUseAlphaChannel(bool useAlphaChannel)
{
UseAlphaChannel = useAlphaChannel;
}
//! Returns if the alpha channel should be used for drawing images on the button
bool CGUIButton::isAlphaChannelUsed() const
{
......@@ -408,16 +415,17 @@ bool CGUIButton::isAlphaChannelUsed() const
return UseAlphaChannel;
}
bool CGUIButton::isDrawingBorder() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return Border;
}
//! Writes attributes of the element.
void CGUIButton::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
{
IGUIButton::serializeAttributes(out,options);
out->addBool ("PushButton", IsPushButton );
......@@ -435,6 +443,7 @@ void CGUIButton::serializeAttributes(io::IAttributes* out, io::SAttributeReadWri
// out->addString ("OverrideFont", OverrideFont);
}
//! Reads attributes of the element
void CGUIButton::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{
......@@ -463,7 +472,9 @@ void CGUIButton::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWr
updateAbsolutePosition();
}
} // end namespace gui
} // end namespace irr
#endif // _IRR_COMPILE_WITH_GUI_
......@@ -108,8 +108,6 @@ namespace gui
bool Border;
u32 MouseOverTime;
u32 FocusTime;
u32 ClickTime;
IGUISpriteBank* SpriteBank;
......
......@@ -206,9 +206,11 @@ CGUITabControl::CGUITabControl(IGUIEnvironment* environment,
//! destructor
CGUITabControl::~CGUITabControl()
{
for (s32 i=0; i<(s32)Tabs.size(); ++i)
for (u32 i=0; i<Tabs.size(); ++i)
{
if (Tabs[i])
Tabs[i]->drop();
}
if (UpButton)
UpButton->drop();
......@@ -269,9 +271,11 @@ void CGUITabControl::addTab(CGUITab* tab)
return;
// check if its already added
for (s32 i=0; i < (s32)Tabs.size(); ++i)
for (u32 i=0; i < Tabs.size(); ++i)
{
if (Tabs[i] == tab)
return;
}
tab->grab();
......@@ -309,7 +313,7 @@ s32 CGUITabControl::getTabCount() const
//! Returns a tab based on zero based index
IGUITab* CGUITabControl::getTab(s32 idx) const
{
if (idx < 0 || idx >= (s32)Tabs.size())
if ((u32)idx >= Tabs.size())
return 0;
return Tabs[idx];
......@@ -523,7 +527,7 @@ void CGUITabControl::draw()
//const wchar_t* activetext = 0;
CGUITab *activeTab = 0;
for (s32 i=CurrentScrollTabIndex; i<(s32)Tabs.size(); ++i)
for (u32 i=0; i<Tabs.size(); ++i)
{
// get Text
const wchar_t* text = 0;
......@@ -543,7 +547,7 @@ void CGUITabControl::draw()
pos += len;
if (i == ActiveTab)
if ((s32)i == ActiveTab)
{
left = frameRect.UpperLeftCorner.X;
right = frameRect.LowerRightCorner.X;
......
......@@ -17,6 +17,7 @@ CMetaTriangleSelector::CMetaTriangleSelector()
#endif
}
//! destructor
CMetaTriangleSelector::~CMetaTriangleSelector()
{
......@@ -24,7 +25,6 @@ CMetaTriangleSelector::~CMetaTriangleSelector()
}
//! Returns amount of all available triangles in this selector
s32 CMetaTriangleSelector::getTriangleCount() const
{
......@@ -36,10 +36,9 @@ s32 CMetaTriangleSelector::getTriangleCount() const
}
//! Gets all triangles.
void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::matrix4* transform) const
s32& outTriangleCount, const core::matrix4* transform) const
{
s32 outWritten = 0;
......@@ -54,11 +53,10 @@ void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 array
}
//! Gets all triangles which lie within a specific bounding box.
void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::aabbox3d<f32>& box,
const core::matrix4* transform) const
s32& outTriangleCount, const core::aabbox3d<f32>& box,
const core::matrix4* transform) const
{
s32 outWritten = 0;
......@@ -74,11 +72,10 @@ void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 array
}
//! Gets all triangles which have or may have contact with a 3d line.
void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform) const
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform) const
{
s32 outWritten = 0;
......@@ -94,7 +91,6 @@ void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 array
}
//! Adds a triangle selector to the collection of triangle selectors
//! in this metaTriangleSelector.
void CMetaTriangleSelector::addTriangleSelector(ITriangleSelector* toAdd)
......@@ -107,23 +103,23 @@ void CMetaTriangleSelector::addTriangleSelector(ITriangleSelector* toAdd)
}
//! Removes a specific triangle selector which was added before from the collection.
bool CMetaTriangleSelector::removeTriangleSelector(ITriangleSelector* toRemove)
{
for (u32 i=0; i<TriangleSelectors.size(); ++i)
{
if (toRemove == TriangleSelectors[i])
{
TriangleSelectors[i]->drop();
TriangleSelectors.erase(i);
return true;
}
}
return false;
return false;
}
//! Removes all triangle selectors from the collection.
void CMetaTriangleSelector::removeAllTriangleSelectors()
{
......
......@@ -422,7 +422,7 @@ void CParticleSystemSceneNode::doParticleSystem(u32 time)
// animate all particles
f32 scale = (f32)timediff;
for (s32 i=0; i<(s32)Particles.size();)
for (u32 i=0; i<Particles.size();)
{
if (now > Particles[i].endTime)
Particles.erase(i);
......@@ -533,7 +533,7 @@ void CParticleSystemSceneNode::serializeAttributes(io::IAttributes* out, io::SAt
E_PARTICLE_AFFECTOR_TYPE atype = EPAT_NONE;
for (core::list<IParticleAffector*>::ConstIterator it = AffectorList.begin();
it != AffectorList.end(); ++it)
it != AffectorList.end(); ++it)
{
atype = (*it)->getType();
......
......@@ -278,8 +278,8 @@ CSceneManager::~CSceneManager()
if (MeshManipulator)
MeshManipulator->drop();
if ( GUIEnvironment )
GUIEnvironment->drop ();
if (GUIEnvironment)
GUIEnvironment->drop();
u32 i;
......@@ -350,8 +350,9 @@ video::IVideoDriver* CSceneManager::getVideoDriver()
return Driver;
}
//! returns the GUI Environment
gui::IGUIEnvironment* CSceneManager::getGUIEnvironment ()
gui::IGUIEnvironment* CSceneManager::getGUIEnvironment()
{
return GUIEnvironment;
}
......@@ -376,6 +377,7 @@ ITextSceneNode* CSceneManager::addTextSceneNode(gui::IGUIFont* font,
return t;
}
//! Adds a text scene node, which uses billboards
ITextSceneNode* CSceneManager::addBillboardTextSceneNode(gui::IGUIFont* font,
const wchar_t* text, ISceneNode* parent,
......@@ -399,12 +401,9 @@ ITextSceneNode* CSceneManager::addBillboardTextSceneNode(gui::IGUIFont* font,
//! Adds a scene node, which can render a quake3 shader
ISceneNode* CSceneManager::addQuake3SceneNode( IMeshBuffer* meshBuffer,
const quake3::SShader * shader,
ISceneNode* parent,
s32 id
)
ISceneNode* CSceneManager::addQuake3SceneNode(IMeshBuffer* meshBuffer,
const quake3::SShader * shader,
ISceneNode* parent, s32 id)
{
if ( 0 == shader )
return 0;
......@@ -412,11 +411,10 @@ ISceneNode* CSceneManager::addQuake3SceneNode( IMeshBuffer* meshBuffer,
if (!parent)
parent = this;
CQuake3ShaderSceneNode* node = new CQuake3ShaderSceneNode ( parent, this, id, FileSystem, meshBuffer, shader );
CQuake3ShaderSceneNode* node = new CQuake3ShaderSceneNode( parent, this, id, FileSystem, meshBuffer, shader );
node->drop();
return node;
}
//! adds Volume Lighting Scene Node.
......@@ -437,8 +435,9 @@ ISceneNode* CSceneManager::addVolumeLightSceneNode(ISceneNode* parent, s32 id,
//! adds a test scene node for test purposes to the scene. It is a simple cube of (1,1,1) size.
//! the returned pointer must not be dropped.
ISceneNode* CSceneManager::addCubeSceneNode(f32 size, ISceneNode* parent, s32 id,
const core::vector3df& position, const core::vector3df& rotation, const core::vector3df& scale)
ISceneNode* CSceneManager::addCubeSceneNode(f32 size, ISceneNode* parent,
s32 id, const core::vector3df& position,
const core::vector3df& rotation, const core::vector3df& scale)
{
if (!parent)
parent = this;
......@@ -449,11 +448,11 @@ ISceneNode* CSceneManager::addCubeSceneNode(f32 size, ISceneNode* parent, s32 id
return node;
}
//! Adds a sphere scene node for test purposes to the scene.
ISceneNode* CSceneManager::addSphereSceneNode(f32 radius, s32 polyCount, ISceneNode* parent, s32 id,
const core::vector3df& position,
const core::vector3df& rotation,
const core::vector3df& scale)
ISceneNode* CSceneManager::addSphereSceneNode(f32 radius, s32 polyCount,
ISceneNode* parent, s32 id, const core::vector3df& position,
const core::vector3df& rotation, const core::vector3df& scale)
{
if (!parent)
parent = this;
......@@ -504,7 +503,6 @@ ISceneNode* CSceneManager::addWaterSurfaceSceneNode(IMesh* mesh, f32 waveHeight,
}
//! adds a scene node for rendering an animated mesh model
IAnimatedMeshSceneNode* CSceneManager::addAnimatedMeshSceneNode(IAnimatedMesh* mesh, ISceneNode* parent, s32 id,
const core::vector3df& position, const core::vector3df& rotation,
......@@ -584,7 +582,6 @@ ICameraSceneNode* CSceneManager::addCameraSceneNode(ISceneNode* parent,
}
//! Adds a camera scene node which is able to be controlle with the mouse similar
//! like in the 3D Software Maya by Alias Wavefront.
//! The returned pointer must not be dropped.
......@@ -604,7 +601,6 @@ ICameraSceneNode* CSceneManager::addCameraSceneNodeMaya(ISceneNode* parent,
}
//! Adds a camera scene node which is able to be controled with the mouse and keys
//! like in most first person shooters (FPS):
ICameraSceneNode* CSceneManager::addCameraSceneNodeFPS(ISceneNode* parent,
......@@ -624,7 +620,6 @@ ICameraSceneNode* CSceneManager::addCameraSceneNodeFPS(ISceneNode* parent,
}
//! Adds a dynamic light scene node. The light will cast dynamic light on all
//! other scene nodes in the scene, which have the material flag video::MTF_LIGHTING
//! turned on. (This is the default setting in most scene nodes).
......@@ -641,7 +636,6 @@ ILightSceneNode* CSceneManager::addLightSceneNode(ISceneNode* parent,
}
//! Adds a billboard scene node to the scene. A billboard is like a 3d sprite: A 2d element,
//! which always looks to the camera. It is usually used for things like explosions, fire,
//! lensflares and things like that.
......@@ -726,13 +720,13 @@ ITerrainSceneNode* CSceneManager::addTerrainSceneNode(
{
io::IReadFile* file = FileSystem->createAndOpenFile(heightMapFileName);
if(!file && !addAlsoIfHeightmapEmpty)
{
os::Printer::log("Could not load terrain, because file could not be opened.",
heightMapFileName, ELL_ERROR);
return 0;
}
if(!file && !addAlsoIfHeightmapEmpty)
{
os::Printer::log("Could not load terrain, because file could not be opened.",
heightMapFileName, ELL_ERROR);
return 0;
}
ITerrainSceneNode* terrain = addTerrainSceneNode(file, parent, id,
position, rotation, scale, vertexColor, maxLOD, patchSize,
smoothFactor, addAlsoIfHeightmapEmpty);
......@@ -1239,9 +1233,9 @@ void CSceneManager::drawAll()
Driver->setAmbientLight(AmbientLight);
LightList.sort (); // on distance to camera
LightList.sort(); // on distance to camera
u32 maxLights = core::min_ ( Driver->getMaximalDynamicLightAmount (), LightList.size () );
u32 maxLights = core::min_ ( Driver->getMaximalDynamicLightAmount(), LightList.size() );
for (i=0; i< maxLights; ++i)
LightList[i].node->render();
......@@ -1267,7 +1261,7 @@ void CSceneManager::drawAll()
for (i=0; i<SolidNodeList.size(); ++i)
SolidNodeList[i].node->render();
Parameters.setAttribute ( "drawn", (s32) SolidNodeList.size () );
Parameters.setAttribute ( "drawn", (s32) SolidNodeList.size() );
SolidNodeList.set_used(0);
}
......@@ -1296,7 +1290,6 @@ void CSceneManager::drawAll()
TransparentNodeList.set_used(0);
}
clearDeletionList();
CurrentRendertime = ESNRP_COUNT;
......@@ -1495,7 +1488,7 @@ void CSceneManager::clearDeletionList()
if (DeletionList.empty())
return;
for (s32 i=0; i<(s32)DeletionList.size(); ++i)
for (u32 i=0; i<DeletionList.size(); ++i)
{
DeletionList[i]->remove();
DeletionList[i]->drop();
......
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