]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Graphic/Models.cpp
CMake: Switch to --std=gnu++11 to fix builds with POWER
[lugaru.git] / Source / Graphic / Models.cpp
index a9833d05e05c8dc486574cf326b28a405c2f9dc6..4120864b74146e015f0b4830462cfc40e908a759 100644 (file)
@@ -18,9 +18,10 @@ You should have received a copy of the GNU General Public License
 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "Game.h"
-#include "Graphic/Models.h"
-#include "Utils/Folders.h"
+#include "Graphic/Models.hpp"
+
+#include "Game.hpp"
+#include "Utils/Folders.hpp"
 
 extern float multiplier;
 extern float viewdistance;
@@ -29,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;
@@ -473,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;
@@ -818,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;
@@ -929,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);
@@ -961,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);
@@ -1373,7 +1354,6 @@ void Model::MakeDecal(int atype, XYZ where, float size, float opacity, float rot
 Model::~Model()
 {
     deallocate();
-    textureptr.destroy();
 }
 
 void Model::deallocate()
@@ -1446,7 +1426,7 @@ void Model::deallocate()
     free(decalposition);
     decalposition = 0;
 
-};
+}
 
 Model::Model()
 {