Some more constification, but still not done. Now we have also SEvent in OnEvent as const ref, so most user apps will need some kind of upgrade for the new library version.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@964 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
cca0506230
commit
f74f7586e2
|
@ -36,7 +36,7 @@ We will use this input to move the scene node with the keys W and S.
|
|||
class MyEventReceiver : public IEventReceiver
|
||||
{
|
||||
public:
|
||||
virtual bool OnEvent(SEvent event)
|
||||
virtual bool OnEvent(const SEvent& event)
|
||||
{
|
||||
/*
|
||||
If the key 'W' or 'S' was left up, we get the position of the scene node,
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
We will use this input to move the scene node with the keys W and S.</p>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td> <pre>class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> virtual bool OnEvent(SEvent event)<br> { </pre></td>
|
||||
<td> <pre>class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> virtual bool OnEvent(const SEvent& event)<br> { </pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>If the key 'W' or 'S' was left up, we get the position of the scene
|
||||
|
|
|
@ -44,7 +44,7 @@ the pointer to the gui environment.
|
|||
class MyEventReceiver : public IEventReceiver
|
||||
{
|
||||
public:
|
||||
virtual bool OnEvent(SEvent event)
|
||||
virtual bool OnEvent(const SEvent& event)
|
||||
{
|
||||
if (event.EventType == EET_GUI_EVENT)
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ IGUIListBox* listbox = 0;
|
|||
event) and get the pointer to the gui environment. </p>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td> <pre>class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> virtual bool OnEvent(SEvent event)<br> {<br> if (event.EventType == EET_GUI_EVENT)<br> {<br> s32 id = event.GUIEvent.Caller->getID();<br> IGUIEnvironment* env = device->getGUIEnvironment();</pre>
|
||||
<td> <pre>class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> virtual bool OnEvent(const SEvent& event)<br> {<br> if (event.EventType == EET_GUI_EVENT)<br> {<br> s32 id = event.GUIEvent.Caller->getID();<br> IGUIEnvironment* env = device->getGUIEnvironment();</pre>
|
||||
<pre> switch(event.GUIEvent.EventType)
|
||||
{</pre>
|
||||
</td>
|
||||
|
|
|
@ -188,7 +188,7 @@ void createToolBox()
|
|||
class MyEventReceiver : public IEventReceiver
|
||||
{
|
||||
public:
|
||||
virtual bool OnEvent(SEvent event)
|
||||
virtual bool OnEvent(const SEvent& event)
|
||||
{
|
||||
// Escape swaps Camera Input
|
||||
if (event.EventType == EET_KEY_INPUT_EVENT &&
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
</div>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td> <pre><font size="2">class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> virtual bool OnEvent(SEvent event)<br> {<br> if (event.EventType == EET_GUI_EVENT)<br> {<br> s32 id = event.GUIEvent.Caller->getID();<br> IGUIEnvironment* env = Device->getGUIEnvironment();<br> switch(event.GUIEvent.EventType)<br> {<br> case EGET_MENU_ITEM_SELECTED:<br> {<br> <font color="#006600"> // a menu item was clicked</font><br> IGUIContextMenu* menu = (IGUIContextMenu*)event.GUIEvent.Caller;<br> s32 id = menu->getItemCommandId(menu->getSelectedItem());<br> <br> switch(id)<br> {<br> case 100<font color="#006600">: // File -> Open Mode</font>l<br> env->addFileOpenDialog(L"Please select a model file to open");<br> break;<br> case 200<font color="#006600">: // File -> Quit</font><br> Device->closeDevice();<br> break;<br> case 300<font color="#006600">: // View -> Skybox</font><br> SkyBox->setVisible(!SkyBox->isVisible());<br> break;<br> case 400<font color="#006600">: // View -> Debug Informatio</font>n<br> if (Model)<br> Model->setDebugDataVisible(!Model->isDebugDataVisible());<br> break;<br> case 500<font color="#006600">: // Help->About</font><br> showAboutText();<br> break;<br> case 610<font color="#006600">: // View -> Material -> Soli</font>d<br> if (Model)<br> Model->setMaterialType(video::EMT_SOLID);<br> break;<br> case 620<font color="#006600">: // View -> Material -> Transparen</font>t<br> if (Model)<br> Model->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);<br> break;<br> case 630<font color="#006600">: // View -> Material -> Reflectio</font>n<br> if (Model)<br> Model->setMaterialType(video::EMT_SPHERE_MAP);<br> break;<br> }<br> break;<br> }<br> case EGET_FILE_SELECTED:<br> {<br> <font color="#006600"> // load the model file, selected in the file open dialo</font>g<br> IGUIFileOpenDialog* dialog = <br> (IGUIFileOpenDialog*)event.GUIEvent.Caller;<br> loadModel(core::stringc(dialog->getFilename()).c_str());<br> }<br> case EGET_BUTTON_CLICKED:<br> switch(id)<br> {<br> case 1101:<br> {<br> <font color="#006600"> // set scal</font>e<br> gui::IGUIElement* root = env->getRootGUIElement();<br> core::vector3df scale;<br> core::stringc s;<br> s = root->getElementFromId(901, true)->getText();<br> scale.X = (f32)atof(s.c_str());<br> s = root->getElementFromId(902, true)->getText();<br> scale.Y = (f32)atof(s.c_str());<br> s = root->getElementFromId(903, true)->getText();<br> scale.Z = (f32)atof(s.c_str());<br> if (Model)<br> Model->setScale(scale);<br> }<br> break;<br> case 1102:<br> env->addFileOpenDialog(L"Please select a model file to open");<br> break;<br> case 1103:<br> showAboutText();<br> break;<br> case 1104:<br> createToolBox();<br> break;<br> }<br> break;<br> }<br> }<br> return false;<br> }<br>};</font></pre></td>
|
||||
<td> <pre><font size="2">class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> virtual bool OnEvent(const SEvent& event)<br> {<br> if (event.EventType == EET_GUI_EVENT)<br> {<br> s32 id = event.GUIEvent.Caller->getID();<br> IGUIEnvironment* env = Device->getGUIEnvironment();<br> switch(event.GUIEvent.EventType)<br> {<br> case EGET_MENU_ITEM_SELECTED:<br> {<br> <font color="#006600"> // a menu item was clicked</font><br> IGUIContextMenu* menu = (IGUIContextMenu*)event.GUIEvent.Caller;<br> s32 id = menu->getItemCommandId(menu->getSelectedItem());<br> <br> switch(id)<br> {<br> case 100<font color="#006600">: // File -> Open Mode</font>l<br> env->addFileOpenDialog(L"Please select a model file to open");<br> break;<br> case 200<font color="#006600">: // File -> Quit</font><br> Device->closeDevice();<br> break;<br> case 300<font color="#006600">: // View -> Skybox</font><br> SkyBox->setVisible(!SkyBox->isVisible());<br> break;<br> case 400<font color="#006600">: // View -> Debug Informatio</font>n<br> if (Model)<br> Model->setDebugDataVisible(!Model->isDebugDataVisible());<br> break;<br> case 500<font color="#006600">: // Help->About</font><br> showAboutText();<br> break;<br> case 610<font color="#006600">: // View -> Material -> Soli</font>d<br> if (Model)<br> Model->setMaterialType(video::EMT_SOLID);<br> break;<br> case 620<font color="#006600">: // View -> Material -> Transparen</font>t<br> if (Model)<br> Model->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);<br> break;<br> case 630<font color="#006600">: // View -> Material -> Reflectio</font>n<br> if (Model)<br> Model->setMaterialType(video::EMT_SPHERE_MAP);<br> break;<br> }<br> break;<br> }<br> case EGET_FILE_SELECTED:<br> {<br> <font color="#006600"> // load the model file, selected in the file open dialo</font>g<br> IGUIFileOpenDialog* dialog = <br> (IGUIFileOpenDialog*)event.GUIEvent.Caller;<br> loadModel(core::stringc(dialog->getFilename()).c_str());<br> }<br> case EGET_BUTTON_CLICKED:<br> switch(id)<br> {<br> case 1101:<br> {<br> <font color="#006600"> // set scal</font>e<br> gui::IGUIElement* root = env->getRootGUIElement();<br> core::vector3df scale;<br> core::stringc s;<br> s = root->getElementFromId(901, true)->getText();<br> scale.X = (f32)atof(s.c_str());<br> s = root->getElementFromId(902, true)->getText();<br> scale.Y = (f32)atof(s.c_str());<br> s = root->getElementFromId(903, true)->getText();<br> scale.Z = (f32)atof(s.c_str());<br> if (Model)<br> Model->setScale(scale);<br> }<br> break;<br> case 1102:<br> env->addFileOpenDialog(L"Please select a model file to open");<br> break;<br> case 1103:<br> showAboutText();<br> break;<br> case 1104:<br> createToolBox();<br> break;<br> }<br> break;<br> }<br> }<br> return false;<br> }<br>};</font></pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> Most of the hard work is done. We only need to create the Irrlicht
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
setMaterial();
|
||||
}
|
||||
|
||||
bool OnEvent(SEvent event)
|
||||
bool OnEvent(const SEvent& event)
|
||||
{
|
||||
// check if user presses the key 'E' or 'R'
|
||||
if (event.EventType == irr::EET_KEY_INPUT_EVENT &&
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
setMaterial();
|
||||
}
|
||||
|
||||
bool OnEvent(SEvent event)
|
||||
bool OnEvent(const SEvent& event)
|
||||
{
|
||||
// check if user presses the key 'E' or 'R'
|
||||
if (event.EventType == irr::EET_KEY_INPUT_EVENT &&
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
Terrain = terrain;
|
||||
}
|
||||
|
||||
bool OnEvent(SEvent event)
|
||||
bool OnEvent(const SEvent& event)
|
||||
{
|
||||
// check if user presses the key 'W' or 'D'
|
||||
if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
we toggle to material between solid and detail mapped.</p>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td> <pre>#include <irrlicht.h><br>#include <iostream><br>using namespace irr;<br><br>#pragma comment(lib, "Irrlicht.lib")<br><br>class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> MyEventReceiver(scene::ISceneNode* terrain)<br> {<br><font color="#006600"> // store pointer to terrain so we can change its drawing mode<br></font> Terrain = terrain;<br> }<br><br> bool OnEvent(SEvent event)<br> {<br> <font color="#006600"> // check if user presses the key 'W' or 'D'</font><br> if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)<br> {<br> switch (event.KeyInput.Key)<br> {<br> case irr::KEY_KEY_W:<font color="#006600"> // switch wire frame mode</font><br> Terrain->setMaterialFlag(video::EMF_WIREFRAME, !Terrain->getMaterial(0).Wireframe);<br> return true;<br> case irr::KEY_KEY_D:<font color="#006600"> // toggle detail map</font><br> Terrain->setMaterialType(<br> Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ? <br> video::EMT_DETAIL_MAP : video::EMT_SOLID);<br> return true;<br> }<br> }<br> return false;<br> }<br><br>private:<br> scene::ISceneNode* Terrain;<br>};<br><br></pre></td>
|
||||
<td> <pre>#include <irrlicht.h><br>#include <iostream><br>using namespace irr;<br><br>#pragma comment(lib, "Irrlicht.lib")<br><br>class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> MyEventReceiver(scene::ISceneNode* terrain)<br> {<br><font color="#006600"> // store pointer to terrain so we can change its drawing mode<br></font> Terrain = terrain;<br> }<br><br> bool OnEvent(const SEvent& event)<br> {<br> <font color="#006600"> // check if user presses the key 'W' or 'D'</font><br> if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)<br> {<br> switch (event.KeyInput.Key)<br> {<br> case irr::KEY_KEY_W:<font color="#006600"> // switch wire frame mode</font><br> Terrain->setMaterialFlag(video::EMF_WIREFRAME, !Terrain->getMaterial(0).Wireframe);<br> return true;<br> case irr::KEY_KEY_D:<font color="#006600"> // toggle detail map</font><br> Terrain->setMaterialType(<br> Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ? <br> video::EMT_DETAIL_MAP : video::EMT_SOLID);<br> return true;<br> }<br> }<br> return false;<br> }<br><br>private:<br> scene::ISceneNode* Terrain;<br>};<br><br></pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>The start of the main function starts like in most other example.
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
FilenameTemplate = templateName;
|
||||
}
|
||||
|
||||
bool OnEvent(SEvent event)
|
||||
bool OnEvent(const SEvent& event)
|
||||
{
|
||||
// check if user presses the key F9
|
||||
if (event.EventType == EET_KEY_INPUT_EVENT &&
|
||||
|
|
|
@ -116,7 +116,7 @@ void CDemo::run()
|
|||
}
|
||||
|
||||
|
||||
bool CDemo::OnEvent(SEvent event)
|
||||
bool CDemo::OnEvent(const SEvent& event)
|
||||
{
|
||||
if (!device)
|
||||
return false;
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
|
||||
void run();
|
||||
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows,
|
|||
|
||||
|
||||
|
||||
bool CMainMenu::OnEvent(SEvent event)
|
||||
bool CMainMenu::OnEvent(const SEvent& event)
|
||||
{
|
||||
if (event.EventType == EET_KEY_INPUT_EVENT &&
|
||||
event.KeyInput.Key == KEY_F9 &&
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
bool run(bool& outFullscreen, bool& outMusic, bool& outShadows,
|
||||
bool& outAdditive, bool &outVSync, video::E_DRIVER_TYPE& outDriver);
|
||||
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace scene
|
|||
: ISceneNode(parent, mgr, id, position, rotation, scale) {}
|
||||
|
||||
//! Destructor
|
||||
virtual ~IAnimatedMeshSceneNode() {};
|
||||
virtual ~IAnimatedMeshSceneNode() {}
|
||||
|
||||
//! Sets the current frame number.
|
||||
//! From now on the animation is played from this frame.
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
virtual void setSize(const core::dimension2d<f32>& size) = 0;
|
||||
|
||||
//! Returns the size of the billboard.
|
||||
virtual const core::dimension2d<f32>& getSize() = 0;
|
||||
virtual const core::dimension2d<f32>& getSize() const = 0;
|
||||
|
||||
//! Set the color of all vertices of the billboard
|
||||
//! \param overallColor: the color to set
|
||||
|
@ -44,7 +44,7 @@ public:
|
|||
//! 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) = 0;
|
||||
virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) const = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -66,25 +66,23 @@ namespace scene
|
|||
virtual void OnAnimate(u32 timeMs) =0;
|
||||
|
||||
//! Does nothing as bones are not visible
|
||||
virtual void render() { };
|
||||
virtual void render() { }
|
||||
|
||||
|
||||
virtual void setAbsoluteTransformation(core::matrix4 transformation)
|
||||
virtual void setAbsoluteTransformation(const core::matrix4& transformation)
|
||||
{
|
||||
AbsoluteTransformation=transformation;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! updates the absolute position based on the relative and the parents position
|
||||
virtual void updateAbsolutePositionOfAllChildren()=0;
|
||||
|
||||
|
||||
s32 positionHint;
|
||||
s32 scaleHint;
|
||||
s32 rotationHint;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace scene
|
|||
: ISceneNode(parent, mgr, id, position, rotation, scale), IsOrthogonal(false) {}
|
||||
|
||||
//! Destructor
|
||||
virtual ~ICameraSceneNode() {};
|
||||
virtual ~ICameraSceneNode() {}
|
||||
|
||||
//! Sets the projection matrix of the camera.
|
||||
/** The core::matrix4 class has some methods
|
||||
|
@ -44,11 +44,11 @@ namespace scene
|
|||
|
||||
//! Gets the current projection matrix of the camera.
|
||||
/** \return Returns the current projection matrix of the camera. */
|
||||
virtual const core::matrix4& getProjectionMatrix() = 0;
|
||||
virtual const core::matrix4& getProjectionMatrix() const = 0;
|
||||
|
||||
//! Gets the current view matrix of the camera.
|
||||
/** \return Returns the current view matrix of the camera. */
|
||||
virtual const core::matrix4& getViewMatrix() = 0;
|
||||
virtual const core::matrix4& getViewMatrix() const = 0;
|
||||
|
||||
//! It is possible to send mouse and key events to the camera.
|
||||
/** Most cameras
|
||||
|
@ -56,7 +56,7 @@ namespace scene
|
|||
example with ISceneManager::addMayaCameraSceneNode or
|
||||
ISceneManager::addMeshViewerCameraSceneNode, may want to get this input
|
||||
for changing their position, look at target or whatever. */
|
||||
virtual bool OnEvent(SEvent event) = 0;
|
||||
virtual bool OnEvent(const SEvent& event) = 0;
|
||||
|
||||
//! Sets the look at target of the camera
|
||||
/** \param pos: Look at target of the camera. */
|
||||
|
@ -76,19 +76,19 @@ namespace scene
|
|||
|
||||
//! Gets the value of the near plane of the camera.
|
||||
/** \return Returns the value of the near plane of the camera. */
|
||||
virtual f32 getNearValue() = 0;
|
||||
virtual f32 getNearValue() const = 0;
|
||||
|
||||
//! Gets the value of the far plane of the camera.
|
||||
/** \return Returns the value of the far plane of the camera. */
|
||||
virtual f32 getFarValue() = 0;
|
||||
virtual f32 getFarValue() const = 0;
|
||||
|
||||
//! Gets the aspect ratio of the camera.
|
||||
/** \return Returns the aspect ratio of the camera. */
|
||||
virtual f32 getAspectRatio() = 0;
|
||||
virtual f32 getAspectRatio() const = 0;
|
||||
|
||||
//! Gets the field of view of the camera.
|
||||
/** \return Returns the field of view of the camera in radiants. */
|
||||
virtual f32 getFOV() = 0;
|
||||
virtual f32 getFOV() const = 0;
|
||||
|
||||
//! Sets the value of the near clipping plane. (default: 1.0f)
|
||||
/** \param zn: New z near value. */
|
||||
|
@ -117,12 +117,12 @@ namespace scene
|
|||
virtual void setInputReceiverEnabled(bool enabled) = 0;
|
||||
|
||||
//! Returns if the input receiver of the camera is currently enabled.
|
||||
virtual bool isInputReceiverEnabled() = 0;
|
||||
virtual bool isInputReceiverEnabled() const = 0;
|
||||
|
||||
//! Returns if a camera is orthogonal.
|
||||
/** This setting does not change anything of the view or projection matrix. However
|
||||
it influences how collision detection and picking is done with this camera. */
|
||||
virtual bool isOrthogonal()
|
||||
virtual bool isOrthogonal() const
|
||||
{
|
||||
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
|
||||
return IsOrthogonal;
|
||||
|
@ -136,7 +136,6 @@ namespace scene
|
|||
IsOrthogonal = orthogonal;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
bool IsOrthogonal;
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
IDummyTransformationSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id)
|
||||
: ISceneNode(parent, mgr, id) {}
|
||||
|
||||
//! Returns a reference to the current relative transformation matrix.
|
||||
//! Returns a reference to the current relative transformation matrix.
|
||||
//! This is the matrix, this scene node uses instead of scale, translation
|
||||
//! and rotation.
|
||||
virtual core::matrix4& getRelativeTransformationMatrix() = 0;
|
||||
|
|
|
@ -249,11 +249,11 @@ class IEventReceiver
|
|||
{
|
||||
public:
|
||||
|
||||
virtual ~IEventReceiver() {};
|
||||
virtual ~IEventReceiver() {}
|
||||
|
||||
//! called if an event happened.
|
||||
//! \return Returns true if the event was processed
|
||||
virtual bool OnEvent(SEvent event) = 0;
|
||||
virtual bool OnEvent(const SEvent& event) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class IFileList : public virtual IReferenceCounted
|
|||
public:
|
||||
|
||||
//! destructor
|
||||
virtual ~IFileList() {};
|
||||
virtual ~IFileList() {}
|
||||
|
||||
//! Returns the amount of files in the filelist.
|
||||
//! \return
|
||||
|
|
|
@ -36,7 +36,7 @@ class IFileSystem : public virtual IReferenceCounted
|
|||
public:
|
||||
|
||||
//! destructor
|
||||
virtual ~IFileSystem() {};
|
||||
virtual ~IFileSystem() {}
|
||||
|
||||
//! Opens a file for read access.
|
||||
/** \param filename: Name of file to open.
|
||||
|
@ -113,22 +113,22 @@ public:
|
|||
virtual bool changeWorkingDirectoryTo(const c8* newDirectory) = 0;
|
||||
|
||||
//! Converts a relative path to an absolute (unique) path, resolving symbolic links if required
|
||||
virtual irr::core::stringc getAbsolutePath(irr::core::stringc &filename) = 0;
|
||||
virtual core::stringc getAbsolutePath(const core::stringc& filename) const = 0;
|
||||
|
||||
//! Returns the directory a file is located in.
|
||||
/** \param filename: The file to get the directory from */
|
||||
virtual irr::core::stringc getFileDir(irr::core::stringc &filename) = 0;
|
||||
virtual core::stringc getFileDir(const core::stringc& filename) const = 0;
|
||||
|
||||
//! Creates a list of files and directories in the current working directory and returns it.
|
||||
/** \return a Pointer to the created IFileList is returned. After the list has been used
|
||||
it has to be deleted using its IFileList::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IFileList* createFileList() = 0;
|
||||
virtual IFileList* createFileList() const = 0;
|
||||
|
||||
//! Determinates if a file exists and would be able to be opened.
|
||||
/** \param filename is the string identifying the file which should be tested for existance.
|
||||
\return Returns true if file exsits, and false if it does not exist or an error occured. */
|
||||
virtual bool existFile(const c8* filename) = 0;
|
||||
//! Determines if a file exists and could be opened.
|
||||
/** \param filename is the string identifying the file which should be tested for existence.
|
||||
\return Returns true if file exists, and false if it does not exist or an error occured. */
|
||||
virtual bool existFile(const c8* filename) const = 0;
|
||||
|
||||
//! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
|
||||
/** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
|
||||
|
|
|
@ -632,7 +632,7 @@ public:
|
|||
|
||||
|
||||
//! Called if an event happened.
|
||||
virtual bool OnEvent(SEvent event)
|
||||
virtual bool OnEvent(const SEvent& event)
|
||||
{
|
||||
return Parent ? Parent->OnEvent(event) : false;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ public:
|
|||
//! Posts an input event to the environment.
|
||||
/** Usually you do not have to
|
||||
use this method, it is used by the internal engine. */
|
||||
virtual bool postEventFromUser(SEvent event) = 0;
|
||||
virtual bool postEventFromUser(const SEvent& event) = 0;
|
||||
|
||||
//! This sets a new event receiver for gui events.
|
||||
/** Usually you do not have to
|
||||
|
|
|
@ -44,7 +44,7 @@ class IImage : public virtual IReferenceCounted
|
|||
public:
|
||||
|
||||
//! destructor
|
||||
virtual ~IImage() {};
|
||||
virtual ~IImage() {}
|
||||
|
||||
//! Lock function. Use this to get a pointer to the image data. After you
|
||||
//! don't need the pointer anymore, you must call unlock().
|
||||
|
|
|
@ -27,17 +27,17 @@ class IImageLoader : public virtual IReferenceCounted
|
|||
public:
|
||||
|
||||
//! destructor
|
||||
virtual ~IImageLoader() {};
|
||||
virtual ~IImageLoader() {}
|
||||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".tga")
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) = 0;
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) const = 0;
|
||||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
virtual bool isALoadableFileFormat(irr::io::IReadFile* file) = 0;
|
||||
virtual bool isALoadableFileFormat(irr::io::IReadFile* file) const = 0;
|
||||
|
||||
//! creates a surface from the file
|
||||
virtual IImage* loadImage(irr::io::IReadFile* file) = 0;
|
||||
virtual IImage* loadImage(irr::io::IReadFile* file) const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -19,24 +19,18 @@ namespace video
|
|||
class IImageWriter : public IReferenceCounted
|
||||
{
|
||||
public:
|
||||
//! constructor
|
||||
IImageWriter()
|
||||
{
|
||||
}
|
||||
|
||||
//! destructor
|
||||
virtual ~IImageWriter()
|
||||
{
|
||||
};
|
||||
virtual ~IImageWriter() { }
|
||||
|
||||
//! return true if this writer can write a file with the given extension
|
||||
virtual bool isAWriteableFileExtension(const c8* fileName) = 0;
|
||||
virtual bool isAWriteableFileExtension(const c8* fileName) const = 0;
|
||||
|
||||
//! write image to file
|
||||
virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param = 0) = 0;
|
||||
virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param = 0) const = 0;
|
||||
};
|
||||
|
||||
} // namespace video
|
||||
} // namespace irr
|
||||
|
||||
#endif // _I_IMAGE_WRITER_H_INCLUDED__
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
virtual ~ILogger() {}
|
||||
|
||||
//! Returns the current set log level.
|
||||
virtual ELOG_LEVEL getLogLevel() = 0;
|
||||
virtual ELOG_LEVEL getLogLevel() const = 0;
|
||||
|
||||
//! Sets a new log level. With this value, texts which are sent to
|
||||
//! the logger are filtered out. For example setting this value to
|
||||
|
|
|
@ -26,7 +26,7 @@ class IMaterialRenderer : public virtual IReferenceCounted
|
|||
public:
|
||||
|
||||
//! destructor
|
||||
virtual ~IMaterialRenderer() {};
|
||||
virtual ~IMaterialRenderer() {}
|
||||
|
||||
//! Called by the IVideoDriver implementation the let the renderer set its needed render states.
|
||||
/** This is called during the IVideoDriver::setMaterial() call.
|
||||
|
@ -69,12 +69,12 @@ public:
|
|||
/** Called during the
|
||||
IVideoDriver::setMaterial() call before the new material will get the OnSetMaterial()
|
||||
call. */
|
||||
virtual void OnUnsetMaterial() {};
|
||||
virtual void OnUnsetMaterial() {}
|
||||
|
||||
//! Returns if the material is transparent.
|
||||
/** The scene managment needs to know this
|
||||
for being able to sort the materials by opaque and transparent. */
|
||||
virtual bool isTransparent() { return false; }
|
||||
virtual bool isTransparent() const { return false; }
|
||||
|
||||
//! Returns the render capability of the material.
|
||||
/** Because some more complex materials
|
||||
|
@ -86,7 +86,7 @@ public:
|
|||
it cannot use the latest shaders. More specific examples:
|
||||
Fixed function pipeline materials should return 0 in most cases, parallax mapped
|
||||
material will only return 0 when at least pixel shader 1.4 is available on that machine. */
|
||||
virtual s32 getRenderCapability() { return 0; }
|
||||
virtual s32 getRenderCapability() const { return 0; }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace scene
|
|||
public:
|
||||
|
||||
//! destructor
|
||||
virtual ~IMeshCache() {};
|
||||
virtual ~IMeshCache() {}
|
||||
|
||||
//! Adds a mesh to the internal list of loaded meshes.
|
||||
/** Usually, ISceneManager::getMesh() is called to load a mesh from a file.
|
||||
|
|
|
@ -27,11 +27,11 @@ class IMeshLoader : public virtual IReferenceCounted
|
|||
public:
|
||||
|
||||
//! destructor
|
||||
virtual ~IMeshLoader() {};
|
||||
virtual ~IMeshLoader() {}
|
||||
|
||||
//! Returns true if the file maybe is able to be loaded by this class.
|
||||
/** This decision should be based only on the file extension (e.g. ".cob") */
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) = 0;
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) const = 0;
|
||||
|
||||
//! Creates/loads an animated mesh from the file.
|
||||
/** \return Pointer to the created mesh. Returns 0 if loading failed.
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace scene
|
|||
public:
|
||||
|
||||
//! destructor
|
||||
virtual ~IMeshManipulator() {};
|
||||
virtual ~IMeshManipulator() {}
|
||||
|
||||
//! Flips the direction of surfaces.
|
||||
/** Changes backfacing triangles to frontfacing
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace scene
|
|||
{
|
||||
public:
|
||||
|
||||
virtual ~IMeshWriter() {};
|
||||
virtual ~IMeshWriter() {}
|
||||
|
||||
//! Returns the type of the mesh writer
|
||||
/** For own implementations, use MAKE_IRR_ID as shown in the EMESH_WRITER_TYPE
|
||||
|
|
|
@ -1100,7 +1100,7 @@ namespace scene
|
|||
//! Posts an input event to the environment.
|
||||
/** Usually you do not have to
|
||||
use this method, it is used by the internal engine. */
|
||||
virtual bool postEventFromUser(SEvent event) = 0;
|
||||
virtual bool postEventFromUser(const SEvent& event) = 0;
|
||||
|
||||
//! Clears the whole scene.
|
||||
/** All scene nodes are removed. */
|
||||
|
|
|
@ -35,10 +35,10 @@ namespace scene
|
|||
public:
|
||||
|
||||
//! Constructor
|
||||
ISceneNode( ISceneNode* parent, ISceneManager* mgr, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
|
||||
ISceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
|
||||
: RelativeTranslation(position), RelativeRotation(rotation), RelativeScale(scale),
|
||||
Parent(parent), ID(id), SceneManager(mgr), TriangleSelector(0),
|
||||
AutomaticCullingState(EAC_BOX), IsVisible(true),
|
||||
|
@ -51,7 +51,6 @@ namespace scene
|
|||
}
|
||||
|
||||
|
||||
|
||||
//! Destructor
|
||||
virtual ~ISceneNode()
|
||||
{
|
||||
|
@ -332,7 +331,7 @@ namespace scene
|
|||
|
||||
//! Returns amount of materials used by this scene node.
|
||||
//! \return Returns current count of materials used by this scene node.
|
||||
virtual u32 getMaterialCount()
|
||||
virtual u32 getMaterialCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -356,7 +355,7 @@ namespace scene
|
|||
//! \param texture: Texture to be used.
|
||||
void setMaterialTexture(u32 textureLayer, video::ITexture* texture)
|
||||
{
|
||||
if (textureLayer>= video::MATERIAL_MAX_TEXTURES)
|
||||
if (textureLayer >= video::MATERIAL_MAX_TEXTURES)
|
||||
return;
|
||||
|
||||
for (u32 i=0; i<getMaterialCount(); ++i)
|
||||
|
@ -483,7 +482,7 @@ namespace scene
|
|||
//! Returns if this scene node is a debug object.
|
||||
/** Debug objects have some special properties, for example they can be easily
|
||||
excluded from collision detection or from serialization, etc. */
|
||||
bool isDebugObject()
|
||||
bool isDebugObject() const
|
||||
{
|
||||
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
|
||||
return IsDebugObject;
|
||||
|
@ -546,6 +545,7 @@ namespace scene
|
|||
TriangleSelector->grab();
|
||||
}
|
||||
|
||||
|
||||
//! updates the absolute position based on the relative and the parents position
|
||||
virtual void updateAbsolutePosition()
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace scene
|
|||
: ISceneNode(parent, mgr, id) {}
|
||||
|
||||
//! sets the mesh from which the shadow volume should be generated.
|
||||
virtual void setMeshToRenderFrom(IMesh* mesh) = 0;
|
||||
virtual void setMeshToRenderFrom(const IMesh* mesh) = 0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
|
|
|
@ -166,7 +166,7 @@ while(device->run())
|
|||
input library for example for doing joystick input, you can use this to post key or mouse input
|
||||
events to the engine. Internally, this method only delegates the events further to the
|
||||
scene manager and the GUI environment. */
|
||||
virtual void postEventFromUser(SEvent event) = 0;
|
||||
virtual void postEventFromUser(const SEvent& event) = 0;
|
||||
|
||||
//! Sets the input receiving scene manager.
|
||||
/** If set to null, the main scene manager (returned by GetSceneManager()) will receive the input */
|
||||
|
|
|
@ -24,10 +24,10 @@ class aabbox3d
|
|||
|
||||
// Constructors
|
||||
|
||||
aabbox3d(): MinEdge(-1,-1,-1), MaxEdge(1,1,1) {};
|
||||
aabbox3d(const vector3d<T>& min, const vector3d<T>& max): MinEdge(min), MaxEdge(max) {};
|
||||
aabbox3d(const vector3d<T>& init): MinEdge(init), MaxEdge(init) {};
|
||||
aabbox3d(T minx, T miny, T minz, T maxx, T maxy, T maxz): MinEdge(minx, miny, minz), MaxEdge(maxx, maxy, maxz) {};
|
||||
aabbox3d(): MinEdge(-1,-1,-1), MaxEdge(1,1,1) {}
|
||||
aabbox3d(const vector3d<T>& min, const vector3d<T>& max): MinEdge(min), MaxEdge(max) {}
|
||||
aabbox3d(const vector3d<T>& init): MinEdge(init), MaxEdge(init) {}
|
||||
aabbox3d(T minx, T miny, T minz, T maxx, T maxy, T maxz): MinEdge(minx, miny, minz), MaxEdge(maxx, maxy, maxz) {}
|
||||
|
||||
// operators
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace core
|
|||
\brief File containing useful basic utility functions
|
||||
*/
|
||||
|
||||
// ----------------------------- some basic quite often used string functions --------------------------
|
||||
// ----------- some basic quite often used string functions -----------------
|
||||
|
||||
static const stringc irrEmtpyStringc = "";
|
||||
|
||||
|
|
|
@ -17,11 +17,10 @@ namespace core
|
|||
class dimension2d
|
||||
{
|
||||
public:
|
||||
dimension2d()
|
||||
: Width(0), Height(0) {};
|
||||
dimension2d() : Width(0), Height(0) {}
|
||||
|
||||
dimension2d(const T& width, const T& height)
|
||||
: Width(width), Height(height) {};
|
||||
: Width(width), Height(height) {}
|
||||
|
||||
bool operator == (const dimension2d<T>& other) const
|
||||
{
|
||||
|
|
|
@ -14,36 +14,34 @@ namespace core
|
|||
{
|
||||
|
||||
const float fast_atof_table[16] = { // we write [16] here instead of [] to work around a swig bug
|
||||
0.f,
|
||||
0.1f,
|
||||
0.01f,
|
||||
0.001f,
|
||||
0.0001f,
|
||||
0.00001f,
|
||||
0.000001f,
|
||||
0.0000001f,
|
||||
0.00000001f,
|
||||
0.000000001f,
|
||||
0.0000000001f,
|
||||
0.00000000001f,
|
||||
0.000000000001f,
|
||||
0.0000000000001f,
|
||||
0.00000000000001f,
|
||||
0.000000000000001f
|
||||
};
|
||||
0.f,
|
||||
0.1f,
|
||||
0.01f,
|
||||
0.001f,
|
||||
0.0001f,
|
||||
0.00001f,
|
||||
0.000001f,
|
||||
0.0000001f,
|
||||
0.00000001f,
|
||||
0.000000001f,
|
||||
0.0000000001f,
|
||||
0.00000000001f,
|
||||
0.000000000001f,
|
||||
0.0000000000001f,
|
||||
0.00000000000001f,
|
||||
0.000000000000001f
|
||||
};
|
||||
|
||||
inline u32 strtol10(const char* in, const char** out=0)
|
||||
{
|
||||
u32 value = 0;
|
||||
c8 symbol;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
symbol = *in;
|
||||
if ( symbol < '0' || symbol > '9' )
|
||||
if ( *in < '0' || *in > '9' )
|
||||
break;
|
||||
|
||||
value = ( value * 10 ) + ( symbol - '0' );
|
||||
value = ( value * 10 ) + ( *in - '0' );
|
||||
++in;
|
||||
}
|
||||
if (out)
|
||||
|
@ -62,7 +60,7 @@ inline const char* fast_atof_move( const char* c, float& out)
|
|||
|
||||
if (*c=='-')
|
||||
{
|
||||
c++;
|
||||
++c;
|
||||
inv = true;
|
||||
}
|
||||
|
||||
|
@ -71,7 +69,7 @@ inline const char* fast_atof_move( const char* c, float& out)
|
|||
|
||||
if (*c == '.')
|
||||
{
|
||||
c++;
|
||||
++c;
|
||||
|
||||
//float pl = (float)strtol(c, &t, 10);
|
||||
float pl = (float) strtol10 ( c, &t );
|
||||
|
@ -87,7 +85,7 @@ inline const char* fast_atof_move( const char* c, float& out)
|
|||
//float exp = (float)strtol(c, &t, 10);
|
||||
bool einv = (*c=='-');
|
||||
if (einv)
|
||||
c++;
|
||||
++c;
|
||||
|
||||
float exp = (float)strtol10(c, &c);
|
||||
if (einv)
|
||||
|
|
|
@ -21,11 +21,11 @@ inline void heapsink(T*array, s32 element, s32 max)
|
|||
s32 j = (element<<1);
|
||||
|
||||
if (j+1 < max && array[j] < array[j+1])
|
||||
j = j+1; // take right child
|
||||
j = j+1; // take right child
|
||||
|
||||
if (array[element] < array[j])
|
||||
{
|
||||
T t = array[j]; // swap elements
|
||||
T t = array[j]; // swap elements
|
||||
array[j] = array[element];
|
||||
array[element] = t;
|
||||
element = j;
|
||||
|
@ -67,7 +67,5 @@ inline void heapsort(T* array_, s32 size)
|
|||
} // end namespace core
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ C3DSMeshFileLoader::~C3DSMeshFileLoader()
|
|||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".bsp")
|
||||
bool C3DSMeshFileLoader::isALoadableFileExtension(const c8* filename)
|
||||
bool C3DSMeshFileLoader::isALoadableFileExtension(const c8* filename) const
|
||||
{
|
||||
return strstr(filename, ".3ds")!=0;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".cob")
|
||||
virtual bool isALoadableFileExtension(const c8* fileName);
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) const;
|
||||
|
||||
//! creates/loads an animated mesh from the file.
|
||||
//! \return Pointer to the created mesh. Returns 0 if loading failed.
|
||||
|
|
|
@ -546,7 +546,7 @@ video::SMaterial& CAnimatedMeshSceneNode::getMaterial(u32 i)
|
|||
|
||||
|
||||
//! returns amount of materials used by this scene node.
|
||||
u32 CAnimatedMeshSceneNode::getMaterialCount()
|
||||
u32 CAnimatedMeshSceneNode::getMaterialCount() const
|
||||
{
|
||||
return Materials.size();
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace scene
|
|||
virtual video::SMaterial& getMaterial(u32 i);
|
||||
|
||||
//! returns amount of materials used by this scene node.
|
||||
virtual u32 getMaterialCount();
|
||||
virtual u32 getMaterialCount() const;
|
||||
|
||||
//! Creates shadow volume scene node as child of this node
|
||||
//! and returns a pointer to it.
|
||||
|
|
|
@ -37,7 +37,7 @@ CB3DMeshFileLoader::~CB3DMeshFileLoader()
|
|||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".bsp")
|
||||
bool CB3DMeshFileLoader::isALoadableFileExtension(const c8* fileName)
|
||||
bool CB3DMeshFileLoader::isALoadableFileExtension(const c8* fileName) const
|
||||
{
|
||||
return strstr(fileName, ".b3d") != 0;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".bsp")
|
||||
virtual bool isALoadableFileExtension(const c8* fileName);
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) const;
|
||||
|
||||
//! creates/loads an animated mesh from the file.
|
||||
//! \return Pointer to the created mesh. Returns 0 if loading failed.
|
||||
|
|
|
@ -38,7 +38,7 @@ CBSPMeshFileLoader::~CBSPMeshFileLoader()
|
|||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".bsp")
|
||||
bool CBSPMeshFileLoader::isALoadableFileExtension(const c8* filename)
|
||||
bool CBSPMeshFileLoader::isALoadableFileExtension(const c8* filename) const
|
||||
{
|
||||
return strstr(filename, ".bsp") || strstr(filename, ".shader");
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".bsp")
|
||||
virtual bool isALoadableFileExtension(const c8* fileName);
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) const;
|
||||
|
||||
//! creates/loads an animated mesh from the file.
|
||||
//! \return Pointer to the created mesh. Returns 0 if loading failed.
|
||||
|
|
|
@ -15,10 +15,9 @@ namespace scene
|
|||
|
||||
//! constructor
|
||||
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
|
||||
)
|
||||
: IBillboardSceneNode(parent, mgr, id, position)
|
||||
const core::vector3df& position, const core::dimension2d<f32>& size,
|
||||
video::SColor shade_top, video::SColor shade_down)
|
||||
: IBillboardSceneNode(parent, mgr, id, position)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CBillboardSceneNode");
|
||||
|
@ -47,13 +46,6 @@ CBillboardSceneNode::CBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr,
|
|||
}
|
||||
|
||||
|
||||
|
||||
CBillboardSceneNode::~CBillboardSceneNode()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! pre render event
|
||||
void CBillboardSceneNode::OnRegisterSceneNode()
|
||||
{
|
||||
|
@ -157,14 +149,14 @@ video::SMaterial& CBillboardSceneNode::getMaterial(u32 i)
|
|||
|
||||
|
||||
//! returns amount of materials used by this scene node.
|
||||
u32 CBillboardSceneNode::getMaterialCount()
|
||||
u32 CBillboardSceneNode::getMaterialCount() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
//! gets the size of the billboard
|
||||
const core::dimension2d<f32>& CBillboardSceneNode::getSize()
|
||||
const core::dimension2d<f32>& CBillboardSceneNode::getSize() const
|
||||
{
|
||||
return Size;
|
||||
}
|
||||
|
@ -181,6 +173,7 @@ void CBillboardSceneNode::serializeAttributes(io::IAttributes* out, io::SAttribu
|
|||
out->addColor ("Shade_Down", vertices[0].Color );
|
||||
}
|
||||
|
||||
|
||||
//! Reads attributes of the scene node.
|
||||
void CBillboardSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
|
||||
{
|
||||
|
@ -194,6 +187,7 @@ void CBillboardSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttrib
|
|||
setSize(Size);
|
||||
}
|
||||
|
||||
|
||||
//! Set the color of all vertices of the billboard
|
||||
//! \param overallColor: the color to set
|
||||
void CBillboardSceneNode::setColor(const video::SColor & overallColor)
|
||||
|
@ -202,6 +196,7 @@ void CBillboardSceneNode::setColor(const video::SColor & overallColor)
|
|||
vertices[0].Color = overallColor;
|
||||
}
|
||||
|
||||
|
||||
//! 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
|
||||
|
@ -213,10 +208,11 @@ void CBillboardSceneNode::setColor(const video::SColor & topColor, const video::
|
|||
vertices[3].Color = bottomColor;
|
||||
}
|
||||
|
||||
|
||||
//! Gets the color of the top and bottom vertices of the billboard
|
||||
//! \param[out] topColor: stores the color of the top vertices
|
||||
//! \param[out] bottomColor: stores the color of the bottom vertices
|
||||
void CBillboardSceneNode::getColor(video::SColor & topColor, video::SColor & bottomColor)
|
||||
void CBillboardSceneNode::getColor(video::SColor & topColor, video::SColor & bottomColor) const
|
||||
{
|
||||
bottomColor = vertices[0].Color;
|
||||
topColor = vertices[1].Color;
|
||||
|
@ -226,8 +222,10 @@ void CBillboardSceneNode::getColor(video::SColor & topColor, video::SColor & bot
|
|||
//! Creates a clone of this scene node and its children.
|
||||
ISceneNode* CBillboardSceneNode::clone(ISceneNode* newParent, ISceneManager* newManager)
|
||||
{
|
||||
if (!newParent) newParent = Parent;
|
||||
if (!newManager) newManager = SceneManager;
|
||||
if (!newParent)
|
||||
newParent = Parent;
|
||||
if (!newManager)
|
||||
newManager = SceneManager;
|
||||
|
||||
CBillboardSceneNode* nb = new CBillboardSceneNode(newParent,
|
||||
newManager, ID, RelativeTranslation, Size);
|
||||
|
|
|
@ -24,8 +24,6 @@ public:
|
|||
const core::vector3df& position, const core::dimension2d<f32>& size,
|
||||
video::SColor shade_top=video::SColor(0xFFFFFFFF),video::SColor shade_down=video::SColor(0xFFFFFFFF));
|
||||
|
||||
virtual ~CBillboardSceneNode();
|
||||
|
||||
//! pre render event
|
||||
virtual void OnRegisterSceneNode();
|
||||
|
||||
|
@ -39,12 +37,12 @@ public:
|
|||
virtual void setSize(const core::dimension2d<f32>& size);
|
||||
|
||||
//! gets the size of the billboard
|
||||
virtual const core::dimension2d<f32>& getSize();
|
||||
virtual const core::dimension2d<f32>& getSize() const;
|
||||
|
||||
virtual video::SMaterial& getMaterial(u32 i);
|
||||
|
||||
//! returns amount of materials used by this scene node.
|
||||
virtual u32 getMaterialCount();
|
||||
virtual u32 getMaterialCount() const;
|
||||
|
||||
//! Set the color of all vertices of the billboard
|
||||
//! \param overallColor: the color to set
|
||||
|
@ -58,7 +56,7 @@ public:
|
|||
//! Gets the color of the top and bottom vertices of the billboard
|
||||
//! \param[out] topColor: stores the color of the top vertices
|
||||
//! \param[out] bottomColor: stores the color of the bottom vertices
|
||||
virtual void getColor(video::SColor & topColor, video::SColor & bottomColor);
|
||||
virtual void getColor(video::SColor& topColor, video::SColor& bottomColor) const;
|
||||
|
||||
//! Writes attributes of the scene node.
|
||||
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
|
||||
|
@ -86,6 +84,5 @@ private:
|
|||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -368,7 +368,7 @@ namespace scene
|
|||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".bsp")
|
||||
bool CCSMLoader::isALoadableFileExtension(const c8* fileName)
|
||||
bool CCSMLoader::isALoadableFileExtension(const c8* fileName) const
|
||||
{
|
||||
return strstr(fileName, ".csm")!=0;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace scene
|
|||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".bsp")
|
||||
virtual bool isALoadableFileExtension(const c8* fileName);
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) const;
|
||||
|
||||
//! creates/loads an animated mesh from the file.
|
||||
virtual IAnimatedMesh* createMesh(irr::io::IReadFile* file);
|
||||
|
|
|
@ -85,7 +85,7 @@ CCameraFPSSceneNode::~CCameraFPSSceneNode()
|
|||
//! example with scene::ISceneManager::addMayaCameraSceneNode or
|
||||
//! scene::ISceneManager::addFPSCameraSceneNode, may want to get this input
|
||||
//! for changing their position, look at target or whatever.
|
||||
bool CCameraFPSSceneNode::OnEvent(SEvent event)
|
||||
bool CCameraFPSSceneNode::OnEvent(const SEvent& event)
|
||||
{
|
||||
if (event.EventType == EET_KEY_INPUT_EVENT)
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace scene
|
|||
//! example with scene::ISceneManager::addMayaCameraSceneNode or
|
||||
//! scene::ISceneManager::addMeshViewerCameraSceneNode, may want to get this input
|
||||
//! for changing their position, look at target or whatever.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! OnAnimate() is called just before rendering the whole scene.
|
||||
//! nodes may calculate or store animations here, and may do other useful things,
|
||||
|
|
|
@ -43,7 +43,7 @@ CCameraMayaSceneNode::~CCameraMayaSceneNode()
|
|||
//! example with scene::ISceneManager::addMayaCameraSceneNode or
|
||||
//! scene::ISceneManager::addMeshViewerCameraSceneNode, may want to get this input
|
||||
//! for changing their position, look at target or whatever.
|
||||
bool CCameraMayaSceneNode::OnEvent(SEvent event)
|
||||
bool CCameraMayaSceneNode::OnEvent(const SEvent& event)
|
||||
{
|
||||
if (event.EventType != EET_MOUSE_INPUT_EVENT ||
|
||||
!InputReceiverEnabled)
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace scene
|
|||
//! example with scene::ISceneManager::addMayaCameraSceneNode or
|
||||
//! scene::ISceneManager::addMeshViewerCameraSceneNode, may want to get this input
|
||||
//! for changing their position, look at target or whatever.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! OnAnimate() is called just before rendering the whole scene.
|
||||
//! nodes may calculate or store animations here, and may do other useful things,
|
||||
|
|
|
@ -60,7 +60,7 @@ void CCameraSceneNode::setInputReceiverEnabled(bool enabled)
|
|||
|
||||
|
||||
//! Returns if the input receiver of the camera is currently enabled.
|
||||
bool CCameraSceneNode::isInputReceiverEnabled()
|
||||
bool CCameraSceneNode::isInputReceiverEnabled() const
|
||||
{
|
||||
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
|
||||
return InputReceiverEnabled;
|
||||
|
@ -80,7 +80,7 @@ void CCameraSceneNode::setProjectionMatrix(const core::matrix4& projection)
|
|||
|
||||
//! Gets the current projection matrix of the camera
|
||||
//! \return Returns the current projection matrix of the camera.
|
||||
const core::matrix4& CCameraSceneNode::getProjectionMatrix()
|
||||
const core::matrix4& CCameraSceneNode::getProjectionMatrix() const
|
||||
{
|
||||
return ViewArea.Matrices [ video::ETS_PROJECTION ];
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ const core::matrix4& CCameraSceneNode::getProjectionMatrix()
|
|||
|
||||
//! Gets the current view matrix of the camera
|
||||
//! \return Returns the current view matrix of the camera.
|
||||
const core::matrix4& CCameraSceneNode::getViewMatrix()
|
||||
const core::matrix4& CCameraSceneNode::getViewMatrix() const
|
||||
{
|
||||
return ViewArea.Matrices [ video::ETS_VIEW ];
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ const core::matrix4& CCameraSceneNode::getViewMatrix()
|
|||
//! example with scene::ISceneManager::addMayaCameraSceneNode or
|
||||
//! scene::ISceneManager::addFPSCameraSceneNode, may want to get this input
|
||||
//! for changing their position, look at target or whatever.
|
||||
bool CCameraSceneNode::OnEvent(SEvent event)
|
||||
bool CCameraSceneNode::OnEvent(const SEvent& event)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -143,22 +143,22 @@ core::vector3df CCameraSceneNode::getUpVector() const
|
|||
}
|
||||
|
||||
|
||||
f32 CCameraSceneNode::getNearValue()
|
||||
f32 CCameraSceneNode::getNearValue() const
|
||||
{
|
||||
return ZNear;
|
||||
}
|
||||
|
||||
f32 CCameraSceneNode::getFarValue()
|
||||
f32 CCameraSceneNode::getFarValue() const
|
||||
{
|
||||
return ZFar;
|
||||
}
|
||||
|
||||
f32 CCameraSceneNode::getAspectRatio()
|
||||
f32 CCameraSceneNode::getAspectRatio() const
|
||||
{
|
||||
return Aspect;
|
||||
}
|
||||
|
||||
f32 CCameraSceneNode::getFOV()
|
||||
f32 CCameraSceneNode::getFOV() const
|
||||
{
|
||||
return Fovy;
|
||||
}
|
||||
|
|
|
@ -32,18 +32,18 @@ namespace scene
|
|||
|
||||
//! Gets the current projection matrix of the camera
|
||||
//! \return Returns the current projection matrix of the camera.
|
||||
virtual const core::matrix4& getProjectionMatrix();
|
||||
virtual const core::matrix4& getProjectionMatrix() const;
|
||||
|
||||
//! Gets the current view matrix of the camera
|
||||
//! \return Returns the current view matrix of the camera.
|
||||
virtual const core::matrix4& getViewMatrix();
|
||||
virtual const core::matrix4& getViewMatrix() const;
|
||||
|
||||
//! It is possible to send mouse and key events to the camera. Most cameras
|
||||
//! may ignore this input, but camera scene nodes which are created for
|
||||
//! example with scene::ISceneManager::addMayaCameraSceneNode or
|
||||
//! scene::ISceneManager::addMeshViewerCameraSceneNode, may want to get this input
|
||||
//! for changing their position, look at target or whatever.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! sets the look at target of the camera
|
||||
//! \param pos: Look at target of the camera.
|
||||
|
@ -63,19 +63,19 @@ namespace scene
|
|||
|
||||
//! Gets distance from the camera to the near plane.
|
||||
//! \return Value of the near plane of the camera.
|
||||
virtual f32 getNearValue();
|
||||
virtual f32 getNearValue() const;
|
||||
|
||||
//! Gets the distance from the camera to the far plane.
|
||||
//! \return Value of the far plane of the camera.
|
||||
virtual f32 getFarValue();
|
||||
virtual f32 getFarValue() const;
|
||||
|
||||
//! Get the aspect ratio of the camera.
|
||||
//! \return The aspect ratio of the camera.
|
||||
virtual f32 getAspectRatio();
|
||||
virtual f32 getAspectRatio() const;
|
||||
|
||||
//! Gets the field of view of the camera.
|
||||
//! \return Field of view of the camera
|
||||
virtual f32 getFOV();
|
||||
virtual f32 getFOV() const;
|
||||
|
||||
//! Sets the value of the near clipping plane. (default: 1.0f)
|
||||
virtual void setNearValue(f32 zn);
|
||||
|
@ -107,7 +107,7 @@ namespace scene
|
|||
virtual void setInputReceiverEnabled(bool enabled);
|
||||
|
||||
//! Returns if the input receiver of the camera is currently enabled.
|
||||
virtual bool isInputReceiverEnabled();
|
||||
virtual bool isInputReceiverEnabled() const;
|
||||
|
||||
//! Writes attributes of the scene node.
|
||||
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
|
||||
|
|
|
@ -205,7 +205,7 @@ CColladaFileLoader::~CColladaFileLoader()
|
|||
|
||||
//! Returns true if the file maybe is able to be loaded by this class.
|
||||
/** This decision should be based only on the file extension (e.g. ".cob") */
|
||||
bool CColladaFileLoader::isALoadableFileExtension(const c8* fileName)
|
||||
bool CColladaFileLoader::isALoadableFileExtension(const c8* fileName) const
|
||||
{
|
||||
return strstr(fileName, ".xml") ||
|
||||
strstr(fileName, ".dae");
|
||||
|
|
|
@ -156,7 +156,7 @@ public:
|
|||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".cob")
|
||||
virtual bool isALoadableFileExtension(const c8* fileName);
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) const;
|
||||
|
||||
//! creates/loads an animated mesh from the file.
|
||||
//! \return Pointer to the created mesh. Returns 0 if loading failed.
|
||||
|
|
|
@ -125,7 +125,7 @@ video::SMaterial& CCubeSceneNode::getMaterial(u32 i)
|
|||
|
||||
|
||||
//! returns amount of materials used by this scene node.
|
||||
u32 CCubeSceneNode::getMaterialCount()
|
||||
u32 CCubeSceneNode::getMaterialCount() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace scene
|
|||
virtual video::SMaterial& getMaterial(u32 i);
|
||||
|
||||
//! returns amount of materials used by this scene node.
|
||||
virtual u32 getMaterialCount();
|
||||
virtual u32 getMaterialCount() const;
|
||||
|
||||
//! Returns type of the scene node
|
||||
virtual ESCENE_NODE_TYPE getType() const { return ESNT_CUBE; }
|
||||
|
|
|
@ -223,7 +223,7 @@ public:
|
|||
}
|
||||
|
||||
//! Returns if the material is transparent.
|
||||
virtual bool isTransparent()
|
||||
virtual bool isTransparent() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ public:
|
|||
}
|
||||
|
||||
//! Returns if the material is transparent.
|
||||
virtual bool isTransparent()
|
||||
virtual bool isTransparent() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ public:
|
|||
}
|
||||
|
||||
//! Returns if the material is transparent.
|
||||
virtual bool isTransparent()
|
||||
virtual bool isTransparent() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ public:
|
|||
|
||||
//! Returns if the material is transparent. The scene managment needs to know this
|
||||
//! for being able to sort the materials by opaque and transparent.
|
||||
virtual bool isTransparent()
|
||||
virtual bool isTransparent() const
|
||||
{
|
||||
return false; // this material is not really transparent because it does no blending.
|
||||
}
|
||||
|
@ -573,7 +573,7 @@ public:
|
|||
}
|
||||
|
||||
//! Returns if the material is transparent.
|
||||
virtual bool isTransparent()
|
||||
virtual bool isTransparent() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ namespace video
|
|||
}
|
||||
|
||||
//! Returns the render capability of the material.
|
||||
s32 CD3D8NormalMapRenderer::getRenderCapability()
|
||||
s32 CD3D8NormalMapRenderer::getRenderCapability() const
|
||||
{
|
||||
if (Driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) &&
|
||||
Driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1))
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype);
|
||||
|
||||
//! Returns the render capability of the material.
|
||||
virtual s32 getRenderCapability();
|
||||
virtual s32 getRenderCapability() const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ namespace video
|
|||
}
|
||||
|
||||
//! Returns the render capability of the material.
|
||||
s32 CD3D8ParallaxMapRenderer::getRenderCapability()
|
||||
s32 CD3D8ParallaxMapRenderer::getRenderCapability() const
|
||||
{
|
||||
if (Driver->queryFeature(video::EVDF_PIXEL_SHADER_1_4) &&
|
||||
Driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1))
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
bool resetAllRenderstates, video::IMaterialRendererServices* services);
|
||||
|
||||
//! Returns the render capability of the material.
|
||||
virtual s32 getRenderCapability();
|
||||
virtual s32 getRenderCapability() const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ void CD3D8ShaderMaterialRenderer::OnUnsetMaterial()
|
|||
|
||||
//! Returns if the material is transparent. The scene managment needs to know this
|
||||
//! for being able to sort the materials by opaque and transparent.
|
||||
bool CD3D8ShaderMaterialRenderer::isTransparent()
|
||||
bool CD3D8ShaderMaterialRenderer::isTransparent() const
|
||||
{
|
||||
return BaseMaterial ? BaseMaterial->isTransparent() : false;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype);
|
||||
|
||||
//! Returns if the material is transparent.
|
||||
virtual bool isTransparent();
|
||||
virtual bool isTransparent() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@ public:
|
|||
|
||||
//! Returns if the material is transparent. The scene management needs to know this
|
||||
//! for being able to sort the materials by opaque and transparent.
|
||||
virtual bool isTransparent()
|
||||
virtual bool isTransparent() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ public:
|
|||
|
||||
//! Returns if the material is transparent. The scene managment needs to know this
|
||||
//! for being able to sort the materials by opaque and transparent.
|
||||
virtual bool isTransparent()
|
||||
virtual bool isTransparent() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ public:
|
|||
|
||||
//! Returns if the material is transparent. The scene managment needs to know this
|
||||
//! for being able to sort the materials by opaque and transparent.
|
||||
virtual bool isTransparent()
|
||||
virtual bool isTransparent() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ public:
|
|||
|
||||
//! Returns if the material is transparent. The scene managment needs to know this
|
||||
//! for being able to sort the materials by opaque and transparent.
|
||||
virtual bool isTransparent()
|
||||
virtual bool isTransparent() const
|
||||
{
|
||||
return false; // this material is not really transparent because it does no blending.
|
||||
}
|
||||
|
@ -599,7 +599,7 @@ public:
|
|||
|
||||
//! Returns if the material is transparent. The scene managment needs to know this
|
||||
//! for being able to sort the materials by opaque and transparent.
|
||||
virtual bool isTransparent()
|
||||
virtual bool isTransparent() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ namespace video
|
|||
|
||||
|
||||
//! Returns the render capability of the material.
|
||||
s32 CD3D9NormalMapRenderer::getRenderCapability()
|
||||
s32 CD3D9NormalMapRenderer::getRenderCapability() const
|
||||
{
|
||||
if (Driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) &&
|
||||
Driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1))
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype);
|
||||
|
||||
//! Returns the render capability of the material.
|
||||
virtual s32 getRenderCapability();
|
||||
virtual s32 getRenderCapability() const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -314,7 +314,7 @@ namespace video
|
|||
}
|
||||
|
||||
//! Returns the render capability of the material.
|
||||
s32 CD3D9ParallaxMapRenderer::getRenderCapability()
|
||||
s32 CD3D9ParallaxMapRenderer::getRenderCapability() const
|
||||
{
|
||||
if (Driver->queryFeature(video::EVDF_PIXEL_SHADER_1_4) &&
|
||||
Driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1))
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype);
|
||||
|
||||
//! Returns the render capability of the material.
|
||||
virtual s32 getRenderCapability();
|
||||
virtual s32 getRenderCapability() const;
|
||||
|
||||
virtual void OnSetMaterial(video::SMaterial& material,
|
||||
const video::SMaterial& lastMaterial,
|
||||
|
|
|
@ -146,7 +146,7 @@ void CD3D9ShaderMaterialRenderer::OnUnsetMaterial()
|
|||
|
||||
//! Returns if the material is transparent. The scene managment needs to know this
|
||||
//! for being able to sort the materials by opaque and transparent.
|
||||
bool CD3D9ShaderMaterialRenderer::isTransparent()
|
||||
bool CD3D9ShaderMaterialRenderer::isTransparent() const
|
||||
{
|
||||
return BaseMaterial ? BaseMaterial->isTransparent() : false;
|
||||
}
|
||||
|
|
|
@ -44,40 +44,40 @@ public:
|
|||
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype);
|
||||
|
||||
//! Returns if the material is transparent.
|
||||
virtual bool isTransparent();
|
||||
virtual bool isTransparent() const;
|
||||
|
||||
protected:
|
||||
|
||||
//! constructor only for use by derived classes who want to
|
||||
//! create a fall back material for example.
|
||||
CD3D9ShaderMaterialRenderer(IDirect3DDevice9* d3ddev,
|
||||
video::IVideoDriver* driver,
|
||||
IShaderConstantSetCallBack* callback,
|
||||
IMaterialRenderer* baseMaterial, s32 userData=0);
|
||||
|
||||
video::IVideoDriver* driver,
|
||||
IShaderConstantSetCallBack* callback,
|
||||
IMaterialRenderer* baseMaterial,
|
||||
s32 userData=0);
|
||||
|
||||
void init(s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram);
|
||||
bool createPixelShader(const c8* pxsh);
|
||||
bool createVertexShader(const char* vtxsh);
|
||||
|
||||
HRESULT stubD3DXAssembleShader(LPCSTR pSrcData, UINT SrcDataLen,
|
||||
CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags, LPD3DXBUFFER* ppShader,
|
||||
LPD3DXBUFFER* ppErrorMsgs);
|
||||
CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags, LPD3DXBUFFER* ppShader,
|
||||
LPD3DXBUFFER* ppErrorMsgs);
|
||||
|
||||
HRESULT stubD3DXAssembleShaderFromFile(LPCSTR pSrcFile,
|
||||
CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags,
|
||||
LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs);
|
||||
|
||||
HRESULT stubD3DXCompileShader(LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude, LPCSTR pFunctionName,
|
||||
LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader,
|
||||
LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable);
|
||||
LPD3DXINCLUDE pInclude, LPCSTR pFunctionName,
|
||||
LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader,
|
||||
LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable);
|
||||
|
||||
HRESULT stubD3DXCompileShaderFromFile(LPCSTR pSrcFile, CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude, LPCSTR pFunctionName,
|
||||
LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs,
|
||||
LPD3DXCONSTANTTABLE* ppConstantTable);
|
||||
LPD3DXINCLUDE pInclude, LPCSTR pFunctionName,
|
||||
LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs,
|
||||
LPD3DXCONSTANTTABLE* ppConstantTable);
|
||||
|
||||
IDirect3DDevice9* pID3DDevice;
|
||||
video::IVideoDriver* Driver;
|
||||
|
|
|
@ -435,7 +435,7 @@ IAnimatedMesh* CDMFLoader::createMesh(io::IReadFile* file)
|
|||
/** \brief Tell us if this file is able to be loaded by this class
|
||||
based on the file extension (e.g. ".bsp")
|
||||
\return true if file is loadable.*/
|
||||
bool CDMFLoader::isALoadableFileExtension(const c8* filename)
|
||||
bool CDMFLoader::isALoadableFileExtension(const c8* filename) const
|
||||
{
|
||||
return strstr(filename, ".dmf") != 0;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace scene
|
|||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".cob")
|
||||
virtual bool isALoadableFileExtension(const c8* fileName);
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) const;
|
||||
|
||||
/** creates/loads an animated mesh from the file.
|
||||
\return Pointer to the created mesh. Returns 0 if loading failed.
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace scene
|
|||
virtual core::matrix4 getRelativeTransformation() const;
|
||||
|
||||
//! does nothing.
|
||||
virtual void render() {};
|
||||
virtual void render() {}
|
||||
|
||||
//! Returns type of the scene node
|
||||
virtual ESCENE_NODE_TYPE getType() const { return ESNT_DUMMY_TRANSFORMATION; }
|
||||
|
|
|
@ -209,10 +209,10 @@ bool CFileSystem::changeWorkingDirectoryTo(const c8* newDirectory)
|
|||
return success;
|
||||
}
|
||||
|
||||
irr::core::stringc CFileSystem::getAbsolutePath(irr::core::stringc &filename)
|
||||
core::stringc CFileSystem::getAbsolutePath(const core::stringc& filename) const
|
||||
{
|
||||
c8 *p=0;
|
||||
irr::core::stringc ret;
|
||||
core::stringc ret;
|
||||
|
||||
#ifdef _IRR_WINDOWS_API_
|
||||
|
||||
|
@ -231,34 +231,28 @@ irr::core::stringc CFileSystem::getAbsolutePath(irr::core::stringc &filename)
|
|||
return ret;
|
||||
}
|
||||
|
||||
irr::core::stringc CFileSystem::getFileDir(irr::core::stringc &filename)
|
||||
core::stringc CFileSystem::getFileDir(const core::stringc& filename) const
|
||||
{
|
||||
irr::core::stringc ret;
|
||||
|
||||
// find last forward or backslash
|
||||
s32 lastSlash = filename.findLast('/');
|
||||
#ifdef _IRR_WINDOWS_API_
|
||||
s32 lastBackSlash = filename.findLast('\\');
|
||||
const s32 lastBackSlash = filename.findLast('\\');
|
||||
lastSlash = lastSlash > lastBackSlash ? lastSlash : lastBackSlash;
|
||||
#endif
|
||||
|
||||
if (lastSlash >= 0 && lastSlash < (s32)filename.size())
|
||||
ret = filename.subString(0, lastSlash);
|
||||
if ((u32)lastSlash < filename.size())
|
||||
return filename.subString(0, lastSlash);
|
||||
else
|
||||
ret = ".";
|
||||
|
||||
return ret;
|
||||
return ".";
|
||||
}
|
||||
|
||||
//! Creates a list of files and directories in the current working directory
|
||||
IFileList* CFileSystem::createFileList()
|
||||
IFileList* CFileSystem::createFileList() const
|
||||
{
|
||||
return new CFileList();
|
||||
}
|
||||
|
||||
|
||||
//! determines if a file exists and would be able to be opened.
|
||||
bool CFileSystem::existFile(const c8* filename)
|
||||
bool CFileSystem::existFile(const c8* filename) const
|
||||
{
|
||||
u32 i;
|
||||
|
||||
|
|
|
@ -56,18 +56,18 @@ public:
|
|||
virtual bool changeWorkingDirectoryTo(const c8* newDirectory);
|
||||
|
||||
//! Converts a relative path to an absolute (unique) path, resolving symbolic links
|
||||
virtual irr::core::stringc getAbsolutePath(irr::core::stringc &filename);
|
||||
virtual core::stringc getAbsolutePath(const core::stringc& filename) const;
|
||||
|
||||
//! Returns the directory a file is located in.
|
||||
/** \param filename: The file to get the directory from */
|
||||
virtual irr::core::stringc getFileDir(irr::core::stringc &filename);
|
||||
virtual core::stringc getFileDir(const core::stringc& filename) const;
|
||||
|
||||
//! Creates a list of files and directories in the current working directory
|
||||
//! and returns it.
|
||||
virtual IFileList* createFileList();
|
||||
virtual IFileList* createFileList() const;
|
||||
|
||||
//! determinates if a file exists and would be able to be opened.
|
||||
virtual bool existFile(const c8* filename);
|
||||
virtual bool existFile(const c8* filename) const;
|
||||
|
||||
//! Creates a XML Reader from a file.
|
||||
virtual IXMLReader* createXMLReader(const c8* filename);
|
||||
|
@ -99,7 +99,6 @@ private:
|
|||
};
|
||||
|
||||
|
||||
|
||||
} // end namespace irr
|
||||
} // end namespace io
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void CGUIButton::setSprite(EGUI_BUTTON_STATE state, s32 index, video::SColor col
|
|||
}
|
||||
|
||||
//! called if an event happened.
|
||||
bool CGUIButton::OnEvent(SEvent event)
|
||||
bool CGUIButton::OnEvent(const SEvent& event)
|
||||
{
|
||||
if (!IsEnabled)
|
||||
return Parent ? Parent->OnEvent(event) : false;
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace gui
|
|||
~CGUIButton();
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw();
|
||||
|
|
|
@ -33,7 +33,7 @@ CGUICheckBox::CGUICheckBox(bool checked, IGUIEnvironment* environment, IGUIEleme
|
|||
|
||||
|
||||
//! called if an event happened.
|
||||
bool CGUICheckBox::OnEvent(SEvent event)
|
||||
bool CGUICheckBox::OnEvent(const SEvent& event)
|
||||
{
|
||||
switch(event.EventType)
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace gui
|
|||
virtual bool isChecked() const;
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw();
|
||||
|
|
|
@ -337,7 +337,7 @@ void CGUIColorSelectDialog::buildColorRing( const core::dimension2d<s32> & dim,
|
|||
|
||||
|
||||
//! called if an event happened.
|
||||
bool CGUIColorSelectDialog::OnEvent(SEvent event)
|
||||
bool CGUIColorSelectDialog::OnEvent(const SEvent& event)
|
||||
{
|
||||
|
||||
switch(event.EventType)
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace gui
|
|||
virtual ~CGUIColorSelectDialog();
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw();
|
||||
|
|
|
@ -147,7 +147,7 @@ void CGUIComboBox::updateAbsolutePosition()
|
|||
|
||||
|
||||
//! called if an event happened.
|
||||
bool CGUIComboBox::OnEvent(SEvent event)
|
||||
bool CGUIComboBox::OnEvent(const SEvent& event)
|
||||
{
|
||||
switch(event.EventType)
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace gui
|
|||
virtual void updateAbsolutePosition();
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw();
|
||||
|
|
|
@ -212,7 +212,7 @@ void CGUIContextMenu::removeAllItems()
|
|||
|
||||
|
||||
//! called if an event happened.
|
||||
bool CGUIContextMenu::OnEvent(SEvent event)
|
||||
bool CGUIContextMenu::OnEvent(const SEvent& event)
|
||||
{
|
||||
if (!IsEnabled)
|
||||
return Parent ? Parent->OnEvent(event) : false;
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace gui
|
|||
virtual void removeAllItems();
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw();
|
||||
|
|
|
@ -174,7 +174,7 @@ void CGUIEditBox::setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT ver
|
|||
|
||||
|
||||
//! called if an event happened.
|
||||
bool CGUIEditBox::OnEvent(SEvent event)
|
||||
bool CGUIEditBox::OnEvent(const SEvent& event)
|
||||
{
|
||||
switch(event.EventType)
|
||||
{
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace gui
|
|||
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical);
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw();
|
||||
|
|
|
@ -360,7 +360,7 @@ void CGUIEnvironment::clear()
|
|||
|
||||
|
||||
//! called by ui if an event happened.
|
||||
bool CGUIEnvironment::OnEvent(SEvent event)
|
||||
bool CGUIEnvironment::OnEvent(const SEvent& event)
|
||||
{
|
||||
if (UserReceiver && (event.EventType != EET_GUI_EVENT || event.GUIEvent.Caller != this))
|
||||
return UserReceiver->OnEvent(event);
|
||||
|
@ -483,7 +483,7 @@ void CGUIEnvironment::setUserEventReceiver(IEventReceiver* evr)
|
|||
|
||||
|
||||
//! posts an input event to the environment
|
||||
bool CGUIEnvironment::postEventFromUser(SEvent event)
|
||||
bool CGUIEnvironment::postEventFromUser(const SEvent& event)
|
||||
{
|
||||
switch(event.EventType)
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
virtual IOSOperator* getOSOperator() const;
|
||||
|
||||
//! posts an input event to the environment
|
||||
virtual bool postEventFromUser(SEvent event);
|
||||
virtual bool postEventFromUser(const SEvent& event);
|
||||
|
||||
//! This sets a new event receiver for gui events. Usually you do not have to
|
||||
//! use this method, it is used by the internal engine.
|
||||
|
@ -56,7 +56,7 @@ public:
|
|||
virtual void clear();
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! returns the current gui skin
|
||||
virtual IGUISkin* getSkin() const;
|
||||
|
|
|
@ -134,7 +134,7 @@ const wchar_t* CGUIFileOpenDialog::getFileName() const
|
|||
|
||||
|
||||
//! called if an event happened.
|
||||
bool CGUIFileOpenDialog::OnEvent(SEvent event)
|
||||
bool CGUIFileOpenDialog::OnEvent(const SEvent& event)
|
||||
{
|
||||
switch(event.EventType)
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace gui
|
|||
virtual const wchar_t* getFileName() const;
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(SEvent event);
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue