mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Disable texcoord attribs for fillrect.
Fixed fillrects in Pokemon Stadium 2.
This commit is contained in:
parent
998b813491
commit
8ea0cddbec
|
@ -243,6 +243,7 @@ namespace graphics {
|
||||||
struct DrawRectParameters
|
struct DrawRectParameters
|
||||||
{
|
{
|
||||||
DrawModeParam mode;
|
DrawModeParam mode;
|
||||||
|
bool texrect = true;
|
||||||
u32 verticesCount = 0;
|
u32 verticesCount = 0;
|
||||||
RectVertex * vertices = nullptr;
|
RectVertex * vertices = nullptr;
|
||||||
const CombinerProgram * combiner = nullptr;
|
const CombinerProgram * combiner = nullptr;
|
||||||
|
|
|
@ -19,5 +19,5 @@ namespace opengl {
|
||||||
extern const GLuint texcoord1;
|
extern const GLuint texcoord1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MaxAttribIndex 10
|
#define MaxAttribIndex 8
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,6 +133,9 @@ void BufferedDrawer::drawRects(const graphics::Context::DrawRectParameters & _pa
|
||||||
{
|
{
|
||||||
_updateRectBuffer(_params);
|
_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);
|
glDrawArrays(GLenum(_params.mode), m_rectsBuffers.vbo.pos - _params.verticesCount, _params.verticesCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ void UnbufferedDrawer::drawRects(const graphics::Context::DrawRectParameters & _
|
||||||
glVertexAttribPointer(rectAttrib::position, 4, GL_FLOAT, GL_FALSE, sizeof(RectVertex), ptr);
|
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);
|
m_cachedAttribArray->enableVertexAttribArray(rectAttrib::texcoord0, true);
|
||||||
const void * ptr = &_params.vertices->s0;
|
const void * ptr = &_params.vertices->s0;
|
||||||
if (_updateAttribPointer(rectAttrib::texcoord0, ptr))
|
if (_updateAttribPointer(rectAttrib::texcoord0, ptr))
|
||||||
|
@ -104,7 +104,7 @@ void UnbufferedDrawer::drawRects(const graphics::Context::DrawRectParameters & _
|
||||||
} else
|
} else
|
||||||
m_cachedAttribArray->enableVertexAttribArray(rectAttrib::texcoord0, false);
|
m_cachedAttribArray->enableVertexAttribArray(rectAttrib::texcoord0, false);
|
||||||
|
|
||||||
if (_params.combiner->usesTile(1)) {
|
if (_params.texrect && _params.combiner->usesTile(1)) {
|
||||||
m_cachedAttribArray->enableVertexAttribArray(rectAttrib::texcoord1, true);
|
m_cachedAttribArray->enableVertexAttribArray(rectAttrib::texcoord1, true);
|
||||||
const void * ptr = &_params.vertices->s1;
|
const void * ptr = &_params.vertices->s1;
|
||||||
if (_updateAttribPointer(rectAttrib::texcoord1, ptr))
|
if (_updateAttribPointer(rectAttrib::texcoord1, ptr))
|
||||||
|
|
|
@ -879,6 +879,7 @@ void GraphicsDrawer::drawRect(int _ulx, int _uly, int _lrx, int _lry)
|
||||||
|
|
||||||
Context::DrawRectParameters rectParams;
|
Context::DrawRectParameters rectParams;
|
||||||
rectParams.mode = drawmode::TRIANGLE_STRIP;
|
rectParams.mode = drawmode::TRIANGLE_STRIP;
|
||||||
|
rectParams.texrect = false;
|
||||||
rectParams.verticesCount = 4;
|
rectParams.verticesCount = 4;
|
||||||
rectParams.vertices = m_rect;
|
rectParams.vertices = m_rect;
|
||||||
rectParams.combiner = currentCombiner();
|
rectParams.combiner = currentCombiner();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user