A lot of PSP optimizations

This commit is contained in:
2026-06-30 21:01:11 -05:00
parent 55352805ee
commit 84ebaa0751
44 changed files with 287 additions and 863 deletions
+1 -33
View File
@@ -25,16 +25,7 @@ errorret_t meshInitGL(
mesh->vertices = vertices;
#ifdef DUSK_OPENGL_LEGACY
// Nothing needed.
#if MESH_ENABLE_COLOR
glEnableClientState(GL_COLOR_ARRAY);
errorChain(errorGLCheck());
#endif
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
errorChain(errorGLCheck());
glEnableClientState(GL_VERTEX_ARRAY);
errorChain(errorGLCheck());
// Nothing needed; client state is enabled once globally in displayOpenGLInit.
#else
// Generate Vertex Buffer Object
glGenBuffers(1, &mesh->vboId);
@@ -82,20 +73,6 @@ errorret_t meshInitGL(
glEnableVertexAttribArray(1);
errorChain(errorGLCheck());
#if MESH_ENABLE_COLOR
glVertexAttribPointer(
2,
sizeof(color_t) / sizeof(GLubyte),
GL_UNSIGNED_BYTE,
GL_TRUE,
sizeof(meshvertex_t),
(const GLvoid*)offsetof(meshvertex_t, color)
);
errorChain(errorGLCheck());
glEnableVertexAttribArray(2);
errorChain(errorGLCheck());
#endif
// Unbind VAO and VBO to prevent accidental modification
glBindBuffer(GL_ARRAY_BUFFER, 0);
errorChain(errorGLCheck());
@@ -138,15 +115,6 @@ errorret_t meshDrawGL(
// Legacy pointer style rendering
const GLsizei stride = sizeof(meshvertex_t);
#if MESH_ENABLE_COLOR
glColorPointer(
sizeof(color4b_t),
GL_UNSIGNED_BYTE,
stride,
(const GLvoid*)&mesh->vertices[offset].color
);
#endif
glTexCoordPointer(
MESH_VERTEX_UV_SIZE,
GL_FLOAT,