X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FModels.cpp;h=d0a991b8217a5b6eed602b44b613913ce6664dd9;hb=1f3a04488655b851cb12cf3d4d331577b896de3f;hp=0203689a260ffd5b51cbf0bbef51db5b26106cf3;hpb=6c36b920245ca8b1e3d9aaede5f9d2a6210538a1;p=lugaru.git diff --git a/Source/Models.cpp b/Source/Models.cpp index 0203689..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; @@ -207,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; @@ -405,10 +404,6 @@ bool Model::loadnotex(const char *filename ) FILE *tfile; long i; - //~ int oldvertexNum, oldTriangleNum; - //~ oldvertexNum = vertexNum; - //~ oldTriangleNum = TriangleNum; - type = notextype; color = 0; @@ -434,7 +429,6 @@ bool Model::loadnotex(const char *filename ) } for (i = 0; i < TriangleNum; i++) { - //funpackf(tfile, "Bi Bi Bi", &Triangles[i].vertex[0], &Triangles[i].vertex[1], &Triangles[i].vertex[2]); short vertex[ 6]; funpackf(tfile, "Bs Bs Bs Bs Bs Bs", &vertex[ 0], &vertex[ 1], &vertex[ 2], &vertex[ 3], &vertex[ 4], &vertex[ 5]); Triangles[i].vertex[ 0] = vertex[ 0]; @@ -480,10 +474,6 @@ bool Model::load(const char *filename, bool texture ) if (visibleloading) Game::LoadingScreen(); - //~ int oldvertexNum, oldTriangleNum; - //~ oldvertexNum = vertexNum; - //~ oldTriangleNum = TriangleNum; - type = normaltype; color = 0; @@ -512,7 +502,6 @@ bool Model::load(const char *filename, bool texture ) } for (i = 0; i < TriangleNum; i++) { - //funpackf(tfile, "Bi Bi Bi", &Triangles[i].vertex[0], &Triangles[i].vertex[1], &Triangles[i].vertex[2]); short vertex[ 6]; funpackf(tfile, "Bs Bs Bs Bs Bs Bs", &vertex[ 0], &vertex[ 1], &vertex[ 2], &vertex[ 3], &vertex[ 4], &vertex[ 5]); Triangles[i].vertex[ 0] = vertex[ 0]; @@ -590,7 +579,6 @@ bool Model::loaddecal(const char *filename, bool texture ) } for (i = 0; i < TriangleNum; i++) { - //funpackf(tfile, "Bi Bi Bi", &Triangles[i].vertex[0], &Triangles[i].vertex[1], &Triangles[i].vertex[2]); short vertex[ 6]; funpackf(tfile, "Bs Bs Bs Bs Bs Bs", &vertex[ 0], &vertex[ 1], &vertex[ 2], &vertex[ 3], &vertex[ 4], &vertex[ 5]); Triangles[i].vertex[ 0] = vertex[ 0]; @@ -655,10 +643,6 @@ bool Model::loadraw(char *filename ) LOG(std::string("Loading raw...") + filename); - //~ int oldvertexNum, oldTriangleNum; - //~ oldvertexNum = vertexNum; - //~ oldTriangleNum = TriangleNum; - type = rawtype; color = 0; @@ -686,7 +670,6 @@ bool Model::loadraw(char *filename ) } for (i = 0; i < TriangleNum; i++) { - //funpackf(tfile, "Bi Bi Bi", &Triangles[i].vertex[0], &Triangles[i].vertex[1], &Triangles[i].vertex[2]); short vertex[ 6]; funpackf(tfile, "Bs Bs Bs Bs Bs Bs", &vertex[ 0], &vertex[ 1], &vertex[ 2], &vertex[ 3], &vertex[ 4], &vertex[ 5]); Triangles[i].vertex[ 0] = vertex[ 0]; @@ -922,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); @@ -937,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