summaryrefslogtreecommitdiff
path: root/thirdparty/etcpak/MipMap.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/etcpak/MipMap.hpp')
-rw-r--r--thirdparty/etcpak/MipMap.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/thirdparty/etcpak/MipMap.hpp b/thirdparty/etcpak/MipMap.hpp
new file mode 100644
index 0000000000..d3b4bc9e7c
--- /dev/null
+++ b/thirdparty/etcpak/MipMap.hpp
@@ -0,0 +1,11 @@
+#ifndef __MIPMAP_HPP__
+#define __MIPMAP_HPP__
+
+#include "Vector.hpp"
+
+inline int NumberOfMipLevels( const v2i& size )
+{
+ return (int)floor( log2( std::max( size.x, size.y ) ) ) + 1;
+}
+
+#endif