diff --git a/BPTCEncoder/src/BC7Compressor.cpp b/BPTCEncoder/src/BC7Compressor.cpp index bec62f3..8456aab 100755 --- a/BPTCEncoder/src/BC7Compressor.cpp +++ b/BPTCEncoder/src/BC7Compressor.cpp @@ -605,7 +605,7 @@ static inline float frand() { uint32 fltAsInt; float flt; } fltUnion = { (127 << 23) | m }; - return fltUnion.flt - 1.0; + return fltUnion.flt - 1.0f; } bool BC7CompressionMode::AcceptNewEndpointError(double newError, double oldError, float temp) const { diff --git a/CLTool/CMakeLists.txt b/CLTool/CMakeLists.txt index 58166f0..d899e16 100644 --- a/CLTool/CMakeLists.txt +++ b/CLTool/CMakeLists.txt @@ -54,11 +54,11 @@ ADD_EXECUTABLE( ${SOURCES} ) -# Make sure that if we're using boost libraries for threading then we add this linker path. -# Personally, I believe this is a bug in CMAKE but I'm not exactly sure. -#IF( THREAD_API MATCHES "Boost" ) -# SET_TARGET_PROPERTIES(tc PROPERTIES LINK_FLAGS "/LIBPATH:\"${Boost_LIBRARY_DIRS}\"") -#ENDIF() +# Add flag for link time code generation. This was used to build the libpng libraries, so we should +# probably also include it for this project as well... +IF( MSVC ) + SET_TARGET_PROPERTIES(tc PROPERTIES LINK_FLAGS "/LTCG") +ENDIF() TARGET_LINK_LIBRARIES( tc BPTCEncoder ) TARGET_LINK_LIBRARIES( tc TexCompIO ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16b24e2..d57b796 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,9 +68,15 @@ IF(MSVC) SET(MSVC_LIB_DIR "${MSVC_INSTALL_PATH}/lib/${MSVC_ARCHITECTURE_STRING}/${MSVC_VERSION_STRING}") SET(CMAKE_LIBRARY_PATH "${CMAKE_LIBRARY_PATH};${MSVC_LIB_DIR}") + + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + ELSEIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fms-extensions") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fms-extensions") + ENDIF(MSVC) IF(TREAT_WARNINGS_AS_ERRORS) diff --git a/IO/include/FileStream.h b/IO/include/FileStream.h index c165b5a..58caef5 100644 --- a/IO/include/FileStream.h +++ b/IO/include/FileStream.h @@ -79,7 +79,7 @@ class FileStream { int32 Write(const uint8 *buf, uint32 bufSz); // Returns where in the filestream we are. Returns -1 on error. - int64 Tell(); + int32 Tell(); enum ESeekPosition { eSeekPosition_Beginning, diff --git a/IO/src/FileStreamWin32.cpp b/IO/src/FileStreamWin32.cpp index 176b519..d4ad399 100755 --- a/IO/src/FileStreamWin32.cpp +++ b/IO/src/FileStreamWin32.cpp @@ -197,7 +197,7 @@ int32 FileStream::Write(const uint8 *buf, uint32 bufSz) { return amtWritten; } -int64 FileStream::Tell() { +int32 FileStream::Tell() { HANDLE fp = m_Impl->GetFileHandle(); if(NULL == fp) { return -1; diff --git a/IO/src/ImageFile.cpp b/IO/src/ImageFile.cpp index 1f14771..e2ab30e 100644 --- a/IO/src/ImageFile.cpp +++ b/IO/src/ImageFile.cpp @@ -231,7 +231,7 @@ unsigned char *ImageFile::ReadFileData(const CHAR *filename) { // Figure out the filesize. fstr.Seek(0, FileStream::eSeekPosition_End); - uint64 fileSize = fstr.Tell(); + uint32 fileSize = fstr.Tell(); // Allocate data for file contents unsigned char *rawData = new unsigned char[fileSize]; diff --git a/IO/src/ImageWriterPNG.h b/IO/src/ImageWriterPNG.h index e9bfb85..7899817 100644 --- a/IO/src/ImageWriterPNG.h +++ b/IO/src/ImageWriterPNG.h @@ -55,7 +55,7 @@ class ImageWriterPNG : public ImageWriter { virtual bool WriteImage(); private: - uint64 m_StreamPosition; + uint32 m_StreamPosition; uint32 m_TotalBytesWritten; friend class PNGStreamWriter; };