1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Disable texcoord attribs for fillrect.

Fixed fillrects in Pokemon Stadium 2.
This commit is contained in:
Sergey Lipskiy 2017-03-11 12:46:40 +07:00
parent 998b813491
commit 8ea0cddbec
5 changed files with 8 additions and 3 deletions

View File

@ -243,6 +243,7 @@ namespace graphics {
struct DrawRectParameters
{
DrawModeParam mode;
bool texrect = true;
u32 verticesCount = 0;
RectVertex * vertices = nullptr;
const CombinerProgram * combiner = nullptr;

View File

@ -19,5 +19,5 @@ namespace opengl {
extern const GLuint texcoord1;
}
#define MaxAttribIndex 10
#define MaxAttribIndex 8
}

View File

@ -133,6 +133,9 @@ void BufferedDrawer::drawRects(const graphics::Context::DrawRectParameters & _pa
{
_updateRectBuffer(_params);
m_cachedAttribArray->enableVertexAttribArray(rectAttrib::texcoord0, _params.texrect);
m_cachedAttribArray->enableVertexAttribArray(rectAttrib::texcoord1, _params.texrect);
glDrawArrays(GLenum(_params.mode), m_rectsBuffers.vbo.pos - _params.verticesCount, _params.verticesCount);
}

View File

@ -96,7 +96,7 @@ void UnbufferedDrawer::drawRects(const graphics::Context::DrawRectParameters & _
glVertexAttribPointer(rectAttrib::position, 4, GL_FLOAT, GL_FALSE, sizeof(RectVertex), ptr);
}
if (_params.combiner->usesTile(0)) {
if (_params.texrect && _params.combiner->usesTile(0)) {
m_cachedAttribArray->enableVertexAttribArray(rectAttrib::texcoord0, true);
const void * ptr = &_params.vertices->s0;
if (_updateAttribPointer(rectAttrib::texcoord0, ptr))
@ -104,7 +104,7 @@ void UnbufferedDrawer::drawRects(const graphics::Context::DrawRectParameters & _
} else
m_cachedAttribArray->enableVertexAttribArray(rectAttrib::texcoord0, false);
if (_params.combiner->usesTile(1)) {
if (_params.texrect && _params.combiner->usesTile(1)) {
m_cachedAttribArray->enableVertexAttribArray(rectAttrib::texcoord1, true);
const void * ptr = &_params.vertices->s1;
if (_updateAttribPointer(rectAttrib::texcoord1, ptr))

View File

@ -879,6 +879,7 @@ void GraphicsDrawer::drawRect(int _ulx, int _uly, int _lrx, int _lry)
Context::DrawRectParameters rectParams;
rectParams.mode = drawmode::TRIANGLE_STRIP;
rectParams.texrect = false;
rectParams.verticesCount = 4;
rectParams.vertices = m_rect;
rectParams.combiner = currentCombiner();