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
}
......
......@@ -29,7 +29,7 @@ namespace scene
"box", // camera box against node box
"frustum_box", // camera frustum against node box
"frustum_sphere", // camera frustum against node sphere
"occ_query", // occlusion query
"occ_query", // occlusion query
0
};
......
......@@ -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
......@@ -55,31 +55,10 @@ namespace video
//! No driver, just for counting the elements
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)
};
......
......@@ -19,7 +19,7 @@ namespace scene
enum ESCENE_NODE_TYPE
{
//! of type CSceneManager (note that ISceneManager is not(!) an ISceneNode)
ESNT_SCENE_MANAGER = MAKE_IRR_ID('s','m','n','g'),
ESNT_SCENE_MANAGER = MAKE_IRR_ID('s','m','n','g'),
//! simple cube scene node
ESNT_CUBE = MAKE_IRR_ID('c','u','b','e'),
......
......@@ -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,9 +64,8 @@ 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,
it is a static, non animated mesh. */
/** \return The amount of frames. If the amount is 1,
it is a static, non animated mesh. */
virtual u32 getFrameCount() const = 0;
//! Gets the animation speed of the animated mesh.
......
......@@ -80,17 +80,17 @@ namespace scene
//! this holds the header info of the MD3 file
struct SMD3Header
{
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
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 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
s32 fileSize;
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
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 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
s32 fileSize;
} PACK_STRUCT;
//! this holds the header info of an MD3 mesh section
......
......@@ -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.
*/
......@@ -76,7 +76,7 @@ namespace scene
/** If the camera's target and rotation are bound ( @see
bindTargetAndRotation() ) then calling this will also change
the camera's scene node rotation to match the target.
Note that setTarget uses the current absolute position
Note that setTarget uses the current absolute position
internally, so if you changed setPosition since last rendering you must
call updateAbsolutePosition before using this function.
\param pos Look at target of the camera, in world co-ordinates. */
......@@ -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
......
This diff is collapsed.
......@@ -20,19 +20,19 @@ namespace gui
enum ECURSOR_ICON
{
// Following cursors might be system specific, or might use an Irrlicht icon-set. No guarantees so far.
ECI_NORMAL, // arrow
ECI_CROSS, // Crosshair
ECI_HAND, // Hand
ECI_HELP, // Arrow and question mark
ECI_IBEAM, // typical text-selection cursor
ECI_NO, // should not click icon
ECI_WAIT, // hourclass
ECI_SIZEALL, // arrow in all directions
ECI_NORMAL, // arrow
ECI_CROSS, // Crosshair
ECI_HAND, // Hand
ECI_HELP, // Arrow and question mark
ECI_IBEAM, // typical text-selection cursor
ECI_NO, // should not click icon
ECI_WAIT, // hourclass
ECI_SIZEALL, // arrow in all directions
ECI_SIZENESW, // resizes in direction north-east or south-west
ECI_SIZENWSE, // resizes in direction north-west or south-east
ECI_SIZENS, // resizes in direction north or south
ECI_SIZEWE, // resizes in direction west or east
ECI_UP, // up-arrow
ECI_SIZENWSE, // resizes in direction north-west or south-east
ECI_SIZENS, // resizes in direction north or south
ECI_SIZEWE, // resizes in direction west or east
ECI_UP, // up-arrow
// Implementer note: Should we add system specific cursors, which use guaranteed the system icons,
// then I would recommend using a naming scheme like ECI_W32_CROSS, ECI_X11_CROSSHAIR and adding those
......
......@@ -216,7 +216,7 @@ namespace irr
//! The text in an editbox was changed. This does not include automatic changes in text-breaking.
EGET_EDITBOX_CHANGED,
//! The marked area in an editbox was changed.
//! The marked area in an editbox was changed.
EGET_EDITBOX_MARKING_CHANGED,
//! The tab was changed in an tab control
......@@ -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
......@@ -345,13 +345,13 @@ struct SEvent
{
NUMBER_OF_BUTTONS = 32,
AXIS_X = 0, // e.g. analog stick 1 left to right
AXIS_X = 0, // e.g. analog stick 1 left to right
AXIS_Y, // e.g. analog stick 1 top to bottom
AXIS_Z, // e.g. throttle, or analog 2 stick 2 left to right
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
......@@ -454,18 +454,18 @@ struct SJoystickInfo
/** This is an internal Irrlicht index; it does not map directly
* to any particular hardware joystick. It corresponds to the
* irr::SJoystickEvent Joystick ID. */
u8 Joystick;
u8 Joystick;
//! The name that the joystick uses to identify itself.
core::stringc Name;
core::stringc Name;
//! The number of buttons that the joystick has.
u32 Buttons;
u32 Buttons;
//! The number of axes that the joystick has, i.e. X, Y, Z, R, U, V.
/** Note: with a Linux device, the POV hat (if any) will use two axes. These
* will be included in this count. */
u32 Axes;
u32 Axes;
//! An indication of whether the joystick has a POV hat.
/** A Windows device will identify the presence or absence or the POV hat. A
......
......@@ -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;
};
......
......@@ -24,7 +24,7 @@ namespace gui
//! call setVisible(false)
ECMC_HIDE = 2
// note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags.
// note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags.
};
//! GUI Context menu interface.
......@@ -64,10 +64,10 @@ namespace gui
virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true,
bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
//! Insert a menu item at specified position.
/** \param idx: Position to insert the new element,
should be smaller than itemcount otherwise the item is added to the end.
\param text: Text of menu item. Set this to 0 to create
//! Insert a menu item at specified position.
/** \param idx: Position to insert the new element,
should be smaller than itemcount otherwise the item is added to the end.
\param text: Text of menu item. Set this to 0 to create
an separator instead of a real item, which is the same like
calling addSeparator();
\param commandId: Command id of menu item, a simple id you may
......@@ -81,11 +81,11 @@ 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.
\return Returns the index of the item when found or otherwise -1. */
\return Returns the index of the item when found or otherwise -1. */
virtual s32 findItemWithCommandId(s32 commandId, u32 idxStartSearch=0) const = 0;
//! Adds a separator item to the menu
......
......@@ -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())
{
......@@ -278,9 +278,9 @@ public:
//! Adds a GUI element as new child of this element.
virtual void addChild(IGUIElement* child)
{
if ( child && child != this )
addChildToEnd(child);
if (child)
{
addChildToEnd(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;
}
......@@ -557,7 +550,7 @@ public:
virtual bool sendToBack(IGUIElement* child)
{
core::list<IGUIElement*>::Iterator it = Children.begin();
if (child == (*it)) // already there
if (child == (*it)) // already there
return true;
for (; it != Children.end(); ++it)
{
......@@ -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 );
......@@ -653,61 +645,59 @@ public:
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))
{
// only check tab stops and those with the same group status
if ((*it)->isTabStop() && ((*it)->isTabGroup() == group))
{
currentOrder = (*it)->getTabOrder();
currentOrder = (*it)->getTabOrder();
// is this what we're looking for?
if (currentOrder == wanted)
{
closest = *it;
return true;
}
// is this what we're looking for?
if (currentOrder == wanted)
{
closest = *it;
return true;
}
// is it closer than the current closest?
if (closest)
{
closestOrder = closest->getTabOrder();
if ( ( reverse && currentOrder > closestOrder && currentOrder < startOrder)
||(!reverse && currentOrder < closestOrder && currentOrder > startOrder))
{
closest = *it;
}
}
else
if ( (reverse && currentOrder < startOrder) || (!reverse && currentOrder > startOrder) )
// is it closer than the current closest?
if (closest)
{
closestOrder = closest->getTabOrder();
if ( ( reverse && currentOrder > closestOrder && currentOrder < startOrder)
||(!reverse && currentOrder < closestOrder && currentOrder > startOrder))
{
closest = *it;
}
}
else
if ( (reverse && currentOrder < startOrder) || (!reverse && currentOrder > startOrder) )
{
closest = *it;
}
// is it before the current first?
if (first)
{
closestOrder = first->getTabOrder();
// is it before the current first?
if (first)
{
closestOrder = first->getTabOrder();
if ( (reverse && closestOrder < currentOrder) || (!reverse && closestOrder > currentOrder) )
{
first = *it;
}
}
else
if ( (reverse && closestOrder < currentOrder) || (!reverse && closestOrder > currentOrder) )
{
first = *it;
}
}
else
{
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;
}
......@@ -744,7 +734,7 @@ public:
{
return GUIElementTypeNames[Type];
}
//! Returns the name of the element.
/** \return Name as character string. */
virtual const c8* getName() const
......@@ -774,7 +764,7 @@ public:
scripting languages, editors, debuggers or xml serialization purposes. */
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
{
out->addString("Name", Name.c_str());
out->addString("Name", Name.c_str());
out->addInt("Id", ID );
out->addString("Caption", getText());
out->addRect("Rect", DesiredRect);
......@@ -851,7 +841,7 @@ protected:
if (NoClip)
{
IGUIElement* p=this;
while (p->Parent)
while (p && p->Parent)
p = p->Parent;
parentAbsoluteClip = p->AbsoluteClippingRect;
}
......@@ -1013,7 +1003,7 @@ protected:
//! tooltip
core::stringw ToolTipText;
//! users can set this for identificating the element by string
core::stringc Name;
......
......@@ -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.
......@@ -89,8 +87,8 @@ public:
virtual IGUIElement* getFocus() const = 0;
//! Returns the element which was last under the mouse cursor
/** NOTE: This information is updated _after_ the user-eventreceiver
received it's mouse-events. To find the hovered element while catching
/** NOTE: This information is updated _after_ the user-eventreceiver
received it's mouse-events. To find the hovered element while catching
mouse events you have to use instead:
IGUIEnvironment::getRootGUIElement()->getElementFromPoint(mousePos);
\return Pointer to the element under the mouse. */
......@@ -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;
......@@ -217,7 +214,7 @@ public:
//! Returns the root gui element.
/** This is the first gui element, the (direct or indirect) parent of all
other gui elements. It is a valid IGUIElement, with dimensions the same
size as the screen.
size as the screen.
\return Pointer to the root element of the GUI. The returned pointer
should not be dropped. See IReferenceCounted::drop() for more
information. */
......@@ -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
......@@ -593,8 +583,8 @@ public:
//! Loads the gui. Note that the current gui is not cleared before.
/** When a parent is set the elements will be added below the parent, the parent itself does not deserialize.
When the file contains skin-settings from the gui-environment those are always serialized into the
guienvironment independent of the parent setting.
When the file contains skin-settings from the gui-environment those are always serialized into the
guienvironment independent of the parent setting.
\param filename Name of the file.
\param parent Parent for the loaded GUI, root if 0.
\return True if loading succeeded, else false. */
......@@ -602,8 +592,8 @@ public:
//! Loads the gui. Note that the current gui is not cleared before.
/** When a parent is set the elements will be added below the parent, the parent itself does not deserialize.
When the file contains skin-settings from the gui-environment those are always serialized into the
guienvironment independent of the parent setting.
When the file contains skin-settings from the gui-environment those are always serialized into the
guienvironment independent of the parent setting.
\param file The file to load from.
\param parent Parent for the loaded GUI, root if 0.
\return True if loading succeeded, else false. */
......@@ -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
......@@ -89,7 +88,7 @@ namespace gui
virtual bool hasChildren() const = 0;
//! returns true if this node has child nodes
/** \deprecated Deprecated in 1.8, use hasChildren() instead.
/** \deprecated Deprecated in 1.8, use hasChildren() instead.
This method may be removed by Irrlicht 1.9 */
_IRR_DEPRECATED_ bool hasChilds() const
{
......@@ -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;
};
......
......@@ -62,7 +62,7 @@ namespace gui
So to get absolute positions you have to add the resulting rectangle to getAbsolutePosition().UpperLeftCorner.<br>
To get it relative to the parent element you have to add the resulting rectangle to getRelativePosition().UpperLeftCorner.
Beware that adding a menu will not change the clientRect as menus are own gui elements, so in that case you might want to subtract
the menu area additionally. */
the menu area additionally. */
virtual core::rect<s32> getClientRect() 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
......
......@@ -103,7 +103,7 @@ namespace scene
}
//! Renames a loaded mesh.
/** \deprecated Use renameMesh() instead. This method may be removed by
/** \deprecated Use renameMesh() instead. This method may be removed by
Irrlicht 1.9 */
_IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename)
{
......@@ -125,12 +125,12 @@ namespace scene
//! Get the name of a loaded mesh, based on its index.
/** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
\return The name if mesh was found and has a name, else the path is empty. */
\return The name if mesh was found and has a name, else the path is empty. */
virtual const io::SNamedPath& getMeshName(u32 index) const = 0;
//! Get the name of the loaded mesh if there is any.
/** \param mesh Pointer to mesh to query.
\return The name if mesh was found and has a name, else the path is empty. */
\return The name if mesh was found and has a name, else the path is empty. */
virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0;
//! Renames a loaded mesh.
......
......@@ -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
......@@ -119,7 +119,7 @@ namespace scene
}
//! Scales the actual mesh, not a scene node.
/** \deprecated Use scale() instead. This method may be removed by Irrlicht 1.9
/** \deprecated Use scale() instead. This method may be removed by Irrlicht 1.9
\param mesh Mesh on which the operation is performed.
\param factor Scale factor for each axis. */
_IRR_DEPRECATED_ void scaleMesh(IMesh* mesh, const core::vector3df& factor) const {return scale(mesh,factor);}
......@@ -159,7 +159,7 @@ namespace scene
}
//! Applies a transformation to a mesh
/** \deprecated Use transform() instead. This method may be removed by Irrlicht 1.9
/** \deprecated Use transform() instead. This method may be removed by Irrlicht 1.9
\param mesh Mesh on which the operation is performed.
\param m transformation matrix. */
_IRR_DEPRECATED_ virtual void transformMesh(IMesh* mesh, const core::matrix4& m) const {return transform(mesh,m);}
......@@ -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;
......
......@@ -81,7 +81,7 @@ public:
//! Set the maximum particle life-time in milliseconds
virtual void setMaxLifeTime( u32 lifeTimeMax ) = 0;
//! Set maximal random derivation from the direction
//! Set maximal random derivation from the direction
virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) = 0;
//! Get direction the emitter emits particles
......@@ -111,9 +111,10 @@ public:
//! Get the maximum particle life-time in milliseconds
virtual u32 getMaxLifeTime() const = 0;
//! Get maximal random derivation from the direction
//! 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;
......@@ -371,48 +371,50 @@ namespace quake3
enum eQ3ModifierFunction
{
TCMOD = 0,
TCMOD = 0,
DEFORMVERTEXES = 1,
RGBGEN = 2,
TCGEN = 3,
MAP = 4,
ALPHAGEN = 5,
FUNCTION2 = 0x10,
SCROLL = FUNCTION2 + 1,
SCALE = FUNCTION2 + 2,
ROTATE = FUNCTION2 + 3,
STRETCH = FUNCTION2 + 4,
TURBULENCE = FUNCTION2 + 5,
WAVE = FUNCTION2 + 6,
IDENTITY = FUNCTION2 + 7,
VERTEX = FUNCTION2 + 8,
TEXTURE = FUNCTION2 + 9,
LIGHTMAP = FUNCTION2 + 10,
ENVIRONMENT = FUNCTION2 + 11,
RGBGEN = 2,
TCGEN = 3,
MAP = 4,
ALPHAGEN = 5,
FUNCTION2 = 0x10,
SCROLL = FUNCTION2 + 1,
SCALE = FUNCTION2 + 2,
ROTATE = FUNCTION2 + 3,
STRETCH = FUNCTION2 + 4,
TURBULENCE = FUNCTION2 + 5,
WAVE = FUNCTION2 + 6,
IDENTITY = FUNCTION2 + 7,
VERTEX = FUNCTION2 + 8,
TEXTURE = FUNCTION2 + 9,
LIGHTMAP = FUNCTION2 + 10,
ENVIRONMENT = FUNCTION2 + 11,
DOLLAR_LIGHTMAP = FUNCTION2 + 12,
BULGE = FUNCTION2 + 13,
AUTOSPRITE = FUNCTION2 + 14,
AUTOSPRITE2 = FUNCTION2 + 15,
TRANSFORM = FUNCTION2 + 16,
EXACTVERTEX = FUNCTION2 + 17,
CONSTANT = FUNCTION2 + 18,
BULGE = FUNCTION2 + 13,
AUTOSPRITE = FUNCTION2 + 14,
AUTOSPRITE2 = FUNCTION2 + 15,
TRANSFORM = FUNCTION2 + 16,
EXACTVERTEX = FUNCTION2 + 17,
CONSTANT = FUNCTION2 + 18,
LIGHTINGSPECULAR = FUNCTION2 + 19,
MOVE = FUNCTION2 + 20,
NORMAL = FUNCTION2 + 21,
MOVE = FUNCTION2 + 20,
NORMAL = FUNCTION2 + 21,
IDENTITYLIGHTING = FUNCTION2 + 22,
WAVE_MODIFIER_FUNCTION = 0x30,
SINUS = WAVE_MODIFIER_FUNCTION + 1,
COSINUS = WAVE_MODIFIER_FUNCTION + 2,
SQUARE = WAVE_MODIFIER_FUNCTION + 3,
TRIANGLE = WAVE_MODIFIER_FUNCTION + 4,
SAWTOOTH = WAVE_MODIFIER_FUNCTION + 5,
SINUS = WAVE_MODIFIER_FUNCTION + 1,
COSINUS = WAVE_MODIFIER_FUNCTION + 2,
SQUARE = WAVE_MODIFIER_FUNCTION + 3,
TRIANGLE = WAVE_MODIFIER_FUNCTION + 4,
SAWTOOTH = WAVE_MODIFIER_FUNCTION + 5,
SAWTOOTH_INVERSE = WAVE_MODIFIER_FUNCTION + 6,
NOISE = WAVE_MODIFIER_FUNCTION + 7,
NOISE = WAVE_MODIFIER_FUNCTION + 7,
UNKNOWN = -2
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,10 +119,7 @@ namespace scene
// node without the iterator becoming invalid
ISceneNodeAnimator* anim = *ait;
++ait;
if ( anim->isEnabled() )
{
anim->animateNode(this, timeMs);
}
anim->animateNode(this, timeMs);
}
// update absolute position
......@@ -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,24 +182,12 @@ 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
automatically recalculated on each change of the relative
/** NOTE: For speed reasons the absolute transformation is not
automatically recalculated on each change of the relative
transformation or by a transformation change of an parent. Instead the
update usually happens once per frame in OnAnimate. You can enforce
update usually happens once per frame in OnAnimate. You can enforce
an update with updateAbsolutePosition().
\return The absolute transformation matrix. */
virtual const core::matrix4& getAbsoluteTransformation() const
......@@ -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;
}
......@@ -527,10 +513,10 @@ namespace scene
//! Gets the absolute position of the node in world coordinates.
/** If you want the position of the node relative to its parent,
use getPosition() instead.
NOTE: For speed reasons the absolute position is not
automatically recalculated on each change of the relative
position or by a position change of an parent. Instead the
update usually happens once per frame in OnAnimate. You can enforce
NOTE: For speed reasons the absolute position is not
automatically recalculated on each change of the relative
position or by a position change of an parent. Instead the
update usually happens once per frame in OnAnimate. You can enforce
an update with updateAbsolutePosition().
\return The current absolute position of the scene node (updated on last call of updateAbsolutePosition). */
virtual core::vector3df getAbsolutePosition() const
......@@ -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);
setPosition(in->getAttributeAsVector3d("Position", RelativeTranslation));
setRotation(in->getAttributeAsVector3d("Rotation", RelativeRotation));
setScale(in->getAttributeAsVector3d("Scale", RelativeScale));
IsVisible = in->getAttributeAsBool("Visible", IsVisible);
if (in->existsAttribute("AutomaticCulling"))
{
s32 tmpState = in->getAttributeAsEnumeration("AutomaticCulling",
scene::AutomaticCullingNames);
if (tmpState != -1)
AutomaticCullingState = (u32)tmpState;
else
AutomaticCullingState = in->getAttributeAsInt("AutomaticCulling");
}
Name = in->getAttributeAsString("Name");
ID = in->getAttributeAsInt("Id");
setPosition(in->getAttributeAsVector3d("Position"));
setRotation(in->getAttributeAsVector3d("Rotation"));
setScale(in->getAttributeAsVector3d("Scale"));
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.
};
......
......@@ -18,7 +18,7 @@ namespace scene
//! Special scene node animator for FPS cameras
/** This scene node animator can be attached to a camera to make it act
like a first person shooter
like a first person shooter
*/
class ISceneNodeAnimatorCameraFPS : public ISceneNodeAnimator
{
......@@ -45,15 +45,15 @@ namespace scene
virtual void setKeyMap(SKeyMap *map, u32 count) = 0;
//! Sets the keyboard mapping for this animator
//! \param keymap The new keymap array
//! \param keymap The new keymap array
virtual void setKeyMap(const core::array<SKeyMap>& keymap) = 0;
//! Gets the keyboard mapping for this animator
virtual const core::array<SKeyMap>& getKeyMap() const = 0;
//! Sets whether vertical movement should be allowed.
/** If vertical movement is enabled then the camera may fight with
gravity causing camera shake. Disable this if the camera has
/** If vertical movement is enabled then the camera may fight with
gravity causing camera shake. Disable this if the camera has
a collision animator with gravity enabled. */
virtual void setVerticalMovement(bool allow) = 0;
......
......@@ -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
......
......@@ -29,7 +29,7 @@ public:
//! Called when the scene manager create a scene node while loading a file.
virtual void OnCreateNode(ISceneNode* node) = 0;
//! Called when the scene manager read a scene node while loading a file.
/** The userData pointer contains a list of attributes with userData which
were attached to the scene node in the read scene file.*/
......
......@@ -152,7 +152,7 @@ namespace scene
\param file The file to read the image from. File is not rewinded.
\param vertexColor Color of all vertices.
\param smoothFactor Number of smoothing passes. */
virtual bool loadHeightMap(io::IReadFile* file,
virtual bool loadHeightMap(io::IReadFile* file,
video::SColor vertexColor=video::SColor(255,255,255,255),
s32 smoothFactor=0) =0;
......
......@@ -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;
};
......
......@@ -51,7 +51,7 @@ public:
// Day of the year, from 1 to 366
u32 Yearday;
// Whether daylight saving is on
bool IsDST;
bool IsDST;
};
virtual RealTimeDate getRealTimeAndDate() const = 0;
......
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
......
......@@ -15,7 +15,7 @@ namespace io
{
//! Interface providing methods for making it easier to write XML files.
/** This XML Writer writes xml files using in the platform dependent
/** This XML Writer writes xml files using in the platform dependent
wchar_t format and sets the xml-encoding correspondingly. */
class IXMLWriter : public virtual IReferenceCounted
{
......
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_
......
This diff is collapsed.
......@@ -27,57 +27,58 @@ 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
{
//! Pointer to the IDirect3D9 interface
IDirect3D9* D3D9;
//! Pointer to the IDirect3DDevice9 interface
IDirect3DDevice9* D3DDev9;
//! Window handle.
/** Get with for example HWND h = reinterpret_cast<HWND>(exposedData.D3D9.HWnd) */
void* HWnd;
};
struct SOpenGLWin32
{
//! Private GDI Device Context.
/** Get if for example with: HDC h = reinterpret_cast<HDC>(exposedData.OpenGLWin32.HDc) */
void* HDc;
//! Permanent Rendering Context.
/** Get if for example with: HGLRC h = reinterpret_cast<HGLRC>(exposedData.OpenGLWin32.HRc) */
void* HRc;
//! Window handle.
/** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd) */
void* HWnd;
};
struct SOpenGLLinux
{
// 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;
struct
{
//! Pointer to the IDirect3D9 interface
IDirect3D9* D3D9;
//! Pointer to the IDirect3DDevice9 interface
IDirect3DDevice9* D3DDev9;
//! Window handle.
/** Get with for example HWND h = reinterpret_cast<HWND>(exposedData.D3D9.HWnd) */
void* HWnd;
} 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) */
void* HDc;
//! Permanent Rendering Context.
/** Get if for example with: HGLRC h = reinterpret_cast<HGLRC>(exposedData.OpenGLWin32.HRc) */
void* HRc;
//! Window handle.
/** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd) */
void* HWnd;
} OpenGLWin32;
struct
{
// XWindow handles
void* X11Display;
void* X11Context;
unsigned long X11Window;
} OpenGLLinux;
};
};
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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");
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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.
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