X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGraphic%2FModels.cpp;h=f58962c2f4ab5e3c5f57aea22b7f49f1f19abe26;hb=51a0860281c8978f5404c730eb809fb455d99aea;hp=649bcdef904c2d26eed36d48dc1510f76ea983e1;hpb=ed3662c0852c4312a612b4fc35bd03aba8d13db7;p=lugaru.git diff --git a/Source/Graphic/Models.cpp b/Source/Graphic/Models.cpp index 649bcde..f58962c 100644 --- a/Source/Graphic/Models.cpp +++ b/Source/Graphic/Models.cpp @@ -30,8 +30,6 @@ extern float fadestart; extern float texdetail; extern bool decals; -extern bool visibleloading; - int Model::LineCheck(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate) { static int j; @@ -401,7 +399,7 @@ void Model::UpdateVertexArrayNoTexNoNorm() } } -bool Model::loadnotex(const std::string& filename ) +bool Model::loadnotex(const std::string& filename) { FILE *tfile; long i; @@ -465,7 +463,7 @@ bool Model::loadnotex(const std::string& filename ) } -bool Model::load(const std::string& filename, bool texture ) +bool Model::load(const std::string& filename, bool texture) { FILE *tfile; long i; @@ -474,8 +472,7 @@ bool Model::load(const std::string& filename, bool texture ) LOG(std::string("Loading model...") + filename); - if (visibleloading) - Game::LoadingScreen(); + Game::LoadingScreen(); type = normaltype; color = 0; @@ -819,8 +816,7 @@ void Model::Rotate(float xang, float yang, float zang) void Model::CalculateNormals(bool facenormalise) { - if (visibleloading) - Game::LoadingScreen(); + Game::LoadingScreen(); static int i; if (type != normaltype && type != decalstype) return; @@ -930,15 +926,7 @@ void Model::drawdifftex(GLuint texture) glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); - -#ifndef WIN32 - glLockArraysEXT( 0, TriangleNum * 3); -#endif glDrawArrays(GL_TRIANGLES, 0, TriangleNum * 3); -#ifndef WIN32 - glUnlockArraysEXT(); -#endif - if (!color) glDisableClientState(GL_NORMAL_ARRAY); @@ -962,15 +950,7 @@ void Model::drawdifftex(Texture texture) glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); - -#ifndef WIN32 - glLockArraysEXT( 0, TriangleNum * 3); -#endif glDrawArrays(GL_TRIANGLES, 0, TriangleNum * 3); -#ifndef WIN32 - glUnlockArraysEXT(); -#endif - if (!color) glDisableClientState(GL_NORMAL_ARRAY); @@ -1374,7 +1354,6 @@ void Model::MakeDecal(int atype, XYZ where, float size, float opacity, float rot Model::~Model() { deallocate(); - textureptr.destroy(); } void Model::deallocate() @@ -1447,23 +1426,20 @@ void Model::deallocate() free(decalposition); decalposition = 0; -}; +} Model::Model() + : vertexNum(0), TriangleNum(0), + hastexture(0), + type(0), oldtype(0), + possible(0), + owner(0), + vertex(0), + normals(0), + facenormals(0), + Triangles(0), + vArray(0) { - vertexNum = 0, TriangleNum = 0; - hastexture = 0; - - type = 0, oldtype = 0; - - possible = 0; - owner = 0; - vertex = 0; - normals = 0; - facenormals = 0; - Triangles = 0; - vArray = 0; - memset(&modelTexture, 0, sizeof(modelTexture)); numpossible = 0; color = 0; @@ -1485,4 +1461,3 @@ Model::Model() type = nothing; } -