Con_Printf("glDrawRangeElements detected (max vertices %i, max indices %i)\n", gl_maxdrawrangeelementsvertices, gl_maxdrawrangeelementsindices);
}
- backendunits = min(MAX_TEXTUREUNITS, gl_textureunits);
+ backendunits = bound(1, gl_textureunits, MAX_TEXTUREUNITS);
backendimageunits = backendunits;
backendarrayunits = backendunits;
if (gl_support_fragment_shader)
qglGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, (int *)&backendarrayunits);
CHECKGLERROR
Con_Printf("GLSL shader support detected: texture units = %i texenv, %i image, %i array\n", backendunits, backendimageunits, backendarrayunits);
+ backendimageunits = bound(1, backendimageunits, MAX_TEXTUREUNITS);
+ backendarrayunits = bound(1, backendarrayunits, MAX_TEXTUREUNITS);
}
else if (backendunits > 1)
Con_Printf("multitexture detected: texture units = %i\n", backendunits);
memset(&backend_modelmatrix, 0, sizeof(backend_modelmatrix));
}
-void GL_SetupView_Orientation_FromEntity(matrix4x4_t *matrix)
+void GL_SetupView_Orientation_FromEntity(const matrix4x4_t *matrix)
{
matrix4x4_t tempmatrix, basematrix;
Matrix4x4_Invert_Simple(&tempmatrix, matrix);
unsigned int numelements = numtriangles * 3;
if (numvertices < 3 || numtriangles < 1)
{
- Con_Printf("R_Mesh_Draw(%d, %d, %d, %08p);\n", firstvertex, numvertices, numtriangles, elements);
+ Con_Printf("R_Mesh_Draw(%d, %d, %d, %8p);\n", firstvertex, numvertices, numtriangles, elements);
return;
}
CHECKGLERROR