X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FModels.cpp;h=d0a991b8217a5b6eed602b44b613913ce6664dd9;hb=1f3a04488655b851cb12cf3d4d331577b896de3f;hp=0b8105396bd4f00204e73440c319a0783707d65f;hpb=2a9d19feea3589e45e3f6aa4e7b6052732b35f3f;p=lugaru.git diff --git a/Source/Models.cpp b/Source/Models.cpp index 0b81053..d0a991b 100644 --- a/Source/Models.cpp +++ b/Source/Models.cpp @@ -1,5 +1,6 @@ /* Copyright (C) 2003, 2010 - Wolfire Games +Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file) This file is part of Lugaru. @@ -153,7 +154,6 @@ int Model::SphereCheck(XYZ *p1, float radius, XYZ *p, XYZ *move, float *rotate) static int firstintersecting; static XYZ point; static XYZ oldp1; - static XYZ start, end; firstintersecting = -1; @@ -180,12 +180,6 @@ int Model::SphereCheck(XYZ *p1, float radius, XYZ *p, XYZ *move, float *rotate) intersecting = sphere_line_intersection(&vertex[Triangles[j].vertex[0]], &vertex[Triangles[j].vertex[2]], p1, &radius); if (intersecting) { *p1 += facenormals[j] * (distance - radius); - /*start=*p1; - end=*p1; - end.y-=radius; - if(LineFacetd(&start,&end,&vertex[Triangles[j].vertex[0]],&vertex[Triangles[j].vertex[1]],&vertex[Triangles[j].vertex[2]],&facenormals[j],&point)){ - p1->y=point.y+radius; - }*/ } } if ((distance < olddistance || firstintersecting == -1) && intersecting) { @@ -213,7 +207,6 @@ int Model::SphereCheckPossible(XYZ *p1, float radius, XYZ *move, float *rotate) static int firstintersecting; static XYZ point; static XYZ oldp1; - static XYZ start, end; firstintersecting = -1; @@ -243,7 +236,6 @@ int Model::SphereCheckPossible(XYZ *p1, float radius, XYZ *move, float *rotate) if (!intersecting) intersecting = sphere_line_intersection(&vertex[Triangles[j].vertex[0]], &vertex[Triangles[j].vertex[2]], p1, &radius); if (intersecting) { - //if(j>=0&&j=0&&Triangles[i].vertex[1]>=0&&Triangles[i].vertex[2]>=0){ - if(isnormal(vertex[Triangles[i].vertex[0]].x)&&isnormal(vertex[Triangles[i].vertex[0]].y)&&isnormal(vertex[Triangles[i].vertex[0]].z) - &&isnormal(vertex[Triangles[i].vertex[1]].x)&&isnormal(vertex[Triangles[i].vertex[1]].y)&&isnormal(vertex[Triangles[i].vertex[1]].z) - &&isnormal(vertex[Triangles[i].vertex[2]].x)&&isnormal(vertex[Triangles[i].vertex[2]].y)&&isnormal(vertex[Triangles[i].vertex[2]].z)){ - */ glTexCoord2f(Triangles[i].gx[0], Triangles[i].gy[0]); if (color) glColor3f(normals[Triangles[i].vertex[0]].x, normals[Triangles[i].vertex[0]].y, normals[Triangles[i].vertex[0]].z); @@ -920,8 +886,6 @@ void Model::drawimmediate() if (!color && flat) glNormal3f(facenormals[i].x, facenormals[i].y, facenormals[i].y); glVertex3f(vertex[Triangles[i].vertex[2]].x, vertex[Triangles[i].vertex[2]].y, vertex[Triangles[i].vertex[2]].z); - //} - //} } glEnd(); } @@ -941,14 +905,7 @@ void Model::draw() glInterleavedArrays( GL_T2F_C3F_V3F, 8 * sizeof(GLfloat), &vArray[0]); textureptr.bind(); -#if PLATFORM_MACOSX - glLockArraysEXT( 0, TriangleNum * 3); -#endif glDrawArrays(GL_TRIANGLES, 0, TriangleNum * 3); -#if PLATFORM_MACOSX - glUnlockArraysEXT(); -#endif - if (!color) glDisableClientState(GL_NORMAL_ARRAY); @@ -956,7 +913,6 @@ void Model::draw() glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); - //drawimmediate(); } //TODO: phase out in favor of Texture @@ -1030,12 +986,9 @@ void Model::drawdecals(Texture shadowtexture, Texture bloodtexture, Texture bloo if (type != decalstype) return; static int i; - //~ static float distancemult; static int lasttype; - //~ static float viewdistsquared; static bool blend; - //~ viewdistsquared = viewdistance * viewdistance; blend = 1; lasttype = -1; @@ -1154,7 +1107,6 @@ void Model::MakeDecal(int atype, XYZ *where, float *size, float *opacity, float static float placex, placez; static XYZ rot; - //static XYZ point,point1,point2; static float distance; static int i, j; @@ -1233,7 +1185,6 @@ void Model::MakeDecal(int atype, XYZ where, float size, float opacity, float rot static float placex, placez; static XYZ rot; - //static XYZ point,point1,point2; static float distance; static int i, j;