]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/CNullDriver.h
Avoid undefined arithmetic on nullptr in buffer_offset function
[irrlicht.git] / source / Irrlicht / CNullDriver.h
index 90a80554941edb3bedcf4fbbe999cb2640d1ce22..625ff1a6c45204846a0e7d599f39ba4ad41941aa 100644 (file)
@@ -7,11 +7,9 @@
 \r
 #include "IVideoDriver.h"\r
 #include "IFileSystem.h"\r
-#include "IImagePresenter.h"\r
 #include "IGPUProgrammingServices.h"\r
 #include "irrArray.h"\r
 #include "irrString.h"\r
-#include "irrMap.h"\r
 #include "IAttributes.h"\r
 #include "IMesh.h"\r
 #include "IMeshBuffer.h"\r
 #include "CFPSCounter.h"\r
 #include "S3DVertex.h"\r
 #include "SVertexIndex.h"\r
-#include "SLight.h"\r
 #include "SExposedVideoData.h"\r
-\r
-#ifdef _MSC_VER\r
-#pragma warning( disable: 4996)\r
-#endif\r
+#include <list>\r
 \r
 namespace irr\r
 {\r
@@ -49,99 +43,99 @@ namespace video
                virtual ~CNullDriver();\r
 \r
                virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0,\r
-                       const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0) _IRR_OVERRIDE_;\r
+                       const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0) override;\r
 \r
-               virtual bool endScene() _IRR_OVERRIDE_;\r
+               bool endScene() override;\r
 \r
                //! Disable a feature of the driver.\r
-               virtual void disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag=true) _IRR_OVERRIDE_;\r
+               void disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag=true) override;\r
 \r
                //! queries the features of the driver, returns true if feature is available\r
-               virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_;\r
+               bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const override;\r
 \r
                //! Get attributes of the actual video driver\r
-               virtual const io::IAttributes& getDriverAttributes() const _IRR_OVERRIDE_;\r
+               const io::IAttributes& getDriverAttributes() const override;\r
 \r
                //! sets transformation\r
-               virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_;\r
+               void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) override;\r
 \r
                //! Retrieve the number of image loaders\r
-               virtual u32 getImageLoaderCount() const _IRR_OVERRIDE_;\r
+               u32 getImageLoaderCount() const override;\r
 \r
                //! Retrieve the given image loader\r
-               virtual IImageLoader* getImageLoader(u32 n) _IRR_OVERRIDE_;\r
+               IImageLoader* getImageLoader(u32 n) override;\r
 \r
                //! Retrieve the number of image writers\r
-               virtual u32 getImageWriterCount() const _IRR_OVERRIDE_;\r
+               u32 getImageWriterCount() const override;\r
 \r
                //! Retrieve the given image writer\r
-               virtual IImageWriter* getImageWriter(u32 n) _IRR_OVERRIDE_;\r
+               IImageWriter* getImageWriter(u32 n) override;\r
 \r
                //! sets a material\r
-               virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_;\r
+               void setMaterial(const SMaterial& material) override;\r
 \r
                //! loads a Texture\r
-               virtual ITexture* getTexture(const io::path& filename) _IRR_OVERRIDE_;\r
+               ITexture* getTexture(const io::path& filename) override;\r
 \r
                //! loads a Texture\r
-               virtual ITexture* getTexture(io::IReadFile* file) _IRR_OVERRIDE_;\r
+               ITexture* getTexture(io::IReadFile* file) override;\r
 \r
                //! Returns a texture by index\r
-               virtual ITexture* getTextureByIndex(u32 index) _IRR_OVERRIDE_;\r
+               ITexture* getTextureByIndex(u32 index) override;\r
 \r
                //! Returns amount of textures currently loaded\r
-               virtual u32 getTextureCount() const _IRR_OVERRIDE_;\r
+               u32 getTextureCount() const override;\r
 \r
                //! Renames a texture\r
-               virtual void renameTexture(ITexture* texture, const io::path& newName) _IRR_OVERRIDE_;\r
+               void renameTexture(ITexture* texture, const io::path& newName) override;\r
 \r
-               virtual ITexture* addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) _IRR_OVERRIDE_;\r
+               ITexture* addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) override;\r
 \r
-               virtual ITexture* addTexture(const io::path& name, IImage* image) _IRR_OVERRIDE_;\r
+               ITexture* addTexture(const io::path& name, IImage* image) override;\r
 \r
                virtual ITexture* addTextureCubemap(const io::path& name, IImage* imagePosX, IImage* imageNegX, IImage* imagePosY,\r
-                       IImage* imageNegY, IImage* imagePosZ, IImage* imageNegZ) _IRR_OVERRIDE_;\r
+                       IImage* imageNegY, IImage* imagePosZ, IImage* imageNegZ) override;\r
 \r
-               virtual ITexture* addTextureCubemap(const irr::u32 sideLen, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) _IRR_OVERRIDE_;\r
+               ITexture* addTextureCubemap(const irr::u32 sideLen, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) override;\r
 \r
                virtual bool setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0),\r
-                       f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_;\r
+                       f32 clearDepth = 1.f, u8 clearStencil = 0) override;\r
 \r
                virtual bool setRenderTarget(ITexture* texture, u16 clearFlag, SColor clearColor = SColor(255,0,0,0),\r
-                       f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_;\r
+                       f32 clearDepth = 1.f, u8 clearStencil = 0) override;\r
 \r
                //! sets a viewport\r
-               virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_;\r
+               void setViewPort(const core::rect<s32>& area) override;\r
 \r
                //! gets the area of the current viewport\r
-               virtual const core::rect<s32>& getViewPort() const _IRR_OVERRIDE_;\r
+               const core::rect<s32>& getViewPort() const override;\r
 \r
                //! draws a vertex primitive list\r
                virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,\r
                                const void* indexList, u32 primitiveCount,\r
                                E_VERTEX_TYPE vType=EVT_STANDARD, scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES,\r
-                               E_INDEX_TYPE iType=EIT_16BIT) _IRR_OVERRIDE_;\r
+                               E_INDEX_TYPE iType=EIT_16BIT) override;\r
 \r
                //! draws a vertex primitive list in 2d\r
                virtual void draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount,\r
                                const void* indexList, u32 primitiveCount,\r
                                E_VERTEX_TYPE vType=EVT_STANDARD, scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES,\r
-                               E_INDEX_TYPE iType=EIT_16BIT) _IRR_OVERRIDE_;\r
+                               E_INDEX_TYPE iType=EIT_16BIT) override;\r
 \r
                //! Draws a 3d line.\r
                virtual void draw3DLine(const core::vector3df& start,\r
-                       const core::vector3df& end, SColor color = SColor(255,255,255,255)) _IRR_OVERRIDE_;\r
+                       const core::vector3df& end, SColor color = SColor(255,255,255,255)) override;\r
 \r
                //! Draws a 3d triangle.\r
                virtual void draw3DTriangle(const core::triangle3df& triangle,\r
-                       SColor color = SColor(255,255,255,255)) _IRR_OVERRIDE_;\r
+                       SColor color = SColor(255,255,255,255)) override;\r
 \r
                //! Draws a 3d axis aligned box.\r
                virtual void draw3DBox(const core::aabbox3d<f32>& box,\r
-                       SColor color = SColor(255,255,255,255)) _IRR_OVERRIDE_;\r
+                       SColor color = SColor(255,255,255,255)) override;\r
 \r
                //! draws an 2d image\r
-               virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, bool useAlphaChannelOfTexture) _IRR_OVERRIDE_;\r
+               void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, bool useAlphaChannelOfTexture) override;\r
 \r
                //! draws a set of 2d images, using a color and the alpha\r
                /** channel of the texture if desired. The images are drawn\r
@@ -167,7 +161,7 @@ namespace video
                                s32 kerningWidth = 0,\r
                                const core::rect<s32>* clipRect = 0,\r
                                SColor color=SColor(255,255,255,255),\r
-                               bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_;\r
+                               bool useAlphaChannelOfTexture=false) override;\r
 \r
                //! Draws a set of 2d images, using a color and the alpha channel of the texture.\r
                /** All drawings are clipped against clipRect (if != 0).\r
@@ -190,108 +184,92 @@ namespace video
                                const core::array<core::rect<s32> >& sourceRects,\r
                                const core::rect<s32>* clipRect=0,\r
                                SColor color=SColor(255,255,255,255),\r
-                               bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_;\r
+                               bool useAlphaChannelOfTexture=false) override;\r
 \r
                //! Draws a 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.\r
                virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,\r
                        const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,\r
-                       SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_;\r
+                       SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) override;\r
 \r
                //! Draws a part of the texture into the rectangle.\r
                virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,\r
                        const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,\r
-                       const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_;\r
+                       const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false) override;\r
 \r
                //! Draws a 2d rectangle\r
-               virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos, const core::rect<s32>* clip = 0) _IRR_OVERRIDE_;\r
+               void draw2DRectangle(SColor color, const core::rect<s32>& pos, const core::rect<s32>* clip = 0) override;\r
 \r
                //! Draws a 2d rectangle with a gradient.\r
                virtual void draw2DRectangle(const core::rect<s32>& pos,\r
                        SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown,\r
-                       const core::rect<s32>* clip = 0) _IRR_OVERRIDE_;\r
+                       const core::rect<s32>* clip = 0) override;\r
 \r
                //! Draws the outline of a 2d rectangle\r
-               virtual void draw2DRectangleOutline(const core::recti& pos, SColor color=SColor(255,255,255,255)) _IRR_OVERRIDE_;\r
+               void draw2DRectangleOutline(const core::recti& pos, SColor color=SColor(255,255,255,255)) override;\r
 \r
                //! Draws a 2d line.\r
                virtual void draw2DLine(const core::position2d<s32>& start,\r
                                        const core::position2d<s32>& end,\r
-                                       SColor color=SColor(255,255,255,255)) _IRR_OVERRIDE_;\r
+                                       SColor color=SColor(255,255,255,255)) override;\r
 \r
                //! Draws a pixel\r
-               virtual void drawPixel(u32 x, u32 y, const SColor & color) _IRR_OVERRIDE_;\r
+               void drawPixel(u32 x, u32 y, const SColor & color) override;\r
 \r
                //! Draws a non filled concyclic reqular 2d polygon.\r
                virtual void draw2DPolygon(core::position2d<s32> center,\r
-                       f32 radius, video::SColor Color, s32 vertexCount) _IRR_OVERRIDE_;\r
+                       f32 radius, video::SColor Color, s32 vertexCount) override;\r
 \r
                virtual void setFog(SColor color=SColor(0,255,255,255),\r
                                E_FOG_TYPE fogType=EFT_FOG_LINEAR,\r
                                f32 start=50.0f, f32 end=100.0f, f32 density=0.01f,\r
-                               bool pixelFog=false, bool rangeFog=false) _IRR_OVERRIDE_;\r
+                               bool pixelFog=false, bool rangeFog=false) override;\r
 \r
                virtual void getFog(SColor& color, E_FOG_TYPE& fogType,\r
                                f32& start, f32& end, f32& density,\r
-                               bool& pixelFog, bool& rangeFog) _IRR_OVERRIDE_;\r
+                               bool& pixelFog, bool& rangeFog) override;\r
 \r
                //! get color format of the current color buffer\r
-               virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_;\r
+               ECOLOR_FORMAT getColorFormat() const override;\r
 \r
                //! get screen size\r
-               virtual const core::dimension2d<u32>& getScreenSize() const _IRR_OVERRIDE_;\r
+               const core::dimension2d<u32>& getScreenSize() const override;\r
 \r
                //! get current render target\r
                IRenderTarget* getCurrentRenderTarget() const;\r
 \r
                //! get render target size\r
-               virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const _IRR_OVERRIDE_;\r
+               const core::dimension2d<u32>& getCurrentRenderTargetSize() const override;\r
 \r
                // get current frames per second value\r
-               virtual s32 getFPS() const _IRR_OVERRIDE_;\r
+               s32 getFPS() const override;\r
 \r
                //! returns amount of primitives (mostly triangles) were drawn in the last frame.\r
                //! very useful method for statistics.\r
-               virtual u32 getPrimitiveCountDrawn( u32 param = 0 ) const _IRR_OVERRIDE_;\r
-\r
-               //! deletes all dynamic lights there are\r
-               virtual void deleteAllDynamicLights() _IRR_OVERRIDE_;\r
-\r
-               //! adds a dynamic light, returning an index to the light\r
-               //! \param light: the light data to use to create the light\r
-               //! \return An index to the light, or -1 if an error occurs\r
-               virtual s32 addDynamicLight(const SLight& light) _IRR_OVERRIDE_;\r
-\r
-               //! Turns a dynamic light on or off\r
-               //! \param lightIndex: the index returned by addDynamicLight\r
-               //! \param turnOn: true to turn the light on, false to turn it off\r
-               virtual void turnLightOn(s32 lightIndex, bool turnOn) _IRR_OVERRIDE_;\r
-\r
-               //! returns the maximal amount of dynamic lights the device can handle\r
-               virtual u32 getMaximalDynamicLightAmount() const _IRR_OVERRIDE_;\r
+               u32 getPrimitiveCountDrawn( u32 param = 0 ) const override;\r
 \r
                //! \return Returns the name of the video driver. Example: In case of the DIRECT3D8\r
                //! driver, it would return "Direct3D8.1".\r
-               virtual const wchar_t* getName() const _IRR_OVERRIDE_;\r
+               const wchar_t* getName() const override;\r
 \r
                //! Sets the dynamic ambient light color. The default color is\r
                //! (0,0,0,0) which means it is dark.\r
                //! \param color: New color of the ambient light.\r
-               virtual void setAmbientLight(const SColorf& color) _IRR_OVERRIDE_;\r
+               void setAmbientLight(const SColorf& color) override;\r
 \r
                //! Get the global ambient light currently used by the driver\r
-               virtual const SColorf& getAmbientLight() const _IRR_OVERRIDE_;\r
+               const SColorf& getAmbientLight() const override;\r
 \r
                //! Adds an external image loader to the engine.\r
-               virtual void addExternalImageLoader(IImageLoader* loader) _IRR_OVERRIDE_;\r
+               void addExternalImageLoader(IImageLoader* loader) override;\r
 \r
                //! Adds an external image writer to the engine.\r
-               virtual void addExternalImageWriter(IImageWriter* writer) _IRR_OVERRIDE_;\r
+               void addExternalImageWriter(IImageWriter* writer) override;\r
 \r
                //! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do\r
                //! this: First, draw all geometry. Then use this method, to draw the shadow\r
                //! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow.\r
                virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles,\r
-                       bool zfail=true, u32 debugDataVisible=0) _IRR_OVERRIDE_;\r
+                       bool zfail=true, u32 debugDataVisible=0) override;\r
 \r
                //! Fills the stencil shadow with color. After the shadow volume has been drawn\r
                //! into the stencil buffer using IVideoDriver::drawStencilShadowVolume(), use this\r
@@ -300,55 +278,46 @@ namespace video
                        video::SColor leftUpEdge = video::SColor(0,0,0,0),\r
                        video::SColor rightUpEdge = video::SColor(0,0,0,0),\r
                        video::SColor leftDownEdge = video::SColor(0,0,0,0),\r
-                       video::SColor rightDownEdge = video::SColor(0,0,0,0)) _IRR_OVERRIDE_;\r
-\r
-               //! Returns current amount of dynamic lights set\r
-               //! \return Current amount of dynamic lights set\r
-               virtual u32 getDynamicLightCount() const _IRR_OVERRIDE_;\r
+                       video::SColor rightDownEdge = video::SColor(0,0,0,0)) override;\r
 \r
-               //! Returns light data which was previously set with IVideDriver::addDynamicLight().\r
-               //! \param idx: Zero based index of the light. Must be greater than 0 and smaller\r
-               //! than IVideoDriver()::getDynamicLightCount.\r
-               //! \return Light data.\r
-               virtual const SLight& getDynamicLight(u32 idx) const _IRR_OVERRIDE_;\r
 \r
                //! Removes a texture from the texture cache and deletes it, freeing lot of\r
                //! memory.\r
-               virtual void removeTexture(ITexture* texture) _IRR_OVERRIDE_;\r
+               void removeTexture(ITexture* texture) override;\r
 \r
                //! Removes all texture from the texture cache and deletes them, freeing lot of\r
                //! memory.\r
-               virtual void removeAllTextures() _IRR_OVERRIDE_;\r
+               void removeAllTextures() override;\r
 \r
                //! Creates a render target texture.\r
                virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,\r
-                       const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_;\r
+                       const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) override;\r
 \r
                //! Creates a render target texture for a cubemap\r
                ITexture* addRenderTargetTextureCubemap(const irr::u32 sideLen,\r
-                               const io::path& name, const ECOLOR_FORMAT format) _IRR_OVERRIDE_;\r
+                               const io::path& name, const ECOLOR_FORMAT format) override;\r
 \r
                //! Creates an 1bit alpha channel of the texture based of an color key.\r
-               virtual void makeColorKeyTexture(video::ITexture* texture, video::SColor color, bool zeroTexels) const _IRR_OVERRIDE_;\r
+               void makeColorKeyTexture(video::ITexture* texture, video::SColor color, bool zeroTexels) const override;\r
 \r
                //! Creates an 1bit alpha channel of the texture based of an color key position.\r
                virtual void makeColorKeyTexture(video::ITexture* texture, core::position2d<s32> colorKeyPixelPos,\r
-                       bool zeroTexels) const _IRR_OVERRIDE_;\r
+                       bool zeroTexels) const override;\r
 \r
                //! Returns the maximum amount of primitives (mostly vertices) which\r
                //! the device is able to render with one drawIndexedTriangleList\r
                //! call.\r
-               virtual u32 getMaximalPrimitiveCount() const _IRR_OVERRIDE_;\r
+               u32 getMaximalPrimitiveCount() const override;\r
 \r
                //! Enables or disables a texture creation flag.\r
-               virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled) _IRR_OVERRIDE_;\r
+               void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled) override;\r
 \r
                //! Returns if a texture creation flag is enabled or disabled.\r
-               virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const _IRR_OVERRIDE_;\r
+               bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const override;\r
 \r
-               virtual core::array<IImage*> createImagesFromFile(const io::path& filename, E_TEXTURE_TYPE* type = 0) _IRR_OVERRIDE_;\r
+               core::array<IImage*> createImagesFromFile(const io::path& filename, E_TEXTURE_TYPE* type = 0) override;\r
 \r
-               virtual core::array<IImage*> createImagesFromFile(io::IReadFile* file, E_TEXTURE_TYPE* type = 0) _IRR_OVERRIDE_;\r
+               core::array<IImage*> createImagesFromFile(io::IReadFile* file, E_TEXTURE_TYPE* type = 0) override;\r
 \r
                //! Creates a software image from a byte array.\r
                /** \param useForeignMemory: If true, the image will use the data pointer\r
@@ -356,33 +325,33 @@ namespace video
                data when the image will be destructed. If false, the memory will by copied. */\r
                virtual IImage* createImageFromData(ECOLOR_FORMAT format,\r
                        const core::dimension2d<u32>& size, void *data, bool ownForeignMemory = false,\r
-                       bool deleteMemory = true) _IRR_OVERRIDE_;\r
+                       bool deleteMemory = true) override;\r
 \r
                //! Creates an empty software image.\r
-               virtual IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) _IRR_OVERRIDE_;\r
+               IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) override;\r
 \r
                //! Creates a software image from another image.\r
-               virtual IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) _IRR_OVERRIDE_;\r
+               IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) override;\r
 \r
                //! Creates a software image from part of another image.\r
                virtual IImage* createImage(IImage* imageToCopy,\r
                                const core::position2d<s32>& pos,\r
-                               const core::dimension2d<u32>& size) _IRR_OVERRIDE_;\r
+                               const core::dimension2d<u32>& size) override;\r
 \r
                //! Creates a software image from part of a texture.\r
                virtual IImage* createImage(ITexture* texture,\r
                                const core::position2d<s32>& pos,\r
-                               const core::dimension2d<u32>& size) _IRR_OVERRIDE_;\r
+                               const core::dimension2d<u32>& size) override;\r
 \r
                //! Draws a mesh buffer\r
-               virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) _IRR_OVERRIDE_;\r
+               void drawMeshBuffer(const scene::IMeshBuffer* mb) override;\r
 \r
                //! Draws the normals of a mesh buffer\r
                virtual void drawMeshBufferNormals(const scene::IMeshBuffer* mb, f32 length=10.f,\r
-                       SColor color=0xffffffff) _IRR_OVERRIDE_;\r
+                       SColor color=0xffffffff) override;\r
 \r
                //! Check if the driver supports creating textures with the given color format\r
-               virtual bool queryTextureFormat(ECOLOR_FORMAT format) const _IRR_OVERRIDE_\r
+               bool queryTextureFormat(ECOLOR_FORMAT format) const override\r
                {\r
                        return false;\r
                }\r
@@ -392,25 +361,29 @@ namespace video
                {\r
                        SHWBufferLink(const scene::IMeshBuffer *_MeshBuffer)\r
                                :MeshBuffer(_MeshBuffer),\r
-                               ChangedID_Vertex(0),ChangedID_Index(0),LastUsed(0),\r
+                               ChangedID_Vertex(0),ChangedID_Index(0),\r
                                Mapped_Vertex(scene::EHM_NEVER),Mapped_Index(scene::EHM_NEVER)\r
                        {\r
-                               if (MeshBuffer)\r
+                               if (MeshBuffer) {\r
                                        MeshBuffer->grab();\r
+                                       MeshBuffer->setHWBuffer(reinterpret_cast<void*>(this));\r
+                               }\r
                        }\r
 \r
                        virtual ~SHWBufferLink()\r
                        {\r
-                               if (MeshBuffer)\r
+                               if (MeshBuffer) {\r
+                                       MeshBuffer->setHWBuffer(NULL);\r
                                        MeshBuffer->drop();\r
+                               }\r
                        }\r
 \r
                        const scene::IMeshBuffer *MeshBuffer;\r
                        u32 ChangedID_Vertex;\r
                        u32 ChangedID_Index;\r
-                       u32 LastUsed;\r
                        scene::E_HARDWARE_MAPPING Mapped_Vertex;\r
                        scene::E_HARDWARE_MAPPING Mapped_Index;\r
+                       std::list<SHWBufferLink*>::iterator listPosition;\r
                };\r
 \r
                //! Gets hardware buffer link from a meshbuffer (may create or update buffer)\r
@@ -430,10 +403,10 @@ namespace video
 \r
        public:\r
                //! Remove hardware buffer\r
-               virtual void removeHardwareBuffer(const scene::IMeshBuffer* mb) _IRR_OVERRIDE_;\r
+               void removeHardwareBuffer(const scene::IMeshBuffer* mb) override;\r
 \r
                //! Remove all hardware buffers\r
-               virtual void removeAllHardwareBuffers() _IRR_OVERRIDE_;\r
+               void removeAllHardwareBuffers() override;\r
 \r
                //! Update all hardware buffers, remove unused ones\r
                virtual void updateAllHardwareBuffers();\r
@@ -444,68 +417,68 @@ namespace video
                //! Create occlusion query.\r
                /** Use node for identification and mesh for occlusion test. */\r
                virtual void addOcclusionQuery(scene::ISceneNode* node,\r
-                               const scene::IMesh* mesh=0) _IRR_OVERRIDE_;\r
+                               const scene::IMesh* mesh=0) override;\r
 \r
                //! Remove occlusion query.\r
-               virtual void removeOcclusionQuery(scene::ISceneNode* node) _IRR_OVERRIDE_;\r
+               void removeOcclusionQuery(scene::ISceneNode* node) override;\r
 \r
                //! Remove all occlusion queries.\r
-               virtual void removeAllOcclusionQueries() _IRR_OVERRIDE_;\r
+               void removeAllOcclusionQueries() override;\r
 \r
                //! Run occlusion query. Draws mesh stored in query.\r
                /** If the mesh shall not be rendered visible, use\r
                overrideMaterial to disable the color and depth buffer. */\r
-               virtual void runOcclusionQuery(scene::ISceneNode* node, bool visible=false) _IRR_OVERRIDE_;\r
+               void runOcclusionQuery(scene::ISceneNode* node, bool visible=false) override;\r
 \r
                //! Run all occlusion queries. Draws all meshes stored in queries.\r
                /** If the meshes shall not be rendered visible, use\r
                overrideMaterial to disable the color and depth buffer. */\r
-               virtual void runAllOcclusionQueries(bool visible=false) _IRR_OVERRIDE_;\r
+               void runAllOcclusionQueries(bool visible=false) override;\r
 \r
                //! Update occlusion query. Retrieves results from GPU.\r
                /** If the query shall not block, set the flag to false.\r
                Update might not occur in this case, though */\r
-               virtual void updateOcclusionQuery(scene::ISceneNode* node, bool block=true) _IRR_OVERRIDE_;\r
+               void updateOcclusionQuery(scene::ISceneNode* node, bool block=true) override;\r
 \r
                //! Update all occlusion queries. Retrieves results from GPU.\r
                /** If the query shall not block, set the flag to false.\r
                Update might not occur in this case, though */\r
-               virtual void updateAllOcclusionQueries(bool block=true) _IRR_OVERRIDE_;\r
+               void updateAllOcclusionQueries(bool block=true) override;\r
 \r
                //! Return query result.\r
                /** Return value is the number of visible pixels/fragments.\r
                The value is a safe approximation, i.e. can be larger than the\r
                actual value of pixels. */\r
-               virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_;\r
+               u32 getOcclusionQueryResult(scene::ISceneNode* node) const override;\r
 \r
                //! Create render target.\r
-               virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_;\r
+               IRenderTarget* addRenderTarget() override;\r
 \r
                //! Remove render target.\r
-               virtual void removeRenderTarget(IRenderTarget* renderTarget) _IRR_OVERRIDE_;\r
+               void removeRenderTarget(IRenderTarget* renderTarget) override;\r
 \r
                //! Remove all render targets.\r
-               virtual void removeAllRenderTargets() _IRR_OVERRIDE_;\r
+               void removeAllRenderTargets() override;\r
 \r
                //! Only used by the engine internally.\r
                /** Used to notify the driver that the window was resized. */\r
-               virtual void OnResize(const core::dimension2d<u32>& size) _IRR_OVERRIDE_;\r
+               void OnResize(const core::dimension2d<u32>& size) override;\r
 \r
                //! Adds a new material renderer to the video device.\r
                virtual s32 addMaterialRenderer(IMaterialRenderer* renderer,\r
-                               const char* name = 0) _IRR_OVERRIDE_;\r
+                               const char* name = 0) override;\r
 \r
                //! Returns driver and operating system specific data about the IVideoDriver.\r
-               virtual const SExposedVideoData& getExposedVideoData() _IRR_OVERRIDE_;\r
+               const SExposedVideoData& getExposedVideoData() override;\r
 \r
                //! Returns type of video driver\r
-               virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_;\r
+               E_DRIVER_TYPE getDriverType() const override;\r
 \r
                //! Returns the transformation set by setTransform\r
-               virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const _IRR_OVERRIDE_;\r
+               const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const override;\r
 \r
                //! Returns pointer to the IGPUProgrammingServices interface.\r
-               virtual IGPUProgrammingServices* getGPUProgrammingServices() _IRR_OVERRIDE_;\r
+               IGPUProgrammingServices* getGPUProgrammingServices() override;\r
 \r
                //! Adds a new material renderer to the VideoDriver, using pixel and/or\r
                //! vertex shaders to render geometry.\r
@@ -513,7 +486,7 @@ namespace video
                        const c8* pixelShaderProgram = 0,\r
                        IShaderConstantSetCallBack* callback = 0,\r
                        E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
-                       s32 userData=0) _IRR_OVERRIDE_;\r
+                       s32 userData=0) override;\r
 \r
                //! Like IGPUProgrammingServices::addShaderMaterial(), but tries to load the\r
                //! programs from files.\r
@@ -521,7 +494,7 @@ namespace video
                        io::IReadFile* pixelShaderProgram = 0,\r
                        IShaderConstantSetCallBack* callback = 0,\r
                        E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
-                       s32 userData=0) _IRR_OVERRIDE_;\r
+                       s32 userData=0) override;\r
 \r
                //! Like IGPUProgrammingServices::addShaderMaterial(), but tries to load the\r
                //! programs from files.\r
@@ -529,16 +502,16 @@ namespace video
                        const io::path& pixelShaderProgramFileName,\r
                        IShaderConstantSetCallBack* callback = 0,\r
                        E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
-                       s32 userData=0) _IRR_OVERRIDE_;\r
+                       s32 userData=0) override;\r
 \r
                //! Returns pointer to material renderer or null\r
-               virtual IMaterialRenderer* getMaterialRenderer(u32 idx) const _IRR_OVERRIDE_;\r
+               IMaterialRenderer* getMaterialRenderer(u32 idx) const override;\r
 \r
                //! Returns amount of currently available material renderers.\r
-               virtual u32 getMaterialRendererCount() const _IRR_OVERRIDE_;\r
+               u32 getMaterialRendererCount() const override;\r
 \r
                //! Returns name of the material renderer\r
-               virtual const char* getMaterialRendererName(u32 idx) const _IRR_OVERRIDE_;\r
+               const char* getMaterialRendererName(u32 idx) const override;\r
 \r
                //! Adds a new material renderer to the VideoDriver, based on a high level shading\r
                //! language. Currently only HLSL in D3D9 is supported.\r
@@ -557,7 +530,7 @@ namespace video
                        u32 verticesOut = 0,\r
                        IShaderConstantSetCallBack* callback = 0,\r
                        E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
-                       s32 userData = 0) _IRR_OVERRIDE_;\r
+                       s32 userData = 0) override;\r
 \r
                //! Like IGPUProgrammingServices::addShaderMaterial() (look there for a detailed description),\r
                //! but tries to load the programs from files.\r
@@ -576,7 +549,7 @@ namespace video
                        u32 verticesOut = 0,\r
                        IShaderConstantSetCallBack* callback = 0,\r
                        E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
-                       s32 userData = 0) _IRR_OVERRIDE_;\r
+                       s32 userData = 0) override;\r
 \r
                //! Like IGPUProgrammingServices::addShaderMaterial() (look there for a detailed description),\r
                //! but tries to load the programs from files.\r
@@ -595,72 +568,72 @@ namespace video
                        u32 verticesOut = 0,\r
                        IShaderConstantSetCallBack* callback = 0,\r
                        E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,\r
-                       s32 userData = 0) _IRR_OVERRIDE_;\r
+                       s32 userData = 0) override;\r
 \r
                //! Returns a pointer to the mesh manipulator.\r
-               virtual scene::IMeshManipulator* getMeshManipulator() _IRR_OVERRIDE_;\r
+               scene::IMeshManipulator* getMeshManipulator() override;\r
 \r
-               virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_;\r
+               void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) override;\r
 \r
                //! Returns an image created from the last rendered frame.\r
-               virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_;\r
+               IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) override;\r
 \r
                //! Writes the provided image to disk file\r
-               virtual bool writeImageToFile(IImage* image, const io::path& filename, u32 param = 0) _IRR_OVERRIDE_;\r
+               bool writeImageToFile(IImage* image, const io::path& filename, u32 param = 0) override;\r
 \r
                //! Writes the provided image to a file.\r
-               virtual bool writeImageToFile(IImage* image, io::IWriteFile * file, u32 param = 0) _IRR_OVERRIDE_;\r
+               bool writeImageToFile(IImage* image, io::IWriteFile * file, u32 param = 0) override;\r
 \r
                //! Sets the name of a material renderer.\r
-               virtual void setMaterialRendererName(s32 idx, const char* name) _IRR_OVERRIDE_;\r
+               void setMaterialRendererName(u32 idx, const char* name) override;\r
 \r
                //! Swap the material renderers used for certain id's\r
-               virtual void swapMaterialRenderers(u32 idx1, u32 idx2, bool swapNames) _IRR_OVERRIDE_;\r
+               void swapMaterialRenderers(u32 idx1, u32 idx2, bool swapNames) override;\r
 \r
                //! looks if the image is already loaded\r
-               virtual video::ITexture* findTexture(const io::path& filename) _IRR_OVERRIDE_;\r
+               video::ITexture* findTexture(const io::path& filename) override;\r
 \r
                //! Set/unset a clipping plane.\r
                //! There are at least 6 clipping planes available for the user to set at will.\r
                //! \param index: The plane index. Must be between 0 and MaxUserClipPlanes.\r
                //! \param plane: The plane itself.\r
                //! \param enable: If true, enable the clipping plane else disable it.\r
-               virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) _IRR_OVERRIDE_;\r
+               bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) override;\r
 \r
                //! Enable/disable a clipping plane.\r
                //! There are at least 6 clipping planes available for the user to set at will.\r
                //! \param index: The plane index. Must be between 0 and MaxUserClipPlanes.\r
                //! \param enable: If true, enable the clipping plane else disable it.\r
-               virtual void enableClipPlane(u32 index, bool enable) _IRR_OVERRIDE_;\r
+               void enableClipPlane(u32 index, bool enable) override;\r
 \r
                //! Returns the graphics card vendor name.\r
-               virtual core::stringc getVendorInfo() _IRR_OVERRIDE_ {return "Not available on this driver.";}\r
+               core::stringc getVendorInfo() override {return "Not available on this driver.";}\r
 \r
                //! Set the minimum number of vertices for which a hw buffer will be created\r
                /** \param count Number of vertices to set as minimum. */\r
-               virtual void setMinHardwareBufferVertexCount(u32 count) _IRR_OVERRIDE_;\r
+               void setMinHardwareBufferVertexCount(u32 count) override;\r
 \r
                //! Get the global Material, which might override local materials.\r
                /** Depending on the enable flags, values from this Material\r
                are used to override those of local materials of some\r
                meshbuffer being rendered. */\r
-               virtual SOverrideMaterial& getOverrideMaterial() _IRR_OVERRIDE_;\r
+               SOverrideMaterial& getOverrideMaterial() override;\r
 \r
                //! Get the 2d override material for altering its values\r
-               virtual SMaterial& getMaterial2D() _IRR_OVERRIDE_;\r
+               SMaterial& getMaterial2D() override;\r
 \r
                //! Enable the 2d override material\r
-               virtual void enableMaterial2D(bool enable=true) _IRR_OVERRIDE_;\r
+               void enableMaterial2D(bool enable=true) override;\r
 \r
                //! Only used by the engine internally.\r
-               virtual void setAllowZWriteOnTransparent(bool flag) _IRR_OVERRIDE_\r
+               void setAllowZWriteOnTransparent(bool flag) override\r
                { AllowZWriteOnTransparent=flag; }\r
 \r
                //! Returns the maximum texture size supported.\r
-               virtual core::dimension2du getMaxTextureSize() const _IRR_OVERRIDE_;\r
+               core::dimension2du getMaxTextureSize() const override;\r
 \r
                //! Used by some SceneNodes to check if a material should be rendered in the transparent render pass\r
-               virtual bool needsTransparentRenderPass(const irr::video::SMaterial& material) const _IRR_OVERRIDE_;\r
+               bool needsTransparentRenderPass(const irr::video::SMaterial& material) const override;\r
 \r
                //! Color conversion convenience function\r
                /** Convert an image (as array of pixels) from source to destination\r
@@ -673,13 +646,13 @@ namespace video
                \param dF Color format of destination\r
                */\r
                virtual void convertColor(const void* sP, ECOLOR_FORMAT sF, s32 sN,\r
-                               void* dP, ECOLOR_FORMAT dF) const _IRR_OVERRIDE_;\r
+                               void* dP, ECOLOR_FORMAT dF) const override;\r
 \r
                //! deprecated method\r
                virtual ITexture* createRenderTargetTexture(const core::dimension2d<u32>& size,\r
                                const c8* name=0);\r
 \r
-               virtual bool checkDriverReset() _IRR_OVERRIDE_ {return false;}\r
+               bool checkDriverReset() override {return false;}\r
        protected:\r
 \r
                //! deletes all textures\r
@@ -745,9 +718,9 @@ namespace video
 \r
                        void setSize(const core::dimension2d<u32>& size) { Size = OriginalSize = size; }\r
 \r
-                       virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel=0, u32 layer = 0, E_TEXTURE_LOCK_FLAGS lockFlags = ETLF_FLIP_Y_UP_RTT) _IRR_OVERRIDE_ { return 0; }\r
-                       virtual void unlock()_IRR_OVERRIDE_ {}\r
-                       virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0) _IRR_OVERRIDE_ {}\r
+                       void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel=0, u32 layer = 0, E_TEXTURE_LOCK_FLAGS lockFlags = ETLF_FLIP_Y_UP_RTT) override { return 0; }\r
+                       void unlock()override {}\r
+                       void regenerateMipMapLevels(void* data = 0, u32 layer = 0) override {}\r
                };\r
                core::array<SSurface> Textures;\r
 \r
@@ -819,11 +792,9 @@ namespace video
 \r
                core::array<video::IImageLoader*> SurfaceLoader;\r
                core::array<video::IImageWriter*> SurfaceWriter;\r
-               core::array<SLight> Lights;\r
                core::array<SMaterialRenderer> MaterialRenderers;\r
 \r
-               //core::array<SHWBufferLink*> HWBufferLinks;\r
-               core::map< const scene::IMeshBuffer* , SHWBufferLink* > HWBufferMap;\r
+               std::list<SHWBufferLink*> HWBufferList;\r
 \r
                io::IFileSystem* FileSystem;\r
 \r