1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Correct special drawers.

This commit is contained in:
Sergey Lipskiy 2017-02-25 20:36:41 +07:00
parent bca21ed071
commit 483212f382
3 changed files with 21 additions and 18 deletions

View File

@ -25,6 +25,7 @@ namespace glsl {
"void main() \n"
"{ \n"
" gl_Position = aRectPosition; \n"
" gl_Position.y = -gl_Position.y; \n"
"} \n"
;
}
@ -42,6 +43,7 @@ namespace glsl {
"void main() \n"
"{ \n"
" gl_Position = aRectPosition; \n"
" gl_Position.y = -gl_Position.y;\n"
" vTexCoord0 = aTexCoord0; \n"
"} \n"
;

View File

@ -171,13 +171,6 @@ void TexrectDrawer::add()
m_max_lry = std::max(m_max_lry, m_lry);
}
Context::DrawRectParameters rectParams;
rectParams.mode = drawmode::TRIANGLE_STRIP;
rectParams.verticesCount = 4;
rectParams.vertices = pRect;
rectParams.combiner = currentCombiner();
gfxContext.drawRects(rectParams);
RectCoords coords;
coords.x = pRect[1].x;
coords.y = pRect[1].y;
@ -185,8 +178,16 @@ void TexrectDrawer::add()
coords.x = pRect[3].x;
coords.y = pRect[3].y;
m_vecRectCoords.push_back(coords);
++m_numRects;
for (u32 i = 0; i < 4; ++i)
pRect[i].y = -pRect[i].y;
Context::DrawRectParameters rectParams;
rectParams.mode = drawmode::TRIANGLE_STRIP;
rectParams.verticesCount = 4;
rectParams.vertices = pRect;
rectParams.combiner = currentCombiner();
gfxContext.drawRects(rectParams);
}
bool TexrectDrawer::draw()
@ -293,10 +294,10 @@ bool TexrectDrawer::draw()
gfxContext.bindFramebuffer(bufferTarget::DRAW_FRAMEBUFFER, m_FBO);
m_programClear->activate();
rect[0].y = m_uly;
rect[1].y = m_uly;
rect[2].y = m_lry;
rect[3].y = m_lry;
rect[0].y = -m_uly;
rect[1].y = -m_uly;
rect[2].y = -m_lry;
rect[3].y = -m_lry;
if (m_pBuffer == nullptr)
gfxContext.setViewport(0, 0, VI.width, VI.height);

View File

@ -288,37 +288,37 @@ void TextDrawer::drawText(const char *_pText, float _x, float _y) const
continue;
rect.x = x2;
rect.y = -y2;
rect.y = y2;
rect.s0 = m_atlas->c[*p].tx;
rect.t0 = m_atlas->c[*p].ty;
coords.push_back(rect);
rect.x = x2 + w;
rect.y = -y2;
rect.y = y2;
rect.s0 = m_atlas->c[*p].tx + m_atlas->c[*p].bw / m_atlas->w;
rect.t0 = m_atlas->c[*p].ty;
coords.push_back(rect);
rect.x = x2;
rect.y = -y2 - h;
rect.y = y2 + h;
rect.s0 = m_atlas->c[*p].tx;
rect.t0 = m_atlas->c[*p].ty + m_atlas->c[*p].bh / m_atlas->h;
coords.push_back(rect);
rect.x = x2 + w;
rect.y = -y2;
rect.y = y2;
rect.s0 = m_atlas->c[*p].tx + m_atlas->c[*p].bw / m_atlas->w;
rect.t0 = m_atlas->c[*p].ty;
coords.push_back(rect);
rect.x = x2;
rect.y = -y2 - h;
rect.y = y2 + h;
rect.s0 = m_atlas->c[*p].tx;
rect.t0 = m_atlas->c[*p].ty + m_atlas->c[*p].bh / m_atlas->h;
coords.push_back(rect);
rect.x = x2 + w;
rect.y = -y2 - h;
rect.y = y2 + h;
rect.s0 = m_atlas->c[*p].tx + m_atlas->c[*p].bw / m_atlas->w;
rect.t0 = m_atlas->c[*p].ty + m_atlas->c[*p].bh / m_atlas->h;
coords.push_back(rect);