]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Objects.cpp
major refactor of texture system
[lugaru.git] / Source / Objects.cpp
index 353fa6e31f74b8d88215b2aa40928466b447bd74..8f2544f905df5a3666839c95130deaf479d75263 100644 (file)
@@ -759,10 +759,6 @@ Objects::Objects()
        center = 0;
        radius = 0;
        numobjects = 0;
-       boxtextureptr = 0;
-       treetextureptr = 0;
-       bushtextureptr = 0;
-       rocktextureptr = 0;
 
        memset(position, 0, sizeof(position));
        memset(type, 0, sizeof(type));
@@ -787,9 +783,9 @@ Objects::Objects()
 
 Objects::~Objects()
 {
-       if (boxtextureptr) glDeleteTextures( 1, &boxtextureptr );
-       if (treetextureptr) glDeleteTextures( 1, &treetextureptr );
-       if (bushtextureptr) glDeleteTextures( 1, &bushtextureptr );
-       if (rocktextureptr) glDeleteTextures( 1, &rocktextureptr );
+    boxtextureptr.destroy();
+    treetextureptr.destroy();
+    bushtextureptr.destroy();
+    rocktextureptr.destroy();
 };