From a61b76ddbb0cd8a9f10bfb542dcb152bb39f81e2 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 9 Mar 2024 22:54:28 +0100 Subject: [PATCH] fixup! Delete deprecated video driver methods --- source/Irrlicht/COGLESDriver.cpp | 94 -------------------------------- 1 file changed, 94 deletions(-) diff --git a/source/Irrlicht/COGLESDriver.cpp b/source/Irrlicht/COGLESDriver.cpp index 4822df633..3e218d2f6 100644 --- a/source/Irrlicht/COGLESDriver.cpp +++ b/source/Irrlicht/COGLESDriver.cpp @@ -1021,84 +1021,6 @@ void COGLES1Driver::draw2DImage(const video::ITexture* texture, u32 layer, bool } -//! draws a set of 2d images, using a color and the alpha channel -void COGLES1Driver::draw2DImageBatch(const video::ITexture* texture, - const core::position2d& pos, - const core::array >& sourceRects, - const core::array& indices, s32 kerningWidth, - const core::rect* clipRect, SColor color, - bool useAlphaChannelOfTexture) -{ - if (!texture) - return; - - if (!CacheHandler->getTextureCache().set(0, texture)) - return; - - setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture); - - if (clipRect) - { - if (!clipRect->isValid()) - return; - - glEnable(GL_SCISSOR_TEST); - const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); - glScissor(clipRect->UpperLeftCorner.X, renderTargetSize.Height-clipRect->LowerRightCorner.Y, - clipRect->getWidth(),clipRect->getHeight()); - } - - const core::dimension2du& ss = texture->getOriginalSize(); - core::position2d targetPos(pos); - // texcoords need to be flipped horizontally for RTTs - const bool isRTT = texture->isRenderTarget(); - const f32 invW = 1.f / static_cast(ss.Width); - const f32 invH = 1.f / static_cast(ss.Height); - - core::array vertices; - core::array quadIndices; - vertices.reallocate(indices.size()*4); - quadIndices.reallocate(indices.size()*6); - for (u32 i=0; i tcoords( - sourceRects[currentIndex].UpperLeftCorner.X * invW, - (isRTT?sourceRects[currentIndex].LowerRightCorner.Y:sourceRects[currentIndex].UpperLeftCorner.Y) * invH, - sourceRects[currentIndex].LowerRightCorner.X * invW, - (isRTT?sourceRects[currentIndex].UpperLeftCorner.Y:sourceRects[currentIndex].LowerRightCorner.Y) * invH); - - const core::rect poss(targetPos, sourceRects[currentIndex].getSize()); - - const u32 vstart = vertices.size(); - - vertices.push_back(S3DVertex((f32)poss.UpperLeftCorner.X, (f32)poss.UpperLeftCorner.Y, 0, 0,0,1, color, tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y)); - vertices.push_back(S3DVertex((f32)poss.LowerRightCorner.X, (f32)poss.UpperLeftCorner.Y, 0, 0,0,1, color, tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y)); - vertices.push_back(S3DVertex((f32)poss.LowerRightCorner.X, (f32)poss.LowerRightCorner.Y, 0, 0,0,1, color, tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y)); - vertices.push_back(S3DVertex((f32)poss.UpperLeftCorner.X, (f32)poss.LowerRightCorner.Y, 0, 0,0,1, color, tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y)); - - quadIndices.push_back(vstart); - quadIndices.push_back(vstart+1); - quadIndices.push_back(vstart+2); - quadIndices.push_back(vstart); - quadIndices.push_back(vstart+2); - quadIndices.push_back(vstart+3); - - targetPos.X += sourceRects[currentIndex].getWidth(); - } - if (vertices.size()) - drawVertexPrimitiveList2d3d(vertices.pointer(), vertices.size(), - quadIndices.pointer(), vertices.size()/2, - video::EVT_STANDARD, scene::EPT_TRIANGLES, - EIT_16BIT, false); - if (clipRect) - glDisable(GL_SCISSOR_TEST); -} - - //! draws a set of 2d images, using a color and the alpha channel of the texture if desired. void COGLES1Driver::draw2DImageBatch(const video::ITexture* texture, const core::array >& positions, @@ -1312,22 +1234,6 @@ void COGLES1Driver::draw2DLine(const core::position2d& start, } -//! Draws a pixel -void COGLES1Driver::drawPixel(u32 x, u32 y, const SColor &color) -{ - const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); - if (x > (u32)renderTargetSize.Width || y > (u32)renderTargetSize.Height) - return; - - setRenderStates2DMode(color.getAlpha() < 255, false, false); - - u16 indices[] = {0}; - S3DVertex vertices[1]; - vertices[0] = S3DVertex((f32)x, (f32)y, 0, 0, 0, 1, color, 0, 0); - drawVertexPrimitiveList2d3d(vertices, 1, indices, 1, video::EVT_STANDARD, scene::EPT_POINTS, EIT_16BIT, false); -} - - //! creates a matrix in supplied GLfloat array to pass to OGLES1 inline void COGLES1Driver::getGLMatrix(GLfloat gl_matrix[16], const core::matrix4& m) {