Browse Source

Moved Squish back to its own directory.

Lasse Öörni 13 years ago
parent
commit
2ff2fc81fa

+ 1 - 0
CMakeLists.txt

@@ -163,6 +163,7 @@ add_subdirectory (ThirdParty/FreeType)
 add_subdirectory (ThirdParty/kNet)
 add_subdirectory (ThirdParty/LibCpuId)
 add_subdirectory (ThirdParty/PugiXml)
+add_subdirectory (ThirdParty/Squish)
 add_subdirectory (ThirdParty/StanHull)
 add_subdirectory (ThirdParty/STB)
 add_subdirectory (Tools/AssetImporter)

+ 2 - 2
Engine/Resource/CMakeLists.txt

@@ -8,11 +8,11 @@ set (SOURCE_FILES ${CPP_FILES} ${H_FILES})
 
 # Include directories
 include_directories (
-    ../Container ../Core ../IO ../Math ../../ThirdParty/STB ../../ThirdParty/PugiXml/src
+    ../Container ../Core ../IO ../Math ../../ThirdParty/STB ../../ThirdParty/PugiXml/src ../../ThirdParty/Squish
 )
 
 # Define target & libraries to link
 add_library (${TARGET_NAME} STATIC ${SOURCE_FILES})
-target_link_libraries (${TARGET_NAME} Container Core IO Math STB PugiXml)
+target_link_libraries (${TARGET_NAME} Container Core IO Math PugiXml Squish STB)
 enable_pch ()
 finalize_lib ()

+ 1 - 1
Engine/Resource/Image.cpp

@@ -27,9 +27,9 @@
 #include "FileSystem.h"
 #include "Image.h"
 #include "Log.h"
-#include "Squish.h"
 
 #include <cstring>
+#include <squish.h>
 #include <stb_image.h>
 #include <stb_image_write.h>
 

+ 14 - 0
ThirdParty/Squish/CMakeLists.txt

@@ -0,0 +1,14 @@
+# Define target name
+set (TARGET_NAME Squish)
+
+# Define source files
+file (GLOB CPP_FILES *.cpp)
+file (GLOB H_FILES *.h)
+set (SOURCE_FILES ${CPP_FILES} ${H_FILES})
+
+# Include directories
+include_directories (.)
+
+# Define target & libraries to link
+add_library (${TARGET_NAME} STATIC ${SOURCE_FILES})
+finalize_lib ()

+ 35 - 0
ThirdParty/Squish/README

@@ -0,0 +1,35 @@
+LICENSE
+-------
+
+The squish library is distributed under the terms and conditions of the MIT
+license. This license is specified at the top of each source file and must be
+preserved in its entirety.
+
+BUILDING AND INSTALLING THE LIBRARY
+-----------------------------------
+
+If you are using Visual Studio 2003 or above under Windows then load the Visual
+Studio 2003 project in the vs7 folder. By default, the library is built using
+SSE2 optimisations. To change this either change or remove the SQUISH_USE_SSE=2
+from the preprocessor symbols.
+
+If you are using a Mac then load the Xcode 2.2 project in the distribution. By
+default, the library is built using Altivec optimisations. To change this
+either change or remove SQUISH_USE_ALTIVEC=1 from the preprocessor symbols. I
+guess I'll have to think about changing this for the new Intel Macs that are
+rolling out...
+
+If you are using unix then first edit the config file in the base directory of
+the distribution, enabling Altivec or SSE with the USE_ALTIVEC or USE_SSE
+variables, and editing the optimisation flags passed to the C++ compiler if
+necessary. Then make can be used to build the library, and make install (from
+the superuser account) can be used to install (into /usr/local by default).
+
+REPORTING BUGS OR FEATURE REQUESTS
+----------------------------------
+
+Feedback can be sent to Simon Brown (the developer) at [email protected]
+
+New releases are announced on the squish library homepage at
+http://sjbrown.co.uk/?code=squish
+

+ 1 - 2
Engine/Resource/Squish.cpp → ThirdParty/Squish/squish.cpp

@@ -25,8 +25,7 @@
 
 // Modified by Lasse Öörni for Urho3D to include only DXT decompression
 
-#include "Precompiled.h"
-#include "Squish.h"
+#include <squish.h>
 
 namespace squish {
 

+ 4 - 1
Engine/Resource/Squish.h → ThirdParty/Squish/squish.h

@@ -25,7 +25,8 @@
 
 // Modified by Lasse Öörni for Urho3D to include only DXT decompression
 
-#pragma once
+#ifndef SQUISH_H
+#define SQUISH_H
 
 //! All squish API functions live in this namespace.
 namespace squish {
@@ -113,3 +114,5 @@ void DecompressImage( u8* rgba, int width, int height, void const* blocks, int f
 
 } // namespace squish
 
+#endif // ndef SQUISH_H
+