diff --git a/source/Irrlicht/CSoftwareDriver2.h b/source/Irrlicht/CSoftwareDriver2.h index 557499b0..4c87bf3f 100644 --- a/source/Irrlicht/CSoftwareDriver2.h +++ b/source/Irrlicht/CSoftwareDriver2.h @@ -361,7 +361,7 @@ namespace video ETF_TEXGEN_MASK = ETF_TEXGEN_CAMERA_SPHERE | ETF_TEXGEN_CAMERA_REFLECTION | ETF_TEXGEN_WRAP }; size_t TransformationStack; // 0 .. 3D , 1 .. 2D - core::matrix4 Transformation[2][ETS_COUNT_BURNING]; + core::matrix4 ALIGN(16) Transformation[2][ETS_COUNT_BURNING]; size_t TransformationFlag[2][ETS_COUNT_BURNING]; // E_TRANSFORMATION_FLAG diff --git a/source/Irrlicht/IBurningShader.h b/source/Irrlicht/IBurningShader.h index 4991fe9b..748a9a40 100644 --- a/source/Irrlicht/IBurningShader.h +++ b/source/Irrlicht/IBurningShader.h @@ -376,8 +376,7 @@ namespace video tFixPoint AlphaRef; int RenderPass_ShaderIsTransparent; - u8 _unused_pack[4]; - sScanConvertData scan; + sScanConvertData ALIGN(16) scan; sScanLineData line; tVideoSample PrimitiveColor; //used if no color interpolation is defined diff --git a/source/Irrlicht/SoftwareDriver2_compile_config.h b/source/Irrlicht/SoftwareDriver2_compile_config.h index 70673b45..897049ac 100644 --- a/source/Irrlicht/SoftwareDriver2_compile_config.h +++ b/source/Irrlicht/SoftwareDriver2_compile_config.h @@ -306,4 +306,13 @@ namespace irr { //! Size of a static C-style array. #define array_size(_arr) ((sizeof(_arr)/sizeof(*_arr))) +//! Compiler Align +#if defined(_MSC_VER) +#define ALIGN(x) __declspec(align(x)) +#elif defined(__GNUC__) +#define ALIGN(x) __attribute__ ((aligned(x))) +#else +#define ALIGN(x) +#endif + #endif // __S_VIDEO_2_SOFTWARE_COMPILE_CONFIG_H_INCLUDED__