]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/CNullDriver.cpp
Resolve conflicts with master
[irrlicht.git] / source / Irrlicht / CNullDriver.cpp
index 98b2bf7746a1d103d2d62ce7c571edd9dc75f0c0..a02431cf8f51b44d2032619129786a05d6d53bc7 100644 (file)
@@ -32,57 +32,15 @@ IImageLoader* createImageLoaderJPG();
 //! creates a loader which is able to load targa images\r
 IImageLoader* createImageLoaderTGA();\r
 \r
-//! creates a loader which is able to load psd images\r
-IImageLoader* createImageLoaderPSD();\r
-\r
-//! creates a loader which is able to load psd images\r
-IImageLoader* createImageLoaderPVR();\r
-\r
-//! creates a loader which is able to load dds images\r
-IImageLoader* createImageLoaderDDS();\r
-\r
-//! creates a loader which is able to load pcx images\r
-IImageLoader* createImageLoaderPCX();\r
-\r
 //! creates a loader which is able to load png images\r
 IImageLoader* createImageLoaderPNG();\r
 \r
-//! creates a loader which is able to load WAL images\r
-IImageLoader* createImageLoaderWAL();\r
-\r
-//! creates a loader which is able to load halflife images\r
-IImageLoader* createImageLoaderHalfLife();\r
-\r
-//! creates a loader which is able to load lmp images\r
-IImageLoader* createImageLoaderLMP();\r
-\r
-//! creates a loader which is able to load ppm/pgm/pbm images\r
-IImageLoader* createImageLoaderPPM();\r
-\r
-//! creates a loader which is able to load rgb images\r
-IImageLoader* createImageLoaderRGB();\r
-\r
-\r
-//! creates a writer which is able to save bmp images\r
-IImageWriter* createImageWriterBMP();\r
-\r
 //! creates a writer which is able to save jpg images\r
 IImageWriter* createImageWriterJPG();\r
 \r
-//! creates a writer which is able to save tga images\r
-IImageWriter* createImageWriterTGA();\r
-\r
-//! creates a writer which is able to save psd images\r
-IImageWriter* createImageWriterPSD();\r
-\r
-//! creates a writer which is able to save pcx images\r
-IImageWriter* createImageWriterPCX();\r
-\r
 //! creates a writer which is able to save png images\r
 IImageWriter* createImageWriterPNG();\r
 \r
-//! creates a writer which is able to save ppm images\r
-IImageWriter* createImageWriterPPM();\r
 \r
 //! constructor\r
 CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize)\r
@@ -95,9 +53,8 @@ CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& scre
        #endif\r
 \r
        DriverAttributes = new io::CAttributes();\r
-       DriverAttributes->addInt("MaxTextures", _IRR_MATERIAL_MAX_TEXTURES_);\r
-       DriverAttributes->addInt("MaxSupportedTextures", _IRR_MATERIAL_MAX_TEXTURES_);\r
-       DriverAttributes->addInt("MaxLights", getMaximalDynamicLightAmount());\r
+       DriverAttributes->addInt("MaxTextures", MATERIAL_MAX_TEXTURES);\r
+       DriverAttributes->addInt("MaxSupportedTextures", MATERIAL_MAX_TEXTURES);\r
        DriverAttributes->addInt("MaxAnisotropy", 1);\r
 //     DriverAttributes->addInt("MaxUserClipPlanes", 0);\r
 //     DriverAttributes->addInt("MaxAuxBuffers", 0);\r
@@ -125,68 +82,14 @@ CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& scre
        if (FileSystem)\r
                FileSystem->grab();\r
 \r
-       // create surface loader\r
-\r
-#ifdef _IRR_COMPILE_WITH_WAL_LOADER_\r
-       SurfaceLoader.push_back(video::createImageLoaderHalfLife());\r
-       SurfaceLoader.push_back(video::createImageLoaderWAL());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_LMP_LOADER_\r
-       SurfaceLoader.push_back(video::createImageLoaderLMP());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_PPM_LOADER_\r
-       SurfaceLoader.push_back(video::createImageLoaderPPM());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_RGB_LOADER_\r
-       SurfaceLoader.push_back(video::createImageLoaderRGB());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_PSD_LOADER_\r
-       SurfaceLoader.push_back(video::createImageLoaderPSD());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_PVR_LOADER_\r
-       SurfaceLoader.push_back(video::createImageLoaderPVR());\r
-#endif\r
-#if defined(_IRR_COMPILE_WITH_DDS_LOADER_) || defined(_IRR_COMPILE_WITH_DDS_DECODER_LOADER_)\r
-       SurfaceLoader.push_back(video::createImageLoaderDDS());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_PCX_LOADER_\r
-       SurfaceLoader.push_back(video::createImageLoaderPCX());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_TGA_LOADER_\r
+       // create surface loaders and writers\r
        SurfaceLoader.push_back(video::createImageLoaderTGA());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_PNG_LOADER_\r
        SurfaceLoader.push_back(video::createImageLoaderPNG());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_JPG_LOADER_\r
        SurfaceLoader.push_back(video::createImageLoaderJPG());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_BMP_LOADER_\r
        SurfaceLoader.push_back(video::createImageLoaderBMP());\r
-#endif\r
-\r
-\r
-#ifdef _IRR_COMPILE_WITH_PPM_WRITER_\r
-       SurfaceWriter.push_back(video::createImageWriterPPM());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_PCX_WRITER_\r
-       SurfaceWriter.push_back(video::createImageWriterPCX());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_PSD_WRITER_\r
-       SurfaceWriter.push_back(video::createImageWriterPSD());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_TGA_WRITER_\r
-       SurfaceWriter.push_back(video::createImageWriterTGA());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_JPG_WRITER_\r
+\r
        SurfaceWriter.push_back(video::createImageWriterJPG());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_PNG_WRITER_\r
        SurfaceWriter.push_back(video::createImageWriterPNG());\r
-#endif\r
-#ifdef _IRR_COMPILE_WITH_BMP_WRITER_\r
-       SurfaceWriter.push_back(video::createImageWriterBMP());\r
-#endif\r
 \r
 \r
        // set ExposedData to 0\r
@@ -816,27 +719,6 @@ void CNullDriver::draw3DLine(const core::vector3df& start,
 }\r
 \r
 \r
-//! Draws a 3d triangle.\r
-void CNullDriver::draw3DTriangle(const core::triangle3df& triangle, SColor color)\r
-{\r
-       S3DVertex vertices[3];\r
-       vertices[0].Pos=triangle.pointA;\r
-       vertices[0].Color=color;\r
-       vertices[0].Normal=triangle.getNormal().normalize();\r
-       vertices[0].TCoords.set(0.f,0.f);\r
-       vertices[1].Pos=triangle.pointB;\r
-       vertices[1].Color=color;\r
-       vertices[1].Normal=vertices[0].Normal;\r
-       vertices[1].TCoords.set(0.5f,1.f);\r
-       vertices[2].Pos=triangle.pointC;\r
-       vertices[2].Color=color;\r
-       vertices[2].Normal=vertices[0].Normal;\r
-       vertices[2].TCoords.set(1.f,0.f);\r
-       const u16 indexList[] = {0,1,2};\r
-       drawVertexPrimitiveList(vertices, 3, indexList, 1, EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT);\r
-}\r
-\r
-\r
 //! Draws a 3d axis aligned box.\r
 void CNullDriver::draw3DBox(const core::aabbox3d<f32>& box, SColor color)\r
 {\r
@@ -876,31 +758,6 @@ void CNullDriver::draw2DImage(const video::ITexture* texture, const core::positi
 }\r
 \r
 \r
-\r
-//! draws a set of 2d images, using a color and the alpha channel of the\r
-//! texture if desired. The images are drawn beginning at pos and concatenated\r
-//! in one line. All drawings are clipped against clipRect (if != 0).\r
-//! The subtextures are defined by the array of sourceRects and are chosen\r
-//! by the indices given.\r
-void CNullDriver::draw2DImageBatch(const video::ITexture* texture,\r
-                               const core::position2d<s32>& pos,\r
-                               const core::array<core::rect<s32> >& sourceRects,\r
-                               const core::array<s32>& indices,\r
-                               s32 kerningWidth,\r
-                               const core::rect<s32>* clipRect, SColor color,\r
-                               bool useAlphaChannelOfTexture)\r
-{\r
-       core::position2d<s32> target(pos);\r
-\r
-       for (u32 i=0; i<indices.size(); ++i)\r
-       {\r
-               draw2DImage(texture, target, sourceRects[indices[i]],\r
-                               clipRect, color, useAlphaChannelOfTexture);\r
-               target.X += sourceRects[indices[i]].getWidth();\r
-               target.X += kerningWidth;\r
-       }\r
-}\r
-\r
 //! draws a set of 2d images, using a color and the alpha channel of the\r
 //! texture if desired.\r
 void CNullDriver::draw2DImageBatch(const video::ITexture* texture,\r
@@ -941,16 +798,6 @@ void CNullDriver::draw2DImage(const video::ITexture* texture, const core::positi
 }\r
 \r
 \r
-//! Draws the outline of a 2d rectangle\r
-void CNullDriver::draw2DRectangleOutline(const core::recti& pos, SColor color)\r
-{\r
-       draw2DLine(pos.UpperLeftCorner, core::position2di(pos.LowerRightCorner.X, pos.UpperLeftCorner.Y), color);\r
-       draw2DLine(core::position2di(pos.LowerRightCorner.X, pos.UpperLeftCorner.Y), pos.LowerRightCorner, color);\r
-       draw2DLine(pos.LowerRightCorner, core::position2di(pos.UpperLeftCorner.X, pos.LowerRightCorner.Y), color);\r
-       draw2DLine(core::position2di(pos.UpperLeftCorner.X, pos.LowerRightCorner.Y), pos.UpperLeftCorner, color);\r
-}\r
-\r
-\r
 //! Draw a 2d rectangle\r
 void CNullDriver::draw2DRectangle(SColor color, const core::rect<s32>& pos, const core::rect<s32>* clip)\r
 {\r
@@ -974,38 +821,6 @@ void CNullDriver::draw2DLine(const core::position2d<s32>& start,
 {\r
 }\r
 \r
-//! Draws a pixel\r
-void CNullDriver::drawPixel(u32 x, u32 y, const SColor & color)\r
-{\r
-}\r
-\r
-\r
-//! Draws a non filled concyclic regular 2d polygon.\r
-void CNullDriver::draw2DPolygon(core::position2d<s32> center,\r
-       f32 radius, video::SColor color, s32 count)\r
-{\r
-       if (count < 2)\r
-               return;\r
-\r
-       core::position2d<s32> first;\r
-       core::position2d<s32> a,b;\r
-\r
-       for (s32 j=0; j<count; ++j)\r
-       {\r
-               b = a;\r
-\r
-               f32 p = j / (f32)count * (core::PI*2);\r
-               a = center + core::position2d<s32>((s32)(sin(p)*radius), (s32)(cos(p)*radius));\r
-\r
-               if (j==0)\r
-                       first = a;\r
-               else\r
-                       draw2DLine(a, b, color);\r
-       }\r
-\r
-       draw2DLine(a, first, color);\r
-}\r
-\r
 \r
 //! returns color format\r
 ECOLOR_FORMAT CNullDriver::getColorFormat() const\r
@@ -1076,80 +891,6 @@ const wchar_t* CNullDriver::getName() const
 }\r
 \r
 \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
-void CNullDriver::drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail, u32 debugDataVisible)\r
-{\r
-}\r
-\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
-//! to draw the color of the shadow.\r
-void CNullDriver::drawStencilShadow(bool clearStencilBuffer,\r
-               video::SColor leftUpEdge, video::SColor rightUpEdge,\r
-               video::SColor leftDownEdge, video::SColor rightDownEdge)\r
-{\r
-}\r
-\r
-\r
-//! deletes all dynamic lights there are\r
-void CNullDriver::deleteAllDynamicLights()\r
-{\r
-       Lights.set_used(0);\r
-}\r
-\r
-\r
-//! adds a dynamic light\r
-s32 CNullDriver::addDynamicLight(const SLight& light)\r
-{\r
-       Lights.push_back(light);\r
-       return Lights.size() - 1;\r
-}\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
-void CNullDriver::turnLightOn(s32 lightIndex, bool turnOn)\r
-{\r
-       // Do nothing\r
-}\r
-\r
-\r
-//! returns the maximal amount of dynamic lights the device can handle\r
-u32 CNullDriver::getMaximalDynamicLightAmount() const\r
-{\r
-       return 0;\r
-}\r
-\r
-\r
-//! Returns current amount of dynamic lights set\r
-//! \return Current amount of dynamic lights set\r
-u32 CNullDriver::getDynamicLightCount() const\r
-{\r
-       return Lights.size();\r
-}\r
-\r
-\r
-//! Returns light data which was previously set by IVideoDriver::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
-const SLight& CNullDriver::getDynamicLight(u32 idx) const\r
-{\r
-       if ( idx < Lights.size() )\r
-               return Lights[idx];\r
-       else\r
-       {\r
-               _IRR_DEBUG_BREAK_IF(true)\r
-               static const SLight dummy;\r
-               return dummy;\r
-       }\r
-}\r
-\r
-\r
 //! Creates a boolean alpha channel of the texture based of an color key.\r
 void CNullDriver::makeColorKeyTexture(video::ITexture* texture,\r
                                                                        video::SColor color,\r
@@ -1976,10 +1717,10 @@ s32 CNullDriver::addMaterialRenderer(IMaterialRenderer* renderer, const char* na
 \r
 \r
 //! Sets the name of a material renderer.\r
-void CNullDriver::setMaterialRendererName(s32 idx, const char* name)\r
+void CNullDriver::setMaterialRendererName(u32 idx, const char* name)\r
 {\r
-       if (idx < s32(sizeof(sBuiltInMaterialTypeNames) / sizeof(char*))-1 ||\r
-               idx >= (s32)MaterialRenderers.size())\r
+       if (idx < (sizeof(sBuiltInMaterialTypeNames) / sizeof(char*))-1 ||\r
+               idx >= MaterialRenderers.size())\r
                return;\r
 \r
        MaterialRenderers[idx].Name = name;\r