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);
void R_Clip_DisplayBuffer(void)
{
+ /*
#if CLIPTEST
int i;
static int firstupload = true;
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++)
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];