]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Graphic/Models.cpp
Using an enum for model type
[lugaru.git] / Source / Graphic / Models.cpp
index 0f6a2dbda324c8cb22ced38eac55babfedf7e3e3..c58e6910d82a14ee8b94ef9bb0d352692395d20a 100644 (file)
@@ -880,33 +880,6 @@ void Model::draw()
     glDisableClientState(GL_TEXTURE_COORD_ARRAY);
 }
 
-//TODO: phase out in favor of Texture
-void Model::drawdifftex(GLuint texture)
-{
-    glEnableClientState(GL_NORMAL_ARRAY);
-    glEnableClientState(GL_VERTEX_ARRAY);
-    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-    if (color) {
-        glInterleavedArrays( GL_T2F_C3F_V3F, 8 * sizeof(GLfloat), &vArray[0]);
-    } else {
-        glInterleavedArrays( GL_T2F_N3F_V3F, 8 * sizeof(GLfloat), &vArray[0]);
-    }
-
-    glBindTexture(GL_TEXTURE_2D, (unsigned long)texture);
-    glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
-    glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
-
-    glDrawArrays(GL_TRIANGLES, 0, Triangles.size() * 3);
-
-    if (color) {
-        glDisableClientState(GL_COLOR_ARRAY);
-    } else {
-        glDisableClientState(GL_NORMAL_ARRAY);
-    }
-    glDisableClientState(GL_VERTEX_ARRAY);
-    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-}
-
 void Model::drawdifftex(Texture texture)
 {
     glEnableClientState(GL_NORMAL_ARRAY);
@@ -1205,20 +1178,15 @@ void Model::deallocate()
 
 Model::Model()
   : vertexNum(0),
-    hastexture(0),
-    type(0), oldtype(0),
+    type(nothing),
     owner(0),
     vertex(0),
     normals(0),
-    vArray(0)
+    vArray(0),
+    color(0),
+    boundingspherecenter(),
+    boundingsphereradius(0),
+    flat(false)
 {
     memset(&modelTexture, 0, sizeof(modelTexture));
-    color = 0;
-
-    boundingspherecenter = 0;
-    boundingsphereradius = 0;
-
-    flat = 0;
-
-    type = nothing;
 }