diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 61d766768..c83c2d16c 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -40,7 +40,6 @@ #include "scene/sceneRenderState.h" #include "scene/sceneObjectLightingPlugin.h" #include "T3D/fx/explosion.h" -#include "T3D/fx/particleEmitter.h" #include "T3D/fx/cameraFXMgr.h" #include "environment/waterBlock.h" #include "T3D/debris.h" diff --git a/Engine/source/T3D/shapeBase.h b/Engine/source/T3D/shapeBase.h index e3b18b196..2dd1d0070 100644 --- a/Engine/source/T3D/shapeBase.h +++ b/Engine/source/T3D/shapeBase.h @@ -63,14 +63,15 @@ #include "console/dynamicTypes.h" #endif +// Need full definition visible for SimObjectPtr +#include "T3D/fx/particleEmitter.h" + class GFXCubemap; class TSShapeInstance; class SceneRenderState; class TSThread; class GameConnection; struct CameraScopeQuery; -class ParticleEmitter; -class ParticleEmitterData; class ProjectileData; class ExplosionData; struct DebrisData; diff --git a/Engine/source/core/util/str.h b/Engine/source/core/util/str.h index a07a98b62..2f4fec552 100644 --- a/Engine/source/core/util/str.h +++ b/Engine/source/core/util/str.h @@ -293,11 +293,10 @@ private: // causes an ambiguous cast compile error. Making it private is simply // more insurance that it isn't used on different compilers. // NOTE: disable on GCC since it causes hyper casting to U32 on gcc. -#ifndef TORQUE_COMPILER_GCC +#if !defined(TORQUE_COMPILER_GCC) && !defined(__clang__) operator const bool() const { return false; } #endif - static void copy(StringChar *dst, const StringChar *src, U32 size); StringData *_string; diff --git a/Engine/source/gfx/D3D9/gfxD3D9Device.h b/Engine/source/gfx/D3D9/gfxD3D9Device.h index 3237315ad..c928b1a0d 100644 --- a/Engine/source/gfx/D3D9/gfxD3D9Device.h +++ b/Engine/source/gfx/D3D9/gfxD3D9Device.h @@ -76,7 +76,7 @@ inline void D3D9Assert( HRESULT hr, const char *info ) // Typedefs #define D3DX_FUNCTION(fn_name, fn_return, fn_args) \ - typedef fn_return (WINAPI *D3DXFNPTR##fn_name##)##fn_args##; + typedef fn_return (WINAPI *D3DXFNPTR##fn_name)fn_args; #include "gfx/D3D9/d3dx9Functions.h" #undef D3DX_FUNCTION diff --git a/Engine/source/gfx/D3D9/gfxD3D9EnumTranslate.h b/Engine/source/gfx/D3D9/gfxD3D9EnumTranslate.h index b0ec97eae..a8ccc0496 100644 --- a/Engine/source/gfx/D3D9/gfxD3D9EnumTranslate.h +++ b/Engine/source/gfx/D3D9/gfxD3D9EnumTranslate.h @@ -55,7 +55,7 @@ extern _D3DDECLTYPE GFXD3D9DeclType[GFXDeclType_COUNT]; #define GFXREVERSE_LOOKUP( tablearray, enumprefix, val ) \ for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ - if( (S32)tablearray##[i] == val ) \ + if( (S32)tablearray[i] == val ) \ { \ val = i; \ break; \ diff --git a/Engine/source/gfx/D3D9/pc/gfxD3D9EnumTranslate.pc.cpp b/Engine/source/gfx/D3D9/pc/gfxD3D9EnumTranslate.pc.cpp index 1126693d1..29063f4e4 100644 --- a/Engine/source/gfx/D3D9/pc/gfxD3D9EnumTranslate.pc.cpp +++ b/Engine/source/gfx/D3D9/pc/gfxD3D9EnumTranslate.pc.cpp @@ -47,13 +47,13 @@ _D3DDECLTYPE GFXD3D9DeclType[GFXDeclType_COUNT]; #define INIT_LOOKUPTABLE( tablearray, enumprefix, type ) \ for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ - tablearray##[i] = (##type##)GFX_UNINIT_VAL; + tablearray[i] = (type)GFX_UNINIT_VAL; #define VALIDATE_LOOKUPTABLE( tablearray, enumprefix ) \ for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ - if( (S32)tablearray##[i] == GFX_UNINIT_VAL ) \ + if( (S32)tablearray[i] == GFX_UNINIT_VAL ) \ Con::warnf( "GFXD3D9EnumTranslate: Unassigned value in " #tablearray ": %i", i ); \ - else if( (S32)tablearray##[i] == GFX_UNSUPPORTED_VAL ) \ + else if( (S32)tablearray[i] == GFX_UNSUPPORTED_VAL ) \ Con::warnf( "GFXD3D9EnumTranslate: Unsupported value in " #tablearray ": %i", i ); //------------------------------------------------------------------------------ diff --git a/Engine/source/gui/containers/guiRolloutCtrl.h b/Engine/source/gui/containers/guiRolloutCtrl.h index dc11ab3dc..3d48c49b9 100644 --- a/Engine/source/gui/containers/guiRolloutCtrl.h +++ b/Engine/source/gui/containers/guiRolloutCtrl.h @@ -118,6 +118,7 @@ class GuiRolloutCtrl : public GuiTickCtrl DECLARE_CALLBACK( void, onCollapsed, () ); /// @} + virtual void processTick(); public: @@ -152,7 +153,6 @@ class GuiRolloutCtrl : public GuiTickCtrl // Sizing Animation Functions void animateTo( S32 height ); - virtual void processTick(); void collapse() { animateTo( mHeader.extent.y ); } void expand() { animateTo( mExpanded.extent.y ); } diff --git a/Engine/source/gui/worldEditor/undoActions.h b/Engine/source/gui/worldEditor/undoActions.h index 66e8df5ef..48475647c 100644 --- a/Engine/source/gui/worldEditor/undoActions.h +++ b/Engine/source/gui/worldEditor/undoActions.h @@ -30,7 +30,9 @@ #include "console/simObjectMemento.h" #endif -class GuiInspectorField; +// Need full definition visible for SimObjectPtr +#include "gui/editor/inspector/field.h" + class GuiInspector; class MECreateUndoAction : public UndoAction diff --git a/Engine/source/platform/types.h b/Engine/source/platform/types.h index 6f44d1e96..96ceb12f0 100644 --- a/Engine/source/platform/types.h +++ b/Engine/source/platform/types.h @@ -54,7 +54,17 @@ struct EmptyType {}; ///< "Null" type used by templates ////////////////////////////////////////////////////////////////////////////////////////////////////////// typedef char UTF8; ///< Compiler independent 8 bit Unicode encoded character + +#if defined(_MSC_VER) && defined(__clang__) +// Clang's MSVC compatibility mode doesn't currently support /Zc:wchar_t-, +// which we rely on to avoid type conversion errors when calling system +// APIs when UTF16 is defined as unsigned short. So, just define UTF16 +// as wchar_t instead since it's always a 2 byte unsigned on windows anyway. +typedef wchar_t UTF16; +#else typedef unsigned short UTF16; ///< Compiler independent 16 bit Unicode encoded character +#endif + typedef unsigned int UTF32; ///< Compiler independent 32 bit Unicode encoded character typedef const char* StringTableEntry; diff --git a/Engine/source/platform/types.visualc.h b/Engine/source/platform/types.visualc.h index e383c1ea7..455f007b2 100644 --- a/Engine/source/platform/types.visualc.h +++ b/Engine/source/platform/types.visualc.h @@ -42,7 +42,7 @@ typedef unsigned _int64 U64; #if _MSC_VER < 1200 // No support for old compilers # error "VC: Minimum VisualC++ 6.0 or newer required" -#else _MSC_VER >= 1200 +#else // _MSC_VER >= 1200 # define TORQUE_COMPILER_STRING "VisualC++" #endif @@ -84,8 +84,10 @@ typedef unsigned _int64 U64; # define TORQUE_CPU_STRING "x86" # define TORQUE_CPU_X86 # define TORQUE_LITTLE_ENDIAN +#ifndef __clang__ // asm not yet supported with clang # define TORQUE_SUPPORTS_NASM # define TORQUE_SUPPORTS_VC_INLINE_X86_ASM +#endif #elif defined( TORQUE_OS_XENON ) # define TORQUE_CPU_STRING "ppc" # define TORQUE_CPU_PPC diff --git a/Engine/source/platformWin32/winDirectInput.cpp b/Engine/source/platformWin32/winDirectInput.cpp index e56f86265..2fd8084ef 100644 --- a/Engine/source/platformWin32/winDirectInput.cpp +++ b/Engine/source/platformWin32/winDirectInput.cpp @@ -450,7 +450,7 @@ int DInputManager::getXInputState(S32 controllerID, S32 property, bool current) switch(property) { #define CHECK_PROP_ANALOG(prop, stateTest) \ - case prop: (current) ? retVal = mXInputStateNew[controllerID].state.Gamepad.##stateTest : retVal = mXInputStateOld[controllerID].state.Gamepad.##stateTest; return retVal; + case prop: (current) ? retVal = mXInputStateNew[controllerID].state.Gamepad.stateTest : retVal = mXInputStateOld[controllerID].state.Gamepad.stateTest; return retVal; CHECK_PROP_ANALOG(XI_THUMBLX, sThumbLX) CHECK_PROP_ANALOG(XI_THUMBLY, sThumbLY) diff --git a/Engine/source/platformWin32/winFileio.cpp b/Engine/source/platformWin32/winFileio.cpp index 0aeab392d..2f0f81370 100644 --- a/Engine/source/platformWin32/winFileio.cpp +++ b/Engine/source/platformWin32/winFileio.cpp @@ -1411,9 +1411,9 @@ static bool recurseDumpDirectories(const char *basePath, const char *subPath, Ve if( ( subPath && ( dStrncmp( subPath, "", 1 ) != 0 ) )) { if( subTrail == '/' ) - dSprintf(search, search.size, "%s%s", subPath, fileName); + dSprintf(search, search.size, "%s%s", subPath, fileName.ptr); else - dSprintf(search, search.size, "%s/%s", subPath, fileName); + dSprintf(search, search.size, "%s/%s", subPath, fileName.ptr); char* child = search; if( currentDepth < recurseDepth || recurseDepth == -1 ) @@ -1427,7 +1427,7 @@ static bool recurseDumpDirectories(const char *basePath, const char *subPath, Ve child = fileName; else { - dSprintf(search, search.size, "/%s", fileName); + dSprintf(search, search.size, "/%s", fileName.ptr); child = search; } diff --git a/Engine/source/platformWin32/winMath.cpp b/Engine/source/platformWin32/winMath.cpp index fb7a73054..50e5fdbc6 100644 --- a/Engine/source/platformWin32/winMath.cpp +++ b/Engine/source/platformWin32/winMath.cpp @@ -79,7 +79,7 @@ ConsoleFunction( mathInit, void, 1, 10, "( ... )" properties |= CPU_PROP_SSE; continue; } - Con::printf("Error: MathInit(): ignoring unknown math extension '%s'", *argv); + Con::printf("Error: MathInit(): ignoring unknown math extension '%s'", argv->getStringValue()); } Math::init(properties); } diff --git a/Engine/source/scene/scenePolyhedralSpace.h b/Engine/source/scene/scenePolyhedralSpace.h index bafa998fb..154fd52e7 100644 --- a/Engine/source/scene/scenePolyhedralSpace.h +++ b/Engine/source/scene/scenePolyhedralSpace.h @@ -30,7 +30,7 @@ #ifndef _SCENEPOLYHEDRALOBJECT_H_ #include "scene/mixin/scenePolyhedralObject.h" #endif - +#include "scene/mixin/scenePolyhedralObject.impl.h" /// class ScenePolyhedralSpace : public ScenePolyhedralObject< SceneSpace > diff --git a/Engine/source/windowManager/win32/win32Window.cpp b/Engine/source/windowManager/win32/win32Window.cpp index d5d019738..9dac998f1 100644 --- a/Engine/source/windowManager/win32/win32Window.cpp +++ b/Engine/source/windowManager/win32/win32Window.cpp @@ -439,8 +439,8 @@ void Win32Window::centerWindow() // Get the monitor's extents. MONITORINFO monInfo; - dMemset(&monInfo, 0, sizeof MONITORINFO); - monInfo.cbSize = sizeof MONITORINFO; + dMemset(&monInfo, 0, sizeof(MONITORINFO)); + monInfo.cbSize = sizeof(MONITORINFO); GetMonitorInfo(hMon, &monInfo); // Calculate the offset to center the window in the working area @@ -502,8 +502,8 @@ bool Win32Window::setSize( const Point2I &newSize ) // Get the monitor's extents. MONITORINFO monInfo; - dMemset(&monInfo, 0, sizeof MONITORINFO); - monInfo.cbSize = sizeof MONITORINFO; + dMemset(&monInfo, 0, sizeof(MONITORINFO)); + monInfo.cbSize = sizeof(MONITORINFO); GetMonitorInfo(hMon, &monInfo); // Calculate the offset to center the window in the working area diff --git a/Engine/source/windowManager/win32/win32WindowMgr.cpp b/Engine/source/windowManager/win32/win32WindowMgr.cpp index bf1a9b77a..51beef6cc 100644 --- a/Engine/source/windowManager/win32/win32WindowMgr.cpp +++ b/Engine/source/windowManager/win32/win32WindowMgr.cpp @@ -502,8 +502,8 @@ void Win32WindowManager::lowerCurtain() // Get the monitor's extents. MONITORINFO monInfo; - dMemset(&monInfo, 0, sizeof MONITORINFO); - monInfo.cbSize = sizeof MONITORINFO; + dMemset(&monInfo, 0, sizeof(MONITORINFO)); + monInfo.cbSize = sizeof(MONITORINFO); GetMonitorInfo(hMon, &monInfo); diff --git a/Engine/source/windowManager/win32/winDispatch.cpp b/Engine/source/windowManager/win32/winDispatch.cpp index 400e918df..908c4fbde 100644 --- a/Engine/source/windowManager/win32/winDispatch.cpp +++ b/Engine/source/windowManager/win32/winDispatch.cpp @@ -137,14 +137,14 @@ static void _keyboardEvent(Win32Window* window,UINT message, WPARAM wParam, WPAR && window->getKeyboardTranslation() && !window->shouldNotTranslate( torqueMods, newVirtKey ) ) { - U16 chars[ 64 ]; + wchar_t chars[ 64 ]; dMemset( chars, 0, sizeof( chars ) ); S32 res = ToUnicode( keyCode, scanCode, keyboardState, chars, sizeof( chars ) / sizeof( chars[ 0 ] ), 0 ); // This should only happen on Window 9x/ME systems if( res == 0 ) - res = ToAscii( keyCode, scanCode, keyboardState, chars, 0 ); + res = ToAscii( keyCode, scanCode, keyboardState, (LPWORD)chars, 0 ); if( res >= 1 ) {