restored multitextured functionality (for lightmaps)

This commit is contained in:
ecker 2026-08-09 23:28:48 -05:00
parent f8bef6fe2f
commit 50134535dc

View File

@ -895,48 +895,46 @@ GL_FORCE_INLINE void submitVertices(GLenum mode, GLsizei first, GLuint count, GL
apply_strided_texture_uv_scale(target);
// /*
// Now, if multitexturing is enabled, we want to send exactly the same vertices again, except:
// - We want to enable blending, and send them to the TR list
// - We want to set the depth func to GL_EQUAL
// - We want to set the second texture ID
// - We want to set the uv coordinates to the passed st ones
// */
/*
Now, if multitexturing is enabled, we want to send exactly the same vertices again, except:
- We want to enable blending, and send them to the TR list
- We want to set the depth func to GL_EQUAL
- We want to set the second texture ID
- We want to set the uv coordinates to the passed st ones
*/
// if(!TEXTURES_ENABLED[1]) {
// /* Multitexture actively disabled */
// return;
// }
if(!TEXTURES_ENABLED[1]) {
/* Multitexture actively disabled */
return;
}
// TextureObject* texture1 = _glGetTexture1();
TextureObject* texture1 = _glGetTexture1();
// /* Multitexture implicitly disabled */
// if(!texture1 || ((ATTRIB_LIST.enabled & ST_ENABLED_FLAG) != ST_ENABLED_FLAG)) {
// /* Multitexture actively disabled */
// return;
// }
/* Multitexture implicitly disabled */
if(!texture1 || ((ATTRIB_LIST.enabled & ST_ENABLED_FLAG) != ST_ENABLED_FLAG)) {
/* Multitexture actively disabled */
return;
}
// /* Push back a copy of the list to the transparent poly list, including the header
// (hence the + 1)
// */
// Vertex* vertex = aligned_vector_push_back(
// &_glTransparentPolyList()->vector, (Vertex*) _glSubmissionTargetHeader(target), target->count + 1
// );
/* Push back a copy of the list to the transparent poly list, including the header
(hence the + 1)
*/
Vertex* vertex = aligned_vector_push_back(
&_glTransparentPolyList()->vector, (Vertex*) _glSubmissionTargetHeader(target), target->count + 1
);
// gl_assert(vertex);
gl_assert(vertex);
// PolyHeader* mtHeader = (PolyHeader*) vertex++;
// /* Send the buffer again to the transparent list */
// apply_poly_header(mtHeader, GL_TRUE, _glTransparentPolyList(), 1);
PolyHeader* mtHeader = (PolyHeader*) vertex++;
/* Send the buffer again to the transparent list */
apply_poly_header(mtHeader, GL_TRUE, _glTransparentPolyList(), 1);
// /* Replace the UV coordinates with the ST ones */
// VertexExtra* ve = aligned_vector_at(target->extras, 0);
// ITERATE(target->count) {
// vertex->uv[0] = ve->st[0];
// vertex->uv[1] = ve->st[1];
// ++vertex;
// ++ve;
// }
/* Replace the UV coordinates with the ST ones */
ITERATE(target->count) {
vertex->uv[0] = _glUnpackHalfFloat(vertex->st[0]);
vertex->uv[1] = _glUnpackHalfFloat(vertex->st[1]);
++vertex;
}
}
void APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {