Commit 5aad0b4c authored by mercury233's avatar mercury233

more files from the 1.8.4 release

parent d1e6eaf4
......@@ -104,8 +104,6 @@ namespace scene
video::SMaterial Material;
core::aabbox3d<f32> BoundingBox;
private:
CDynamicMeshBuffer(const CDynamicMeshBuffer&); // = delete in c++11, prevent copying
IVertexBuffer *VertexBuffer;
IIndexBuffer *IndexBuffer;
};
......
......@@ -21,7 +21,7 @@ namespace scene
CMeshBuffer():ChangedID_Vertex(1),ChangedID_Index(1),MappingHint_Vertex(EHM_NEVER), MappingHint_Index(EHM_NEVER)
{
#ifdef _DEBUG
setDebugName("CMeshBuffer");
setDebugName("SMeshBuffer");
#endif
}
......
......@@ -115,29 +115,11 @@ namespace video
//! Support for different blend functions. Without, only ADD is available
EVDF_BLEND_OPERATIONS,
//! Support for separate blending for RGB and Alpha.
EVDF_BLEND_SEPARATE,
//! Support for texture coord transformation via texture matrix
EVDF_TEXTURE_MATRIX,
//! Support for DXTn compressed textures.
EVDF_TEXTURE_COMPRESSED_DXT,
//! Support for PVRTC compressed textures.
EVDF_TEXTURE_COMPRESSED_PVRTC,
//! Support for PVRTC2 compressed textures.
EVDF_TEXTURE_COMPRESSED_PVRTC2,
//! Support for ETC1 compressed textures.
EVDF_TEXTURE_COMPRESSED_ETC1,
//! Support for ETC2 compressed textures.
EVDF_TEXTURE_COMPRESSED_ETC2,
//! Support for cube map textures.
EVDF_TEXTURE_CUBEMAP,
//! Support for NVidia's CG shader language
EVDF_CG,
//! Only used for counting the elements of this enum
EVDF_COUNT
......
......@@ -5,8 +5,6 @@
#ifndef __E_DRIVER_TYPES_H_INCLUDED__
#define __E_DRIVER_TYPES_H_INCLUDED__
#include "irrTypes.h"
namespace irr
{
namespace video
......@@ -39,8 +37,10 @@ namespace video
contribution. */
EDT_BURNINGSVIDEO,
//! Direct3D8 device is longer supported in Irrlicht. You have to go back to Irrlicht 1.8 if you still need that.
DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS, // keep enum to avoid breaking enumeration order (might be used in ini-files, serialization, etc)
//! Direct3D8 device, only available on Win32 platforms.
/** Performs hardware accelerated rendering of 3D and 2D
primitives. */
EDT_DIRECT3D8,
//! Direct3D 9 device, only available on Win32 platforms.
/** Performs hardware accelerated rendering of 3D and 2D
......@@ -56,30 +56,9 @@ namespace video
EDT_COUNT
};
const c8* const DRIVER_TYPE_NAMES[] =
{
"NullDriver",
"Software Renderer",
"Burning's Video",
"Direct3D 8.1",
"Direct3D 9.0c",
"OpenGL 1.x/2.x/3.x",
0
};
const c8* const DRIVER_TYPE_NAMES_SHORT[] =
{
"null",
"software",
"burning",
"d3d8",
"d3d9",
"opengl",
0
};
} // end namespace video
} // end namespace irr
#endif
......@@ -91,9 +91,6 @@ enum EGUI_ELEMENT_TYPE
//! The root of the GUI
EGUIET_ROOT,
//! IGUIProfiler
EGUIET_PROFILER,
//! Not an element, amount of elements in there
EGUIET_COUNT,
......@@ -130,7 +127,6 @@ const c8* const GUIElementTypeNames[] =
"window",
"element",
"root",
"profiler",
0
};
......
......@@ -84,10 +84,7 @@ namespace video
EMF_BLEND_OPERATION = 0x40000,
//! Flag for polygon offset
EMF_POLYGON_OFFSET = 0x80000,
//! Flag for blend factor
EMF_BLEND_FACTOR = 0x160000
EMF_POLYGON_OFFSET = 0x80000
};
} // end namespace video
......
......@@ -31,10 +31,7 @@ namespace scene
EMWT_OBJ = MAKE_IRR_ID('o','b','j',0),
//! PLY mesh writer for .ply files
EMWT_PLY = MAKE_IRR_ID('p','l','y',0),
//! B3D mesh writer, for static .b3d files
EMWT_B3D = MAKE_IRR_ID('b', '3', 'd', 0)
EMWT_PLY = MAKE_IRR_ID('p','l','y',0)
};
......
......@@ -12,6 +12,48 @@ namespace irr
{
namespace scene
{
//! Possible types of (animated) meshes.
enum E_ANIMATED_MESH_TYPE
{
//! Unknown animated mesh type.
EAMT_UNKNOWN = 0,
//! Quake 2 MD2 model file
EAMT_MD2,
//! Quake 3 MD3 model file
EAMT_MD3,
//! Maya .obj static model
EAMT_OBJ,
//! Quake 3 .bsp static Map
EAMT_BSP,
//! 3D Studio .3ds file
EAMT_3DS,
//! My3D Mesh, the file format by Zhuck Dimitry
EAMT_MY3D,
//! Pulsar LMTools .lmts file. This Irrlicht loader was written by Jonas Petersen
EAMT_LMTS,
//! Cartography Shop .csm file. This loader was created by Saurav Mohapatra.
EAMT_CSM,
//! .oct file for Paul Nette's FSRad or from Murphy McCauley's Blender .oct exporter.
/** The oct file format contains 3D geometry and lightmaps and
can be loaded directly by Irrlicht */
EAMT_OCT,
//! Halflife MDL model file
EAMT_MDL_HALFLIFE,
//! generic skinned mesh
EAMT_SKINNED
};
//! Interface for an animated mesh.
/** There are already simple implementations of this interface available so
you don't have to implement this interface on your own if you need to:
......@@ -22,8 +64,7 @@ namespace scene
public:
//! Gets the frame count of the animated mesh.
/** Note that the play-time is usually getFrameCount()-1 as it stops as soon as the last frame-key is reached.
\return The amount of frames. If the amount is 1,
/** \return The amount of frames. If the amount is 1,
it is a static, non animated mesh. */
virtual u32 getFrameCount() const = 0;
......
......@@ -82,11 +82,11 @@ namespace scene
{
c8 headerID[4]; //id of file, always "IDP3"
s32 Version; //this is a version number, always 15
s8 fileName[68];//sometimes left Blank... 65 chars, 32bit aligned == 68 chars
s8 fileName[68]; //sometimes left Blank... 65 chars, 32bit aligned == 68 chars
s32 numFrames; //number of KeyFrames
s32 numTags; //number of 'tags' per frame
s32 numMeshes; //number of meshes/skins
s32 numMaxSkins;//maximum number of unique skins used in md3 file. artefact md2
s32 numMaxSkins; //maximum number of unique skins used in md3 file. artefact md2
s32 frameStart; //starting position of frame-structur
s32 tagStart; //starting position of tag-structures
s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures
......
......@@ -72,11 +72,7 @@ namespace scene
virtual void setCurrentFrame(f32 frame) = 0;
//! Sets the frame numbers between the animation is looped.
/** The default is 0 to getFrameCount()-1 of the mesh.
Number of played frames is end-start.
It interpolates toward the last frame but stops when it is reached.
It does not interpolate back to start even when looping.
Looping animations should ensure last and first frame-key are identical.
/** The default is 0 - MaximalFrameCount of the mesh.
\param begin: Start frame number of the loop.
\param end: End frame number of the loop.
\return True if successful, false if not. */
......
This diff is collapsed.
......@@ -14,9 +14,9 @@ namespace scene
{
struct SViewFrustum;
//! Scene Node which is a (controllable) camera.
//! Scene Node which is a (controlable) camera.
/** The whole scene will be rendered from the cameras point of view.
Because the ICameraSceneNode is a SceneNode, it can be attached to any
Because the ICameraScenNode is a SceneNode, it can be attached to any
other scene node, and will follow its parents movement, rotation and so
on.
*/
......@@ -135,7 +135,8 @@ namespace scene
virtual void setFOV(f32 fovy) =0;
//! Get the view frustum.
/** \return The current view frustum. */
/** Needed sometimes by bspTree or LOD render nodes.
\return The current view frustum. */
virtual const SViewFrustum* getViewFrustum() const =0;
//! Disables or enables the camera to get key or mouse inputs.
......@@ -149,6 +150,7 @@ namespace scene
//! Checks if a camera is orthogonal.
virtual bool isOrthogonal() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsOrthogonal;
}
......@@ -159,13 +161,10 @@ namespace scene
point at the target point. FPS camera use this binding by
default; other cameras do not.
\param bound True to bind the camera's scene node rotation
and targeting, false to unbind them.
and targetting, false to unbind them.
@see getTargetAndRotationBinding() */
virtual void bindTargetAndRotation(bool bound) =0;
//! Updates the matrices without uploading them to the driver
virtual void updateMatrices() = 0;
//! Queries if the camera scene node's rotation and its target position are bound together.
/** @see bindTargetAndRotation() */
virtual bool getTargetAndRotationBinding(void) const =0;
......@@ -177,7 +176,7 @@ namespace scene
if (!out)
return;
out->addBool("IsOrthogonal", IsOrthogonal);
out->addBool ("IsOrthogonal", IsOrthogonal );
}
//! Reads attributes of the camera node
......
......@@ -139,7 +139,7 @@ namespace scene
//! Return the mesh for the given node. If it has no mesh or shouldn't export it's mesh
//! you can return 0 in which case only the transformation matrix of the node will be used.
// TODO: Function is not const because there is no const getMesh() function for several Irrlicht nodes.
// Note: Function is not const because there is no const getMesh() function.
virtual IMesh* getMesh(irr::scene::ISceneNode * node) = 0;
//! Return if the node has it's own material overwriting the mesh-materials
......@@ -360,12 +360,6 @@ namespace scene
/** A tool function to help when using a custom name generator to generative valid names for collada names and id's. */
virtual irr::core::stringw toNCName(const irr::core::stringw& oldString, const irr::core::stringw& prefix=irr::core::stringw(L"_NC_")) const = 0;
//! After export you can find out which name had been used for writing the geometry for this node.
/** The name comes from IColladaMeshWriterNames::nameForMesh, but you can't access the node there.
\return Either a pointer to the name or NULL */
// TODO: Function is not const because there is no const getMesh() function for several Irrlicht nodes.
virtual const irr::core::stringw* findGeometryNameForNode(ISceneNode* node) = 0;
protected:
// NOTE: You usually should also call setProperties with the same paraemter when using setDefaultProperties
......
......@@ -315,7 +315,7 @@ struct SEvent
//! Any kind of keyboard event.
struct SKeyInput
{
//! Character corresponding to the key (0, if not a character, value undefined in key releases)
//! Character corresponding to the key (0, if not a character)
wchar_t Char;
//! Key which has been pressed or released
......@@ -351,7 +351,7 @@ struct SEvent
AXIS_R, // e.g. rudder, or analog 2 stick 2 top to bottom
AXIS_U,
AXIS_V,
NUMBER_OF_AXES=18 // (please tell Irrlicht maintainers if you absolutely need more axes)
NUMBER_OF_AXES
};
/** A bitmap of button states. You can use IsButtonPressed() to
......
......@@ -75,9 +75,6 @@ public:
//! get the archive type
virtual E_FILE_ARCHIVE_TYPE getType() const { return EFAT_UNKNOWN; }
//! return the name (id) of the file Archive
virtual const io::path& getArchiveName() const =0;
//! An optionally used password string
/** This variable is publicly accessible from the interface in order to
avoid single access patterns to this place, and hence allow some more
......
......@@ -51,7 +51,7 @@ public:
The returned pointer should be dropped when no longer needed.
See IReferenceCounted::drop() for more information.
*/
virtual IReadFile* createMemoryReadFile(const void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
//! Creates an IReadFile interface for accessing files inside files.
/** This is useful e.g. for archives.
......
......@@ -20,16 +20,11 @@ namespace gui
class IGUIFont;
class IGUISpriteBank;
//! Current state of buttons used for drawing sprites.
//! Note that up to 3 states can be active at the same time:
//! EGBS_BUTTON_UP or EGBS_BUTTON_DOWN
//! EGBS_BUTTON_MOUSE_OVER or EGBS_BUTTON_MOUSE_OFF
//! EGBS_BUTTON_FOCUSED or EGBS_BUTTON_NOT_FOCUSED
enum EGUI_BUTTON_STATE
{
//! The button is not pressed.
//! The button is not pressed
EGBS_BUTTON_UP=0,
//! The button is currently pressed down.
//! The button is currently pressed down
EGBS_BUTTON_DOWN,
//! The mouse cursor is over the button
EGBS_BUTTON_MOUSE_OVER,
......@@ -39,14 +34,12 @@ namespace gui
EGBS_BUTTON_FOCUSED,
//! The button doesn't have the focus
EGBS_BUTTON_NOT_FOCUSED,
//! The button is disabled All other states are ignored in that case.
EGBS_BUTTON_DISABLED,
//! not used, counts the number of enumerated items
EGBS_COUNT
};
//! Names for gui button state icons
const c8* const GUIButtonStateNames[EGBS_COUNT+1] =
const c8* const GUIButtonStateNames[] =
{
"buttonUp",
"buttonDown",
......@@ -54,52 +47,8 @@ namespace gui
"buttonMouseOff",
"buttonFocused",
"buttonNotFocused",
"buttonDisabled",
0 // count
};
//! State of buttons used for drawing texture images.
//! Note that only a single state is active at a time
//! Also when no image is defined for a state it will use images from another state
//! and if that state is not set from the replacement for that,etc.
//! So in many cases setting EGBIS_IMAGE_UP and EGBIS_IMAGE_DOWN is sufficient.
enum EGUI_BUTTON_IMAGE_STATE
{
//! When no other states have images they will all use this one.
EGBIS_IMAGE_UP,
//! When not set EGBIS_IMAGE_UP is used.
EGBIS_IMAGE_UP_MOUSEOVER,
//! When not set EGBIS_IMAGE_UP_MOUSEOVER is used.
EGBIS_IMAGE_UP_FOCUSED,
//! When not set EGBIS_IMAGE_UP_FOCUSED is used.
EGBIS_IMAGE_UP_FOCUSED_MOUSEOVER,
//! When not set EGBIS_IMAGE_UP is used.
EGBIS_IMAGE_DOWN,
//! When not set EGBIS_IMAGE_DOWN is used.
EGBIS_IMAGE_DOWN_MOUSEOVER,
//! When not set EGBIS_IMAGE_DOWN_MOUSEOVER is used.
EGBIS_IMAGE_DOWN_FOCUSED,
//! When not set EGBIS_IMAGE_DOWN_FOCUSED is used.
EGBIS_IMAGE_DOWN_FOCUSED_MOUSEOVER,
//! When not set EGBIS_IMAGE_UP or EGBIS_IMAGE_DOWN are used (depending on button state).
EGBIS_IMAGE_DISABLED,
//! not used, counts the number of enumerated items
EGBIS_COUNT
};
//! Names for gui button image states
const c8* const GUIButtonImageStateNames[EGBIS_COUNT+1] =
{
"Image", // not "ImageUp" as it otherwise breaks serialization of old files
"ImageUpOver",
"ImageUpFocused",
"ImageUpFocusedOver",
"PressedImage", // not "ImageDown" as it otherwise breaks serialization of old files
"ImageDownOver",
"ImageDownFocused",
"ImageDownFocusedOver",
"ImageDisabled",
0 // count
0,
0,
};
//! GUI Button interface.
......@@ -128,71 +77,38 @@ namespace gui
font of the active skin otherwise */
virtual IGUIFont* getActiveFont() const = 0;
//! Sets an image which should be displayed on the button when it is in the given state.
/** Only one image-state can be active at a time. Images are drawn below sprites.
If a state is without image it will try to use images from other states as described
in ::EGUI_BUTTON_IMAGE_STATE.
Images are a little less flexible than sprites, but easier to use.
\param state: One of ::EGUI_BUTTON_IMAGE_STATE
\param image: Image to be displayed or NULL to remove the image
\param sourceRect: Source rectangle on the image texture. When width or height are 0 then the full texture-size is used (default). */
virtual void setImage(EGUI_BUTTON_IMAGE_STATE state, video::ITexture* image=0, const core::rect<s32>& sourceRect=core::rect<s32>(0,0,0,0)) = 0;
//! Sets an image which should be displayed on the button when it is in normal state.
/** This is identical to calling setImage(EGBIS_IMAGE_UP, image); and might be deprecated in future revisions.
\param image: Image to be displayed */
/** \param image: Image to be displayed */
virtual void setImage(video::ITexture* image=0) = 0;
//! Sets a background image for the button when it is in normal state.
/** This is identical to calling setImage(EGBIS_IMAGE_UP, image, sourceRect); and might be deprecated in future revisions.
\param image: Texture containing the image to be displayed
\param sourceRect: Position in the texture, where the image is located.
When width or height are 0 then the full texture-size is used */
virtual void setImage(video::ITexture* image, const core::rect<s32>& sourceRect) = 0;
/** \param image: Texture containing the image to be displayed
\param pos: Position in the texture, where the image is located */
virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
//! Sets a background image for the button when it is in pressed state.
/** This is identical to calling setImage(EGBIS_IMAGE_DOWN, image); and might be deprecated in future revisions.
If no images is specified for the pressed state via
/** If no images is specified for the pressed state via
setPressedImage(), this image is also drawn in pressed state.
\param image: Image to be displayed */
virtual void setPressedImage(video::ITexture* image=0) = 0;
//! Sets an image which should be displayed on the button when it is in pressed state.
/** This is identical to calling setImage(EGBIS_IMAGE_DOWN, image, sourceRect); and might be deprecated in future revisions.
\param image: Texture containing the image to be displayed
\param sourceRect: Position in the texture, where the image is located */
virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& sourceRect) = 0;
/** \param image: Texture containing the image to be displayed
\param pos: Position in the texture, where the image is located */
virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
//! Sets the sprite bank used by the button
/** NOTE: The spritebank itself is _not_ serialized so far. The sprites are serialized.
Which means after loading the gui you still have to set the spritebank manually. */
virtual void setSpriteBank(IGUISpriteBank* bank=0) = 0;
//! Sets the animated sprite for a specific button state
/** Several sprites can be drawn at the same time.
Sprites can be animated.
Sprites are drawn above the images.
\param index: Number of the sprite within the sprite bank, use -1 for no sprite
/** \param index: Number of the sprite within the sprite bank, use -1 for no sprite
\param state: State of the button to set the sprite for
\param index: The sprite number from the current sprite bank
\param color: The color of the sprite
\param loop: True if the animation should loop, false if not
\param scale: True if the sprite should scale to button size, false if not */
*/
virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
video::SColor color=video::SColor(255,255,255,255), bool loop=false, bool scale=false) = 0;
//! Get the sprite-index for the given state or -1 when no sprite is set
virtual s32 getSpriteIndex(EGUI_BUTTON_STATE state) const = 0;
//! Get the sprite color for the given state. Color is only used when a sprite is set.
virtual video::SColor getSpriteColor(EGUI_BUTTON_STATE state) const = 0;
//! Returns if the sprite in the given state does loop
virtual bool getSpriteLoop(EGUI_BUTTON_STATE state) const = 0;
//! Returns if the sprite in the given state is scaled
virtual bool getSpriteScale(EGUI_BUTTON_STATE state) const = 0;
video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0;
//! Sets if the button should behave like a push button.
/** Which means it can be in two states: Normal or Pressed. With a click on the button,
......
......@@ -29,21 +29,6 @@ namespace gui
//! Returns true if box is checked.
virtual bool isChecked() const = 0;
//! Sets whether to draw the background
virtual void setDrawBackground(bool draw) = 0;
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const = 0;
//! Sets whether to draw the border
virtual void setDrawBorder(bool draw) = 0;
//! Checks if border drawing is enabled
/** \return true if border drawing is enabled, false otherwise */
virtual bool isDrawBorderEnabled() const = 0;
};
} // end namespace gui
......
......@@ -20,13 +20,6 @@ namespace gui
//! constructor
IGUIColorSelectDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_COLOR_SELECT_DIALOG, environment, parent, id, rectangle) {}
//! get chosen color as usual SColor struct
virtual video::SColor getColor() =0;
//! get chosen color as HSL values
virtual video::SColorHSL getColorHSL() =0;
};
......
......@@ -81,7 +81,7 @@ namespace gui
virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId=-1, bool enabled=true,
bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
//! Find an item by its CommandID
//! Find an item by it's CommandID
/**
\param commandId: We are looking for the first item which has this commandID
\param idxStartSearch: Start searching from this index.
......
......@@ -68,18 +68,10 @@ namespace gui
//! Sets whether to draw the background
virtual void setDrawBackground(bool draw) = 0;
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const = 0;
//! Turns the border on or off
/** \param border: true if you want the border to be drawn, false if not */
virtual void setDrawBorder(bool border) = 0;
//! Checks if border drawing is enabled
/** \return true if border drawing is enabled, false otherwise */
virtual bool isDrawBorderEnabled() const = 0;
//! Sets text justification mode
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
EGUIA_LOWERRIGHT for right justified, or EGUIA_CENTER for centered text.
......@@ -133,20 +125,6 @@ namespace gui
//! Returns maximum amount of characters, previously set by setMax();
virtual u32 getMax() const = 0;
//! Set the character used for the cursor.
/** By default it's "_" */
virtual void setCursorChar(const wchar_t cursorChar) = 0;
//! Get the character used for the cursor.
virtual wchar_t getCursorChar() const = 0;
//! Set the blinktime for the cursor. 2x blinktime is one full cycle.
//** \param timeMs Blinktime in milliseconds. When set to 0 the cursor is constantly on without blinking */
virtual void setCursorBlinkTime(irr::u32 timeMs) = 0;
//! Get the cursor blinktime
virtual irr::u32 getCursorBlinkTime() const = 0;
};
......
......@@ -239,14 +239,14 @@ public:
\return The topmost GUI element at that point, or 0 if there are
no candidate elements at this point.
*/
virtual IGUIElement* getElementFromPoint(const core::position2d<s32>& point)
IGUIElement* getElementFromPoint(const core::position2d<s32>& point)
{
IGUIElement* target = 0;
// we have to search from back to front, because later children
// might be drawn over the top of earlier ones.
core::list<IGUIElement*>::ConstIterator it = Children.getLast();
core::list<IGUIElement*>::Iterator it = Children.getLast();
if (isVisible())
{
......@@ -277,10 +277,10 @@ public:
//! Adds a GUI element as new child of this element.
virtual void addChild(IGUIElement* child)
{
if ( child && child != this )
{
addChildToEnd(child);
if (child)
{
child->updateAbsolutePosition();
}
}
......@@ -342,22 +342,10 @@ public:
//! Returns true if element is visible.
virtual bool isVisible() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsVisible;
}
//! Check whether the element is truly visible, taking into accounts its parents' visibility
/** \return true if the element and all its parents are visible,
false if this or any parent element is invisible. */
virtual bool isTrulyVisible() const
{
if(!IsVisible)
return false;
if(!Parent)
return true;
return Parent->isTrulyVisible();
}
//! Sets the visible state of this element.
virtual void setVisible(bool visible)
......@@ -369,6 +357,7 @@ public:
//! Returns true if this element was created as part of its parent control
virtual bool isSubElement() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsSubElement;
}
......@@ -394,6 +383,7 @@ public:
//! Returns true if this element can be focused by navigating with the tab key
bool isTabStop() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsTabStop;
}
......@@ -447,6 +437,7 @@ public:
//! Returns true if this element is a tab group.
bool isTabGroup() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsTabGroup;
}
......@@ -473,6 +464,7 @@ public:
if ( isSubElement() && IsEnabled && getParent() )
return getParent()->isEnabled();
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsEnabled;
}
......@@ -548,6 +540,7 @@ public:
}
}
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return false;
}
......@@ -569,6 +562,7 @@ public:
}
}
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return false;
}
......@@ -620,7 +614,7 @@ public:
} while (child->Parent && child != this);
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return child == this;
}
......@@ -632,11 +626,9 @@ public:
\param first: element with the highest/lowest known tab order depending on search direction
\param closest: the closest match, depending on tab order and direction
\param includeInvisible: includes invisible elements in the search (default=false)
\param includeDisabled: includes disabled elements in the search (default=false)
\return true if successfully found an element, false to continue searching/fail */
bool getNextElement(s32 startOrder, bool reverse, bool group,
IGUIElement*& first, IGUIElement*& closest, bool includeInvisible=false,
bool includeDisabled=false) const
IGUIElement*& first, IGUIElement*& closest, bool includeInvisible=false) const
{
// we'll stop searching if we find this number
s32 wanted = startOrder + ( reverse ? -1 : 1 );
......@@ -652,9 +644,6 @@ public:
// ignore invisible elements and their children
if ( ( (*it)->isVisible() || includeInvisible ) &&
(group == true || (*it)->isTabGroup() == false) )
{
// ignore disabled, but children are checked (disabled is currently per element ignoring parent states)
if ( (*it)->isEnabled() || includeDisabled )
{
// only check tab stops and those with the same group status
if ((*it)->isTabStop() && ((*it)->isTabGroup() == group))
......@@ -699,15 +688,16 @@ public:
first = *it;
}
}
}
// search within children
if ((*it)->getNextElement(startOrder, reverse, group, first, closest))
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return true;
}
}
++it;
}
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return false;
}
......@@ -851,7 +841,7 @@ protected:
if (NoClip)
{
IGUIElement* p=this;
while (p->Parent)
while (p && p->Parent)
p = p->Parent;
parentAbsoluteClip = p->AbsoluteClippingRect;
}
......
......@@ -9,7 +9,6 @@
#include "IGUISkin.h"
#include "rect.h"
#include "EMessageBoxFlags.h"
#include "EFocusFlags.h"
#include "IEventReceiver.h"
#include "IXMLReader.h"
#include "path.h"
......@@ -59,7 +58,6 @@ class IGUIComboBox;
class IGUIToolBar;
class IGUIButton;
class IGUIWindow;
class IGUIProfiler;
class IGUIElementFactory;
//! GUI Environment. Used as factory and manager of all other GUI elements.
......@@ -105,9 +103,8 @@ public:
//! Returns whether the element has focus
/** \param element Pointer to the element which is tested.
\param checkSubElements When true and focus is on a sub-element of element then it will still count as focused and return true
\return True if the element has focus, else false. */
virtual bool hasFocus(const IGUIElement* element, bool checkSubElements=false) const = 0;
virtual bool hasFocus(IGUIElement* element) const = 0;
//! Returns the current video driver.
/** \return Pointer to the video driver. */
......@@ -201,9 +198,9 @@ public:
more information. */
virtual IGUIFont* getBuiltInFont() const = 0;
//! Returns pointer to the sprite bank which was added with addEmptySpriteBank
/** TODO: This should load files in the future, but not implemented so far.
\param filename Name of a spritebank added with addEmptySpriteBank
//! Returns pointer to the sprite bank with the specified file name.
/** Loads the bank if it was not loaded before.
\param filename Filename of the sprite bank's origin.
\return Pointer to the sprite bank. Returns 0 if it could not be loaded.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IGUISpriteBank* getSpriteBank(const io::path& filename) = 0;
......@@ -264,8 +261,9 @@ public:
\param modal Defines if the dialog is modal. This means, that all other
gui elements which were created before the message box cannot be used
until this messagebox is removed.
\param flags Flags specifying the layout of the message box using ::EMESSAGE_BOX_FLAG.
Create a message box with an OK and CANCEL button for example with (EMBF_OK | EMBF_CANCEL).
\param flags Flags specifying the layout of the message box. For example
to create a message box with an OK and a CANCEL button on it, set this
to (EMBF_OK | EMBF_CANCEL).
\param parent Parent gui element of the message box.
\param id Id with which the gui element can be identified.
\param image Optional texture which will be displayed beside the text as an image
......@@ -541,14 +539,6 @@ public:
virtual IGUITable* addTable(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) =0;
//! Adds an element to display the information from the Irrlicht profiler
/** \param rectangle Rectangle specifying the borders of the element.
\param parent Parent of the element. When 0 the environment itself will
be the parent.
\param id An identifier for the element. */
virtual IGUIProfiler* addProfilerDisplay(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1) = 0;
//! Get the default element factory which can create all built-in elements
/** \return Pointer to the factory.
This pointer should not be dropped. See IReferenceCounted::drop() for
......@@ -620,25 +610,6 @@ public:
//! reads an element
virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* node) =0;
//! Find the next element which would be selected when pressing the tab-key
/** If you set the focus for the result you can manually force focus-changes like they
would happen otherwise by the tab-keys.
\param reverse When true it will search backward (toward lower TabOrder numbers, like shift+tab)
\param group When true it will search for the next tab-group (like ctrl+tab)
*/
virtual IGUIElement* getNextElement(bool reverse=false, bool group=false) = 0;
//! Set the way the gui will handle automatic focus changes
/** The default is (EFF_SET_ON_LMOUSE_DOWN | EFF_SET_ON_TAB).
with the left mouse button.
This does not affect the setFocus function itself - users can still call that whenever they want on any element.
\param flags A bitmask which is a combination of ::EFOCUS_FLAG flags.*/
virtual void setFocusBehavior(u32 flags) = 0;
//! Get the way the gui does handle focus changes
/** \returns A bitmask which is a combination of ::EFOCUS_FLAG flags.*/
virtual u32 getFocusBehavior() const = 0;
};
......
......@@ -29,17 +29,11 @@ namespace gui
IGUIFileOpenDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_FILE_OPEN_DIALOG, environment, parent, id, rectangle) {}
//! Returns the filename of the selected file converted to wide characters. Returns NULL if no file was selected.
//! Returns the filename of the selected file. Returns NULL, if no file was selected.
virtual const wchar_t* getFileName() const = 0;
//! Returns the filename of the selected file. Is empty if no file was selected.
virtual const io::path& getFileNameP() const = 0;
//! Returns the directory of the selected file. Empty if no directory was selected.
virtual const io::path& getDirectoryName() const = 0;
//! Returns the directory of the selected file converted to wide characters. Returns NULL if no directory was selected.
virtual const wchar_t* getDirectoryNameW() const = 0;
//! Returns the directory of the selected file. Returns NULL, if no directory was selected.
virtual const io::path& getDirectoryName() = 0;
};
......
......@@ -48,27 +48,6 @@ namespace gui
//! Returns true if the image is using the alpha channel, false if not
virtual bool isAlphaChannelUsed() const = 0;
//! Sets the source rectangle of the image. By default the full image is used.
/** \param sourceRect coordinates inside the image or an area with size 0 for using the full image (default). */
virtual void setSourceRect(const core::rect<s32>& sourceRect) = 0;
//! Returns the customized source rectangle of the image to be used.
/** By default an empty rectangle of width and height 0 is returned which means the full image is used. */
virtual core::rect<s32> getSourceRect() const = 0;
//! Restrict drawing-area.
/** This allows for example to use the image as a progress bar.
Base for area is the image, which means:
- The original clippping area when the texture is scaled or there is no texture.
- The source-rect for an unscaled texture (but still restricted afterwards by the clipping area)
Unlike normal clipping this does not affect the gui-children.
\param drawBoundUVs: Coordinates between 0 and 1 where 0 are for left+top and 1 for right+bottom
*/
virtual void setDrawBounds(const core::rect<f32>& drawBoundUVs = core::rect<f32>(0.f, 0.f, 1.f, 1.f)) = 0;
//! Get drawing-area restrictions.
virtual core::rect<f32> getDrawBounds() const = 0;
};
......@@ -76,3 +55,4 @@ namespace gui
} // end namespace irr
#endif
......@@ -13,7 +13,6 @@ namespace irr
namespace gui
{
class IGUISpriteBank;
class IGUIScrollBar;
//! Enumeration for listbox colors
enum EGUI_LISTBOX_COLOR
......@@ -129,9 +128,6 @@ namespace gui
//! Sets whether to draw the background
virtual void setDrawBackground(bool draw) = 0;
//! Access the vertical scrollbar
virtual IGUIScrollBar* getVerticalScrollBar() const = 0;
};
......
......@@ -183,18 +183,14 @@ namespace gui
EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT,
//! maximal space to reserve for messagebox text-height
EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT,
//! pixels to move an unscaled button image to the right when a button is pressed and the unpressed image looks identical
//! pixels to move the button image to the right when a pushbutton is pressed
EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X,
//! pixels to move an unscaled button image down when a button is pressed and the unpressed image looks identical
//! pixels to move the button image down when a pushbutton is pressed
EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y,
//! pixels to move the button text to the right when a button is pressed
//! pixels to move the button text to the right when a pushbutton is pressed
EGDS_BUTTON_PRESSED_TEXT_OFFSET_X,
//! pixels to move the button text down when a button is pressed
//! pixels to move the button text down when a pushbutton is pressed
EGDS_BUTTON_PRESSED_TEXT_OFFSET_Y,
//! pixels to move an unscaled button sprite to the right when a button is pressed
EGDS_BUTTON_PRESSED_SPRITE_OFFSET_X,
//! pixels to move an unscaled button sprite down when a button is pressed
EGDS_BUTTON_PRESSED_SPRITE_OFFSET_Y,
//! this value is not used, it only specifies the amount of default sizes
//! available.
......@@ -226,8 +222,6 @@ namespace gui
"ButtonPressedImageOffsetY",
"ButtonPressedTextOffsetX",
"ButtonPressedTextOffsetY",
"ButtonPressedSpriteOffsetX",
"ButtonPressedSpriteOffsetY",
0
};
......
......@@ -13,21 +13,6 @@ namespace gui
{
class IGUIEditBox;
//! Enumeration bitflag for when to validate the text typed into the spinbox
//! Default used by Irrlicht is: (EGUI_SBV_ENTER|EGUI_SBV_LOSE_FOCUS)
enum EGUI_SPINBOX_VALIDATION
{
//! Does not validate typed text, probably a bad idea setting this usually.
EGUI_SBV_NEVER = 0,
//! Validate on each change. Was default up to Irrlicht 1.8
EGUI_SBV_CHANGE = 1,
//! Validate when enter was pressed
EGUI_SBV_ENTER = 2,
//! Validate when the editbox loses the focus
EGUI_SBV_LOSE_FOCUS = 4
};
//! Single line edit box + spin buttons
/** \par This element can create the following events of type EGUI_EVENT_TYPE:
\li EGET_SPINBOX_CHANGED
......@@ -74,14 +59,6 @@ namespace gui
//! get the current step size
virtual f32 getStepSize() const = 0;
//! Sets when the spinbox has to validate entered text.
/** \param validateOn Can be any combination of EGUI_SPINBOX_VALIDATION bit flags */
virtual void setValidateOn(u32 validateOn) = 0;
//! Gets when the spinbox has to validate entered text.
/** \return A combination of EGUI_SPINBOX_VALIDATION bit flags */
virtual u32 getValidateOn() const = 0;
};
......
......@@ -22,34 +22,16 @@ namespace gui
{
//! A single sprite frame.
// Note for implementer: Can't fix variable names to uppercase as this is a public interface used since a while
struct SGUISpriteFrame
{
SGUISpriteFrame() : textureNumber(0), rectNumber(0)
{
}
SGUISpriteFrame(u32 textureIndex, u32 positionIndex)
: textureNumber(textureIndex), rectNumber(positionIndex)
{
}
//! Texture index in IGUISpriteBank
u32 textureNumber;
//! Index in IGUISpriteBank::getPositions()
u32 rectNumber;
};
//! A sprite composed of several frames.
// Note for implementer: Can't fix variable names to uppercase as this is a public interface used since a while
struct SGUISprite
{
SGUISprite() : frameTime(0) {}
SGUISprite(const SGUISpriteFrame& firstFrame) : frameTime(0)
{
Frames.push_back(firstFrame);
}
SGUISprite() : Frames(), frameTime(0) {}
core::array<SGUISpriteFrame> Frames;
u32 frameTime;
......@@ -83,49 +65,20 @@ public:
virtual void setTexture(u32 index, video::ITexture* texture) = 0;
//! Add the texture and use it for a single non-animated sprite.
/** The texture and the corresponding rectangle and sprite will all be added to the end of each array.
\returns The index of the sprite or -1 on failure */
//! The texture and the corresponding rectangle and sprite will all be added to the end of each array.
//! returns the index of the sprite or -1 on failure
virtual s32 addTextureAsSprite(video::ITexture* texture) = 0;
//! Clears sprites, rectangles and textures
//! clears sprites, rectangles and textures
virtual void clear() = 0;
//! Draws a sprite in 2d with position and color
/**
\param index Index of SGUISprite to draw
\param pos Target position - depending on center value either the left-top or the sprite center is used as pivot
\param clip Clipping rectangle, can be 0 when clipping is not wanted.
\param color Color with which the image is drawn.
Note that the alpha component is used. If alpha is other than
255, the image will be transparent.
\param starttime Tick when the first frame was drawn (only difference currenttime-starttime matters).
\param currenttime To calculate the frame of animated sprites
\param loop When true animations are looped
\param center When true pivot is set to the sprite-center. So it affects pos.
*/
virtual void draw2DSprite(u32 index, const core::position2di& pos,
const core::rect<s32>* clip=0,
const video::SColor& color= video::SColor(255,255,255,255),
u32 starttime=0, u32 currenttime=0,
bool loop=true, bool center=false) = 0;
//! Draws a sprite in 2d with destination rectangle and colors
/**
\param index Index of SGUISprite to draw
\param destRect The sprite will be scaled to fit this target rectangle
\param clip Clipping rectangle, can be 0 when clipping is not wanted.
\param colors Array of 4 colors denoting the color values of
the corners of the destRect
\param timeTicks Current frame for animated sprites
(same as currenttime-starttime in other draw2DSprite function)
\param loop When true animations are looped
*/
virtual void draw2DSprite(u32 index, const core::rect<s32>& destRect,
const core::rect<s32>* clip=0,
const video::SColor * const colors=0,
u32 timeTicks = 0,
bool loop=true) = 0;
//! Draws a sprite batch in 2d using an array of positions and a color
virtual void draw2DSpriteBatch(const core::array<u32>& indices, const core::array<core::position2di>& pos,
const core::rect<s32>* clip=0,
......
......@@ -67,14 +67,14 @@ namespace gui
//! Sets whether to draw the background
virtual void setDrawBackground(bool draw) = 0;
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const = 0;
//! Gets the background color
/** \return: The background color */
virtual video::SColor getBackgroundColor() const = 0;
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const = 0;
//! Sets whether to draw the border
virtual void setDrawBorder(bool draw) = 0;
......
......@@ -14,7 +14,7 @@ namespace irr
namespace gui
{
//! A tab-page, onto which other gui elements could be added.
/** IGUITab refers mostly to the page itself, but also carries some data about the tab in the tabbar of an IGUITabControl. */
/** IGUITab refers to the page itself, not to the tab in the tabbar of an IGUITabControl. */
class IGUITab : public IGUIElement
{
public:
......@@ -41,7 +41,7 @@ namespace gui
//! returns the color of the background
virtual video::SColor getBackgroundColor() const = 0;
//! sets the color of it's text in the tab-bar
//! sets the color of the text
virtual void setTextColor(video::SColor c) = 0;
//! gets the color of the text
......
......@@ -6,14 +6,14 @@
#define __I_GUI_TABLE_H_INCLUDED__
#include "IGUIElement.h"
#include "irrTypes.h"
#include "SColor.h"
#include "IGUISkin.h"
namespace irr
{
namespace gui
{
class IGUIFont;
class IGUIScrollBar;
//! modes for ordering used when a column header is clicked
enum EGUI_COLUMN_ORDERING
......@@ -104,9 +104,9 @@ namespace gui
virtual s32 getColumnCount() const = 0;
//! Makes a column active. This will trigger an ordering process.
/** \param idx: The id of the column to make active or a negative number to make non active.
/** \param idx: The id of the column to make active.
\param doOrder: Do also the ordering which depending on mode for active column
\return True when the column could be set active (aka - it did exist). */
\return True if successful. */
virtual bool setActiveColumn(s32 idx, bool doOrder=false) = 0;
//! Returns which header is currently active
......@@ -190,41 +190,11 @@ namespace gui
//! clears the table, deletes all items in the table
virtual void clear() = 0;
//! Set flags, as defined in ::EGUI_TABLE_DRAW_FLAGS, which influence the layout
//! Set flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout
virtual void setDrawFlags(s32 flags) = 0;
//! Get the flags, as defined in ::EGUI_TABLE_DRAW_FLAGS, which influence the layout
//! Get the flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout
virtual s32 getDrawFlags() const = 0;
//! Sets another skin independent font.
/** If this is set to zero, the button uses the font of the skin.
\param font: New font to set. */
virtual void setOverrideFont(IGUIFont* font=0) = 0;
//! Gets the override font (if any)
/** \return The override font (may be 0) */
virtual IGUIFont* getOverrideFont(void) const = 0;
//! Get the font which is used right now for drawing
/** Currently this is the override font when one is set and the
font of the active skin otherwise */
virtual IGUIFont* getActiveFont() const = 0;
//! Get the height of items/rows
virtual s32 getItemHeight() const = 0;
//! Access the vertical scrollbar
virtual IGUIScrollBar* getVerticalScrollBar() const = 0;
//! Access the horizontal scrollbar
virtual IGUIScrollBar* getHorizontalScrollBar() const = 0;
//! Sets whether to draw the background.
virtual void setDrawBackground(bool draw) = 0;
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const = 0;
};
......
......@@ -15,7 +15,6 @@ namespace gui
{
class IGUIFont;
class IGUITreeView;
class IGUIScrollBar;
//! Node for gui tree view
......@@ -253,19 +252,6 @@ namespace gui
*/
virtual void setIconFont( IGUIFont* font ) = 0;
//! Sets a skin independent font.
/** \param font: New font to set or 0 to use the skin-font. */
virtual void setOverrideFont(IGUIFont* font=0) = 0;
//! Gets the override font (if any)
/** \return The override font (may be 0) */
virtual IGUIFont* getOverrideFont(void) const = 0;
//! Get the font which is used for drawing
/** This is the override font when one is set and the
font of the skin otherwise. */
virtual IGUIFont* getActiveFont() const = 0;
//! Sets the image list which should be used for the image and selected image of every node.
/** The default is 0 (no images). */
virtual void setImageList( IGUIImageList* imageList ) = 0;
......@@ -282,12 +268,6 @@ namespace gui
//! Returns the node which is associated to the last event.
/** This pointer is only valid inside the OnEvent call! */
virtual IGUITreeViewNode* getLastEventNode() const = 0;
//! Access the vertical scrollbar
virtual IGUIScrollBar* getVerticalScrollBar() const = 0;
//! Access the horizontal scrollbar
virtual IGUIScrollBar* getHorizontalScrollBar() const = 0;
};
......
......@@ -67,16 +67,6 @@ public:
return createHillPlaneMesh(tileSize, tileCount, material, 0.f, core::dimension2df(), textureRepeatCount);
}
//! Create a geoplane.
/**
\param radius Radius of the plane
\param rows How many rows to place
\param columns How many columns to place
\return Generated mesh.
*/
virtual IMesh* createGeoplaneMesh(f32 radius = 5.f,
u32 rows = 16, u32 columns = 16) const =0;
//! Create a terrain mesh from an image representing a heightfield.
/**
\param texture The texture to apply to the terrain.
......
This diff is collapsed.
......@@ -8,7 +8,6 @@
#include "IReferenceCounted.h"
#include "IImage.h"
#include "path.h"
#include "irrArray.h"
namespace irr
{
......@@ -44,17 +43,6 @@ public:
/** \param file File handle to check.
\return Pointer to newly created image, or 0 upon error. */
virtual IImage* loadImage(io::IReadFile* file) const = 0;
//! Creates a multiple surfaces from the file eg. whole cube map.
/** \param file File handle to check.
\param type Pointer to E_TEXTURE_TYPE where a recommended type of the texture will be stored.
\return Array of pointers to newly created images. */
virtual core::array<IImage*> loadImages(io::IReadFile* file, E_TEXTURE_TYPE* type) const
{
core::array<IImage*> image;
return image;
}
};
......
......@@ -66,7 +66,7 @@ public:
\return Returns true if everything is ok, and false if nothing should
be rendered. The material renderer can choose to return false for
example if he doesn't support the specified vertex type. This is
actually done in D3D9 when using a normal mapped material with
actually done in D3D8 and D3D9 when using a normal mapped material with
a vertex type other than EVT_TANGENTS. */
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) { return true; }
......
......@@ -38,9 +38,6 @@ public:
const SMaterial& lastMaterial,
bool resetAllRenderstates) = 0;
//! Return an index constant for the vertex shader based on a name.
virtual s32 getVertexShaderConstantID(const c8* name) = 0;
//! Sets a constant for the vertex shader based on a name.
/** This can be used if you used a high level shader language like GLSL
or HLSL to create a shader. Example: If you created a shader which has
......@@ -61,15 +58,18 @@ public:
services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
}
\endcode
\param index Index of the variable
\param name Name of the variable
\param floats Pointer to array of floats
\param count Amount of floats in array.
\return True if successful.
*/
virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count) = 0;
virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count) = 0;
//! Bool interface for the above.
virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count) = 0;
//! Int interface for the above.
virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) = 0;
virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count) = 0;
//! Sets a vertex shader constant.
/** Can be used if you created a shader using pixel/vertex shader
......@@ -79,21 +79,21 @@ public:
\param constantAmount: Amount of registers to be set. One register consists of 4 floats. */
virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0;
//! Return an index constant for the pixel shader based on a name.
virtual s32 getPixelShaderConstantID(const c8* name) = 0;
//! Sets a constant for the pixel shader based on a name.
/** This can be used if you used a high level shader language like GLSL
or HLSL to create a shader. See setVertexShaderConstant() for an
example on how to use this.
\param index Index of the variable
\param name Name of the variable
\param floats Pointer to array of floats
\param count Amount of floats in array.
\return True if successful. */
virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) = 0;
virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count) = 0;
//! Bool interface for the above.
virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count) = 0;
//! Int interface for the above.
virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) = 0;
virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count) = 0;
//! Sets a pixel shader constant.
/** Can be used if you created a shader using pixel/vertex shader
......@@ -103,30 +103,6 @@ public:
\param constantAmount Amount of registers to be set. One register consists of 4 floats. */
virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0;
//! \deprecated. This method may be removed by Irrlicht 2.0
_IRR_DEPRECATED_ bool setVertexShaderConstant(const c8* name, const f32* floats, int count)
{
return setVertexShaderConstant(getVertexShaderConstantID(name), floats, count);
}
//! \deprecated. This method may be removed by Irrlicht 2.0
_IRR_DEPRECATED_ bool setVertexShaderConstant(const c8* name, const s32* ints, int count)
{
return setVertexShaderConstant(getVertexShaderConstantID(name), ints, count);
}
//! \deprecated. This method may be removed by Irrlicht 2.0
_IRR_DEPRECATED_ bool setPixelShaderConstant(const c8* name, const f32* floats, int count)
{
return setPixelShaderConstant(getPixelShaderConstantID(name), floats, count);
}
//! \deprecated. This method may be removed by Irrlicht 2.0
_IRR_DEPRECATED_ bool setPixelShaderConstant(const c8* name, const s32* ints, int count)
{
return setPixelShaderConstant(getPixelShaderConstantID(name), ints, count);
}
//! Get pointer to the IVideoDriver interface
/** \return Pointer to the IVideoDriver interface */
virtual IVideoDriver* getVideoDriver() = 0;
......
......@@ -13,54 +13,6 @@ namespace irr
{
namespace scene
{
//! Possible types of meshes.
// Note: Was previously only used in IAnimatedMesh so it still has the "animated" in the name.
// But can now be used for all mesh-types as we need those casts as well.
enum E_ANIMATED_MESH_TYPE
{
//! Unknown animated mesh type.
EAMT_UNKNOWN = 0,
//! Quake 2 MD2 model file
EAMT_MD2,
//! Quake 3 MD3 model file
EAMT_MD3,
//! Maya .obj static model
EAMT_OBJ,
//! Quake 3 .bsp static Map
EAMT_BSP,
//! 3D Studio .3ds file
EAMT_3DS,
//! My3D Mesh, the file format by Zhuck Dimitry
EAMT_MY3D,
//! Pulsar LMTools .lmts file. This Irrlicht loader was written by Jonas Petersen
EAMT_LMTS,
//! Cartography Shop .csm file. This loader was created by Saurav Mohapatra.
EAMT_CSM,
//! .oct file for Paul Nette's FSRad or from Murphy McCauley's Blender .oct exporter.
/** The oct file format contains 3D geometry and lightmaps and
can be loaded directly by Irrlicht */
EAMT_OCT,
//! Halflife MDL model file
EAMT_MDL_HALFLIFE,
//! generic skinned mesh
EAMT_SKINNED,
//! generig non-animated mesh
EAMT_STATIC
};
class IMeshBuffer;
//! Class which holds the geometry of an object.
......@@ -114,17 +66,6 @@ namespace scene
indices have changed. Otherwise, changes won't be updated
on the GPU in the next render cycle. */
virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0;
//! Returns the type of the meshes.
/** This is useful for making a safe downcast. For example,
if getMeshType() returns EAMT_MD2 it's safe to cast the
IMesh to IAnimatedMeshMD2.
Note: It's no longer just about animated meshes, that name has just historical reasons.
\returns Type of the mesh */
virtual E_ANIMATED_MESH_TYPE getMeshType() const
{
return EAMT_STATIC;
}
};
} // end namespace scene
......
......@@ -7,7 +7,6 @@
#include "IReferenceCounted.h"
#include "path.h"
#include "IMeshTextureLoader.h"
namespace irr
{
......@@ -28,15 +27,8 @@ class IMeshLoader : public virtual IReferenceCounted
{
public:
//! Constructor
IMeshLoader() : TextureLoader(0) {}
//! Destructor
virtual ~IMeshLoader()
{
if ( TextureLoader )
TextureLoader->drop();
}
virtual ~IMeshLoader() {}
//! Returns true if the file might be loaded by this class.
/** This decision should be based on the file extension (e.g. ".cob")
......@@ -51,35 +43,6 @@ public:
If you no longer need the mesh, you should call IAnimatedMesh::drop().
See IReferenceCounted::drop() for more information. */
virtual IAnimatedMesh* createMesh(io::IReadFile* file) = 0;
//! Set a new texture loader which this meshloader can use when searching for textures.
/** NOTE: Not all meshloaders do support this interface. Meshloaders which
support it will return a non-null value in getMeshTextureLoader from the start. Setting a
texture-loader to a meshloader which doesn't support it won't help.
\param textureLoader The textureloader to use. When set to NULL the mesh will not load any textures.
*/
virtual void setMeshTextureLoader(IMeshTextureLoader* textureLoader)
{
if ( textureLoader != TextureLoader )
{
if ( textureLoader )
textureLoader->grab();
if ( TextureLoader )
TextureLoader->drop();
TextureLoader = textureLoader;
}
}
//! Get the texture loader used when this meshloder searches for textures.
/** NOTE: not all meshloaders support this interface so this can return NULL.
*/
virtual IMeshTextureLoader* getMeshTextureLoader() const
{
return TextureLoader;
}
protected:
IMeshTextureLoader* TextureLoader;
};
......@@ -87,3 +50,4 @@ protected:
} // end namespace irr
#endif
......@@ -295,32 +295,6 @@ namespace scene
\return A new mesh optimized for the vertex cache. */
virtual IMesh* createForsythOptimizedMesh(const IMesh *mesh) const = 0;
//! Optimize the mesh with an algorithm tuned for heightmaps.
/**
This differs from usual simplification methods in two ways:
- it's intended to be lossless
- it has special care for the borders, which are useful with heightmap tiles
This function is thread-safe. Remember to weld afterwards - this
function only moves vertices, it does not weld.
\param mesh Mesh to operate on.
*/
virtual void heightmapOptimizeMesh(IMesh * const mesh, const f32 tolerance = core::ROUNDING_ERROR_f32) const = 0;
//! Optimize the meshbuffer with an algorithm tuned for heightmaps.
/**
This differs from usual simplification methods in two ways:
- it's intended to be lossless
- it has special care for the borders, which are useful with heightmap tiles
This function is thread-safe. Remember to weld afterwards - this
function only moves vertices, it does not weld.
\param mb Meshbuffer to operate on.
*/
virtual void heightmapOptimizeMesh(IMeshBuffer * const mb, const f32 tolerance = core::ROUNDING_ERROR_f32) const = 0;
//! Apply a manipulator on the Meshbuffer
/** \param func A functor defining the mesh manipulation.
\param buffer The Meshbuffer to apply the manipulator to.
......
......@@ -43,7 +43,7 @@ namespace scene
s32 flags=EMWF_NONE) = 0;
// Writes an animated mesh
// for future use, only b3d writer is able to write animated meshes currently and that was implemented using the writeMesh above.
// for future use, no writer is able to write animated meshes currently
/* \return Returns true if sucessful */
//virtual bool writeAnimatedMesh(io::IWriteFile* file,
// scene::IAnimatedMesh* mesh,
......
......@@ -20,9 +20,6 @@ public:
//! Set the point that particles will attract to
virtual void setPoint( const core::vector3df& point ) = 0;
//! Set the speed, in game units per second that the particles will attract to the specified point
virtual void setSpeed( f32 speed ) =0;
//! Set whether or not the particles are attracting or detracting
virtual void setAttract( bool attract ) = 0;
......@@ -38,9 +35,6 @@ public:
//! Get the point that particles are attracted to
virtual const core::vector3df& getPoint() const = 0;
//! Get the speed that points attract to the specified point
virtual f32 getSpeed() const =0;
//! Get whether or not the particles are attracting or detracting
virtual bool getAttract() const = 0;
......
......@@ -114,6 +114,7 @@ public:
//! Get maximal random derivation from the direction
virtual s32 getMaxAngleDegrees() const = 0;
//! Get emitter type
virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_POINT; }
};
......
......@@ -41,33 +41,8 @@ You can for example easily create a campfire by doing this:
p->addAffector(paf);
paf->drop();
\endcode
*/
//! Bitflags to control particle behavior
enum EParticleBehavior
{
//! Continue emitting new particles even when the node is invisible
EPB_INVISIBLE_EMITTING = 1,
//! Continue affecting particles even when the node is invisible
EPB_INVISIBLE_AFFECTING = 2,
//! Continue updating particle positions or deleting them even when the node is invisible
EPB_INVISIBLE_ANIMATING = 4,
//! Clear all particles when node gets invisible
EPB_CLEAR_ON_INVISIBLE = 8,
//! Particle movement direction on emitting ignores the node rotation
//! This is mainly to allow backward compatible behavior to Irrlicht 1.8
EPB_EMITTER_VECTOR_IGNORE_ROTATION = 16,
//! On emitting global particles interpolate the positions randomly between the last and current node transformations.
//! This can be set to avoid gaps caused by fast node movement or low framerates, but will be somewhat
//! slower to calculate.
EPB_EMITTER_FRAME_INTERPOLATION = 32
};
*/
class IParticleSystemSceneNode : public ISceneNode
{
public:
......@@ -77,10 +52,7 @@ public:
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(parent, mgr, id, position, rotation, scale)
, ParticleBehavior(0)
{
}
: ISceneNode(parent, mgr, id, position, rotation, scale) {}
//! Sets the size of all particles.
virtual void setParticleSize(
......@@ -92,31 +64,12 @@ public:
Default is true. */
virtual void setParticlesAreGlobal(bool global=true) = 0;
//! Bitflags to change the particle behavior
/**
\param flags A combination of ::EParticleBehavior bit-flags. Default is 0. */
virtual void setParticleBehavior(irr::u32 flags)
{
ParticleBehavior = flags;
}
//! Gets how particles behave in different situations
/**
\return A combination of ::EParticleBehavior flags */
virtual irr::u32 getParticleBehavior() const
{
return ParticleBehavior;
}
//! Remove all currently visible particles
virtual void clearParticles() = 0;
//! Do manually update the particles.
/** This should only be called when you want to render the node outside
the scenegraph, as the node will care about this otherwise
automatically. */
//! This should only be called when you want to render the node outside the scenegraph,
//! as the node will care about this otherwise automatically.
virtual void doParticleSystem(u32 time) = 0;
//! Gets the particle emitter, which creates the particles.
......@@ -549,24 +502,11 @@ public:
virtual IParticleRotationAffector* createRotationAffector(
const core::vector3df& speed = core::vector3df(5.0f,5.0f,5.0f),
const core::vector3df& pivotPoint = core::vector3df(0.0f,0.0f,0.0f) ) = 0;
//! Writes attributes of the scene node.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_
{
out->addInt("ParticleBehavior", ParticleBehavior);
}
//! Reads attributes of the scene node.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_
{
ParticleBehavior = in->getAttributeAsInt("ParticleBehavior", ParticleBehavior);
}
protected:
s32 ParticleBehavior;
};
} // end namespace scene
} // end namespace irr
#endif
......@@ -80,7 +80,7 @@ namespace quake3
typedef core::array< video::ITexture* > tTexArray;
// string helper.. TODO: move to generic files
inline s16 isEqual ( const core::stringc &string, u32 &pos, const c8 * const list[], u16 listSize )
inline s16 isEqual ( const core::stringc &string, u32 &pos, const c8 *list[], u16 listSize )
{
const char * in = string.c_str () + pos;
......@@ -412,7 +412,9 @@ namespace quake3
SAWTOOTH_INVERSE = WAVE_MODIFIER_FUNCTION + 6,
NOISE = WAVE_MODIFIER_FUNCTION + 7,
UNKNOWN = -2
};
struct SModifierFunction
......@@ -770,7 +772,7 @@ namespace quake3
io::IFileSystem *fileSystem,
video::IVideoDriver* driver)
{
static const char * const extension[] =
static const char* extension[] =
{
".jpg",
".jpeg",
......@@ -790,7 +792,7 @@ namespace quake3
for ( u32 i = 0; i!= stringList.size (); ++i )
{
video::ITexture* texture = 0;
for (u32 g = 0; g != 7; ++g)
for (u32 g = 0; g != 7 ; ++g)
{
core::cutFilenameExtension ( loadFile, stringList[i] );
......
......@@ -44,8 +44,12 @@ namespace io
virtual const io::path& getFileName() const = 0;
};
//! Internal function, please do not use.
IReadFile* createReadFile(const io::path& fileName);
//! Internal function, please do not use.
IReadFile* createLimitReadFile(const io::path& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize);
//! Internal function, please do not use.
IReadFile* createMemoryReadFile(void* memory, long size, const io::path& fileName, bool deleteMemoryWhenDropped);
} // end namespace io
} // end namespace irr
......
......@@ -7,10 +7,6 @@
#include "irrTypes.h"
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
#include "leakHunter.h"
#endif
namespace irr
{
......@@ -50,17 +46,11 @@ namespace irr
IReferenceCounted()
: DebugName(0), ReferenceCounter(1)
{
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
LeakHunter::addObject(this);
#endif
}
//! Destructor.
virtual ~IReferenceCounted()
{
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
LeakHunter::removeObject(this);
#endif
}
//! Grabs the object. Increments the reference counter by one.
......
......@@ -189,9 +189,9 @@ namespace scene
\return Returns the scene node containing the hit triangle nearest to ray.start.
If no collision is detected, then 0 is returned. */
virtual ISceneNode* getSceneNodeAndCollisionPointFromRay(
const core::line3df& ray,
core::vector3df& outCollisionPoint,
core::triangle3df& outTriangle,
core::line3df ray,
core::vector3df & outCollisionPoint,
core::triangle3df & outTriangle,
s32 idBitMask = 0,
ISceneNode * collisionRootNode = 0,
bool noDebugObjects = false) = 0;
......
......@@ -187,7 +187,12 @@ namespace scene
* architecture and calculating lighting. Irrlicht can
* directly import .csm files thanks to the IrrCSM library
* created by Saurav Mohapatra which is now integrated
* directly in Irrlicht.
* directly in Irrlicht. If you are using this loader,
* please note that you'll have to set the path of the
* textures before loading .csm files. You can do this
* using
* SceneManager-&gt;getParameters()-&gt;setAttribute(scene::CSM_TEXTURE_PATH,
* &quot;path/to/your/textures&quot;);</TD>
* </TR>
* <TR>
* <TD>COLLADA (.dae, .xml)</TD>
......@@ -227,8 +232,9 @@ namespace scene
* game-development. With this loader, it is possible to
* directly load all geometry is as well as textures and
* lightmaps from .dmf files. To set texture and
* material paths, see scene::DMF_USE_MATERIALS_DIRS.
* It is also possible to flip the alpha texture by setting
* material paths, see scene::DMF_USE_MATERIALS_DIRS and
* scene::DMF_TEXTURE_PATH. It is also possible to flip
* the alpha texture by setting
* scene::DMF_FLIP_ALPHA_TEXTURES to true and to set the
* material transparent reference value by setting
* scene::DMF_ALPHA_CHANNEL_REF to a float between 0 and
......@@ -291,7 +297,12 @@ namespace scene
* 3D packages. With this built-in importer, Irrlicht
* can read and display those files directly. This
* loader was written by Zhuck Dimitry who also created
* the whole My3DTools package.
* the whole My3DTools package. If you are using this
* loader, please note that you can set the path of the
* textures before loading .my3d files. You can do this
* using
* SceneManager-&gt;getParameters()-&gt;setAttribute(scene::MY3D_TEXTURE_PATH,
* &quot;path/to/your/textures&quot;);
* </TD>
* </TR>
* <TR>
......@@ -320,7 +331,11 @@ namespace scene
* <TD>LMTools is a set of tools (Windows &amp; Linux) for
* creating lightmaps. Irrlicht can directly read .lmts
* files thanks to<br> the importer created by Jonas
* Petersen.
* Petersen. If you are using this loader, please note
* that you can set the path of the textures before
* loading .lmts files. You can do this using
* SceneManager-&gt;getParameters()-&gt;setAttribute(scene::LMTS_TEXTURE_PATH,
* &quot;path/to/your/textures&quot;);
* Notes for<br> this version of the loader:<br>
* - It does not recognise/support user data in the
* *.lmts files.<br>
......@@ -1418,7 +1433,10 @@ namespace scene
//! Get interface to the parameters set in this scene.
/** String parameters can be used by plugins and mesh loaders.
See COLLADA_CREATE_SCENE_INSTANCES and DMF_USE_MATERIALS_DIRS */
For example the CMS and LMTS loader want a parameter named 'CSM_TexturePath'
and 'LMTS_TexturePath' set to the path were attached textures can be found. See
CSM_TEXTURE_PATH, LMTS_TEXTURE_PATH, MY3D_TEXTURE_PATH,
COLLADA_CREATE_SCENE_INSTANCES, DMF_TEXTURE_PATH and DMF_USE_MATERIALS_DIRS*/
virtual io::IAttributes* getParameters() = 0;
//! Get current render pass.
......@@ -1620,12 +1638,6 @@ namespace scene
current callbacks manager and restore the default behavior. */
virtual void setLightManager(ILightManager* lightManager) = 0;
//! Get current render pass.
virtual E_SCENE_NODE_RENDER_PASS getCurrentRenderPass() const =0;
//! Set current render pass.
virtual void setCurrentRenderPass(E_SCENE_NODE_RENDER_PASS nextPass) =0;
//! Get an instance of a geometry creator.
/** The geometry creator provides some helper methods to create various types of
basic geometry. This can be useful for custom scene nodes. */
......
......@@ -119,11 +119,8 @@ namespace scene
// node without the iterator becoming invalid
ISceneNodeAnimator* anim = *ait;
++ait;
if ( anim->isEnabled() )
{
anim->animateNode(this, timeMs);
}
}
// update absolute position
updateAbsolutePosition();
......@@ -177,9 +174,7 @@ namespace scene
//! Get the axis aligned, transformed and animated absolute bounding box of this node.
/** Note: The result is still an axis-aligned bounding box, so it's size
changes with rotation.
\return The transformed bounding box. */
/** \return The transformed bounding box. */
virtual const core::aabbox3d<f32> getTransformedBoundingBox() const
{
core::aabbox3d<f32> box = getBoundingBox();
......@@ -187,18 +182,6 @@ namespace scene
return box;
}
//! Get a the 8 corners of the original bounding box transformed and
//! animated by the absolute transformation.
/** Note: The result is _not_ identical to getTransformedBoundingBox().getEdges(),
but getting an aabbox3d of these edges would then be identical.
\param edges Receives an array with the transformed edges */
virtual void getTransformedBoundingBoxEdges(core::array< core::vector3d<f32> >& edges) const
{
edges.set_used(8);
getBoundingBox().getEdges( edges.pointer() );
for ( u32 i=0; i<8; ++i )
AbsoluteTransformation.transformVect( edges[i] );
}
//! Get the absolute transformation of the node. Is recalculated every OnAnimate()-call.
/** NOTE: For speed reasons the absolute transformation is not
......@@ -242,6 +225,7 @@ namespace scene
visible (if all parents are also visible). */
virtual bool isVisible() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsVisible;
}
......@@ -250,6 +234,7 @@ namespace scene
false if this or any parent node is invisible. */
virtual bool isTrulyVisible() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
if(!IsVisible)
return false;
......@@ -326,6 +311,7 @@ namespace scene
return true;
}
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return false;
}
......@@ -539,12 +525,12 @@ namespace scene
}
//! Set a culling style or disable culling completely.
/** Box cullling (EAC_BOX) is set by default. Note that not
//! Enables or disables automatic culling based on the bounding box.
/** Automatic culling is enabled by default. Note that not
all SceneNodes support culling and that some nodes always cull
their geometry because it is their only reason for existence,
for example the OctreeSceneNode.
\param state The culling state to be used. Check E_CULLING_TYPE for possible values.*/
\param state The culling state to be used. */
void setAutomaticCulling( u32 state)
{
AutomaticCullingState = state;
......@@ -592,6 +578,7 @@ namespace scene
\return If this node is a debug object, true is returned. */
bool isDebugObject() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsDebugObject;
}
......@@ -701,17 +688,17 @@ namespace scene
{
if (!out)
return;
out->addString("Name", Name.c_str());
out->addInt("Id", ID );
out->addString ("Name", Name.c_str());
out->addInt ("Id", ID );
out->addVector3d("Position", getPosition() );
out->addVector3d("Rotation", getRotation() );
out->addVector3d("Scale", getScale() );
out->addBool("Visible", IsVisible );
out->addInt("AutomaticCulling", AutomaticCullingState);
out->addInt("DebugDataVisible", DebugDataVisible );
out->addBool("IsDebugObject", IsDebugObject );
out->addBool ("Visible", IsVisible );
out->addInt ("AutomaticCulling", AutomaticCullingState);
out->addInt ("DebugDataVisible", DebugDataVisible );
out->addBool ("IsDebugObject", IsDebugObject );
}
......@@ -726,26 +713,23 @@ namespace scene
{
if (!in)
return;
Name = in->getAttributeAsString("Name", Name);
ID = in->getAttributeAsInt("Id", ID);
Name = in->getAttributeAsString("Name");
ID = in->getAttributeAsInt("Id");
setPosition(in->getAttributeAsVector3d("Position", RelativeTranslation));
setRotation(in->getAttributeAsVector3d("Rotation", RelativeRotation));
setScale(in->getAttributeAsVector3d("Scale", RelativeScale));
setPosition(in->getAttributeAsVector3d("Position"));
setRotation(in->getAttributeAsVector3d("Rotation"));
setScale(in->getAttributeAsVector3d("Scale"));
IsVisible = in->getAttributeAsBool("Visible", IsVisible);
if (in->existsAttribute("AutomaticCulling"))
{
IsVisible = in->getAttributeAsBool("Visible");
s32 tmpState = in->getAttributeAsEnumeration("AutomaticCulling",
scene::AutomaticCullingNames);
if (tmpState != -1)
AutomaticCullingState = (u32)tmpState;
else
AutomaticCullingState = in->getAttributeAsInt("AutomaticCulling");
}
DebugDataVisible = in->getAttributeAsInt("DebugDataVisible", DebugDataVisible);
IsDebugObject = in->getAttributeAsBool("IsDebugObject", IsDebugObject);
DebugDataVisible = in->getAttributeAsInt("DebugDataVisible");
IsDebugObject = in->getAttributeAsBool("IsDebugObject");
updateAbsolutePosition();
}
......
......@@ -9,7 +9,6 @@
#include "vector3d.h"
#include "ESceneNodeAnimatorTypes.h"
#include "IAttributeExchangingObject.h"
#include "IAttributes.h"
#include "IEventReceiver.h"
namespace irr
......@@ -31,10 +30,6 @@ namespace scene
class ISceneNodeAnimator : public io::IAttributeExchangingObject, public IEventReceiver
{
public:
ISceneNodeAnimator() : IsEnabled(true), PauseTimeSum(0), PauseTimeStart(0), StartTime(0)
{
}
//! Animates a scene node.
/** \param node Node to animate.
\param timeMs Current time in milli seconds. */
......@@ -55,7 +50,7 @@ namespace scene
}
//! Event receiver, override this function for camera controlling animators
virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_
virtual bool OnEvent(const SEvent& event)
{
return false;
}
......@@ -73,93 +68,6 @@ namespace scene
{
return false;
}
//! Reset a time-based movement by changing the starttime.
/** By default most animators start on object creation.
This value is ignored by animators which don't work with a starttime.
Known problems: CSceneNodeAnimatorRotation currently overwrites this value constantly (might be changed in the future).
\param time Commonly you will use irr::ITimer::getTime().
\param resetPauseTime Reset internal pause time for enabling/diabling animators as well
*/
virtual void setStartTime(u32 time, bool resetPauseTime=true)
{
StartTime = time;
if ( resetPauseTime )
{
PauseTimeStart = 0;
PauseTimeSum = 0;
}
}
//! Get the starttime.
/** This will return 0 for by animators which don't work with a starttime unless a starttime was manually set */
virtual irr::u32 getStartTime() const
{
return StartTime;
}
//! Sets the enabled state of this element.
/**
\param enabled When set to false ISceneNodes will not update the animator anymore.
Animators themself usually don't care. So manual calls to animateNode still work.
\param timeNow When set to values > 0 on enabling and disabling an internal timer will be increased by the time disabled time.
Animator decide themself how to handle that timer, but generally setting it will allow you to pause an animator, so it
will continue at the same position when you enable it again. To use that pass irr::ITimer::getTime() as value.
Animators with no timers will just ignore this.
*/
virtual void setEnabled(bool enabled, u32 timeNow=0)
{
if ( enabled == IsEnabled )
return;
IsEnabled = enabled;
if ( enabled )
{
if ( timeNow > 0 && PauseTimeStart > 0 )
PauseTimeSum += timeNow-PauseTimeStart;
}
else
{
PauseTimeStart = timeNow;
}
}
virtual bool isEnabled() const
{
return IsEnabled;
}
//! Writes attributes of the scene node animator.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_
{
out->addBool("IsEnabled", IsEnabled);
// timers not serialized as they usually depend on system-time which is different on each application start.
}
//! Reads attributes of the scene node animator.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_
{
IsEnabled = in->getAttributeAsBool("IsEnabled", IsEnabled);
PauseTimeSum = 0;
PauseTimeStart = 0;
}
protected:
/** This method can be used by clone() implementations of
derived classes
\param toCopyFrom The animator from which the values are copied */
void cloneMembers(const ISceneNodeAnimator* toCopyFrom)
{
IsEnabled = toCopyFrom->IsEnabled;
PauseTimeSum = toCopyFrom->IsEnabled;
PauseTimeStart = toCopyFrom->PauseTimeStart;
StartTime = toCopyFrom->StartTime;
}
bool IsEnabled; //! Only enabled animators are updated
u32 PauseTimeSum; //! Sum up time which the animator was disabled
u32 PauseTimeStart; //! Last time setEnabled(false) was called with a timer > 0
u32 StartTime; //! Used by animators which are time-based, ignored otherwise.
};
......
......@@ -49,13 +49,6 @@ namespace scene
//! Set the distance
virtual void setDistance(f32 distance) = 0;
//! Set the minimal distance to the camera target for zoom
virtual void setTargetMinDistance(f32 minDistance) = 0;
//! Returns the minimal distance to the camera target for zoom
virtual f32 getTargetMinDistance() const = 0;
};
} // end namespace scene
......
......@@ -65,12 +65,6 @@ enum E_TEXTURE_CREATION_FLAG
/** BurningVideo can handle Non-Power-2 Textures in 2D (GUI), but not in 3D. */
ETCF_ALLOW_NON_POWER_2 = 0x00000040,
//! Allow the driver to keep a copy of the texture in memory
/** This makes calls to ITexture::lock a lot faster, but costs main memory.
Default is off, except for font-texture which always enable this flag.
Currently only used in combination with OpenGL drivers. */
ETCF_ALLOW_MEMORY_COPY = 0x00000080,
/** This flag is never used, it only forces the compiler to compile
these enumeration values to 32 bit. */
ETCF_FORCE_32_BIT_DO_NOT_USE = 0x7fffffff
......@@ -92,19 +86,6 @@ enum E_TEXTURE_LOCK_MODE
ETLM_WRITE_ONLY
};
//! Where did the last IVideoDriver::getTexture call find this texture
enum E_TEXTURE_SOURCE
{
//! IVideoDriver::getTexture was never called (texture created otherwise)
ETS_UNKNOWN,
//! Texture has been found in cache
ETS_FROM_CACHE,
//! Texture had to be loaded
ETS_FROM_FILE
};
//! Interface of a Video Driver dependent Texture.
/** An ITexture is created by an IVideoDriver by using IVideoDriver::addTexture
or IVideoDriver::getTexture. After that, the texture may only be used by this
......@@ -119,8 +100,7 @@ class ITexture : public virtual IReferenceCounted
public:
//! constructor
ITexture(const io::path& name, E_TEXTURE_TYPE type) : NamedPath(name), DriverType(EDT_NULL), OriginalColorFormat(ECF_UNKNOWN),
ColorFormat(ECF_UNKNOWN), Pitch(0), HasMipMaps(false), IsRenderTarget(false), Source(ETS_UNKNOWN), Type(type)
ITexture(const io::path& name) : NamedPath(name)
{
}
......@@ -139,28 +119,18 @@ public:
only mode or read from in write only mode.
Support for this feature depends on the driver, so don't rely on the
texture being write-protected when locking with read-only, etc.
\param layer It determines which cubemap face or texture array layer should be locked.
\param mipmapLevel Number of the mipmapLevel to lock. 0 is main texture.
Non-existing levels will silently fail and return 0.
\return Returns a pointer to the pixel data. The format of the pixel can
be determined by using getColorFormat(). 0 is returned, if
the texture cannot be locked. */
virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 layer = 0) = 0;
virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) = 0;
//! Unlock function. Must be called after a lock() to the texture.
/** One should avoid to call unlock more than once before another lock.
The last locked mip level will be unlocked. */
virtual void unlock() = 0;
//! Regenerates the mip map levels of the texture.
/** Required after modifying the texture, usually after calling unlock().
\param data Optional parameter to pass in image data which will be
used instead of the previously stored or automatically generated mipmap
data. The data has to be a continuous pixel data for all mipmaps until
1x1 pixel. Each mipmap has to be half the width and height of the previous
level. At least one pixel will be always kept.
\param layer It informs a texture about layer which needs
mipmaps regeneration. */
virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0) = 0;
//! Get original size of the texture.
/** The texture is usually scaled, if it was created with an unoptimal
size. For example if the size was not a power of two. This method
......@@ -169,77 +139,57 @@ public:
exact size of the original texture. Use ITexture::getSize() if you want
to know the real size it has now stored in the system.
\return The original size of the texture. */
const core::dimension2d<u32>& getOriginalSize() const { return OriginalSize; };
virtual const core::dimension2d<u32>& getOriginalSize() const = 0;
//! Get dimension (=size) of the texture.
/** \return The size of the texture. */
const core::dimension2d<u32>& getSize() const { return Size; };
virtual const core::dimension2d<u32>& getSize() const = 0;
//! Get driver type of texture.
/** This is the driver, which created the texture. This method is used
internally by the video devices, to check, if they may use a texture
because textures may be incompatible between different devices.
\return Driver type of texture. */
E_DRIVER_TYPE getDriverType() const { return DriverType; };
virtual E_DRIVER_TYPE getDriverType() const = 0;
//! Get the color format of texture.
/** \return The color format of texture. */
ECOLOR_FORMAT getColorFormat() const { return ColorFormat; };
virtual ECOLOR_FORMAT getColorFormat() const = 0;
//! Get pitch of the main texture (in bytes).
/** The pitch is the amount of bytes used for a row of pixels in a
texture.
\return Pitch of texture in bytes. */
u32 getPitch() const { return Pitch; };
virtual u32 getPitch() const = 0;
//! Check whether the texture has MipMaps
/** \return True if texture has MipMaps, else false. */
bool hasMipMaps() const { return HasMipMaps; }
virtual bool hasMipMaps() const { return false; }
//! Returns if the texture has an alpha channel
virtual bool hasAlpha() const {
return getColorFormat () == video::ECF_A8R8G8B8 || getColorFormat () == video::ECF_A1R5G5B5;
}
//! Regenerates the mip map levels of the texture.
/** Required after modifying the texture, usually after calling unlock().
\param mipmapData Optional parameter to pass in image data which will be
used instead of the previously stored or automatically generated mipmap
data. The data has to be a continuous pixel data for all mipmaps until
1x1 pixel. Each mipmap has to be half the width and height of the previous
level. At least one pixel will be always kept.*/
virtual void regenerateMipMapLevels(void* mipmapData=0) = 0;
//! Check whether the texture is a render target
/** Render targets can be set as such in the video driver, in order to
render a scene into the texture. Once unbound as render target, they can
be used just as usual textures again.
\return True if this is a render target, otherwise false. */
bool isRenderTarget() const { return IsRenderTarget; }
virtual bool isRenderTarget() const { return false; }
//! Get name of texture (in most cases this is the filename)
const io::SNamedPath& getName() const { return NamedPath; }
//! Check where the last IVideoDriver::getTexture found this texture
E_TEXTURE_SOURCE getSource() const { return Source; }
//! Used internally by the engine to update Source status on IVideoDriver::getTexture calls.
void updateSource(E_TEXTURE_SOURCE source) { Source = source; }
//! Returns if the texture has an alpha channel
bool hasAlpha() const
{
bool status = false;
switch (ColorFormat)
{
case ECF_A8R8G8B8:
case ECF_A1R5G5B5:
case ECF_DXT1:
case ECF_DXT2:
case ECF_DXT3:
case ECF_DXT4:
case ECF_DXT5:
case ECF_A16B16G16R16F:
case ECF_A32B32G32R32F:
status = true;
break;
default:
break;
}
return status;
}
//! Returns the type of texture
E_TEXTURE_TYPE getType() const { return Type; }
protected:
//! Helper function, helps to get the desired texture creation format from the flags.
......@@ -259,16 +209,6 @@ protected:
}
io::SNamedPath NamedPath;
core::dimension2d<u32> OriginalSize;
core::dimension2d<u32> Size;
E_DRIVER_TYPE DriverType;
ECOLOR_FORMAT OriginalColorFormat;
ECOLOR_FORMAT ColorFormat;
u32 Pitch;
bool HasMipMaps;
bool IsRenderTarget;
E_TEXTURE_SOURCE Source;
E_TEXTURE_TYPE Type;
};
......
This diff is collapsed.
......@@ -14,8 +14,12 @@ namespace video
{
//! A list of all available video modes.
/** You can get a list via IrrlichtDevice::getVideoModeList().
You only need the null device (EDT_NULL) to get the video-modes. */
/** You can get a list via IrrlichtDevice::getVideoModeList(). If you are confused
now, because you think you have to create an Irrlicht Device with a video
mode before being able to get the video mode list, let me tell you that
there is no need to start up an Irrlicht Device with EDT_DIRECT3D8, EDT_OPENGL or
EDT_SOFTWARE: For this (and for lots of other reasons) the null device,
EDT_NULL exists.*/
class IVideoModeList : public virtual IReferenceCounted
{
public:
......
......@@ -38,12 +38,11 @@ namespace io
//! Get name of file.
/** \return File name as zero terminated character string. */
virtual const path& getFileName() const = 0;
//! Flush the content of the buffer in the file
/** \return True if successful, otherwise false. */
virtual bool flush() = 0;
};
//! Internal function, please do not use.
IWriteFile* createWriteFile(const io::path& fileName, bool append);
} // end namespace io
} // end namespace irr
......
This diff is collapsed.
......@@ -34,10 +34,6 @@ namespace irr
class ISceneManager;
} // end namespace scene
namespace video {
class IContextManager;
} // end namespace video
//! The Irrlicht device. You can create it with createDevice() or createDeviceEx().
/** This is the most important class of the Irrlicht Engine. You can
access everything in the engine if you have a pointer to an instance of
......@@ -112,16 +108,16 @@ namespace irr
virtual ILogger* getLogger() = 0;
//! Gets a list with all video modes available.
/** You only need a null driver (ED_NULL) to access
those video modes. So you can get the available modes
before starting any other video driver.
/** If you are confused now, because you think you have to
create an Irrlicht Device with a video mode before being able
to get the video mode list, let me tell you that there is no
need to start up an Irrlicht Device with EDT_DIRECT3D8,
EDT_OPENGL or EDT_SOFTWARE: For this (and for lots of other
reasons) the null driver, EDT_NULL exists.
\return Pointer to a list with all video modes supported
by the gfx adapter. */
virtual video::IVideoModeList* getVideoModeList() = 0;
//! Get context manager
virtual video::IContextManager* getContextManager() = 0;
//! Provides access to the operation system operator object.
/** The OS operator provides methods for
getting system specific informations and doing system
......@@ -231,13 +227,6 @@ namespace irr
\param resize Flag whether the window should be resizable. */
virtual void setResizable(bool resize=false) = 0;
//! Resize the render window.
/** This will only work in windowed mode and is not yet supported on all systems.
It does set the drawing/clientDC size of the window, the window decorations are added to that.
You get the current window size with IVideoDriver::getScreenSize() (might be unified in future)
*/
virtual void setWindowSize(const irr::core::dimension2d<u32>& size) = 0;
//! Minimizes the window if possible.
virtual void minimizeWindow() =0;
......@@ -247,9 +236,6 @@ namespace irr
//! Restore the window to normal size if possible.
virtual void restoreWindow() =0;
//! Get the position of the frame on-screen
virtual core::position2di getWindowPosition() = 0;
//! Activate any joysticks, and generate events for them.
/** Irrlicht contains support for joysticks, but does not generate joystick events by default,
as this would consume joystick info that 3rd party libraries might rely on. Call this method to
......@@ -268,18 +254,6 @@ namespace irr
virtual bool getGammaRamp(f32 &red, f32 &green, f32 &blue,
f32 &brightness, f32 &contrast) =0;
//! Set the maximal elapsed time between 2 clicks to generate doubleclicks for the mouse. It also affects tripleclick behavior.
/** When set to 0 no double- and tripleclicks will be generated.
\param timeMs maximal time in milliseconds for two consecutive clicks to be recognized as double click
*/
virtual void setDoubleClickTime(u32 timeMs) =0;
//! Get the maximal elapsed time between 2 clicks to generate double- and tripleclicks for the mouse.
/** When return value is 0 no double- and tripleclicks will be generated.
\return maximal time in milliseconds for two consecutive clicks to be recognized as double click
*/
virtual u32 getDoubleClickTime() const =0;
//! Remove messages pending in the system message loop
/** This function is usually used after messages have been buffered for a longer time, for example
when loading a large scene. Clearing the message loop prevents that mouse- or buttonclicks which users
......@@ -317,6 +291,12 @@ namespace irr
return true;
#else
return false;
#endif
case video::EDT_DIRECT3D8:
#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
return true;
#else
return false;
#endif
case video::EDT_DIRECT3D9:
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
......
......@@ -13,10 +13,7 @@ namespace irr
namespace video
{
//! An enum for the color format of textures used by the Irrlicht Engine.
/** A color format specifies how color information is stored.
NOTE: Byte order in memory is usually flipped (it's probably correct in bitmap files, but flipped on reading).
So for example ECF_A8R8G8B8 is BGRA in memory same as in DX9's D3DFMT_A8R8G8B8 format.
*/
/** A color format specifies how color information is stored. */
enum ECOLOR_FORMAT
{
//! 16 bit color format used by the software driver.
......@@ -34,97 +31,26 @@ namespace video
//! Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.
ECF_A8R8G8B8,
/** Compressed image formats. **/
//! DXT1 color format.
ECF_DXT1,
//! DXT2 color format.
ECF_DXT2,
//! DXT3 color format.
ECF_DXT3,
//! DXT4 color format.
ECF_DXT4,
//! DXT5 color format.
ECF_DXT5,
//! PVRTC RGB 2bpp.
ECF_PVRTC_RGB2,
//! PVRTC ARGB 2bpp.
ECF_PVRTC_ARGB2,
//! PVRTC RGB 4bpp.
ECF_PVRTC_RGB4,
//! PVRTC ARGB 4bpp.
ECF_PVRTC_ARGB4,
//! PVRTC2 ARGB 2bpp.
ECF_PVRTC2_ARGB2,
//! PVRTC2 ARGB 4bpp.
ECF_PVRTC2_ARGB4,
//! ETC1 RGB.
ECF_ETC1,
/** Floating Point formats. The following formats may only be used for render target textures. */
//! ETC2 RGB.
ECF_ETC2_RGB,
//! ETC2 ARGB.
ECF_ETC2_ARGB,
/** The following formats may only be used for render target textures. */
/** Floating point formats. */
//! 16 bit format using 16 bits for the red channel.
//! 16 bit floating point format using 16 bits for the red channel.
ECF_R16F,
//! 32 bit format using 16 bits for the red and green channels.
//! 32 bit floating point format using 16 bits for the red channel and 16 bits for the green channel.
ECF_G16R16F,
//! 64 bit format using 16 bits for the red, green, blue and alpha channels.
//! 64 bit floating point format 16 bits are used for the red, green, blue and alpha channels.
ECF_A16B16G16R16F,
//! 32 bit format using 32 bits for the red channel.
//! 32 bit floating point format using 32 bits for the red channel.
ECF_R32F,
//! 64 bit format using 32 bits for the red and green channels.
//! 64 bit floating point format using 32 bits for the red channel and 32 bits for the green channel.
ECF_G32R32F,
//! 128 bit format using 32 bits for the red, green, blue and alpha channels.
//! 128 bit floating point format. 32 bits are used for the red, green, blue and alpha channels.
ECF_A32B32G32R32F,
/** Unsigned normalized integer formats. */
//! 8 bit format using 8 bits for the red channel.
ECF_R8,
//! 16 bit format using 8 bits for the red and green channels.
ECF_R8G8,
//! 16 bit format using 16 bits for the red channel.
ECF_R16,
//! 32 bit format using 16 bits for the red and green channels.
ECF_R16G16,
/** Depth and stencil formats. */
//! 16 bit format using 16 bits for depth.
ECF_D16,
//! 32 bit format using 32 bits for depth.
ECF_D32,
//! 32 bit format using 24 bits for depth and 8 bits for stencil.
ECF_D24S8,
//! Unknown color format:
ECF_UNKNOWN
};
......@@ -478,7 +404,7 @@ namespace video
/** \param data: target to write the color. Must contain sufficiently large memory to receive the number of bytes neede for format
\param format: tells the format used to write the color into data
*/
void getData(void *data, ECOLOR_FORMAT format) const
void getData(void *data, ECOLOR_FORMAT format)
{
switch(format)
{
......
......@@ -27,7 +27,9 @@ struct SExposedVideoData
SExposedVideoData() {OpenGLWin32.HDc=0; OpenGLWin32.HRc=0; OpenGLWin32.HWnd=0;}
explicit SExposedVideoData(void* Window) {OpenGLWin32.HDc=0; OpenGLWin32.HRc=0; OpenGLWin32.HWnd=Window;}
struct SD3D9
union
{
struct
{
//! Pointer to the IDirect3D9 interface
IDirect3D9* D3D9;
......@@ -38,9 +40,24 @@ struct SExposedVideoData
//! Window handle.
/** Get with for example HWND h = reinterpret_cast<HWND>(exposedData.D3D9.HWnd) */
void* HWnd;
};
struct SOpenGLWin32
} D3D9;
struct
{
//! Pointer to the IDirect3D8 interface
IDirect3D8* D3D8;
//! Pointer to the IDirect3DDevice8 interface
IDirect3DDevice8* D3DDev8;
//! Window handle.
/** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.D3D8.HWnd) */
void* HWnd;
} D3D8;
struct
{
//! Private GDI Device Context.
/** Get if for example with: HDC h = reinterpret_cast<HDC>(exposedData.OpenGLWin32.HDc) */
......@@ -53,31 +70,15 @@ struct SExposedVideoData
//! Window handle.
/** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd) */
void* HWnd;
};
} OpenGLWin32;
struct SOpenGLLinux
struct
{
// XWindow handles
void* X11Display;
void* X11Context;
unsigned long X11Window;
};
struct SOpenGLOSX
{
//! The NSOpenGLContext object.
void* Context;
//! The NSWindow object.
void* Window;
};
union
{
SD3D9 D3D9;
SOpenGLWin32 OpenGLWin32;
SOpenGLLinux OpenGLLinux;
SOpenGLOSX OpenGLOSX;
} OpenGLLinux;
};
};
......
......@@ -9,7 +9,6 @@
#include "EDeviceTypes.h"
#include "dimension2d.h"
#include "ILogger.h"
#include "position2d.h"
namespace irr
{
......@@ -24,11 +23,10 @@ namespace irr
DeviceType(EIDT_BEST),
DriverType(video::EDT_BURNINGSVIDEO),
WindowSize(core::dimension2d<u32>(800, 600)),
WindowPosition(core::position2di(-1,-1)),
Bits(32),
ZBufferBits(24),
Bits(16),
ZBufferBits(16),
Fullscreen(false),
Stencilbuffer(true),
Stencilbuffer(false),
Vsync(false),
AntiAlias(0),
HandleSRGB(false),
......@@ -60,7 +58,6 @@ namespace irr
DeviceType = other.DeviceType;
DriverType = other.DriverType;
WindowSize = other.WindowSize;
WindowPosition = other.WindowPosition;
Bits = other.Bits;
ZBufferBits = other.ZBufferBits;
Fullscreen = other.Fullscreen;
......@@ -97,20 +94,18 @@ namespace irr
//! Type of video driver used to render graphics.
/** This can currently be video::EDT_NULL, video::EDT_SOFTWARE,
video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D9, and video::EDT_OPENGL.
Default: EDT_BURNINGSVIDEO. */
video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D8,
video::EDT_DIRECT3D9, and video::EDT_OPENGL.
Default: Software. */
video::E_DRIVER_TYPE DriverType;
//! Size of the window or the video mode in fullscreen mode. Default: 800x600
core::dimension2d<u32> WindowSize;
//! Position of the window on-screen. Default: (-1, -1) or centered.
core::position2di WindowPosition;
//! Minimum Bits per pixel of the color buffer in fullscreen mode. Ignored if windowed mode. Default: 32.
//! Minimum Bits per pixel of the color buffer in fullscreen mode. Ignored if windowed mode. Default: 16.
u8 Bits;
//! Minimum Bits per pixel of the depth buffer. Default: 24.
//! Minimum Bits per pixel of the depth buffer. Default: 16.
u8 ZBufferBits;
//! Should be set to true if the device should run in fullscreen.
......@@ -122,7 +117,7 @@ namespace irr
stencil buffer shadows. Note that not all drivers are able to
use the stencil buffer, hence it can be ignored during device
creation. Without the stencil buffer no shadows will be drawn.
Default: true. */
Default: false. */
bool Stencilbuffer;
//! Specifies vertical syncronisation.
......@@ -222,7 +217,7 @@ namespace irr
\code
while (device->run())
{
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, 0);
driver->beginScene(true, true, 0);
smgr->drawAll();
driver->endScene();
}
......@@ -254,7 +249,7 @@ namespace irr
device->getTimer()->tick();
// draw engine picture
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, 0);
driver->beginScene(true, true, 0);
smgr->drawAll();
driver->endScene();
}
......
This diff is collapsed.
......@@ -49,10 +49,16 @@ namespace video
{
public:
//! Default constructor
SMaterialLayer() : Texture(0), TextureWrapU(ETC_REPEAT), TextureWrapV(ETC_REPEAT), TextureWrapW(ETC_REPEAT),
BilinearFilter(true), TrilinearFilter(false), AnisotropicFilter(0), LODBias(0), TextureMatrix(0)
{
}
SMaterialLayer()
: Texture(0),
TextureWrapU(ETC_REPEAT),
TextureWrapV(ETC_REPEAT),
BilinearFilter(true),
TrilinearFilter(false),
AnisotropicFilter(0),
LODBias(0),
TextureMatrix(0)
{}
//! Copy constructor
/** \param other Material layer to copy from. */
......@@ -103,7 +109,6 @@ namespace video
}
TextureWrapU = other.TextureWrapU;
TextureWrapV = other.TextureWrapV;
TextureWrapW = other.TextureWrapW;
BilinearFilter = other.BilinearFilter;
TrilinearFilter = other.TrilinearFilter;
AnisotropicFilter = other.AnisotropicFilter;
......@@ -156,7 +161,6 @@ namespace video
Texture != b.Texture ||
TextureWrapU != b.TextureWrapU ||
TextureWrapV != b.TextureWrapV ||
TextureWrapW != b.TextureWrapW ||
BilinearFilter != b.BilinearFilter ||
TrilinearFilter != b.TrilinearFilter ||
AnisotropicFilter != b.AnisotropicFilter ||
......@@ -183,7 +187,6 @@ namespace video
/** Values are taken from E_TEXTURE_CLAMP. */
u8 TextureWrapU:4;
u8 TextureWrapV:4;
u8 TextureWrapW:4;
//! Is bilinear filtering enabled? Default: true
bool BilinearFilter:1;
......
......@@ -24,7 +24,7 @@ namespace scene
}
//! constructor
SSharedMeshBuffer(core::array<video::S3DVertex> *vertices) : IMeshBuffer(), Vertices(vertices), ChangedID_Vertex(1), ChangedID_Index(1), MappingHintVertex(EHM_NEVER), MappingHintIndex(EHM_NEVER)
SSharedMeshBuffer(core::array<video::S3DVertex> *vertices) : IMeshBuffer(), Vertices(vertices)
{
#ifdef _DEBUG
setDebugName("SSharedMeshBuffer");
......
......@@ -45,7 +45,7 @@ namespace scene
//! Default Constructor
SViewFrustum() : BoundingRadius(0.f), FarNearDistance(0.f) {}
SViewFrustum() {}
//! Copy Constructor
SViewFrustum(const SViewFrustum& other);
......@@ -87,18 +87,9 @@ namespace scene
//! returns a bounding box enclosing the whole view frustum
const core::aabbox3d<f32> &getBoundingBox() const;
//! recalculates the bounding box and sphere based on the planes
//! recalculates the bounding box member based on the planes
inline void recalculateBoundingBox();
//! get the bounding sphere's radius (of an optimized sphere, not the AABB's)
float getBoundingRadius() const;
//! get the bounding sphere's radius (of an optimized sphere, not the AABB's)
core::vector3df getBoundingCenter() const;
//! the cam should tell the frustum the distance between far and near
void setFarNearDistance(float distance);
//! get the given state's matrix based on frustum E_TRANSFORMATION_STATE
core::matrix4& getTransform( video::E_TRANSFORMATION_STATE state);
......@@ -127,15 +118,8 @@ namespace scene
ETS_COUNT_FRUSTUM
};
//! recalculates the bounding sphere based on the planes
inline void recalculateBoundingSphere();
//! Hold a copy of important transform matrices
core::matrix4 Matrices[ETS_COUNT_FRUSTUM];
float BoundingRadius;
float FarNearDistance;
core::vector3df BoundingCenter;
};
......@@ -153,15 +137,11 @@ namespace scene
for (i=0; i<ETS_COUNT_FRUSTUM; ++i)
Matrices[i]=other.Matrices[i];
BoundingRadius = other.BoundingRadius;
FarNearDistance = other.FarNearDistance;
BoundingCenter = other.BoundingCenter;
}
inline SViewFrustum::SViewFrustum(const core::matrix4& mat)
{
setFrom(mat);
setFrom ( mat );
}
......@@ -268,24 +248,6 @@ namespace scene
boundingBox.addInternalPoint(getFarRightUp());
boundingBox.addInternalPoint(getFarLeftDown());
boundingBox.addInternalPoint(getFarRightDown());
// Also recalculate the bounding sphere when the bbox changes
recalculateBoundingSphere();
}
inline float SViewFrustum::getBoundingRadius() const
{
return BoundingRadius;
}
inline core::vector3df SViewFrustum::getBoundingCenter() const
{
return BoundingCenter;
}
inline void SViewFrustum::setFarNearDistance(float distance)
{
FarNearDistance = distance;
}
//! This constructor creates a view frustum based on a projection
......@@ -345,7 +307,7 @@ namespace scene
/*!
View Frustum depends on Projection & View Matrix
*/
inline core::matrix4& SViewFrustum::getTransform(video::E_TRANSFORMATION_STATE state)
inline core::matrix4& SViewFrustum::getTransform(video::E_TRANSFORMATION_STATE state )
{
u32 index = 0;
switch ( state )
......@@ -363,7 +325,7 @@ namespace scene
/*!
View Frustum depends on Projection & View Matrix
*/
inline const core::matrix4& SViewFrustum::getTransform(video::E_TRANSFORMATION_STATE state) const
inline const core::matrix4& SViewFrustum::getTransform(video::E_TRANSFORMATION_STATE state ) const
{
u32 index = 0;
switch ( state )
......@@ -400,45 +362,6 @@ namespace scene
return wasClipped;
}
inline void SViewFrustum::recalculateBoundingSphere()
{
// Find the center
const float shortlen = (getNearLeftUp() - getNearRightUp()).getLength();
const float longlen = (getFarLeftUp() - getFarRightUp()).getLength();
const float farlen = FarNearDistance;
const float fartocenter = (farlen + (shortlen - longlen) * (shortlen + longlen)/(4*farlen)) / 2;
const float neartocenter = farlen - fartocenter;
BoundingCenter = cameraPosition + -planes[VF_NEAR_PLANE].Normal * neartocenter;
// Find the radius
core::vector3df dir[8];
dir[0] = getFarLeftUp() - BoundingCenter;
dir[1] = getFarRightUp() - BoundingCenter;
dir[2] = getFarLeftDown() - BoundingCenter;
dir[3] = getFarRightDown() - BoundingCenter;
dir[4] = getNearRightDown() - BoundingCenter;
dir[5] = getNearLeftDown() - BoundingCenter;
dir[6] = getNearRightUp() - BoundingCenter;
dir[7] = getNearLeftUp() - BoundingCenter;
u32 i = 0;
float diam[8] = { 0.f };
for (i = 0; i < 8; ++i)
diam[i] = dir[i].getLengthSQ();
float longest = 0;
for (i = 0; i < 8; ++i)
{
if (diam[i] > longest)
longest = diam[i];
}
BoundingRadius = sqrtf(longest);
}
} // end namespace scene
} // end namespace irr
......
......@@ -29,24 +29,24 @@ namespace scene
**/
const c8* const ALLOW_ZWRITE_ON_TRANSPARENT = "Allow_ZWrite_On_Transparent";
//! Deprecated, use IMeshLoader::getMeshTextureLoader()->setTexturePath instead.
/** Was used for changing the texture path of the built-in csm loader like this:
//! Name of the parameter for changing the texture path of the built-in csm loader.
/** Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::CSM_TEXTURE_PATH, "path/to/your/textures");
\endcode
**/
const c8* const CSM_TEXTURE_PATH = "CSM_TexturePath";
//! Deprecated, use IMeshLoader::getMeshTextureLoader()->setTexturePath instead.
/** Was used for changing the texture path of the built-in lmts loader like this:
//! Name of the parameter for changing the texture path of the built-in lmts loader.
/** Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::LMTS_TEXTURE_PATH, "path/to/your/textures");
\endcode
**/
const c8* const LMTS_TEXTURE_PATH = "LMTS_TexturePath";
//! Deprecated, use IMeshLoader::getMeshTextureLoader()->setTexturePath instead.
/** Was used for changing the texture path of the built-in MY3D loader like this:
//! Name of the parameter for changing the texture path of the built-in my3d loader.
/** Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::MY3D_TEXTURE_PATH, "path/to/your/textures");
\endcode
......@@ -66,7 +66,7 @@ namespace scene
*/
const c8* const COLLADA_CREATE_SCENE_INSTANCES = "COLLADA_CreateSceneInstances";
//! Deprecated, use IMeshLoader::getMeshTextureLoader()->setTexturePath instead.
//! Name of the parameter for changing the texture path of the built-in DMF loader.
/** This path is prefixed to the file names defined in the Deled file when loading
textures. This allows to alter the paths for a specific project setting.
Use it like this:
......@@ -111,8 +111,8 @@ namespace scene
const c8* const DMF_FLIP_ALPHA_TEXTURES = "DMF_FlipAlpha";
//! Deprecated, use IMeshLoader::getMeshTextureLoader()->setTexturePath instead.
/** Was used for changing the texture path of the built-in obj loader like this:
//! Name of the parameter for changing the texture path of the built-in obj loader.
/** Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::OBJ_TEXTURE_PATH, "path/to/your/textures");
\endcode
......@@ -145,8 +145,8 @@ namespace scene
**/
const c8* const B3D_LOADER_IGNORE_MIPMAP_FLAG = "B3D_IgnoreMipmapFlag";
//! Deprecated, use IMeshLoader::getMeshTextureLoader()->setTexturePath instead.
/** Was used for changing the texture path of the built-in b3d loader like this:
//! Name of the parameter for changing the texture path of the built-in b3d loader.
/** Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::B3D_TEXTURE_PATH, "path/to/your/textures");
\endcode
......
......@@ -115,14 +115,6 @@ class aabbox3d
return MaxEdge - MinEdge;
}
//! Get radius of the bounding sphere
/** \return Radius of the bounding sphere. */
T getRadius() const
{
const T radius = getExtent().getLength() / 2;
return radius;
}
//! Check if the box is empty.
/** This means that there is no space between the min and max edge.
\return True if box is empty, else false. */
......@@ -234,25 +226,6 @@ class aabbox3d
MaxEdge.X <= other.MaxEdge.X && MaxEdge.Y <= other.MaxEdge.Y && MaxEdge.Z <= other.MaxEdge.Z);
}
//! Returns the intersection of this box with another, if possible.
aabbox3d<T> intersect(const aabbox3d<T>& other) const
{
aabbox3d<T> out;
if (!intersectsWithBox(other))
return out;
out.MaxEdge.X = min_(MaxEdge.X, other.MaxEdge.X);
out.MaxEdge.Y = min_(MaxEdge.Y, other.MaxEdge.Y);
out.MaxEdge.Z = min_(MaxEdge.Z, other.MaxEdge.Z);
out.MinEdge.X = max_(MinEdge.X, other.MinEdge.X);
out.MinEdge.Y = max_(MinEdge.Y, other.MinEdge.Y);
out.MinEdge.Z = max_(MinEdge.Z, other.MinEdge.Z);
return out;
}
//! Determines if the axis-aligned box intersects with another axis-aligned box.
/** \param other: Other box to check a intersection with.
\return True if there is an intersection with the other box,
......
This diff is collapsed.
......@@ -8,32 +8,25 @@
#include <iostream>
#include <cstdio>
#include "EDriverTypes.h"
#include "irrTypes.h"
#include "IrrlichtDevice.h"
namespace irr
{
//! ask user for driver
static irr::video::E_DRIVER_TYPE driverChoiceConsole(bool allDrivers=true)
{
#if defined (_IRR_IPHONE_PLATFORM_) || defined (_IRR_ANDROID_PLATFORM_)
return irr::video::EDT_OGLES2;
#else
//! ask user for driver
static irr::video::E_DRIVER_TYPE driverChoiceConsole(bool allDrivers=true)
{
const char* const names[] = {"NullDriver","Software Renderer","Burning's Video","Direct3D 8.1","Direct3D 9.0c","OpenGL 1.x/2.x/3.x"};
printf("Please select the driver you want:\n");
irr::u32 i=0;
char c;
for (i=irr::video::EDT_COUNT; i>0; --i)
{
if (allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1))))
{
if (irr::video::E_DRIVER_TYPE(i-1) == irr::video::EDT_OPENGL)
c = 'a'+irr::video::EDT_COUNT-i;
printf(" (%c) %s\n", 'a'+irr::video::EDT_COUNT-i, irr::video::DRIVER_TYPE_NAMES[i-1]);
}
printf(" (%c) %s\n", 'a'+irr::video::EDT_COUNT-i, names[i-1]);
}
char c;
std::cin >> c;
c = irr::video::EDT_COUNT+'a'-c;
......@@ -45,8 +38,7 @@ namespace irr
return irr::video::E_DRIVER_TYPE(i-1);
}
return irr::video::EDT_COUNT;
#endif
}
}
} // end namespace irr
......
......@@ -13,8 +13,8 @@ namespace irr
namespace core
{
//! Selection of characters which count as decimal point in fast_atof
// TODO: This should probably also be used in irr::core::string, but
// the float-to-string code used there has to be rewritten first.
// TODO: This should probably also be used in irr::core::string, but the float-to-string code
// used there has to be rewritten first.
IRRLICHT_API extern irr::core::stringc LOCALE_DECIMAL_POINTS;
// we write [17] here instead of [] to work around a swig bug
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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