Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fixup! Delete deprecated video driver methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Mar 9, 2024
1 parent 160d5f7 commit a61b76d
Showing 1 changed file with 0 additions and 94 deletions.
94 changes: 0 additions & 94 deletions source/Irrlicht/COGLESDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<s32>& pos,
const core::array<core::rect<s32> >& sourceRects,
const core::array<s32>& indices, s32 kerningWidth,
const core::rect<s32>* 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<u32>& renderTargetSize = getCurrentRenderTargetSize();
glScissor(clipRect->UpperLeftCorner.X, renderTargetSize.Height-clipRect->LowerRightCorner.Y,
clipRect->getWidth(),clipRect->getHeight());
}

const core::dimension2du& ss = texture->getOriginalSize();
core::position2d<s32> targetPos(pos);
// texcoords need to be flipped horizontally for RTTs
const bool isRTT = texture->isRenderTarget();
const f32 invW = 1.f / static_cast<f32>(ss.Width);
const f32 invH = 1.f / static_cast<f32>(ss.Height);

core::array<S3DVertex> vertices;
core::array<u16> quadIndices;
vertices.reallocate(indices.size()*4);
quadIndices.reallocate(indices.size()*6);
for (u32 i=0; i<indices.size(); ++i)
{
const s32 currentIndex = indices[i];
if (!sourceRects[currentIndex].isValid())
break;

const core::rect<f32> 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<s32> 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<core::position2d<s32> >& positions,
Expand Down Expand Up @@ -1312,22 +1234,6 @@ void COGLES1Driver::draw2DLine(const core::position2d<s32>& start,
}


//! Draws a pixel
void COGLES1Driver::drawPixel(u32 x, u32 y, const SColor &color)
{
const core::dimension2d<u32>& 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)
{
Expand Down

0 comments on commit a61b76d

Please sign in to comment.