dmuratshin 9 years ago
parent
commit
8ed7de6a6a
3 changed files with 35 additions and 1 deletions
  1. 4 0
      oxygine/src/core/Object.cpp
  2. 6 1
      oxygine/src/core/ZipFileSystem.cpp
  3. 25 0
      oxygine/src/math/Matrix.h

+ 4 - 0
oxygine/src/core/Object.cpp

@@ -135,7 +135,9 @@ namespace oxygine
         __id = ++_lastID;
 
         //OX_ASSERT(__id != 266);
+#ifdef OX_DEBUG
         OX_ASSERT(_assertCtorID != __id);
+#endif
     }
 
     ObjectBase::ObjectBase(bool assignID): __userData(0), __id(0)
@@ -177,7 +179,9 @@ namespace oxygine
 
     ObjectBase::~ObjectBase()
     {
+#ifdef OX_DEBUG
         OX_ASSERT(_assertDtorID != __id);
+#endif
 
 #ifdef OXYGINE_DEBUG_TRACE_LEAKS
         __removeFromDebugList(this);

+ 6 - 1
oxygine/src/core/ZipFileSystem.cpp

@@ -363,10 +363,15 @@ namespace oxygine
                 unzCloseCurrentFile(entry->zp);
             }
 
+            ~fileHandleZipStreaming()
+            {
+                int q = 0;
+            }
+
             void release()
             {
                 file::close(_h);
-                _h = 0;
+                delete this;
             }
 
             unsigned int read(void* dest, unsigned int size)

+ 25 - 0
oxygine/src/math/Matrix.h

@@ -70,6 +70,9 @@ namespace oxygine
         static MatrixT& perspectiveFovLH(MatrixT& out, T fovy, T aspect, T znear, T zfar);
         static MatrixT& perspectiveFovRH(MatrixT& out, T fovy, T aspect, T znear, T zfar);
 
+        static MatrixT& perspectivOffCenterLH(MatrixT& out, T left, T right, T bottom, T top, T znear, T zfar);
+        static MatrixT& perspectiveOffCenterRH(MatrixT& out, T left, T right, T bottom, T top, T znear, T zfar);
+
         static MatrixT& orthoLH(MatrixT& out, T width, T height, T zNear, T zFar);
 
         static vector3& transformVec3(vector3& out, const vector3& in, const MatrixT& mat);
@@ -430,6 +433,28 @@ namespace oxygine
         return out;
     }
 
+    template <class T>
+    inline MatrixT<T>& MatrixT<T>::perspectivOffCenterLH(MatrixT& out, T left, T right, T bottom, T top, T znearPlane, T zfarPlane)
+    {
+        out = matrix(
+                  2 * znearPlane / (right - left), 0, 0, 0,
+                  0, 2 * znearPlane / (top - bottom), 0, 0,
+                  (left + right) / (left - right), (top + bottom) / (bottom - top), zfarPlane / (zfarPlane - znearPlane), 1,
+                  0, 0, znearPlane * zfarPlane / (znearPlane - zfarPlane), 0);
+        return out;
+    }
+
+    template <class T>
+    inline MatrixT<T>& MatrixT<T>::perspectiveOffCenterRH(MatrixT& out, T left, T right, T bottom, T top, T znearPlane, T zfarPlane)
+    {
+        out = matrix(
+                  2 * znearPlane / (right - left), 0, 0, 0,
+                  0, 2 * znearPlane / (top - bottom), 0, 0,
+                  (left + right) / (right - left), (top + bottom) / (top - bottom), zfarPlane / (znearPlane - zfarPlane), -1,
+                  0, 0, znearPlane * zfarPlane / (znearPlane - zfarPlane), 0);
+        return out;
+    }
+
     template <class T>
     inline MatrixT<T>& MatrixT<T>::orthoLH(MatrixT& out, T w, T h, T zNear, T zFar)
     {