From 2ad2e945844eb8306552b973a155202d34d907b9 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Thu, 30 Aug 2012 13:28:28 -0400 Subject: [PATCH] Move type defines into core library... all modules should have a standard set of types. --- BPTCEncoder/CMakeLists.txt | 3 ++- BPTCEncoder/src/BC7CompressionModeSIMD.h | 2 +- BPTCEncoder/src/BC7Compressor.cpp | 2 +- BPTCEncoder/src/BC7CompressorSIMD.cpp | 2 +- BPTCEncoder/src/RGBAEndpoints.cpp | 1 - BPTCEncoder/src/RGBAEndpoints.h | 3 ++- BPTCEncoder/src/RGBAEndpointsSIMD.h | 3 ++- .../include/TexCompTypes.h | 22 +++++++++++++++---- Core/src/StopWatch.h | 10 ++++----- 9 files changed, 32 insertions(+), 16 deletions(-) rename BPTCEncoder/src/BC7IntTypes.h => Core/include/TexCompTypes.h (62%) diff --git a/BPTCEncoder/CMakeLists.txt b/BPTCEncoder/CMakeLists.txt index 06fc889..1e3be77 100644 --- a/BPTCEncoder/CMakeLists.txt +++ b/BPTCEncoder/CMakeLists.txt @@ -1,3 +1,5 @@ +INCLUDE_DIRECTORIES(${TexC_SOURCE_DIR}/Core/include) + INCLUDE_DIRECTORIES(${TexC_SOURCE_DIR}/BPTCEncoder/include) INCLUDE_DIRECTORIES(${TexC_BINARY_DIR}/BPTCEncoder/include) @@ -107,7 +109,6 @@ CONFIGURE_FILE( SET( HEADERS src/BC7CompressionMode.h - src/BC7IntTypes.h src/BitStream.h src/RGBAEndpoints.h ) diff --git a/BPTCEncoder/src/BC7CompressionModeSIMD.h b/BPTCEncoder/src/BC7CompressionModeSIMD.h index 66b9d6f..a2c9fed 100755 --- a/BPTCEncoder/src/BC7CompressionModeSIMD.h +++ b/BPTCEncoder/src/BC7CompressionModeSIMD.h @@ -18,7 +18,7 @@ #ifndef __BC7_COMPRESSIONMODE_H__ #define __BC7_COMPRESSIONMODE_H__ -#include "BC7IntTypes.h" +#include "TexCompTypes.h" #include "RGBAEndpointsSIMD.h" // Forward Declarations diff --git a/BPTCEncoder/src/BC7Compressor.cpp b/BPTCEncoder/src/BC7Compressor.cpp index 32ec122..f85b8ea 100755 --- a/BPTCEncoder/src/BC7Compressor.cpp +++ b/BPTCEncoder/src/BC7Compressor.cpp @@ -15,7 +15,7 @@ // //-------------------------------------------------------------------------------------- -#include "BC7IntTypes.h" +#include "TexCompTypes.h" #include "BC7Compressor.h" #include "BC7CompressionMode.h" #include "BCLookupTables.h" diff --git a/BPTCEncoder/src/BC7CompressorSIMD.cpp b/BPTCEncoder/src/BC7CompressorSIMD.cpp index c84784c..4b1ea0c 100755 --- a/BPTCEncoder/src/BC7CompressorSIMD.cpp +++ b/BPTCEncoder/src/BC7CompressorSIMD.cpp @@ -15,7 +15,7 @@ // //-------------------------------------------------------------------------------------- -#include "BC7IntTypes.h" +#include "TexCompTypes.h" #include "BC7Compressor.h" #include "BC7CompressionModeSIMD.h" #include "RGBAEndpointsSIMD.h" diff --git a/BPTCEncoder/src/RGBAEndpoints.cpp b/BPTCEncoder/src/RGBAEndpoints.cpp index c3fcf0b..b2b6ee3 100755 --- a/BPTCEncoder/src/RGBAEndpoints.cpp +++ b/BPTCEncoder/src/RGBAEndpoints.cpp @@ -16,7 +16,6 @@ //-------------------------------------------------------------------------------------- #include "BC7Config.h" -#include "BC7IntTypes.h" #include "RGBAEndpoints.h" #include "BC7Compressor.h" #include "BC7CompressionMode.h" diff --git a/BPTCEncoder/src/RGBAEndpoints.h b/BPTCEncoder/src/RGBAEndpoints.h index f84700d..253b2a5 100755 --- a/BPTCEncoder/src/RGBAEndpoints.h +++ b/BPTCEncoder/src/RGBAEndpoints.h @@ -18,7 +18,8 @@ #ifndef __RGBA_ENDPOINTS_H__ #define __RGBA_ENDPOINTS_H__ -#include "BC7IntTypes.h" +#include "TexCompTypes.h" + #include #include #include diff --git a/BPTCEncoder/src/RGBAEndpointsSIMD.h b/BPTCEncoder/src/RGBAEndpointsSIMD.h index b93f8a5..1b99ce3 100755 --- a/BPTCEncoder/src/RGBAEndpointsSIMD.h +++ b/BPTCEncoder/src/RGBAEndpointsSIMD.h @@ -18,7 +18,8 @@ #ifndef __RGBA_SIMD_ENDPOINTS_H__ #define __RGBA_SIMD_ENDPOINTS_H__ -#include "BC7IntTypes.h" +#include "TexCompTypes.h" + #include #include #include diff --git a/BPTCEncoder/src/BC7IntTypes.h b/Core/include/TexCompTypes.h similarity index 62% rename from BPTCEncoder/src/BC7IntTypes.h rename to Core/include/TexCompTypes.h index 3f32c10..7e9843b 100644 --- a/BPTCEncoder/src/BC7IntTypes.h +++ b/Core/include/TexCompTypes.h @@ -1,4 +1,3 @@ - // Copyright 2012 (c) Pavel Krajcevski // BC7IntTypes.h @@ -6,9 +5,12 @@ // on various platforms. // !FIXME! Still needs to be tested on Windows platforms. +#ifndef _TEX_COMP_TYPES_H_ +#define _TEX_COMP_TYPES_H_ - +// Windows? #ifdef _MSC_VER + typedef __int16 int16; typedef __uint16 uint16; typedef __int32 int32; @@ -16,16 +18,28 @@ typedef __uint32 uint32; typedef __int8 int8; typedef __uint8 uint8; -#else +typedef __uint64 uint64; +typedef __int64 int64; + +typedef __int32_ptr int32_ptr; + +// If not, assume GCC, or at least standard defines... +#else #include typedef int8_t int8; typedef int16_t int16; typedef int32_t int32; +typedef int64_t int64; typedef uint8_t uint8; typedef uint16_t uint16; typedef uint32_t uint32; +typedef uint64_t uint64; -#endif +typedef uintptr_t int32_ptr; + +#endif // _MSC_VER + +#endif // _TEX_COMP_TYPES_H_ diff --git a/Core/src/StopWatch.h b/Core/src/StopWatch.h index 76573de..ceba41c 100755 --- a/Core/src/StopWatch.h +++ b/Core/src/StopWatch.h @@ -17,7 +17,7 @@ #pragma once -#include "Windows.h" +#include "TexCompTypes.h" // A simple stopwatch class using Windows' high-resolution performance counters. class StopWatch @@ -34,8 +34,8 @@ public: double TimeInMicroseconds() const; private: - LONGLONG frequency; - LONGLONG start; - LONGLONG stop; - DWORD_PTR affinityMask; + uint64 frequency; + uint64 start; + uint64 stop; + int32_ptr affinityMask; };