X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=gl_backend.c;h=b77e5fb9e1c0604c1eb3e177f07b143f5a2ef56f;hb=9e3db0fc7835fee2178c2ce677fcc98d8fda449f;hp=5770fb455e5e3517c2d5303befb1348f78aa496e;hpb=dbad5d62a7171a052cb8a298ef7ebbc163b716c1;p=xonotic%2Fdarkplaces.git diff --git a/gl_backend.c b/gl_backend.c index 5770fb45..b77e5fb9 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -157,7 +157,7 @@ static void gl_backend_start(void) 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) @@ -168,6 +168,8 @@ static void gl_backend_start(void) 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); @@ -244,7 +246,7 @@ void GL_SetupView_Orientation_Identity (void) 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); @@ -863,7 +865,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int numtriangles, const int * 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