mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Do not revert Y for rects.
This commit is contained in:
parent
a89486f6bd
commit
fa102a65c9
|
@ -395,7 +395,6 @@ public:
|
||||||
"{ \n"
|
"{ \n"
|
||||||
" gl_Position = aRectPosition; \n"
|
" gl_Position = aRectPosition; \n"
|
||||||
" vShadeColor = uRectColor; \n"
|
" vShadeColor = uRectColor; \n"
|
||||||
" gl_Position.y = -gl_Position.y; \n"
|
|
||||||
" vTexCoord0 = aTexCoord0; \n"
|
" vTexCoord0 = aTexCoord0; \n"
|
||||||
" vTexCoord1 = aTexCoord1; \n"
|
" vTexCoord1 = aTexCoord1; \n"
|
||||||
;
|
;
|
||||||
|
@ -424,7 +423,6 @@ public:
|
||||||
"{ \n"
|
"{ \n"
|
||||||
" gl_Position = aRectPosition; \n"
|
" gl_Position = aRectPosition; \n"
|
||||||
" vShadeColor = uRectColor; \n"
|
" vShadeColor = uRectColor; \n"
|
||||||
" gl_Position.y = -gl_Position.y; \n"
|
|
||||||
;
|
;
|
||||||
if (!_glinfo.isGLESX) {
|
if (!_glinfo.isGLESX) {
|
||||||
m_part +=
|
m_part +=
|
||||||
|
|
|
@ -25,7 +25,6 @@ namespace glsl {
|
||||||
"void main() \n"
|
"void main() \n"
|
||||||
"{ \n"
|
"{ \n"
|
||||||
" gl_Position = aRectPosition; \n"
|
" gl_Position = aRectPosition; \n"
|
||||||
" gl_Position.y = -gl_Position.y; \n"
|
|
||||||
"} \n"
|
"} \n"
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +42,6 @@ namespace glsl {
|
||||||
"void main() \n"
|
"void main() \n"
|
||||||
"{ \n"
|
"{ \n"
|
||||||
" gl_Position = aRectPosition; \n"
|
" gl_Position = aRectPosition; \n"
|
||||||
" gl_Position.y = -gl_Position.y;\n"
|
|
||||||
" vTexCoord0 = aTexCoord0; \n"
|
" vTexCoord0 = aTexCoord0; \n"
|
||||||
"} \n"
|
"} \n"
|
||||||
;
|
;
|
||||||
|
|
|
@ -921,7 +921,7 @@ void GraphicsDrawer::drawRect(int _ulx, int _uly, int _lrx, int _lry)
|
||||||
const float Z = (gDP.otherMode.depthSource == G_ZS_PRIM) ? gDP.primDepth.z : 0.0f;
|
const float Z = (gDP.otherMode.depthSource == G_ZS_PRIM) ? gDP.primDepth.z : 0.0f;
|
||||||
const float W = 1.0f;
|
const float W = 1.0f;
|
||||||
m_rect[0].x = (float)_ulx * (2.0f * scaleX) - 1.0f;
|
m_rect[0].x = (float)_ulx * (2.0f * scaleX) - 1.0f;
|
||||||
m_rect[0].y = (float)_uly * (-2.0f * scaleY) + 1.0f;
|
m_rect[0].y = (float)_uly * (2.0f * scaleY) - 1.0f;
|
||||||
m_rect[0].z = Z;
|
m_rect[0].z = Z;
|
||||||
m_rect[0].w = W;
|
m_rect[0].w = W;
|
||||||
m_rect[1].x = (float)_lrx * (2.0f * scaleX) - 1.0f;
|
m_rect[1].x = (float)_lrx * (2.0f * scaleX) - 1.0f;
|
||||||
|
@ -929,7 +929,7 @@ void GraphicsDrawer::drawRect(int _ulx, int _uly, int _lrx, int _lry)
|
||||||
m_rect[1].z = Z;
|
m_rect[1].z = Z;
|
||||||
m_rect[1].w = W;
|
m_rect[1].w = W;
|
||||||
m_rect[2].x = m_rect[0].x;
|
m_rect[2].x = m_rect[0].x;
|
||||||
m_rect[2].y = (float)_lry * (-2.0f * scaleY) + 1.0f;
|
m_rect[2].y = (float)_lry * (2.0f * scaleY) - 1.0f;
|
||||||
m_rect[2].z = Z;
|
m_rect[2].z = Z;
|
||||||
m_rect[2].w = W;
|
m_rect[2].w = W;
|
||||||
m_rect[3].x = m_rect[1].x;
|
m_rect[3].x = m_rect[1].x;
|
||||||
|
@ -1140,31 +1140,29 @@ void GraphicsDrawer::drawTexturedRect(const TexturedRectParams & _params)
|
||||||
calcCoordsScales(pCurrentBuffer, scaleX, scaleY);
|
calcCoordsScales(pCurrentBuffer, scaleX, scaleY);
|
||||||
const float Z = (gDP.otherMode.depthSource == G_ZS_PRIM) ? gDP.primDepth.z : 0.0f;
|
const float Z = (gDP.otherMode.depthSource == G_ZS_PRIM) ? gDP.primDepth.z : 0.0f;
|
||||||
const float W = 1.0f;
|
const float W = 1.0f;
|
||||||
f32 uly, lry;
|
const f32 ulx = _params.ulx * (2.0f * scaleX) - 1.0f;
|
||||||
if (bUseTexrectDrawer) {
|
const f32 uly = _params.uly * (2.0f * scaleY) - 1.0f;
|
||||||
uly = (float)_params.uly * (2.0f * scaleY) - 1.0f;
|
const f32 lrx = _params.lrx * (2.0f * scaleX) - 1.0f;
|
||||||
lry = (float)_params.lry * (2.0f * scaleY) - 1.0f;
|
const f32 lry = _params.lry * (2.0f * scaleY) - 1.0f;
|
||||||
} else {
|
if (!bUseTexrectDrawer) {
|
||||||
uly = (float)_params.uly * (-2.0f * scaleY) + 1.0f;
|
|
||||||
lry = (float)_params.lry * (-2.0f * scaleY) + 1.0f;
|
|
||||||
// Flush text drawer
|
// Flush text drawer
|
||||||
if (m_texrectDrawer.draw())
|
if (m_texrectDrawer.draw())
|
||||||
_updateStates(DrawingState::TexRect);
|
_updateStates(DrawingState::TexRect);
|
||||||
}
|
}
|
||||||
m_rect[0].x = (float)_params.ulx * (2.0f * scaleX) - 1.0f;
|
m_rect[0].x = ulx;
|
||||||
m_rect[0].y = uly;
|
m_rect[0].y = uly;
|
||||||
m_rect[0].z = Z;
|
m_rect[0].z = Z;
|
||||||
m_rect[0].w = W;
|
m_rect[0].w = W;
|
||||||
m_rect[1].x = (float)(_params.lrx) * (2.0f * scaleX) - 1.0f;
|
m_rect[1].x = lrx;
|
||||||
m_rect[1].y = m_rect[0].y;
|
m_rect[1].y = uly;
|
||||||
m_rect[1].z = Z;
|
m_rect[1].z = Z;
|
||||||
m_rect[1].w = W;
|
m_rect[1].w = W;
|
||||||
m_rect[2].x = m_rect[0].x;
|
m_rect[2].x = ulx;
|
||||||
m_rect[2].y = lry;
|
m_rect[2].y = lry;
|
||||||
m_rect[2].z = Z;
|
m_rect[2].z = Z;
|
||||||
m_rect[2].w = W;
|
m_rect[2].w = W;
|
||||||
m_rect[3].x = m_rect[1].x;
|
m_rect[3].x = lrx;
|
||||||
m_rect[3].y = m_rect[2].y;
|
m_rect[3].y = lry;
|
||||||
m_rect[3].z = Z;
|
m_rect[3].z = Z;
|
||||||
m_rect[3].w = W;
|
m_rect[3].w = W;
|
||||||
|
|
||||||
|
@ -1487,9 +1485,9 @@ void GraphicsDrawer::copyTexturedRect(const CopyRectParams & _params)
|
||||||
const float Z = 0.0f;
|
const float Z = 0.0f;
|
||||||
const float W = 1.0f;
|
const float W = 1.0f;
|
||||||
float X0 = _params.dstX0 * (2.0f * scaleX) - 1.0f;
|
float X0 = _params.dstX0 * (2.0f * scaleX) - 1.0f;
|
||||||
float Y0 = _params.dstY0 * (-2.0f * scaleY) + 1.0f;
|
float Y0 = _params.dstY0 * (2.0f * scaleY) - 1.0f;
|
||||||
float X1 = _params.dstX1 * (2.0f * scaleX) - 1.0f;
|
float X1 = _params.dstX1 * (2.0f * scaleX) - 1.0f;
|
||||||
float Y1 = _params.dstY1 * (-2.0f * scaleY) + 1.0f;
|
float Y1 = _params.dstY1 * (2.0f * scaleY) - 1.0f;
|
||||||
if (_params.invertX) {
|
if (_params.invertX) {
|
||||||
X0 = -X0;
|
X0 = -X0;
|
||||||
X1 = -X1;
|
X1 = -X1;
|
||||||
|
|
|
@ -183,8 +183,6 @@ void TexrectDrawer::add()
|
||||||
m_vecRectCoords.push_back(coords);
|
m_vecRectCoords.push_back(coords);
|
||||||
++m_numRects;
|
++m_numRects;
|
||||||
|
|
||||||
for (u32 i = 0; i < 4; ++i)
|
|
||||||
pRect[i].y = -pRect[i].y;
|
|
||||||
Context::DrawRectParameters rectParams;
|
Context::DrawRectParameters rectParams;
|
||||||
rectParams.mode = drawmode::TRIANGLE_STRIP;
|
rectParams.mode = drawmode::TRIANGLE_STRIP;
|
||||||
rectParams.verticesCount = 4;
|
rectParams.verticesCount = 4;
|
||||||
|
@ -259,25 +257,25 @@ bool TexrectDrawer::draw()
|
||||||
m_programTex->setTextureBounds(texBounds);
|
m_programTex->setTextureBounds(texBounds);
|
||||||
|
|
||||||
rect[0].x = m_ulx;
|
rect[0].x = m_ulx;
|
||||||
rect[0].y = -m_lry;
|
rect[0].y = m_lry;
|
||||||
rect[0].z = m_Z;
|
rect[0].z = m_Z;
|
||||||
rect[0].w = W;
|
rect[0].w = W;
|
||||||
rect[0].s0 = s0;
|
rect[0].s0 = s0;
|
||||||
rect[0].t0 = t0;
|
rect[0].t0 = t0;
|
||||||
rect[1].x = m_lrx;
|
rect[1].x = m_lrx;
|
||||||
rect[1].y = -m_lry;
|
rect[1].y = m_lry;
|
||||||
rect[1].z = m_Z;
|
rect[1].z = m_Z;
|
||||||
rect[1].w = W;
|
rect[1].w = W;
|
||||||
rect[1].s0 = s1;
|
rect[1].s0 = s1;
|
||||||
rect[1].t0 = t0;
|
rect[1].t0 = t0;
|
||||||
rect[2].x = m_ulx;
|
rect[2].x = m_ulx;
|
||||||
rect[2].y = -m_uly;
|
rect[2].y = m_uly;
|
||||||
rect[2].z = m_Z;
|
rect[2].z = m_Z;
|
||||||
rect[2].w = W;
|
rect[2].w = W;
|
||||||
rect[2].s0 = s0;
|
rect[2].s0 = s0;
|
||||||
rect[2].t0 = t1;
|
rect[2].t0 = t1;
|
||||||
rect[3].x = m_lrx;
|
rect[3].x = m_lrx;
|
||||||
rect[3].y = -m_uly;
|
rect[3].y = m_uly;
|
||||||
rect[3].z = m_Z;
|
rect[3].z = m_Z;
|
||||||
rect[3].w = W;
|
rect[3].w = W;
|
||||||
rect[3].s0 = s1;
|
rect[3].s0 = s1;
|
||||||
|
@ -296,10 +294,10 @@ bool TexrectDrawer::draw()
|
||||||
gfxContext.bindFramebuffer(bufferTarget::DRAW_FRAMEBUFFER, m_FBO);
|
gfxContext.bindFramebuffer(bufferTarget::DRAW_FRAMEBUFFER, m_FBO);
|
||||||
m_programClear->activate();
|
m_programClear->activate();
|
||||||
|
|
||||||
rect[0].y = -m_uly;
|
rect[0].y = m_uly;
|
||||||
rect[1].y = -m_uly;
|
rect[1].y = m_uly;
|
||||||
rect[2].y = -m_lry;
|
rect[2].y = m_lry;
|
||||||
rect[3].y = -m_lry;
|
rect[3].y = m_lry;
|
||||||
|
|
||||||
_setViewport();
|
_setViewport();
|
||||||
|
|
||||||
|
|
|
@ -288,37 +288,37 @@ void TextDrawer::drawText(const char *_pText, float _x, float _y) const
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rect.x = x2;
|
rect.x = x2;
|
||||||
rect.y = y2;
|
rect.y = -y2;
|
||||||
rect.s0 = m_atlas->c[*p].tx;
|
rect.s0 = m_atlas->c[*p].tx;
|
||||||
rect.t0 = m_atlas->c[*p].ty;
|
rect.t0 = m_atlas->c[*p].ty;
|
||||||
coords.push_back(rect);
|
coords.push_back(rect);
|
||||||
|
|
||||||
rect.x = x2 + w;
|
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.s0 = m_atlas->c[*p].tx + m_atlas->c[*p].bw / m_atlas->w;
|
||||||
rect.t0 = m_atlas->c[*p].ty;
|
rect.t0 = m_atlas->c[*p].ty;
|
||||||
coords.push_back(rect);
|
coords.push_back(rect);
|
||||||
|
|
||||||
rect.x = x2;
|
rect.x = x2;
|
||||||
rect.y = y2 + h;
|
rect.y = -y2 - h;
|
||||||
rect.s0 = m_atlas->c[*p].tx;
|
rect.s0 = m_atlas->c[*p].tx;
|
||||||
rect.t0 = m_atlas->c[*p].ty + m_atlas->c[*p].bh / m_atlas->h;
|
rect.t0 = m_atlas->c[*p].ty + m_atlas->c[*p].bh / m_atlas->h;
|
||||||
coords.push_back(rect);
|
coords.push_back(rect);
|
||||||
|
|
||||||
rect.x = x2 + w;
|
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.s0 = m_atlas->c[*p].tx + m_atlas->c[*p].bw / m_atlas->w;
|
||||||
rect.t0 = m_atlas->c[*p].ty;
|
rect.t0 = m_atlas->c[*p].ty;
|
||||||
coords.push_back(rect);
|
coords.push_back(rect);
|
||||||
|
|
||||||
rect.x = x2;
|
rect.x = x2;
|
||||||
rect.y = y2 + h;
|
rect.y = -y2 - h;
|
||||||
rect.s0 = m_atlas->c[*p].tx;
|
rect.s0 = m_atlas->c[*p].tx;
|
||||||
rect.t0 = m_atlas->c[*p].ty + m_atlas->c[*p].bh / m_atlas->h;
|
rect.t0 = m_atlas->c[*p].ty + m_atlas->c[*p].bh / m_atlas->h;
|
||||||
coords.push_back(rect);
|
coords.push_back(rect);
|
||||||
|
|
||||||
rect.x = x2 + w;
|
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.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;
|
rect.t0 = m_atlas->c[*p].ty + m_atlas->c[*p].bh / m_atlas->h;
|
||||||
coords.push_back(rect);
|
coords.push_back(rect);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user