mirror of
https://github.com/jenshemprich/MacGLide.git
synced 2024-06-12 15:29:27 +00:00
Fixed frame buffer depth issues for all render paths, consolidated the code
This commit is contained in:
parent
eb31a1311e
commit
e931b834dd
File diff suppressed because one or more lines are too long
|
@ -23,7 +23,6 @@ public:
|
||||||
void free_buffers();
|
void free_buffers();
|
||||||
void initialise_format(GrLfbWriteMode_t format);
|
void initialise_format(GrLfbWriteMode_t format);
|
||||||
bool begin_write();
|
bool begin_write();
|
||||||
void end_write();
|
|
||||||
void end_write(FxU32 alpha, GLfloat depth);
|
void end_write(FxU32 alpha, GLfloat depth);
|
||||||
void end_write_opaque();
|
void end_write_opaque();
|
||||||
inline FxU16 GetChromaKeyValue() {return m_ChromaKey.Scalar;};
|
inline FxU16 GetChromaKeyValue() {return m_ChromaKey.Scalar;};
|
||||||
|
@ -40,8 +39,7 @@ public:
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
void Clear();
|
void Clear();
|
||||||
void draw(const tilesize* tilesizetable);
|
int buildVertexArrays();
|
||||||
void drawCompiledVertexArrays(const tilesize* tilesizetable, int vertexarrayindex, int tilecount);
|
|
||||||
int buildVertexArrays(const tilesize* tilesizetable, int vertexarrayindex);
|
int buildVertexArrays(const tilesize* tilesizetable, int vertexarrayindex);
|
||||||
void set_gl_state();
|
void set_gl_state();
|
||||||
void restore_gl_state();
|
void restore_gl_state();
|
||||||
|
@ -107,4 +105,8 @@ private:
|
||||||
vector bool short Vector;
|
vector bool short Vector;
|
||||||
#endif
|
#endif
|
||||||
} m_ChromaKey;
|
} m_ChromaKey;
|
||||||
|
//#ifdef DEBUG_TILE_RENDERING
|
||||||
|
protected:
|
||||||
|
static void highlightTileCorners(const Framebuffer::TileUpdateState updateState, FxU32* texbuffer, const GLint x_step, const GLint y_step);
|
||||||
|
//#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -82,9 +82,9 @@ void RenderInitialize(void)
|
||||||
GlideMsg( "RenderInitialize()\n");
|
GlideMsg( "RenderInitialize()\n");
|
||||||
#endif
|
#endif
|
||||||
glReportErrors("RenderInitialize");
|
glReportErrors("RenderInitialize");
|
||||||
// initialise triagle buffers
|
// Allocate vertex array buffers
|
||||||
OGLRender.NumberOfTriangles = 0;
|
OGLRender.NumberOfTriangles = 0;
|
||||||
const int triangles = InternalConfig.EXT_compiled_vertex_array ? OGLRender.FrameBufferStartIndex + 2 * Framebuffer::MaxTiles * Framebuffer::MaxTiles : OGLRender.FrameBufferStartIndex;
|
const int triangles = OGLRender.FrameBufferStartIndex + 2 * Framebuffer::MaxTiles * Framebuffer::MaxTiles;
|
||||||
// Framebuffer utilises color, vertex and texture array only
|
// Framebuffer utilises color, vertex and texture array only
|
||||||
OGLRender.TColor = (TColorStruct*) AllocBuffer(triangles, sizeof(TColorStruct));
|
OGLRender.TColor = (TColorStruct*) AllocBuffer(triangles, sizeof(TColorStruct));
|
||||||
if (OpenGL.ColorAlphaUnit2 == 0)
|
if (OpenGL.ColorAlphaUnit2 == 0)
|
||||||
|
@ -588,7 +588,7 @@ void RenderDrawTriangles_impl( void )
|
||||||
if (use_two_tex)
|
if (use_two_tex)
|
||||||
{
|
{
|
||||||
glActiveTextureARB(OpenGL.ColorAlphaUnit1 + 1);
|
glActiveTextureARB(OpenGL.ColorAlphaUnit1 + 1);
|
||||||
if (InternalConfig.EXT_compiled_vertex_array)
|
if (use_compiled_vertex_arrays)
|
||||||
{
|
{
|
||||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
glTexCoordPointer( 4, GL_FLOAT, 0, NULL);
|
glTexCoordPointer( 4, GL_FLOAT, 0, NULL);
|
||||||
|
|
|
@ -550,10 +550,7 @@ void GlideFramebuffer::WriteFrameBuffer()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
end_write();
|
end_write(0x000000ff, OpenGL.ZNear);
|
||||||
// @todo: it would be nice to eleminate the condition,but
|
|
||||||
// m_alpha is always applied to the write and depth never
|
|
||||||
// end_write(m_alpha, m_depth);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -632,15 +629,15 @@ void GlideFramebuffer::SetAlpha(FxU32 alpha)
|
||||||
if (m_must_write && m_framebuffer->PixelPipeline && m_alpha != alpha)
|
if (m_must_write && m_framebuffer->PixelPipeline && m_alpha != alpha)
|
||||||
{
|
{
|
||||||
WriteFrameBuffer();
|
WriteFrameBuffer();
|
||||||
|
}
|
||||||
m_alpha = alpha;
|
m_alpha = alpha;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
void GlideFramebuffer::SetDepth(GLfloat depth)
|
void GlideFramebuffer::SetDepth(GLfloat depth)
|
||||||
{
|
{
|
||||||
if (m_must_write && m_framebuffer->PixelPipeline && m_depth != depth)
|
if (m_must_write && m_framebuffer->PixelPipeline && m_depth != depth)
|
||||||
{
|
{
|
||||||
WriteFrameBuffer();
|
WriteFrameBuffer();
|
||||||
|
}
|
||||||
m_depth = depth;
|
m_depth = depth;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user