X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGraphic%2FModels.cpp;h=ee5add1a88dde9aa6cbb3dd281c372ba300d31c7;hb=e60cbd7add6123d81b3c35543296449b5d02cbaa;hp=38e2447085c528abba18ce2dfe35c2d77332f4bc;hpb=c799187c29525d8dfcbcc7f5b911f5dd7be9b77f;p=lugaru.git diff --git a/Source/Graphic/Models.cpp b/Source/Graphic/Models.cpp index 38e2447..ee5add1 100644 --- a/Source/Graphic/Models.cpp +++ b/Source/Graphic/Models.cpp @@ -28,9 +28,7 @@ extern float viewdistance; extern XYZ viewer; extern float fadestart; extern float texdetail; -extern bool decals; - -extern bool visibleloading; +extern bool decalstoggle; int Model::LineCheck(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate) { @@ -105,7 +103,7 @@ int Model::LineCheckPossible(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate) return firstintersecting; } -int Model::LineCheckSlidePossible(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate) +int Model::LineCheckSlidePossible(XYZ *p1, XYZ *p2, XYZ *move, float *rotate) { static int j; static float distance; @@ -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) { 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; @@ -539,7 +536,7 @@ bool Model::load(const std::string& filename, bool texture ) return true; } -bool Model::loaddecal(const std::string& filename, bool texture ) +bool Model::loaddecal(const std::string& filename) { FILE *tfile; long i, j; @@ -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; @@ -966,7 +962,7 @@ void Model::drawdifftex(Texture texture) void Model::drawdecals(Texture shadowtexture, Texture bloodtexture, Texture bloodtexture2, Texture breaktexture) { - if (decals) { + if (decalstoggle) { if (type != decalstype) return; static int i; @@ -1066,7 +1062,7 @@ void Model::drawdecals(Texture shadowtexture, Texture bloodtexture, Texture bloo void Model::DeleteDecal(int which) { - if (decals) { + if (decalstoggle) { if (type != decalstype) return; decaltype[which] = decaltype[numdecals - 1]; @@ -1085,7 +1081,7 @@ void Model::DeleteDecal(int which) void Model::MakeDecal(int atype, XYZ *where, float *size, float *opacity, float *rotation) { - if (decals) { + if (decalstoggle) { if (type != decalstype) return; @@ -1163,7 +1159,7 @@ void Model::MakeDecal(int atype, XYZ *where, float *size, float *opacity, float void Model::MakeDecal(int atype, XYZ where, float size, float opacity, float rotation) { - if (decals) { + if (decalstoggle) { if (type != decalstype) return; @@ -1358,7 +1354,6 @@ void Model::MakeDecal(int atype, XYZ where, float size, float opacity, float rot Model::~Model() { deallocate(); - textureptr.destroy(); } void Model::deallocate() @@ -1434,20 +1429,17 @@ void Model::deallocate() } 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; @@ -1469,4 +1461,3 @@ Model::Model() type = nothing; } -