Removed multiple inheritance in CBillboardTextSceneNode.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1741 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2008-11-14 09:54:37 +00:00
parent 12516fe663
commit 900123fde8
9 changed files with 74 additions and 11 deletions

View File

@ -17,7 +17,7 @@ namespace scene
which always looks to the camera. It is usually used for explosions, fire,
lensflares, particles and things like that.
*/
class IBillboardSceneNode : virtual public ISceneNode
class IBillboardSceneNode : public ISceneNode
{
public:

View File

@ -0,0 +1,62 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED__
#define __I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED__
#include "IBillboardSceneNode.h"
namespace irr
{
namespace scene
{
//! A billboard text scene node.
/** Acts like a billboard which displays the currently set text.
Due to the exclusion of RTTI in Irrlicht we have to avoid multiple
inheritance. Hence, changes to the ITextSceneNode interface have
to be copied here manually.
*/
class IBillboardTextSceneNode : public IBillboardSceneNode
{
public:
//! Constructor
IBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position = core::vector3df(0,0,0))
: IBillboardSceneNode(parent, mgr, id, position) {}
//! Sets the size of the billboard.
virtual void setSize(const core::dimension2d<f32>& size) = 0;
//! Returns the size of the billboard.
virtual const core::dimension2d<f32>& getSize() const = 0;
//! Set the color of all vertices of the billboard
/** \param overallColor: the color to set */
virtual void setColor(const video::SColor & overallColor) = 0;
//! Set the color of the top and bottom vertices of the billboard
/** \param topColor: the color to set the top vertices
\param bottomColor: the color to set the bottom vertices */
virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor) = 0;
//! Gets the color of the top and bottom vertices of the billboard
/** \param topColor: stores the color of the top vertices
\param bottomColor: stores the color of the bottom vertices */
virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) const = 0;
//! sets the text string
virtual void setText(const wchar_t* text) = 0;
//! sets the color of the text
virtual void setTextColor(video::SColor color) = 0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -108,6 +108,7 @@ namespace scene
class IMetaTriangleSelector;
class IMeshManipulator;
class ITextSceneNode;
class IBillboardTextSceneNode;
class IVolumeLightSceneNode;
class ISceneNodeFactory;
class ISceneNodeAnimatorFactory;
@ -824,7 +825,7 @@ namespace scene
s32 id=-1) = 0;
//! Adds a text scene node, which uses billboards
virtual ITextSceneNode* addBillboardTextSceneNode( gui::IGUIFont* font, const wchar_t* text,
virtual IBillboardTextSceneNode* addBillboardTextSceneNode( gui::IGUIFont* font, const wchar_t* text,
ISceneNode* parent = 0,
const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,

View File

@ -13,7 +13,7 @@ namespace scene
{
//! A scene node for displaying 2d text at a position in three dimensional space
class ITextSceneNode : virtual public ISceneNode
class ITextSceneNode : public ISceneNode
{
public:

View File

@ -17,7 +17,7 @@ namespace scene
CBillboardSceneNode::CBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position, const core::dimension2d<f32>& size,
video::SColor shade_top, video::SColor shade_down)
: ISceneNode(parent, mgr, id, position), IBillboardSceneNode(parent, mgr, id, position)
: IBillboardSceneNode(parent, mgr, id, position)
{
#ifdef _DEBUG
setDebugName("CBillboardSceneNode");

View File

@ -425,7 +425,7 @@ ITextSceneNode* CSceneManager::addTextSceneNode(gui::IGUIFont* font,
//! Adds a text scene node, which uses billboards
ITextSceneNode* CSceneManager::addBillboardTextSceneNode(gui::IGUIFont* font,
IBillboardTextSceneNode* CSceneManager::addBillboardTextSceneNode(gui::IGUIFont* font,
const wchar_t* text, ISceneNode* parent,
const core::dimension2d<f32>& size,
const core::vector3df& position, s32 id,
@ -437,7 +437,7 @@ ITextSceneNode* CSceneManager::addBillboardTextSceneNode(gui::IGUIFont* font,
if (!parent)
parent = this;
ITextSceneNode* node = new CBillboardTextSceneNode(parent, this, id, font, text, position, size,
IBillboardTextSceneNode* node = new CBillboardTextSceneNode(parent, this, id, font, text, position, size,
shade_top, shade_down);
node->drop();

View File

@ -178,7 +178,7 @@ namespace scene
s32 id=-1);
//! Adds a text scene node, which uses billboards
virtual ITextSceneNode* addBillboardTextSceneNode(gui::IGUIFont* font, const wchar_t* text,
virtual IBillboardTextSceneNode* addBillboardTextSceneNode(gui::IGUIFont* font, const wchar_t* text,
ISceneNode* parent = 0,
const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,

View File

@ -22,7 +22,7 @@ CTextSceneNode::CTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
gui::IGUIFont* font, scene::ISceneCollisionManager* coll,
const core::vector3df& position, const wchar_t* text,
video::SColor color)
: ISceneNode(parent, mgr, id, position), ITextSceneNode(parent, mgr, id, position), Text(text), Color(color),
: ITextSceneNode(parent, mgr, id, position), Text(text), Color(color),
Font(font), Coll(coll)
{
@ -93,7 +93,7 @@ CBillboardTextSceneNode::CBillboardTextSceneNode(ISceneNode* parent, ISceneManag
gui::IGUIFont* font,const wchar_t* text,
const core::vector3df& position, const core::dimension2d<f32>& size,
video::SColor shade_top,video::SColor shade_bottom )
: ISceneNode(parent, mgr, id, position), ITextSceneNode(parent, mgr, id, position), IBillboardSceneNode(parent, mgr, id, position),
: IBillboardTextSceneNode(parent, mgr, id, position),
Font(0), Shade_top(shade_top), Shade_bottom(shade_bottom), Mesh(0)
{
#ifdef _DEBUG

View File

@ -6,7 +6,7 @@
#define __C_TEXT_SCENE_NODE_H_INCLUDED__
#include "ITextSceneNode.h"
#include "IBillboardSceneNode.h"
#include "IBillboardTextSceneNode.h"
#include "IGUIFont.h"
#include "IGUIFontBitmap.h"
#include "ISceneCollisionManager.h"
@ -57,7 +57,7 @@ namespace scene
core::aabbox3d<f32> Box;
};
class CBillboardTextSceneNode : virtual public ITextSceneNode, virtual public IBillboardSceneNode
class CBillboardTextSceneNode : public IBillboardTextSceneNode
{
public: