diff --git a/toonz/sources/CMakeLists.txt b/toonz/sources/CMakeLists.txt index e0ac08b..2e621d7 100644 --- a/toonz/sources/CMakeLists.txt +++ b/toonz/sources/CMakeLists.txt @@ -406,9 +406,6 @@ elseif(BUILD_ENV_APPLE) pkg_check_modules(MYPAINT_LIB REQUIRED libmypaint) elseif(BUILD_ENV_UNIXLIKE) if(BUILD_TARGET_WIN) - if(PLATFORM EQUAL 32) - set(QT_LIB ${SDKROOT}/quicktime/QT73SDK/Libraries/QTMLClient.lib) - endif() find_library(GL_LIB opengl32) find_library(GLU_LIB glu32) find_library(GLUT_LIB NAMES glut freeglut) @@ -611,7 +608,7 @@ if(BUILD_ENV_APPLE) add_subdirectory(mousedragfilter) endif() -if((PLATFORM EQUAL 32) AND (BUILD_TARGET_WIN OR BUILD_TARGET_APPLE)) +if((PLATFORM EQUAL 32) AND ((BUILD_TARGET_WIN AND BUILD_ENV_MSVC) OR BUILD_TARGET_APPLE)) add_subdirectory(t32bitsrv) endif() diff --git a/toonz/sources/common/tfx/ttzpimagefx.cpp b/toonz/sources/common/tfx/ttzpimagefx.cpp index 31d3f84..c2c0fdc 100644 --- a/toonz/sources/common/tfx/ttzpimagefx.cpp +++ b/toonz/sources/common/tfx/ttzpimagefx.cpp @@ -10,7 +10,7 @@ //********************************************************************************************** void parseIndexes(std::string indexes, std::vector &items) { -#ifdef _WIN32 +#ifdef _MSC_VER char seps[] = " ,;"; char *token; if (indexes == "all" || indexes == "All" || indexes == "ALL") @@ -38,7 +38,7 @@ void parseIndexes(std::string indexes, std::vector &items) { void insertIndexes(std::vector items, PaletteFilterFxRenderData *t) { -#ifdef _WIN32 +#ifdef _MSC_VER for (int i = 0; i < (int)items.size(); i++) { char *starttoken, *endtoken; char subseps[] = "-"; diff --git a/toonz/sources/common/tiio/movsettings.cpp b/toonz/sources/common/tiio/movsettings.cpp index e8cb9c2..4b095fb 100644 --- a/toonz/sources/common/tiio/movsettings.cpp +++ b/toonz/sources/common/tiio/movsettings.cpp @@ -7,7 +7,7 @@ #include "tproperty.h" #include "tiio.h" -#if !(defined(x64) || defined(__LP64__) || defined(LINUX)) +#if !defined(x64) && !defined(__LP64__) && !defined(LINUX) && !(defined(__GNUC__) && defined(_WIN32)) //******************************************************************************* // 32-bit version diff --git a/toonz/sources/common/trop/tblur.cpp b/toonz/sources/common/trop/tblur.cpp index d3a21c9..ff92e11 100644 --- a/toonz/sources/common/trop/tblur.cpp +++ b/toonz/sources/common/trop/tblur.cpp @@ -3,11 +3,17 @@ #include "traster.h" #include "trop.h" #include "tpixelgr.h" -#ifdef _WIN32 + +#if defined(_WIN32) && defined(x64) +#define USE_SSE2 +#endif + +#ifdef USE_SSE2 #include #include #endif + namespace { #ifdef _WIN32 @@ -223,7 +229,7 @@ inline void blur_code(PIXEL_SRC *row1, PIXEL_DST *row2, int length, float coeff, //------------------------------------------------------------------- -#ifdef _WIN32 +#ifdef USE_SSE2 //------------------------------------------------------------------- template @@ -556,7 +562,7 @@ void load_channel_col32(float *buffer, float *col, int lx, int ly, int x, template void do_filtering_chan(BlurPixel

*row1, T *row2, int length, float coeff, float coeffq, int brad, float diff, bool useSSE) { -#ifdef _WIN32 +#ifdef USE_SSE2 if (useSSE && T::maxChannelValue == 255) blur_code_SSE2(row1, row2, length, coeff, coeffq, brad, diff, 0.5); else @@ -744,7 +750,7 @@ void do_filtering_floatRgb(T *row1, BlurPixel

*row2, int length, float coeff, BLUR_CODE(0, unsigned char) */ -#ifdef _WIN32 +#ifdef USE_SSE2 if (useSSE) blur_code_SSE2(row1, row2, length, coeff, coeffq, brad, diff, 0); else diff --git a/toonz/sources/common/trop/toperators.cpp b/toonz/sources/common/trop/toperators.cpp index 2d73c8d..a1bb38b 100644 --- a/toonz/sources/common/trop/toperators.cpp +++ b/toonz/sources/common/trop/toperators.cpp @@ -4,9 +4,17 @@ #include "tpixel.h" #include "tpixelutils.h" -#ifdef _WIN32 +// calls to _mm_* functions disabled in code for now (marked as comment) +// so disable include +/* +#if defined(_WIN32) && defined(x64) + #define ENABLE_SSE2 +#endif + +#ifdef ENABLE_SSE2 #include // per SSE2 #endif + */ namespace { inline double luminance(TPixel32 *pix) { diff --git a/toonz/sources/common/trop/tover.cpp b/toonz/sources/common/trop/tover.cpp index 208919e..aae900f 100644 --- a/toonz/sources/common/trop/tover.cpp +++ b/toonz/sources/common/trop/tover.cpp @@ -7,7 +7,11 @@ #include "tropcm.h" #include "tpalette.h" -#ifdef _WIN32 +#if defined(_WIN32) && defined(x64) +#define USE_SSE2 +#endif + +#ifdef USE_SSE2 #include // per SSE2 #endif @@ -156,7 +160,7 @@ void do_overT2(TRasterPT rout, const TRasterPT &rup) { //----------------------------------------------------------------------------- -#ifdef _WIN32 +#ifdef USE_SSE2 void do_over_SSE2(TRaster32P rout, const TRaster32P &rup) { __m128i zeros = _mm_setzero_si128(); @@ -331,7 +335,7 @@ void TRop::over(const TRasterP &rout, const TRasterP &rup, const TPoint &pos) { // TRaster64P rout64 = rout, rin64 = rin; if (rout32 && rup32) { -#ifdef _WIN32 +#ifdef USE_SSE2 if (TSystem::getCPUExtensions() & TSystem::CpuSupportsSse2) do_over_SSE2(rout32, rup32); else diff --git a/toonz/sources/common/trop/tresample.cpp b/toonz/sources/common/trop/tresample.cpp index b1fc6f3..d6b588d 100644 --- a/toonz/sources/common/trop/tresample.cpp +++ b/toonz/sources/common/trop/tresample.cpp @@ -18,7 +18,11 @@ using namespace TConsts; -#ifdef _WIN32 +#if defined(_WIN32) && defined(x64) +#define USE_SSE2 +#endif + +#ifdef USE_SSE2 #include // per SSE2 #endif @@ -1345,7 +1349,7 @@ void resample_main_rgbm(TRasterPT rout, const TRasterPT &rin, //--------------------------------------------------------------------------- -#ifdef _WIN32 +#ifdef USE_SSE2 namespace { @@ -2563,7 +2567,7 @@ void rop_resample_rgbm(TRasterPT rout, const TRasterPT &rin, } } -#ifdef _WIN32 +#ifdef USE_SSE2 if ((TSystem::getCPUExtensions() & TSystem::CpuSupportsSse2) && T::maxChannelValue == 255) resample_main_rgbm_SSE2(rout, rin, aff_xy2uv, aff0_uv2fg, min_pix_ref_u, @@ -3205,7 +3209,7 @@ void do_resample(TRasterCM32P rout, const TRasterCM32P &rin, //----------------------------------------------------------------------------- -#ifdef _WIN32 +#ifdef USE_SSE2 template void resample_main_cm32_rgbm_SSE2(TRasterPT rout, const TRasterCM32P &rin, const TAffine &aff_xy2uv, @@ -4593,7 +4597,7 @@ void rop_resample_rgbm_2(TRasterPT rout, const TRasterCM32P &rin, } } -#ifdef _MSC_VER +#if defined(USE_SSE2) && defined(_MSC_VER) TRaster32P rout32 = rout; if ((TSystem::getCPUExtensions() & TSystem::CpuSupportsSse2) && rout32) resample_main_cm32_rgbm_SSE2( diff --git a/toonz/sources/common/trop/tropcm.cpp b/toonz/sources/common/trop/tropcm.cpp index 706adba..777dd91 100644 --- a/toonz/sources/common/trop/tropcm.cpp +++ b/toonz/sources/common/trop/tropcm.cpp @@ -23,7 +23,7 @@ extern "C" { #include "toonz4.6/raster.h" } -#ifdef _WIN32 +#if defined(_WIN32) && defined(x64) #define USE_SSE2 #endif @@ -75,7 +75,7 @@ void TRop::convert(const TRaster32P &rasOut, const TRasterCM32P &rasIn, rasOut->lock(); rasIn->lock(); -#ifdef _WIN32 +#ifdef USE_SSE2 if (TSystem::getCPUExtensions() & TSystem::CpuSupportsSse2) { __m128i zeros = _mm_setzero_si128(); TPixelFloat *paints = diff --git a/toonz/sources/common/tvrender/tofflinegl.cpp b/toonz/sources/common/tvrender/tofflinegl.cpp index b4a3c83..8783c0a 100644 --- a/toonz/sources/common/tvrender/tofflinegl.cpp +++ b/toonz/sources/common/tvrender/tofflinegl.cpp @@ -240,7 +240,22 @@ public: { void *b = buffer; // Pointer To The Buffer -#ifdef x64 +#if !defined(x64) && defined(_MSC_VER) + __asm // Assembler Code To Follow + { + mov ecx, bufferSize // Counter Set To Dimensions Of Our Memory Block + mov ebx, b // Points ebx To Our Data (b) + label: // Label Used For Looping + mov al,[ebx+0] // Loads Value At ebx Into al + mov ah,[ebx+2] // Loads Value At ebx+2 Into ah + mov [ebx+2],al // Stores Value In al At ebx+2 + mov [ebx+0],ah // Stores Value In ah At ebx + + add ebx,4 // Moves Through The Data By 4 Bytes + dec ecx // Decreases Our Loop Counter + jnz label // If Not Zero Jump Back To Label + } +#else int size = bufferSize; UCHAR *pix = (UCHAR *)b; while (size > 0) { @@ -261,21 +276,6 @@ public: ebx+=4; size--; }*/ -#else - __asm // Assembler Code To Follow - { - mov ecx, bufferSize // Counter Set To Dimensions Of Our Memory Block - mov ebx, b // Points ebx To Our Data (b) - label: // Label Used For Looping - mov al,[ebx+0] // Loads Value At ebx Into al - mov ah,[ebx+2] // Loads Value At ebx+2 Into ah - mov [ebx+2],al // Stores Value In al At ebx+2 - mov [ebx+0],ah // Stores Value In ah At ebx - - add ebx,4 // Moves Through The Data By 4 Bytes - dec ecx // Decreases Our Loop Counter - jnz label // If Not Zero Jump Back To Label - } #endif } diff --git a/toonz/sources/image/3gp/tiio_3gp.h b/toonz/sources/image/3gp/tiio_3gp.h index 631dfbe..6d11800 100644 --- a/toonz/sources/image/3gp/tiio_3gp.h +++ b/toonz/sources/image/3gp/tiio_3gp.h @@ -3,7 +3,7 @@ #ifndef TIIO_3GP_H #define TIIO_3_H -#ifdef x64 +#if defined(x64) || (defined(__GNUC__) && defined(_WIN32)) #include "tiio_3gp_proxy.h" #else diff --git a/toonz/sources/image/3gp/tiio_3gpW.cpp b/toonz/sources/image/3gp/tiio_3gpW.cpp index 0a7472f..669bdec 100644 --- a/toonz/sources/image/3gp/tiio_3gpW.cpp +++ b/toonz/sources/image/3gp/tiio_3gpW.cpp @@ -1,6 +1,6 @@ -#ifndef x64 +#if !defined(x64) && !(defined(__GNUC__) && defined(_WIN32)) #include diff --git a/toonz/sources/image/3gp/tiio_3gp_proxy.cpp b/toonz/sources/image/3gp/tiio_3gp_proxy.cpp index 76c82a5..4fba3d8 100644 --- a/toonz/sources/image/3gp/tiio_3gp_proxy.cpp +++ b/toonz/sources/image/3gp/tiio_3gp_proxy.cpp @@ -1,6 +1,6 @@ -#if (defined(x64) || defined(__LP64__) || defined(LINUX)) +#if defined(x64) || defined(__LP64__) || defined(LINUX) || (defined(_WIN32) && defined(__GNUC__)) // Toonz includes #include "tfilepath.h" diff --git a/toonz/sources/image/3gp/tiio_3gp_proxy.h b/toonz/sources/image/3gp/tiio_3gp_proxy.h index db8a539..744769e 100644 --- a/toonz/sources/image/3gp/tiio_3gp_proxy.h +++ b/toonz/sources/image/3gp/tiio_3gp_proxy.h @@ -3,7 +3,7 @@ #ifndef TIIO_3GP_PROXY_H #define TIIO_3GP_PROXY_H -#if defined(x64) || defined(__LP64__) || defined(LINUX) +#if defined(x64) || defined(__LP64__) || defined(LINUX) || (defined(_WIN32) && defined(__GNUC__)) // Qt includes #include diff --git a/toonz/sources/image/mov/tiio_mov.h b/toonz/sources/image/mov/tiio_mov.h index 2e58cd8..37990f6 100644 --- a/toonz/sources/image/mov/tiio_mov.h +++ b/toonz/sources/image/mov/tiio_mov.h @@ -3,7 +3,7 @@ #ifndef TIIO_MOV_H #define TIIO_MOV_H -#ifdef x64 +#if defined(x64) || (defined(__GNUC__) && defined(_WIN32)) #include "tiio_mov_proxy.h" #else diff --git a/toonz/sources/image/mov/tiio_movW.cpp b/toonz/sources/image/mov/tiio_movW.cpp index 0b07b7c..f026920 100644 --- a/toonz/sources/image/mov/tiio_movW.cpp +++ b/toonz/sources/image/mov/tiio_movW.cpp @@ -1,6 +1,6 @@ -#ifndef x64 +#if !defined(x64) && !(defined(__GNUC__) && defined(_WIN32)) #include "texception.h" #include "tsound.h" diff --git a/toonz/sources/image/mov/tiio_mov_proxy.cpp b/toonz/sources/image/mov/tiio_mov_proxy.cpp index f8fa95f..816171d 100644 --- a/toonz/sources/image/mov/tiio_mov_proxy.cpp +++ b/toonz/sources/image/mov/tiio_mov_proxy.cpp @@ -1,6 +1,6 @@ -#if (defined(x64) || defined(__LP64__) || defined(LINUX)) +#if defined(x64) || defined(__LP64__) || defined(LINUX) || (defined(_WIN32) && defined(__GNUC__)) // Toonz includes #include "tfilepath.h" diff --git a/toonz/sources/image/mov/tiio_mov_proxy.h b/toonz/sources/image/mov/tiio_mov_proxy.h index 386c79d..68d0c88 100644 --- a/toonz/sources/image/mov/tiio_mov_proxy.h +++ b/toonz/sources/image/mov/tiio_mov_proxy.h @@ -3,7 +3,7 @@ #ifndef TIIO_MOV_PROXY_H #define TIIO_MOV_PROXY_H -#if defined(x64) || defined(__LP64__) || defined(LINUX) +#if defined(x64) || defined(__LP64__) || defined(LINUX) || (defined(_WIN32) && defined(__GNUC__)) // Qt includes #include diff --git a/toonz/sources/image/tiio.cpp b/toonz/sources/image/tiio.cpp index dfbd74d..4433ba5 100644 --- a/toonz/sources/image/tiio.cpp +++ b/toonz/sources/image/tiio.cpp @@ -20,7 +20,7 @@ // Platform-specific includes #if defined(_WIN32) -#ifndef x64 +#if !defined(x64) && !defined(__GNUC__) #define list QuickTime_list #define map QuickTime_map @@ -169,7 +169,7 @@ void initImageIo(bool lightVersion) { new Tiio::SpriteWriterProperties()); // ffmpeg -#if !defined(_WIN32) || defined(x64) +#if !defined(_WIN32) || defined(x64) || (defined(_WIN32) && defined(__GNUC__)) if (Ffmpeg::checkFfmpeg()) { bool ffprobe = Ffmpeg::checkFfprobe(); if (Ffmpeg::checkFormat("webm")) { diff --git a/toonz/sources/include/movsettings.h b/toonz/sources/include/movsettings.h index 591d538..a152d18 100644 --- a/toonz/sources/include/movsettings.h +++ b/toonz/sources/include/movsettings.h @@ -13,7 +13,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#if !(defined(x64) || defined(__LP64__) || defined(LINUX)) +#if !defined(x64) && !defined(__LP64__) && !defined(LINUX) && !(defined(__GNUC__) && defined(_WIN32)) #ifdef _WIN32 diff --git a/toonz/sources/tcomposer/tcomposer.cpp b/toonz/sources/tcomposer/tcomposer.cpp index e3b1d39..08b146b 100644 --- a/toonz/sources/tcomposer/tcomposer.cpp +++ b/toonz/sources/tcomposer/tcomposer.cpp @@ -74,6 +74,14 @@ #include #include + +#ifdef _WIN32 +#ifndef x64 +#include +#endif +#endif + + //================================================================================== using namespace std; diff --git a/toonz/sources/toonz/main.cpp b/toonz/sources/toonz/main.cpp index 0b1a787..27b1088 100644 --- a/toonz/sources/toonz/main.cpp +++ b/toonz/sources/toonz/main.cpp @@ -85,6 +85,9 @@ #include #ifdef _WIN32 +#ifndef x64 +#include +#endif #include #endif