]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_clip.c
more cleaning - glTexParameterf replaced with glTexParameteri
[xonotic/darkplaces.git] / r_clip.c
index 8625a2a1486def2298b8aaad78024cb228f5726e..ee67e2b2192bb2d8e8054bf43acaa3a8e5073a0c 100644 (file)
--- a/r_clip.c
+++ b/r_clip.c
@@ -211,7 +211,7 @@ int R_Clip_TriangleToPlane(vec3_t point1, vec3_t point2, vec3_t point3, tinyplan
        number = DotProduct(p->normal, p->normal);
        if (number >= 0.1f)
        {
-               *((long *)&y) = 0x5f3759df - ((* (long *) &number) >> 1);
+               *((int *)&y) = 0x5f3759df - ((* (int *) &number) >> 1);
                y = y * (1.5f - (number * 0.5f * y * y));
                VectorScale(p->normal, y, p->normal);
                p->dist = DotProduct(point1, p->normal);
@@ -871,6 +871,7 @@ void ScanEdges (void)
 
 void R_Clip_DisplayBuffer(void)
 {
+       /*
 #if CLIPTEST
        int i;
        static int firstupload = true;
@@ -886,13 +887,13 @@ void R_Clip_DisplayBuffer(void)
                memset(clipbuffertex, 0, sizeof(clipbuffertex));
                glTexImage2D(GL_TEXTURE_2D, 0, 1, 256, 256, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, clipbuffertex);
        }
-       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+       glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        if (lighthalf)
-               glColor3f(0.5, 0.5, 0.5);
+               glColor4ub(0.5, 0.5, 0.5);
        else
-               glColor3f(1, 1, 1);
+               glColor4ub(1, 1, 1);
        firstupload = false;
        b = clipbuffertex;
        for (i = 0;i < clipwidth*clipheight;i++)
@@ -910,9 +911,10 @@ void R_Clip_DisplayBuffer(void)
        glTexCoord2f (0                 , clipheight / 256.0f);glVertex2f (0           , vid.conheight);
        glEnd ();
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-//     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-//     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+//     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+//     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 #endif
+       */
 }
 
 float boxpoints[4*3];