diff --git a/.gitignore b/.gitignore
index 542b906..bb6b2b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,8 @@ build/*
3rdparty/bgfx/3rdparty/dxsdk/**
3rdparty/bgfx/3rdparty/scintilla/**
+3rdparty/RuntimeCompiledCpp/Assets/**
+3rdparty/RuntimeCompiledCpp/Aurora**
+3rdparty/RuntimeCompiledCpp/External/**
+3rdparty/RuntimeCompiledCpp/Examples/SimpleTest/**
+
diff --git a/3rdparty/RuntimeCompiledCpp/CMakeLists.txt b/3rdparty/RuntimeCompiledCpp/CMakeLists.txt
new file mode 100644
index 0000000..0467b73
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/CMakeLists.txt
@@ -0,0 +1,169 @@
+cmake_minimum_required(VERSION 2.8)
+
+project( RuntimeCompiledCPlusPlus )
+#
+# Options
+#
+option(BUILD_EXAMPLES "Build example applications" ON)
+option(GLFW_SYSTEM "Use the operating system glfw library" OFF)
+
+find_package(OpenGL REQUIRED)
+
+if(UNIX AND NOT APPLE)
+ set(BUILD_TYPE SHARED)
+else()
+ set(BUILD_TYPE STATIC)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+endif()
+
+include(cmake/ProjectFiles.cmake)
+
+#
+# RuntimeCompiler
+#
+add_library(RuntimeCompiler ${BUILD_TYPE} ${RuntimeCompiler_SRCS})
+
+#
+# RuntimeObjectSystem
+#
+add_library(RuntimeObjectSystem ${BUILD_TYPE} ${RuntimeObjectSystem_SRCS})
+target_link_libraries(RuntimeObjectSystem RuntimeCompiler)
+if(UNIX)
+ target_link_libraries(RuntimeObjectSystem dl)
+endif()
+
+#
+# Make Install
+#
+install(DIRECTORY RuntimeObjectSystem/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/RuntimeObjectSystem
+ FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY RuntimeCompiler/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/RuntimeCompiler
+ FILES_MATCHING PATTERN "*.h")
+install(TARGETS RuntimeObjectSystem RuntimeCompiler
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/)
+
+if(BUILD_EXAMPLES)
+
+ #
+ # ConsoleExample
+ #
+
+ add_executable(ConsoleExample ${ConsoleExample_SRCS})
+ target_link_libraries(ConsoleExample RuntimeCompiler RuntimeObjectSystem)
+
+ #
+ # Renderer
+ #
+
+ add_library(Renderer ${BUILD_TYPE} ${Renderer_SRCS})
+ target_link_libraries(Renderer ${OPENGL_LIBRARIES} ${ASSIMP_LIBRARIES})
+
+ #
+ # Systems
+ #
+
+ add_library(Systems ${BUILD_TYPE} ${Systems_SRCS})
+
+ #
+ # Freetype WIN32
+ #
+
+ if(WIN32)
+ set(FREETYPE_INCLUDE_DIR_freetype2 ${CMAKE_SOURCE_DIR}/External/support/freetype/include/freetype)
+ set(FREETYPE_INCLUDE_DIR_ft2build ${CMAKE_SOURCE_DIR}/External/support/freetype/include)
+ if(${CMAKE_CL_64})
+ set(FREETYPE_LIBRARY ${CMAKE_SOURCE_DIR}/External/support/lib/freetype2410MTx64.lib)
+ else()
+ set(FREETYPE_LIBRARY ${CMAKE_SOURCE_DIR}/External/support/lib/freetype2410MT.lib)
+ endif()
+ elseif(APPLE)
+ set(FREETYPE_INCLUDE_DIR_freetype2 ${CMAKE_SOURCE_DIR}/External/support/freetype/include/freetype)
+ set(FREETYPE_INCLUDE_DIR_ft2build ${CMAKE_SOURCE_DIR}/External/support/freetype/include)
+ FIND_LIBRARY(ZLIB_LIBRARY libs)
+ MARK_AS_ADVANCED(ZLIB_LIBRARY)
+ set(FREETYPE_LIBRARY ${CMAKE_SOURCE_DIR}/External/support/lib/MacOSX/libfreetype.a ${ZLIB_LIBRARY})
+ endif()
+
+ #
+ # glfw
+ #
+ if(GLFW_SYSTEM)
+ set(GLFW_LIBRARIES glfw)
+ else()
+ include_directories(External/glfw/include)
+ if(WIN32)
+ set(GLFW_LIBRARIES glfw winmm)
+ add_subdirectory( ${CMAKE_SOURCE_DIR}/External/glfw/projects )
+ else()
+ add_library( glfw STATIC IMPORTED )
+ if(APPLE)
+ FIND_LIBRARY(COCOA_LIBRARY Cocoa)
+ FIND_LIBRARY(IOKIT_LIBRARY IOKit)
+ MARK_AS_ADVANCED(COCOA_LIBRARY IOKIT_LIBRARY)
+ set_target_properties( glfw PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/glfw/libOSX/libglfw.a )
+ set(GLFW_LIBRARIES glfw ${COCOA_LIBRARY} ${IOKIT_LIBRARY})
+ else()
+ set_target_properties( glfw PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/glfw/libX11/libglfw.a )
+ set(GLFW_LIBRARIES glfw X11 pthread)
+ endif()
+ endif()
+ endif()
+
+ #
+ # assimp
+ #
+
+ if(WIN32)
+ add_library( assimp STATIC IMPORTED )
+ set(ASSIMP_LIBRARIES assimp)
+ if(${CMAKE_CL_64})
+ set_target_properties( assimp PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/assimp/lib/assimp_release-dll_x64/assimp.lib )
+ set(ASSIMP_DLL ${CMAKE_SOURCE_DIR}/External/assimp/bin/assimp_release-dll_win32/Assimp64.dll)
+ else()
+ set_target_properties( assimp PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/assimp/lib/assimp_release-dll_win32/assimp.lib )
+ set(ASSIMP_DLL ${CMAKE_SOURCE_DIR}/External/assimp/bin/assimp_release-dll_win32/Assimp32.dll)
+ endif()
+ if(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
+ file(COPY ${ASSIMP_DLL} DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+ else()
+ foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
+ file(COPY ${ASSIMP_DLL} DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${OUTPUTCONFIG})
+ endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
+ endif()
+ endif()
+
+ #
+ # SimpleTest
+ #
+
+ add_subdirectory(External/libRocket/Build)
+ include_directories(
+ ${OPENGL_INCLUDE_DIR}
+ External/libRocket/Include
+ External/assimp/include
+ )
+ if(WIN32)
+ add_executable(SimpleTest WIN32 ${SimpleTest_SRCS})
+ else()
+ add_executable(SimpleTest ${SimpleTest_SRCS})
+ endif()
+ target_link_libraries(SimpleTest
+ RuntimeCompiler
+ RuntimeObjectSystem
+ Renderer
+ Systems
+ RocketCore
+ RocketControls
+ RocketDebugger
+ ${OPENGL_LIBRARIES}
+ ${GLFW_LIBRARIES}
+ ${ASSIMP_LIBRARIES}
+ )
+ if(MSVC)
+ set_target_properties(SimpleTest ConsoleExample PROPERTIES COMPILE_FLAGS "/FC")
+ else()
+ Set(CMAKE_CXX_FLAGS "-DCOMPILE_PATH=\"\\\"$(PWD)\\\"\"")
+ endif()
+endif()
diff --git a/3rdparty/RuntimeCompiledCpp/Common/.project b/3rdparty/RuntimeCompiledCpp/Common/.project
new file mode 100644
index 0000000..99b30ec
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Common/.project
@@ -0,0 +1,11 @@
+
+
+ Common
+
+
+
+
+
+
+
+
diff --git a/3rdparty/RuntimeCompiledCpp/Common/AUColor.inl b/3rdparty/RuntimeCompiledCpp/Common/AUColor.inl
new file mode 100644
index 0000000..ba57182
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Common/AUColor.inl
@@ -0,0 +1,55 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+#ifndef AUCOLOR_DEF
+#define AUCOLOR_DEF
+
+#include // for memcpy on linux
+
+class AUColor
+{
+public:
+ AUColor(float Red = 0.0f, float Green = 0.0f, float Blue = 0.0f, float Alpha = 0.0f)
+ {
+ m_Color.r = Red;
+ m_Color.g = Green;
+ m_Color.b = Blue;
+ m_Color.a = Alpha;
+ }
+
+ AUColor( const float rgba[4] )
+ {
+ memcpy( m_Color.rgba, rgba, sizeof( m_Color.rgba ) );
+ }
+
+ union ColorUnion
+ {
+ struct
+ {
+ float r;
+ float g;
+ float b;
+ float a;
+ };
+ float rgba[4];
+ } m_Color;
+
+};
+
+
+#endif //AUCOLOR_DEF
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Common/AUOrientation3D.inl b/3rdparty/RuntimeCompiledCpp/Common/AUOrientation3D.inl
new file mode 100644
index 0000000..6d90529
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Common/AUOrientation3D.inl
@@ -0,0 +1,184 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+#ifndef AUDORIENTATION3D_DEFINED
+#define AUDORIENTATION3D_DEFINED
+
+#include "AUVec3f.inl" //interface relies on class AUVec3f
+#include //for numerical limits
+
+
+class AUOrientation3D
+{
+public:
+ AUOrientation3D() :
+ m_v3dForwards( 1.0f, 0.0f, 0.0f ),
+ m_v3dUp( 0.0f, 1.0f, 0.0f ),
+ m_v3dRight( 0.0f, 0.0f, 1.0f )
+ {
+ }
+
+ AUOrientation3D( const AUVec3f& v3dForwards_, const AUVec3f& v3dUp_) :
+ m_v3dForwards( v3dForwards_ ),
+ m_v3dUp( v3dUp_ )
+ {
+ OrthoNormalise();
+ }
+
+ //Inspectors
+ const AUVec3f& GetForwards() const { return m_v3dForwards; }
+ const AUVec3f& GetUp() const { return m_v3dUp; }
+ const AUVec3f& GetRight() const { return m_v3dRight; }
+
+ void LoadglViewMatrix( float *const fglMatrix_ ) const
+ {
+ //note: OpenGL camera defaults to looking down -z, thus orient z with Forwards
+ fglMatrix_[0] = m_v3dRight.x;
+ fglMatrix_[1] = m_v3dUp.x;
+ fglMatrix_[2] = -m_v3dForwards.x;
+ fglMatrix_[3] = 0.0f;
+
+ fglMatrix_[4] = m_v3dRight.y;
+ fglMatrix_[5] = m_v3dUp.y;
+ fglMatrix_[6] = -m_v3dForwards.y;
+ fglMatrix_[7] = 0.0f;
+
+ fglMatrix_[8] = m_v3dRight.z;
+ fglMatrix_[9] = m_v3dUp.z;
+ fglMatrix_[10] = -m_v3dForwards.z;
+ fglMatrix_[11] = 0.0f;
+
+ fglMatrix_[12] = 0.0f;
+ fglMatrix_[13] = 0.0f;
+ fglMatrix_[14] = 0.0f;
+ fglMatrix_[15] = 1.0f;
+ }
+
+ void LoadglObjectMatrix( float *const fglMatrix_ ) const
+ {
+ //note: OpenGL camera defaults to looking down -z, thus orient z with Forwards
+ fglMatrix_[0] = m_v3dForwards.x;
+ fglMatrix_[1] = m_v3dForwards.y;
+ fglMatrix_[2] = m_v3dForwards.z;
+ fglMatrix_[3] = 0.0f;
+
+ fglMatrix_[4] = m_v3dUp.x;
+ fglMatrix_[5] = m_v3dUp.y;
+ fglMatrix_[6] = m_v3dUp.z;
+ fglMatrix_[7] = 0.0f;
+
+ fglMatrix_[8] = m_v3dRight.x;
+ fglMatrix_[9] = m_v3dRight.y;
+ fglMatrix_[10] = m_v3dRight.z;
+ fglMatrix_[11] = 0.0f;
+
+ fglMatrix_[12] = 0.0f;
+ fglMatrix_[13] = 0.0f;
+ fglMatrix_[14] = 0.0f;
+ fglMatrix_[15] = 1.0f;
+ }
+
+ //Mutators
+ AUVec3f& GetForwards() { return m_v3dForwards; }
+ AUVec3f& GetUp() { return m_v3dUp; }
+ AUVec3f& GetRight() { return m_v3dRight; }
+
+ void Set( const AUVec3f& v3dForwards_, const AUVec3f& v3dUp_)
+ {
+ m_v3dForwards = v3dForwards_;
+ m_v3dUp = v3dUp_;
+ OrthoNormalise();
+ }
+
+ void Rotate( const AUVec3f& v3dAxis_, float fTheta_)
+ {
+ float fCosTheta = static_cast( cos(fTheta_ ) );
+ float fSinTheta = static_cast( sin(fTheta_ ) );
+
+ AUVec3f v3dtemp = v3dAxis_.Cross( m_v3dForwards );
+ m_v3dForwards += fSinTheta * v3dtemp +
+ ( fCosTheta - 1.0f ) * v3dAxis_.Cross( v3dtemp );
+ v3dtemp = v3dAxis_.Cross( m_v3dUp );
+ m_v3dUp += fSinTheta * v3dtemp +
+ ( fCosTheta - 1.0f ) * v3dAxis_.Cross( v3dtemp );
+
+ //orthonormalise coordinate system
+ OrthoNormalise();
+ }
+
+protected:
+ void OrthoNormalise()
+ {
+ if( true == m_v3dForwards.Normalise() )
+ {
+ //have a normalised forwards vector
+ m_v3dRight = m_v3dForwards.Cross( m_v3dUp );
+ if( true == m_v3dRight.Normalise() )
+ {
+ //and now have a normalised right vector so safe to generate cross.
+ m_v3dUp = m_v3dRight.Cross( m_v3dForwards );
+ }
+ else
+ {
+ //have a forwards vector only, so generate an arbitary `up'.
+ m_v3dUp.SetX( m_v3dForwards.z );
+ m_v3dUp.SetY( m_v3dForwards.x );
+ m_v3dUp.SetZ( m_v3dForwards.y );
+
+ //will now get a 'guaranteed' right from this
+ m_v3dRight = m_v3dForwards.Cross( m_v3dUp );
+
+ //and so can generate a true up
+ m_v3dUp = m_v3dRight.Cross( m_v3dForwards );
+ }
+ }
+ else
+ {
+ //can't use forwards as our main vector, so try up
+ if( true == m_v3dUp.Normalise() )
+ {
+ //have a up vector only, so generate an arbitary `up'.
+ m_v3dForwards.SetX( m_v3dUp.z );
+ m_v3dForwards.SetY( m_v3dUp.x );
+ m_v3dForwards.SetZ( m_v3dUp.y );
+
+ //will now get a 'guaranteed' right from this
+ m_v3dRight = m_v3dForwards.Cross( m_v3dUp );
+
+ //and so can generate a true forwards
+ m_v3dForwards = m_v3dUp.Cross( m_v3dRight );
+ }
+ else
+ {
+ //have no appropriate starting vectors, so fake it.
+ m_v3dForwards.Set( 1.0f, 0.0f, 0.0f );
+ m_v3dUp.Set( 0.0f, 1.0f, 0.0f );
+ m_v3dRight.Set( 0.0f, 0.0f, 1.0f );
+ }
+
+ }
+ }
+
+private:
+ AUVec3f m_v3dForwards;
+ AUVec3f m_v3dUp;
+ AUVec3f m_v3dRight;
+
+};
+
+#endif //AUDORIENTATION3D_DEFINED
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Common/AUVec3f.inl b/3rdparty/RuntimeCompiledCpp/Common/AUVec3f.inl
new file mode 100644
index 0000000..b79e11f
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Common/AUVec3f.inl
@@ -0,0 +1,211 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+#ifndef AUVEC3F_DEFINED
+#define AUVEC3F_DEFINED
+
+#include
+#include
+
+
+class AUVec3f
+{
+public:
+ AUVec3f(float fX_ = 0.0f, float fY_ = 0.0f, float fZ_ = 0.0f) :
+ x( fX_ ),
+ y( fY_ ),
+ z( fZ_ )
+ {
+
+ }
+
+ AUVec3f( const AUVec3f& v3din_ ) :
+ x( v3din_.x ),
+ y( v3din_.y ),
+ z( v3din_.z )
+ {
+ }
+
+ //Mutators
+ void SetX( float fX_ ) { x = fX_; }
+ void SetY( float fY_ ) { y = fY_; }
+ void SetZ( float fZ_ ) { z = fZ_; }
+ void Set( float fX_, float fY_, float fZ_ )
+ {
+ x = fX_;
+ y = fY_;
+ z = fZ_;
+ }
+
+ float Dot( const AUVec3f& V_ ) const
+ {
+ return x * V_.x
+ + y * V_.y
+ + z * V_.z;
+ }
+
+ AUVec3f Cross( const AUVec3f& V_ ) const
+ {
+ AUVec3f newV( y * V_.z - z * V_.y,
+ z * V_.x - x * V_.z,
+ x * V_.y - y * V_.x );
+
+ return newV;
+ }
+
+ bool Normalise()
+ {
+ float fMagnitude = Magnitude();
+ if(fMagnitude != 0.0f)
+ {
+ x /= fMagnitude;
+ y /= fMagnitude;
+ z /= fMagnitude;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ AUVec3f GetNormalised() const
+ {
+ AUVec3f v = *this;
+ v.Normalise();
+ return v;
+ }
+
+ AUVec3f Lerp( const AUVec3f& V_, float t ) const
+ {
+ return (*this + (V_ - *this) * t);
+ }
+
+ bool IsInfinite() const
+ {
+ float inf = std::numeric_limits::infinity();
+ return ( x == inf || y == inf || z == inf );
+ }
+
+ void SetInfinite()
+ {
+ x = y = z = std::numeric_limits::infinity();
+ }
+
+ bool IsZero() const
+ {
+ return (x == 0.0f && y == 0.0f && z == 0.0f);
+ }
+
+ //Operators
+ AUVec3f& operator+=( const AUVec3f& V_ )
+ {
+ x += V_.x;
+ y += V_.y;
+ z += V_.z;
+ return *this;
+ }
+
+ AUVec3f& operator-=( const AUVec3f& V_ )
+ {
+ x -= V_.x;
+ y -= V_.y;
+ z -= V_.z;
+ return *this;
+ }
+
+ AUVec3f& operator*=( const float& fScalar_ )
+ {
+ x *= fScalar_;
+ y *= fScalar_;
+ z *= fScalar_;
+ return *this;
+ }
+
+ AUVec3f& operator/=( const float& fScalar_ )
+ {
+ x /= fScalar_;
+ y /= fScalar_;
+ z /= fScalar_;
+ return *this;
+ }
+
+ bool operator==( const AUVec3f& V_ ) const
+ {
+ return ( x == V_.x ) && ( y == V_.y ) && ( z == V_.z );
+ }
+
+ bool operator!=( const AUVec3f& V_ ) const
+ {
+ return !(*this == V_);
+ }
+
+ float Magnitude() const
+ {
+ return static_cast( sqrt( Dot( *this ) ) );
+ }
+
+ float MagnitudeSqr() const
+ {
+ return static_cast( Dot( *this ) );
+ }
+
+ AUVec3f operator+( const AUVec3f& V2_ ) const
+ {
+ AUVec3f newV_( *this );
+ return ( newV_ += V2_ );
+ }
+
+ AUVec3f operator-( const AUVec3f& V2_ ) const
+ {
+ AUVec3f newV_( *this );
+ return ( newV_ -= V2_ );
+ }
+
+ AUVec3f operator*( const float& fScalar_ ) const
+ {
+ AUVec3f newV_( *this );
+ return ( newV_ *= fScalar_ );
+ }
+
+
+ AUVec3f operator/( const float& fScalar_ )
+ {
+ AUVec3f newV_( *this );
+ return ( newV_ /= fScalar_ );
+ }
+
+ AUVec3f operator-()
+ {
+ AUVec3f newV_( -x, -y, -z );
+ return newV_;
+ }
+
+ float x;
+ float y;
+ float z;
+};
+
+
+//functions which do not have to be members
+inline AUVec3f operator*( const float& fScalar_, const AUVec3f& V1_ )
+{
+ return V1_ * fScalar_;
+}
+
+#endif //AUVEC3F_DEFINED
diff --git a/3rdparty/RuntimeCompiledCpp/Common/Common_2010.vcxproj b/3rdparty/RuntimeCompiledCpp/Common/Common_2010.vcxproj
new file mode 100644
index 0000000..881fec1
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Common/Common_2010.vcxproj
@@ -0,0 +1,141 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+
+
+
+
+
+
+
+
+ {2947A63C-A245-4853-B4CC-476354188AEE}
+ Win32Proj
+ Common
+
+
+
+ StaticLibrary
+ true
+ Unicode
+
+
+ StaticLibrary
+ true
+ Unicode
+
+
+ StaticLibrary
+ false
+ true
+ Unicode
+
+
+ StaticLibrary
+ false
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotUsing
+ Level3
+ Disabled
+ WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+
+
+
+
+
+
+ Windows
+ true
+
+
+
+
+ NotUsing
+ Level3
+ Disabled
+ WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+
+
+
+
+
+
+ Windows
+ true
+
+
+
+
+ Level3
+ Use
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+
+
+ Windows
+ true
+ true
+ true
+
+
+
+
+ Level3
+ Use
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+
+
+ Windows
+ true
+ true
+ true
+
+
+
+
+
+
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Common/Math.inl b/3rdparty/RuntimeCompiledCpp/Common/Math.inl
new file mode 100644
index 0000000..f132258
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Common/Math.inl
@@ -0,0 +1,46 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+#ifndef AUMATH_DEFINED
+#define AUMATH_DEFINED
+
+#define _USE_MATH_DEFINES
+#include
+
+/* Adds some helpful macros and exposes the non-standard constants available in math.h (may not be portable):
+ * M_E - e
+ * M_LOG2E - log2(e)
+ * M_LOG10E - log10(e)
+ * M_LN2 - ln(2)
+ * M_LN10 - ln(10)
+ * M_PI - pi
+ * M_PI_2 - pi/2
+ * M_PI_4 - pi/4
+ * M_1_PI - 1/pi
+ * M_2_PI - 2/pi
+ * M_2_SQRTPI - 2/sqrt(pi)
+ * M_SQRT2 - sqrt(2)
+ * M_SQRT1_2 - 1/sqrt(2)
+ */
+
+#define DEG2RAD(deg) ((deg)*((PI)/(180.0)))
+#define RAD2DEG(rad) ((rad)*((180.0)/(PI)))
+#define LERP(a, b, t) ((a) + (t) * ((b) - (a)))
+
+
+#endif // AUMATH_DEFINED
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.cproject b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.cproject
new file mode 100644
index 0000000..a56e650
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.cproject
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.project b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.project
new file mode 100644
index 0000000..8c515b8
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.project
@@ -0,0 +1,29 @@
+
+
+ ConsoleExample
+
+
+ RuntimeCompiler
+ RuntimeObjectSystem
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.settings/org.eclipse.cdt.codan.core.prefs b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.settings/org.eclipse.cdt.codan.core.prefs
new file mode 100644
index 0000000..77386c2
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.settings/org.eclipse.cdt.codan.core.prefs
@@ -0,0 +1,67 @@
+eclipse.preferences.version=1
+org.eclipse.cdt.codan.checkers.errnoreturn=Warning
+org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false}
+org.eclipse.cdt.codan.checkers.errreturnvalue=Error
+org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.checkers.noreturn=Error
+org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false}
+org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error
+org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error
+org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error
+org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false}
+org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning
+org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error
+org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning
+org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true}
+org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error
+org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error
+org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error
+org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error
+org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info
+org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error
+org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error
+org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false}
+org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false}
+org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true}
+org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true}
+org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")}
+org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.settings/org.eclipse.cdt.core.prefs b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.settings/org.eclipse.cdt.core.prefs
new file mode 100644
index 0000000..9fc0987
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/.settings/org.eclipse.cdt.core.prefs
@@ -0,0 +1,8 @@
+eclipse.preferences.version=1
+environment/project/cdt.managedbuild.config.gnu.exe.debug.1276108983/append=true
+environment/project/cdt.managedbuild.config.gnu.exe.debug.1276108983/appendContributed=true
+environment/project/cdt.managedbuild.config.gnu.exe.release.190462196/CWD/delimiter=\:
+environment/project/cdt.managedbuild.config.gnu.exe.release.190462196/CWD/operation=replace
+environment/project/cdt.managedbuild.config.gnu.exe.release.190462196/CWD/value=/media/psf/Home/Documents/Github/dougbinks/RuntimeCompiledCPlusPlus/Aurora/Examples/ConsoleExample/Release
+environment/project/cdt.managedbuild.config.gnu.exe.release.190462196/append=true
+environment/project/cdt.managedbuild.config.gnu.exe.release.190462196/appendContributed=true
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.cpp b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.cpp
new file mode 100644
index 0000000..87e8dbf
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.cpp
@@ -0,0 +1,45 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+// ConsoleExample.cpp : simple example using console command line
+
+
+#include "ConsoleGame.h"
+#include
+#ifdef _WIN32
+#include
+#endif
+
+
+int main(int argc, char* argv[])
+{
+ ConsoleGame game;
+ if( game.Init() )
+ {
+ while( game.MainLoop() )
+ {
+ }
+ }
+ else
+ {
+ std::cout << "\nFailed Initialisation, press a key to exit.\n";
+ _getche();
+ }
+
+ std::cout << "Exiting...\n";
+ return 0;
+}
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.vcxproj b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.vcxproj
new file mode 100644
index 0000000..cc384f6
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.vcxproj
@@ -0,0 +1,178 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ {B95544FF-96D5-4395-8E62-C02A512534D7}
+ Win32Proj
+ ConsoleExample
+
+
+
+ Application
+ true
+ Unicode
+
+
+ Application
+ true
+ Unicode
+
+
+ Application
+ false
+ true
+ Unicode
+
+
+ Application
+ false
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+ false
+
+
+ false
+
+
+
+ NotUsing
+ Level3
+ Disabled
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+
+
+
+
+ true
+
+
+ Console
+ true
+ RuntimeObjectSystem.lib;RuntimeCompiler_VS2010.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+ $(SolutionDir)$(Configuration);
+
+
+
+
+ NotUsing
+ Level3
+ Disabled
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+
+
+
+
+ true
+
+
+ Console
+ true
+ RuntimeObjectSystem.lib;RuntimeCompiler_VS2010.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+ $(SolutionDir)$(Platform)\$(Configuration)\
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+
+
+ true
+
+
+ Console
+ true
+ true
+ true
+ RuntimeObjectSystem.lib;RuntimeCompiler_VS2010.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+ $(SolutionDir)$(Configuration);
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+
+
+ true
+
+
+ Console
+ true
+ true
+ true
+ RuntimeObjectSystem.lib;RuntimeCompiler_VS2010.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+ $(SolutionDir)$(Platform)\$(Configuration)\
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.vcxproj.filters b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.vcxproj.filters
new file mode 100644
index 0000000..c94815f
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.vcxproj.filters
@@ -0,0 +1,27 @@
+
+
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+
+
+
+ Runtime Modifiable
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.xcodeproj/project.pbxproj b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..b4d8889
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.xcodeproj/project.pbxproj
@@ -0,0 +1,252 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 91977BBD16EB398A003FAE7A /* libRuntimeCompiler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 91977BBB16EB398A003FAE7A /* libRuntimeCompiler.a */; };
+ 91977BBE16EB398A003FAE7A /* libRuntimeObjectSystem.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 91977BBC16EB398A003FAE7A /* libRuntimeObjectSystem.a */; };
+ 91DE41E7161B1BB800BE0D16 /* ConsoleExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91DE41DF161B1BB800BE0D16 /* ConsoleExample.cpp */; };
+ 91DE41E8161B1BB800BE0D16 /* ConsoleGame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91DE41E0161B1BB800BE0D16 /* ConsoleGame.cpp */; };
+ 91DE41E9161B1BB800BE0D16 /* RuntimeObject01.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91DE41E4161B1BB800BE0D16 /* RuntimeObject01.cpp */; };
+ 91DE41EA161B1BB800BE0D16 /* StdioLogSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91DE41E5161B1BB800BE0D16 /* StdioLogSystem.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 91A171CC161B175E004B5954 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 12;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 91977BBB16EB398A003FAE7A /* libRuntimeCompiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libRuntimeCompiler.a; path = "../../../../../../../Library/Developer/Xcode/DerivedData/Aurora-amgiihqkoasuvzdugsovjupxbfdk/Build/Products/Debug/libRuntimeCompiler.a"; sourceTree = ""; };
+ 91977BBC16EB398A003FAE7A /* libRuntimeObjectSystem.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libRuntimeObjectSystem.a; path = "../../../../../../../Library/Developer/Xcode/DerivedData/Aurora-amgiihqkoasuvzdugsovjupxbfdk/Build/Products/Debug/libRuntimeObjectSystem.a"; sourceTree = ""; };
+ 91A171CE161B175E004B5954 /* ConsoleExample */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ConsoleExample; sourceTree = BUILT_PRODUCTS_DIR; };
+ 91DE41DF161B1BB800BE0D16 /* ConsoleExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConsoleExample.cpp; sourceTree = ""; };
+ 91DE41E0161B1BB800BE0D16 /* ConsoleGame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConsoleGame.cpp; sourceTree = ""; };
+ 91DE41E1161B1BB800BE0D16 /* ConsoleGame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleGame.h; sourceTree = ""; };
+ 91DE41E2161B1BB800BE0D16 /* InterfaceIds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InterfaceIds.h; sourceTree = ""; };
+ 91DE41E3161B1BB800BE0D16 /* IUpdateable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IUpdateable.h; sourceTree = ""; };
+ 91DE41E4161B1BB800BE0D16 /* RuntimeObject01.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeObject01.cpp; sourceTree = ""; };
+ 91DE41E5161B1BB800BE0D16 /* StdioLogSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StdioLogSystem.cpp; sourceTree = ""; };
+ 91DE41E6161B1BB800BE0D16 /* StdioLogSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StdioLogSystem.h; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 91A171CB161B175E004B5954 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 91977BBD16EB398A003FAE7A /* libRuntimeCompiler.a in Frameworks */,
+ 91977BBE16EB398A003FAE7A /* libRuntimeObjectSystem.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 91A171C3161B175E004B5954 = {
+ isa = PBXGroup;
+ children = (
+ 91977BBB16EB398A003FAE7A /* libRuntimeCompiler.a */,
+ 91977BBC16EB398A003FAE7A /* libRuntimeObjectSystem.a */,
+ 91DE41DF161B1BB800BE0D16 /* ConsoleExample.cpp */,
+ 91DE41E0161B1BB800BE0D16 /* ConsoleGame.cpp */,
+ 91DE41E1161B1BB800BE0D16 /* ConsoleGame.h */,
+ 91DE41E2161B1BB800BE0D16 /* InterfaceIds.h */,
+ 91DE41E3161B1BB800BE0D16 /* IUpdateable.h */,
+ 91DE41E4161B1BB800BE0D16 /* RuntimeObject01.cpp */,
+ 91DE41E5161B1BB800BE0D16 /* StdioLogSystem.cpp */,
+ 91DE41E6161B1BB800BE0D16 /* StdioLogSystem.h */,
+ 91A171CF161B175E004B5954 /* Products */,
+ );
+ sourceTree = "";
+ };
+ 91A171CF161B175E004B5954 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 91A171CE161B175E004B5954 /* ConsoleExample */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 91A171CD161B175E004B5954 /* ConsoleExample */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 91A171D8161B175E004B5954 /* Build configuration list for PBXNativeTarget "ConsoleExample" */;
+ buildPhases = (
+ 91A171CA161B175E004B5954 /* Sources */,
+ 91A171CB161B175E004B5954 /* Frameworks */,
+ 91A171CC161B175E004B5954 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = ConsoleExample;
+ productName = ConsoleExample;
+ productReference = 91A171CE161B175E004B5954 /* ConsoleExample */;
+ productType = "com.apple.product-type.tool";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 91A171C5161B175E004B5954 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0440;
+ ORGANIZATIONNAME = "Doug Binks";
+ };
+ buildConfigurationList = 91A171C8161B175E004B5954 /* Build configuration list for PBXProject "ConsoleExample" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 91A171C3161B175E004B5954;
+ productRefGroup = 91A171CF161B175E004B5954 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 91A171CD161B175E004B5954 /* ConsoleExample */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 91A171CA161B175E004B5954 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 91DE41E7161B1BB800BE0D16 /* ConsoleExample.cpp in Sources */,
+ 91DE41E8161B1BB800BE0D16 /* ConsoleGame.cpp in Sources */,
+ 91DE41E9161B1BB800BE0D16 /* RuntimeObject01.cpp in Sources */,
+ 91DE41EA161B1BB800BE0D16 /* StdioLogSystem.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 91A171D6161B175E004B5954 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ ../../External/boost,
+ ../External/boost,
+ );
+ LIBRARY_SEARCH_PATHS = "";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 91A171D7161B175E004B5954 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ ../../External/boost,
+ ../External/boost,
+ );
+ LIBRARY_SEARCH_PATHS = "";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ 91A171D9161B175E004B5954 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = ../../External/boost;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/../../External/boost/stage/libOSX\"",
+ "\"$(SRCROOT)/../../../../../../../Library/Developer/Xcode/DerivedData/Aurora-amgiihqkoasuvzdugsovjupxbfdk/Build/Products/Debug\"",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = "";
+ };
+ name = Debug;
+ };
+ 91A171DA161B175E004B5954 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = ../../External/boost;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/../../External/boost/stage/libOSX\"",
+ "\"$(SRCROOT)/../../../../../../../Library/Developer/Xcode/DerivedData/Aurora-amgiihqkoasuvzdugsovjupxbfdk/Build/Products/Debug\"",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = "";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 91A171C8161B175E004B5954 /* Build configuration list for PBXProject "ConsoleExample" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 91A171D6161B175E004B5954 /* Debug */,
+ 91A171D7161B175E004B5954 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 91A171D8161B175E004B5954 /* Build configuration list for PBXNativeTarget "ConsoleExample" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 91A171D9161B175E004B5954 /* Debug */,
+ 91A171DA161B175E004B5954 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 91A171C5161B175E004B5954 /* Project object */;
+}
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..e6be109
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleGame.cpp b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleGame.cpp
new file mode 100644
index 0000000..cac5c55
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleGame.cpp
@@ -0,0 +1,175 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#include "ConsoleGame.h"
+
+
+#include "../../RuntimeCompiler/AUArray.h"
+#include "../../RuntimeCompiler/BuildTool.h"
+#include "../../RuntimeCompiler/ICompilerLogger.h"
+#include "../../RuntimeCompiler/FileChangeNotifier.h"
+#include "../../RuntimeObjectSystem/IObjectFactorySystem.h"
+#include "../../RuntimeObjectSystem/ObjectFactorySystem/ObjectFactorySystem.h"
+#include "../../RuntimeObjectSystem/RuntimeObjectSystem.h"
+
+#include "StdioLogSystem.h"
+
+#include "../../RuntimeObjectSystem/IObject.h"
+#include "IUpdateable.h"
+#include "InterfaceIds.h"
+
+#include
+#ifdef WIN32
+#include
+#include
+#else
+#include
+int _getche()
+{
+ int ret = getchar();
+ return ret;
+}
+int _kbhit()
+{
+ std::cout << "This port needs a fix, CTRL-C to quit\n";
+ return 0;
+}
+
+int Sleep( int msecs )
+{
+ return usleep( msecs * 1000);
+}
+#endif
+#include
+#include
+#include
+#include
+#include
+
+// Remove windows.h define of GetObject which conflicts with EntitySystem GetObject
+#if defined _WINDOWS_ && defined GetObject
+#undef GetObject
+#endif
+using FileSystemUtils::Path;
+
+ConsoleGame::ConsoleGame()
+ : m_pCompilerLogger(0)
+ , m_pRuntimeObjectSystem(0)
+ , m_pUpdateable(0)
+{
+}
+
+ConsoleGame::~ConsoleGame()
+{
+ if( m_pRuntimeObjectSystem )
+ {
+ // clean temp object files
+ m_pRuntimeObjectSystem->CleanObjectFiles();
+ }
+
+ if( m_pRuntimeObjectSystem && m_pRuntimeObjectSystem->GetObjectFactorySystem() )
+ {
+ m_pRuntimeObjectSystem->GetObjectFactorySystem()->RemoveListener(this);
+
+ // delete object via correct interface
+ IObject* pObj = m_pRuntimeObjectSystem->GetObjectFactorySystem()->GetObject( m_ObjectId );
+ delete pObj;
+ }
+
+ delete m_pRuntimeObjectSystem;
+ delete m_pCompilerLogger;
+}
+
+
+bool ConsoleGame::Init()
+{
+ //Initialise the RuntimeObjectSystem
+ m_pRuntimeObjectSystem = new RuntimeObjectSystem;
+ m_pCompilerLogger = new StdioLogSystem();
+ if( !m_pRuntimeObjectSystem->Initialise(m_pCompilerLogger, 0) )
+ {
+ m_pRuntimeObjectSystem = 0;
+ return false;
+ }
+ m_pRuntimeObjectSystem->GetObjectFactorySystem()->AddListener(this);
+
+
+ // construct first object
+ IObjectConstructor* pCtor = m_pRuntimeObjectSystem->GetObjectFactorySystem()->GetConstructor( "RuntimeObject01" );
+ if( pCtor )
+ {
+ IObject* pObj = pCtor->Construct();
+ pObj->GetInterface( &m_pUpdateable );
+ if( 0 == m_pUpdateable )
+ {
+ delete pObj;
+ m_pCompilerLogger->LogError("Error - no updateable interface found\n");
+ return false;
+ }
+ m_ObjectId = pObj->GetObjectId();
+
+ }
+
+ return true;
+}
+
+void ConsoleGame::OnConstructorsAdded()
+{
+ // This could have resulted in a change of object pointer, so release old and get new one.
+ if( m_pUpdateable )
+ {
+ IObject* pObj = m_pRuntimeObjectSystem->GetObjectFactorySystem()->GetObject( m_ObjectId );
+ pObj->GetInterface( &m_pUpdateable );
+ if( 0 == m_pUpdateable )
+ {
+ delete pObj;
+ m_pCompilerLogger->LogError( "Error - no updateable interface found\n");
+ }
+ }
+}
+
+
+
+bool ConsoleGame::MainLoop()
+{
+ //check status of any compile
+ if( m_pRuntimeObjectSystem->GetIsCompiledComplete() )
+ {
+ // load module when compile complete
+ m_pRuntimeObjectSystem->LoadCompiledModule();
+ }
+
+ if( !m_pRuntimeObjectSystem->GetIsCompiling() )
+ {
+ static int numUpdates = 0;
+ std::cout << "\nMain Loop - press q to quit. Updates every second. Update: " << numUpdates++ << "\n";
+ if( _kbhit() )
+ {
+ int ret = _getche();
+ if( 'q' == ret )
+ {
+ return false;
+ }
+ }
+ const float deltaTime = 1.0f;
+ m_pRuntimeObjectSystem->GetFileChangeNotifier()->Update( deltaTime );
+ m_pUpdateable->Update( deltaTime );
+ Sleep(1000);
+ }
+
+ return true;
+}
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleGame.h b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleGame.h
new file mode 100644
index 0000000..432b74d
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/ConsoleGame.h
@@ -0,0 +1,64 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+
+#ifndef CONSOLEGAME_INCLUDED
+#define CONSOLEGAME_INCLUDED
+
+#include "../../RuntimeObjectSystem/IObjectFactorySystem.h"
+#include "../../RuntimeObjectSystem/ObjectInterface.h"
+#include "../../RuntimeCompiler/AUArray.h"
+
+#ifndef _WIN32
+int _getche();
+#endif
+
+
+struct IUpdateable;
+struct IRuntimeObjectSystem;
+
+class ConsoleGame : public IObjectFactoryListener
+{
+public:
+ ConsoleGame();
+ virtual ~ConsoleGame();
+
+ bool Init();
+ bool MainLoop();
+
+
+ // IObjectFactoryListener
+
+ virtual void OnConstructorsAdded();
+
+ // ~IObjectFactoryListener
+
+
+private:
+
+ // Runtime Systems
+ ICompilerLogger* m_pCompilerLogger;
+ IRuntimeObjectSystem* m_pRuntimeObjectSystem;
+
+ // Runtime object
+ IUpdateable* m_pUpdateable;
+ ObjectId m_ObjectId;
+
+};
+
+#endif // CONSOLEGAME_INCLUDED
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/IUpdateable.h b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/IUpdateable.h
new file mode 100644
index 0000000..e12e477
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/IUpdateable.h
@@ -0,0 +1,30 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+
+#ifndef IUPDATEABLE_INCLUDED
+#define IUPDATEABLE_INCLUDED
+
+#include "../../RuntimeObjectSystem/IObject.h"
+
+struct IUpdateable : public IObject
+{
+ virtual void Update( float deltaTime ) = 0;
+};
+
+#endif // IUPDATEABLE_INCLUDED
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/InterfaceIds.h b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/InterfaceIds.h
new file mode 100644
index 0000000..771e839
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/InterfaceIds.h
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// InterfaceId header file.
+//
+// Specifys interface ids for getting hold of interfaces
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+#ifndef INTERFACEIDS_INCLUDED
+#define INTERFACEIDS_INCLUDED
+
+#include "../../RuntimeObjectSystem/IObject.h"
+
+enum InterfaceIDEnumConsoleExample
+{
+ IID_IUPDATEABLE = IID_ENDInterfaceID,
+
+ IID_ENDInterfaceIDEnumConsoleExample
+};
+
+
+#endif //INTERFACEIDS_INCLUDED
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/RuntimeObject01.cpp b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/RuntimeObject01.cpp
new file mode 100644
index 0000000..7e602d2
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/RuntimeObject01.cpp
@@ -0,0 +1,18 @@
+#include "../../RuntimeObjectSystem/ObjectInterfacePerModule.h"
+
+#include "../../RuntimeObjectSystem/IObject.h"
+#include "IUpdateable.h"
+#include "InterfaceIds.h"
+#include
+
+
+class RuntimeObject01 : public TInterface
+{
+public:
+ virtual void Update( float deltaTime )
+ {
+ std::cout << "Runtime Object 01231 update called!\n";
+ }
+};
+
+REGISTERCLASS(RuntimeObject01);
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/StdioLogSystem.cpp b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/StdioLogSystem.cpp
new file mode 100644
index 0000000..b9001d2
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/StdioLogSystem.cpp
@@ -0,0 +1,62 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#include "StdioLogSystem.h"
+
+// Currently we create the file on first real output, and only close it on shutdown
+
+#include
+#include
+#include
+
+#ifdef _WIN32
+ #include "Windows.h"
+ #pragma warning( disable : 4996 4800 )
+#endif
+
+
+void StdioLogSystem::LogError(const char * format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ LogInternal(format, args);
+}
+
+void StdioLogSystem::LogWarning(const char * format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ LogInternal(format, args);
+}
+
+void StdioLogSystem::LogInfo(const char * format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ LogInternal(format, args);
+}
+void StdioLogSystem::LogInternal(const char * format, va_list args)
+{
+ int result = vsnprintf(m_buff, LOGSYSTEM_MAX_BUFFER-1, format, args);
+ // Make sure there's a limit to the amount of rubbish we can output
+ m_buff[LOGSYSTEM_MAX_BUFFER-1] = '\0';
+
+ std::cout << m_buff;
+#ifdef _WIN32
+ OutputDebugStringA( m_buff );
+#endif
+}
diff --git a/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/StdioLogSystem.h b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/StdioLogSystem.h
new file mode 100644
index 0000000..1de4138
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Examples/ConsoleExample/StdioLogSystem.h
@@ -0,0 +1,45 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+
+#ifndef STDIOLOGSYSTEM_INCLUDED
+#define STDIOLOGSYSTEM_INCLUDED
+
+#include "../../RuntimeCompiler/ICompilerLogger.h"
+
+#include
+#include
+
+// StdioLogSystem for compiler
+
+const size_t LOGSYSTEM_MAX_BUFFER = 4096;
+
+class StdioLogSystem : public ICompilerLogger
+{
+public:
+ virtual void LogError(const char * format, ...);
+ virtual void LogWarning(const char * format, ...);
+ virtual void LogInfo(const char * format, ...);
+
+protected:
+ void LogInternal(const char * format, va_list args);
+ char m_buff[LOGSYSTEM_MAX_BUFFER];
+};
+
+
+#endif //STDIOLOGSYSTEM_INCLUDED
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/.cproject b/3rdparty/RuntimeCompiledCpp/Renderer/.cproject
new file mode 100644
index 0000000..41d8619
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/.cproject
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/.project b/3rdparty/RuntimeCompiledCpp/Renderer/.project
new file mode 100644
index 0000000..f90c1bc
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/.project
@@ -0,0 +1,27 @@
+
+
+ Renderer
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/3rdparty/RuntimeCompiledCpp/Renderer/.settings/org.eclipse.cdt.managedbuilder.core.prefs
new file mode 100644
index 0000000..be844b5
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/.settings/org.eclipse.cdt.managedbuilder.core.prefs
@@ -0,0 +1,9 @@
+eclipse.preferences.version=1
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.lib.debug.608542581/CPATH/delimiter=\:
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.lib.debug.608542581/CPATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.lib.debug.608542581/CPLUS_INCLUDE_PATH/delimiter=\:
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.lib.debug.608542581/CPLUS_INCLUDE_PATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.lib.debug.608542581/C_INCLUDE_PATH/delimiter=\:
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.lib.debug.608542581/C_INCLUDE_PATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.lib.debug.608542581/append=true
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.lib.debug.608542581/appendContributed=true
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/AURenMesh.cpp b/3rdparty/RuntimeCompiledCpp/Renderer/AURenMesh.cpp
new file mode 100644
index 0000000..0954edd
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/AURenMesh.cpp
@@ -0,0 +1,438 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+
+#include "AURenMesh.h"
+
+
+#ifndef _WIN32
+ #define NO_ASSIMP //Currently not adding assimp support to other platforms
+#endif
+
+
+#include "../Common/AUVec3f.inl" //for cross product used in calculateing normals
+
+// Windows Requirements
+#ifdef _WIN32
+ #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+ #include
+#endif //_WIN32
+
+
+#ifdef __MACH__
+#include
+#else
+// OpenGL requirements
+#include
+#endif //__MACH__
+
+#ifndef NO_ASSIMP
+ #include
+ #include
+ #include
+#endif //NO_ASSIMP
+
+#ifndef _WIN32
+#include
+int _stricmp( const char* pS1, const char* pS2 )
+{
+ return strcasecmp( pS1, pS2 );
+}
+#endif
+
+#include
+#include
+
+AURenMesh::AURenMesh() :
+ m_pafVertexCoordinates( NULL ),
+ m_pafTextureCoordinates( NULL ),
+ m_pafNormals( NULL ),
+ m_pausTriangleIndices( NULL ),
+ m_uiNumVertices( 0 ),
+ m_uiNumTriangles( 0 )
+{
+}
+
+AURenMesh::~AURenMesh()
+{
+ Clear();
+}
+
+void AURenMesh::Clear()
+{
+ delete[] m_pafNormals;
+ delete[] m_pafVertexCoordinates;
+ delete[] m_pafTextureCoordinates;
+ delete[] m_pausTriangleIndices;
+}
+
+bool AURenMesh::LoadFromFile( const std::string& strFilename )
+{
+ // Safely delete any existing data before loading new mesh
+ Clear();
+
+ int index = (int)strFilename.size() - 3;
+ std::string extension = index >= 0 ? strFilename.substr(index, 3) : "";
+ if (!_stricmp(extension.c_str(), "aml"))
+ {
+ return LoadFromFileAML(strFilename);
+ }
+ else
+ {
+ return LoadFromFileImport(strFilename);
+ }
+}
+
+bool AURenMesh::SaveToFile( const std::string& strFilename )
+{
+ std::ofstream outFile;
+ outFile.open(strFilename.c_str(), std::ios::binary);
+
+ if( !outFile )
+ {
+ return false;
+ }
+
+ outFile << "AML Aurora File" << std::endl;
+ outFile << 1 << std::endl; // version
+ outFile << m_uiNumVertices << std::endl;
+ outFile << m_uiNumTriangles << std::endl;
+
+ outFile.write( reinterpret_cast( m_pafVertexCoordinates ), 3 * m_uiNumVertices * sizeof( float ) );
+ outFile.write( reinterpret_cast( m_pafTextureCoordinates ), 2 * m_uiNumVertices * sizeof( float ) );
+ outFile.write( reinterpret_cast( m_pafNormals ), 3 * m_uiNumVertices * sizeof( float ) );
+ outFile.write( reinterpret_cast( m_pausTriangleIndices ), 3 * m_uiNumTriangles * sizeof( unsigned short ) );
+
+ outFile.close();
+
+ return true;
+}
+
+bool AURenMesh::LoadFromFileAML( const std::string& strFilename_ )
+{
+ std::ifstream inFile;
+ inFile.open(strFilename_.c_str(), std::ios::binary);
+
+ if( !inFile )
+ {
+ return false;
+ }
+
+ inFile.ignore(10000,'\n'); //ignore first line
+
+ int iVersion;
+ inFile >> iVersion; //currently ignore version number
+
+ inFile >> m_uiNumVertices;
+
+ inFile >> m_uiNumTriangles;
+
+ //now discard end of line
+ inFile.ignore(10000,'\n');
+
+ m_pafVertexCoordinates = new float[ 3 * m_uiNumVertices ];
+ m_pafNormals = new float[ 3 * m_uiNumVertices ];
+ m_pafTextureCoordinates = new float[ 2 * m_uiNumVertices ];
+ m_pausTriangleIndices = new unsigned short[ 3 * m_uiNumTriangles ];
+
+ inFile.read( reinterpret_cast( m_pafVertexCoordinates ), 3 * m_uiNumVertices * sizeof( float ) );
+ inFile.read( reinterpret_cast( m_pafTextureCoordinates ), 2 * m_uiNumVertices * sizeof( float ) );
+ inFile.read( reinterpret_cast( m_pafNormals ), 3 * m_uiNumVertices * sizeof( float ) );
+ inFile.read( reinterpret_cast( m_pausTriangleIndices ), 3 * m_uiNumTriangles * sizeof( unsigned short ) );
+
+
+ return true;
+}
+
+bool AURenMesh::LoadFromFileImport( const std::string& strFilename )
+{
+#ifndef NO_ASSIMP
+ Assimp::Importer importer;
+
+ const aiScene* pScene = importer.ReadFile( strFilename, aiProcessPreset_TargetRealtime_Fast );
+
+ if (!pScene || pScene->mNumMeshes == 0)
+ {
+ return false;
+ }
+
+ ProcessScene(pScene);
+
+ return true;
+#else
+ assert( false );
+ return false;
+#endif
+}
+
+void AURenMesh::ProcessScene( const aiScene* pScene )
+{
+#ifndef NO_ASSIMP
+ // Calculate total number of verts and tris across all meshes in scene
+ m_uiNumVertices = 0;
+ m_uiNumTriangles = 0;
+ for (unsigned int i=0; imNumMeshes; ++i)
+ {
+ aiMesh* pMesh = pScene->mMeshes[i];
+ m_uiNumVertices += pMesh->mNumVertices;
+ m_uiNumTriangles += pMesh->mNumFaces;
+ }
+
+ // Allocate sufficent space for all data
+ m_pafVertexCoordinates = new float[ 3 * m_uiNumVertices ];
+ m_pafNormals = new float[ 3 * m_uiNumVertices ];
+ m_pafTextureCoordinates = new float[ 2 * m_uiNumVertices ];
+ m_pausTriangleIndices = new unsigned short[ 3 * m_uiNumTriangles ];
+
+ // Iterate through all meshes and load data
+ int vertIndex = 0;
+ int normalIndex = 0;
+ int texIndex = 0;
+ int triIndex = 0;
+ for (unsigned int i=0; imNumMeshes; ++i)
+ {
+ aiMesh* pMesh = pScene->mMeshes[i];
+
+ // Load Verts
+ for (unsigned int j=0; jmNumVertices; ++j)
+ {
+ const aiVector3D& vec = pMesh->mVertices[j];
+ m_pafVertexCoordinates[vertIndex] = vec.x;
+ m_pafVertexCoordinates[vertIndex+1] = vec.y;
+ m_pafVertexCoordinates[vertIndex+2] = vec.z;
+ vertIndex += 3;
+ }
+
+ // Load Normals
+ for (unsigned int j=0; jmNumVertices; ++j)
+ {
+ const aiVector3D& vec = pMesh->mNormals[j];
+ m_pafNormals[normalIndex] = vec.x;
+ m_pafNormals[normalIndex+1] = vec.y;
+ m_pafNormals[normalIndex+2] = vec.z;
+ normalIndex += 3;
+ }
+
+ // Load Tex Coords
+ if (pMesh->HasTextureCoords(0))
+ {
+ for (unsigned int j=0; jmNumVertices; ++j)
+ {
+ const aiVector3D& vec = pMesh->mTextureCoords[0][j];
+ m_pafTextureCoordinates[texIndex] = vec.x;
+ m_pafTextureCoordinates[texIndex+1] = vec.y;
+ texIndex += 2;
+ }
+ }
+
+
+ // Load Tris
+ for (unsigned int j=0; jmNumFaces; ++j)
+ {
+ const aiFace& tri = pMesh->mFaces[j];
+ m_pausTriangleIndices[triIndex] = tri.mIndices[0];
+ m_pausTriangleIndices[triIndex+1] = tri.mIndices[1];
+ m_pausTriangleIndices[triIndex+2] = tri.mIndices[2];
+ triIndex += 3;
+ }
+ }
+#endif
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Function: AURenMesh::AURenMesh
+//
+// Last Modified by: Douglas John Binks (DJB)
+//
+// Last Modified: 21 June 2000
+//
+// Purpose: Normalises the size and position of the object to be
+// centered around the origin and of the correct BCube extent.
+//
+// Inputs: fBCubeHalfWidth_ : float giving the half width of the
+// bounding cube.
+//
+// Outputs: None.
+//
+// Returns: None.
+//
+//////////////////////////////////////////////////////////////////////////////////////////
+void AURenMesh::NormaliseToBCubeHalfWidth( float fBCubeHalfWidth_ )
+{
+ //set up min and max variablse for each axis and use a real value from the
+ //array to initialise (as a `made up' value may be wrong unless we use
+ //floatmax for min etc.).
+ float fMinX = m_pafVertexCoordinates[0];
+ float fMaxX = m_pafVertexCoordinates[0];
+ float fMinY = m_pafVertexCoordinates[1];
+ float fMaxY = m_pafVertexCoordinates[1];
+ float fMinZ = m_pafVertexCoordinates[2];
+ float fMaxZ = m_pafVertexCoordinates[2];
+
+ //Go through array of vertices to find the real min and max
+ unsigned int uiCountCoords;
+ for( uiCountCoords = 0;
+ uiCountCoords < 3 * m_uiNumVertices;
+ uiCountCoords += 3 )
+ {
+ if( fMinX > m_pafVertexCoordinates[ uiCountCoords ] )
+ {
+ fMinX = m_pafVertexCoordinates[ uiCountCoords ];
+ }
+ else
+ {
+ if( fMaxX < m_pafVertexCoordinates[ uiCountCoords ] )
+ {
+ fMaxX = m_pafVertexCoordinates[ uiCountCoords ];
+ }
+ }
+
+ if( fMinY > m_pafVertexCoordinates[ uiCountCoords + 1 ] )
+ {
+ fMinY = m_pafVertexCoordinates[ uiCountCoords + 1 ];
+ }
+ else
+ {
+ if( fMaxY < m_pafVertexCoordinates[ uiCountCoords + 1 ] )
+ {
+ fMaxY = m_pafVertexCoordinates[ uiCountCoords + 1 ];
+ }
+ }
+
+ if( fMinZ > m_pafVertexCoordinates[ uiCountCoords + 2 ] )
+ {
+ fMinZ = m_pafVertexCoordinates[ uiCountCoords + 2 ];
+ }
+ else
+ {
+ if( fMaxZ < m_pafVertexCoordinates[ uiCountCoords + 2 ] )
+ {
+ fMaxZ = m_pafVertexCoordinates[ uiCountCoords + 2 ];
+ }
+ }
+ }
+
+ //calulate the current center
+ float fCenterX = ( fMaxX + fMinX )/2.0f;
+ float fCenterY = ( fMaxY + fMinY )/2.0f;
+ float fCenterZ = ( fMaxZ + fMinZ )/2.0f;
+
+ //calculate the largest distance^2 from the center
+ float fMaxDistance2 = 0.0f;
+ float fDistance2;
+ float fX2, fY2, fZ2;
+ for( uiCountCoords = 0;
+ uiCountCoords < 3 * m_uiNumVertices;
+ uiCountCoords += 3 )
+ {
+ fX2 = m_pafVertexCoordinates[ uiCountCoords ] - fCenterX;
+ fX2 *= fX2;
+ fY2 = m_pafVertexCoordinates[ uiCountCoords + 1 ] - fCenterY;
+ fY2 *= fY2;
+ fZ2 = m_pafVertexCoordinates[ uiCountCoords + 2 ] - fCenterZ;
+ fZ2 *= fZ2;
+ fDistance2 = fX2 + fY2 + fZ2;
+ if( fDistance2 > fMaxDistance2 )
+ {
+ fMaxDistance2 = fDistance2;
+ }
+ }
+
+ //calculate normalising coefficient such that Xnew = cf * Xold
+ float fCoefficient = fBCubeHalfWidth_ / sqrt( fMaxDistance2 );
+
+ //now do normalisation ( use seperate calcs for X,Y,Z so as to use possible
+ //parallel floating point units).
+ for( uiCountCoords = 0;
+ uiCountCoords < 3 * m_uiNumVertices;
+ uiCountCoords += 3 )
+ {
+ m_pafVertexCoordinates[ uiCountCoords ] =
+ fCoefficient * ( m_pafVertexCoordinates[ uiCountCoords ] - fCenterX );
+ m_pafVertexCoordinates[ uiCountCoords + 1 ] =
+ fCoefficient * ( m_pafVertexCoordinates[ uiCountCoords + 1 ] - fCenterY );
+ m_pafVertexCoordinates[ uiCountCoords + 2 ] =
+ fCoefficient * ( m_pafVertexCoordinates[ uiCountCoords + 2 ] - fCenterZ );
+ }
+
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Function: AURenMesh::Render
+//
+// Last Modified by: Douglas John Binks (DJB)
+//
+// Last Modified: 25 July 2000
+//
+// Purpose: Draws the mesh.
+//
+// Inputs: None.
+//
+// Outputs: None.
+//
+// Returns: None.
+//
+//////////////////////////////////////////////////////////////////////////////////////////
+void AURenMesh::Render(const AUColor* pCol ) const
+{
+ if( 0 == m_uiNumVertices )
+ {
+ return;
+ }
+
+ const GLfloat pafDiffuseColor[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ const GLfloat pafSpecularColor[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ const GLfloat fShininess = 40.0f;
+
+
+ if( 0 == pCol )
+ {
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, pafDiffuseColor);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pafDiffuseColor);
+ }
+ else
+ {
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, pCol->m_Color.rgba );
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pCol->m_Color.rgba);
+ }
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pafSpecularColor);
+ glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, fShininess);
+
+ const GLint iNumCoordinatesPerVertex = 3;
+ const GLsizei iStride = 0;
+
+ //set up vertex arrays
+ glEnableClientState( GL_VERTEX_ARRAY );
+ glEnableClientState( GL_NORMAL_ARRAY );
+ glVertexPointer( iNumCoordinatesPerVertex, GL_FLOAT, iStride,
+ (const GLvoid*)m_pafVertexCoordinates );
+ glNormalPointer( GL_FLOAT, iStride,
+ (const GLvoid*)m_pafNormals );
+ glEnableClientState( GL_TEXTURE_COORD_ARRAY );
+ glTexCoordPointer( 2, GL_FLOAT, iStride,
+ (const GLvoid*)m_pafTextureCoordinates );
+
+ //do actual drawing
+ glDrawElements( GL_TRIANGLES, 3 * m_uiNumTriangles, GL_UNSIGNED_SHORT, m_pausTriangleIndices );
+
+
+ //unset vertex arrays
+ glDisableClientState( GL_TEXTURE_COORD_ARRAY );
+ glDisableClientState( GL_VERTEX_ARRAY );
+ glDisableClientState( GL_NORMAL_ARRAY );
+
+}
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/AURenMesh.h b/3rdparty/RuntimeCompiledCpp/Renderer/AURenMesh.h
new file mode 100644
index 0000000..8971808
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/AURenMesh.h
@@ -0,0 +1,85 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+#ifndef AURENDMESH_DEF
+#define AURENDMESH_DEF
+
+#include
+#include "../Common/AUColor.inl"
+#include "IAURenderable.h"
+
+struct aiScene;
+
+class AURenMesh
+{
+public:
+ AURenMesh();
+ bool LoadFromFile( const std::string& strFilename );
+ bool SaveToFile( const std::string& strFilename ); // Saves as AML
+ virtual ~AURenMesh();
+
+ void NormaliseToBCubeHalfWidth( float fBCubeHalfWidth );
+ void Render( const AUColor* pCol = 0 ) const;
+
+protected:
+ bool LoadFromFileAML( const std::string& strFilename ); // For native AML format
+ bool LoadFromFileImport( const std::string& strFilename ); // Use AssImp library for other formats
+ void ProcessScene( const aiScene* pScene ); // Convert AssImp imported scene into internal data structures
+ void Clear();
+ float* m_pafVertexCoordinates;
+ float* m_pafTextureCoordinates;
+ float* m_pafNormals;
+ unsigned short* m_pausTriangleIndices;
+ unsigned int m_uiNumVertices;
+ unsigned int m_uiNumTriangles;
+
+};
+
+class AURenderableMesh : public IAURenderableMesh
+{
+public:
+ AURenderableMesh( AURenMesh* pMesh ) :
+ m_pMesh( pMesh ),
+ m_Color( 1.0f, 1.0f, 1.0f, 1.0f )
+ {
+ }
+
+ virtual const AUColor& GetColor() const
+ {
+ return m_Color;
+ }
+ virtual void SetColor( const AUColor& color )
+ {
+ m_Color = color;
+ }
+
+ virtual void Render() const
+ {
+ m_pMesh->Render( &m_Color );
+ }
+
+ AURenMesh* GetMesh()
+ {
+ return m_pMesh;
+ }
+private:
+ AURenMesh* m_pMesh;
+ AUColor m_Color;
+};
+
+#endif //AURENDMESH_DEF
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/AURenderContext.cpp b/3rdparty/RuntimeCompiledCpp/Renderer/AURenderContext.cpp
new file mode 100644
index 0000000..8ef3c55
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/AURenderContext.cpp
@@ -0,0 +1,82 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#include "AURenderContext.h"
+
+#include "IAURenderable.h"
+
+// Windows Requirements
+#ifdef _WIN32
+ #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+ #include
+#endif //_WIN32
+
+#ifdef __MACH__
+#include
+#else
+// OpenGL requirements
+#include
+#endif //__MACH__
+
+
+AURenderContext::AURenderContext()
+{
+}
+
+
+AURenderContext::~AURenderContext()
+{
+}
+
+AUDynArray g_entities;
+
+void AURenderContext::Render( IEntitySystem* pEntitySystem )
+{
+ //loop through setting matrices and calling render.
+ pEntitySystem->GetAll( g_entities );
+
+ for( size_t i = 0; i < g_entities.Size(); ++i )
+ {
+
+ IAUEntity* pEntity = pEntitySystem->Get( g_entities[ i ] );
+ IAURenderable* pRenderable = pEntity->GetRenderable();
+ if( pRenderable )
+ {
+ glPushMatrix();
+
+ glMatrixMode(GL_MODELVIEW);
+
+ // Translation
+ const AUVec3f& t = pEntity->GetPosition();
+ glTranslatef( t.x, t.y, t.z );
+
+ // Rotation
+ float fglMatrix[16];
+ pEntity->GetOrientation().LoadglObjectMatrix(fglMatrix);
+ glMultMatrixf(fglMatrix);
+
+ // Scale
+ glEnable(GL_NORMALIZE); // Needed so normals don't get wrecked by scaling - not sure how costly it is though
+ const AUVec3f& s = pEntity->GetScale();
+ glScalef( s.x, s.y, s.z );
+
+ pRenderable->Render();
+ glPopMatrix();
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/AURenderContext.h b/3rdparty/RuntimeCompiledCpp/Renderer/AURenderContext.h
new file mode 100644
index 0000000..1f83ce7
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/AURenderContext.h
@@ -0,0 +1,29 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+#include "../Systems/IEntitySystem.h"
+
+class AURenderContext
+{
+public:
+ AURenderContext();
+ ~AURenderContext();
+
+ void Render( IEntitySystem* pEntitySystem );
+};
+
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/IAURenderable.h b/3rdparty/RuntimeCompiledCpp/Renderer/IAURenderable.h
new file mode 100644
index 0000000..d751a2a
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/IAURenderable.h
@@ -0,0 +1,37 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+#ifndef IAURENDMESH_DEF
+#define IAURENDMESH_DEF
+
+#include "../Common/AUColor.inl"
+
+struct IAURenderable
+{
+ virtual ~IAURenderable() {}
+
+ virtual void Render() const = 0; //should not be publically exposed.
+};
+
+struct IAURenderableMesh : public IAURenderable
+{
+ virtual const AUColor& GetColor() const = 0;
+ virtual void SetColor( const AUColor& color ) = 0;
+};
+
+#endif //IAURENDMESH_DEF
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/Renderer.xcodeproj/project.pbxproj b/3rdparty/RuntimeCompiledCpp/Renderer/Renderer.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..12743d3
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/Renderer.xcodeproj/project.pbxproj
@@ -0,0 +1,218 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 910A9D8C1623026D0032E310 /* AURenderContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910A9D861623026D0032E310 /* AURenderContext.cpp */; };
+ 910A9D8D1623026D0032E310 /* AURenderContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 910A9D871623026D0032E310 /* AURenderContext.h */; };
+ 910A9D8E1623026D0032E310 /* AURenMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 910A9D881623026D0032E310 /* AURenMesh.cpp */; };
+ 910A9D8F1623026D0032E310 /* AURenMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 910A9D891623026D0032E310 /* AURenMesh.h */; };
+ 910A9D911623026D0032E310 /* IAURenderable.h in Headers */ = {isa = PBXBuildFile; fileRef = 910A9D8B1623026D0032E310 /* IAURenderable.h */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 910A9D7C162302540032E310 /* libRenderer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRenderer.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 910A9D861623026D0032E310 /* AURenderContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AURenderContext.cpp; sourceTree = ""; };
+ 910A9D871623026D0032E310 /* AURenderContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AURenderContext.h; sourceTree = ""; };
+ 910A9D881623026D0032E310 /* AURenMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AURenMesh.cpp; sourceTree = ""; };
+ 910A9D891623026D0032E310 /* AURenMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AURenMesh.h; sourceTree = ""; };
+ 910A9D8B1623026D0032E310 /* IAURenderable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IAURenderable.h; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 910A9D79162302540032E310 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 910A9D71162302540032E310 = {
+ isa = PBXGroup;
+ children = (
+ 910A9D861623026D0032E310 /* AURenderContext.cpp */,
+ 910A9D871623026D0032E310 /* AURenderContext.h */,
+ 910A9D881623026D0032E310 /* AURenMesh.cpp */,
+ 910A9D891623026D0032E310 /* AURenMesh.h */,
+ 910A9D8B1623026D0032E310 /* IAURenderable.h */,
+ 910A9D7D162302540032E310 /* Products */,
+ );
+ sourceTree = "";
+ };
+ 910A9D7D162302540032E310 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 910A9D7C162302540032E310 /* libRenderer.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 910A9D7A162302540032E310 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 910A9D8D1623026D0032E310 /* AURenderContext.h in Headers */,
+ 910A9D8F1623026D0032E310 /* AURenMesh.h in Headers */,
+ 910A9D911623026D0032E310 /* IAURenderable.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 910A9D7B162302540032E310 /* Renderer */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 910A9D80162302540032E310 /* Build configuration list for PBXNativeTarget "Renderer" */;
+ buildPhases = (
+ 910A9D78162302540032E310 /* Sources */,
+ 910A9D79162302540032E310 /* Frameworks */,
+ 910A9D7A162302540032E310 /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Renderer;
+ productName = Renderer;
+ productReference = 910A9D7C162302540032E310 /* libRenderer.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 910A9D73162302540032E310 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0440;
+ ORGANIZATIONNAME = "Doug Binks";
+ };
+ buildConfigurationList = 910A9D76162302540032E310 /* Build configuration list for PBXProject "Renderer" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 910A9D71162302540032E310;
+ productRefGroup = 910A9D7D162302540032E310 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 910A9D7B162302540032E310 /* Renderer */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 910A9D78162302540032E310 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 910A9D8C1623026D0032E310 /* AURenderContext.cpp in Sources */,
+ 910A9D8E1623026D0032E310 /* AURenMesh.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 910A9D7E162302540032E310 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 910A9D7F162302540032E310 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ 910A9D81162302540032E310 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ EXECUTABLE_PREFIX = lib;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = "";
+ };
+ name = Debug;
+ };
+ 910A9D82162302540032E310 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ EXECUTABLE_PREFIX = lib;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = "";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 910A9D76162302540032E310 /* Build configuration list for PBXProject "Renderer" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 910A9D7E162302540032E310 /* Debug */,
+ 910A9D7F162302540032E310 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 910A9D80162302540032E310 /* Build configuration list for PBXNativeTarget "Renderer" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 910A9D81162302540032E310 /* Debug */,
+ 910A9D82162302540032E310 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 910A9D73162302540032E310 /* Project object */;
+}
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/Renderer.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/3rdparty/RuntimeCompiledCpp/Renderer/Renderer.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..0596502
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/Renderer.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/3rdparty/RuntimeCompiledCpp/Renderer/Renderer_VS2010.vcxproj b/3rdparty/RuntimeCompiledCpp/Renderer/Renderer_VS2010.vcxproj
new file mode 100644
index 0000000..d8f47df
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/Renderer/Renderer_VS2010.vcxproj
@@ -0,0 +1,191 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+
+
+
+
+
+
+
+
+
+ {26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}
+ Win32Proj
+ Renderer
+
+
+
+ StaticLibrary
+ true
+ Unicode
+
+
+ StaticLibrary
+ true
+ Unicode
+
+
+ StaticLibrary
+ false
+ true
+ Unicode
+
+
+ StaticLibrary
+ false
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level3
+ Disabled
+ GLEW_STATIC ;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+ $(SolutionDir)\External\glew-1.6.0\include;$(SolutionDir)\External\libRocket\Include;$(SolutionDir)\External\assimp\include;$(SolutionDir)\External\Independant JPEG Group\jpeg-6b\;%(AdditionalIncludeDirectories)
+ false
+
+
+ Windows
+ true
+
+
+ opengl32.lib;glu32.lib;assimp.lib;
+ $(SolutionDir)\External\assimp\lib\assimp_release-dll_win32
+
+
+ xcopy /y "$(SolutionDir)\External\assimp\bin\assimp_release-dll_win32\*.dll" "$(OutDir)"
+
+
+ copy dlls for assimp
+
+
+
+
+
+
+ Level3
+ Disabled
+ GLEW_STATIC ;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+ $(SolutionDir)\External\glew-1.6.0\include;$(SolutionDir)\External\libRocket\Include;$(SolutionDir)\External\assimp\include;$(SolutionDir)\External\Independant JPEG Group\jpeg-6b\;%(AdditionalIncludeDirectories)
+ false
+
+
+ Windows
+ true
+
+
+ opengl32.lib;glu32.lib;assimp.lib;
+ $(SolutionDir)\External\assimp\lib\assimp_release-dll_x64
+
+
+ xcopy /y "$(SolutionDir)\External\assimp\bin\assimp_release-dll_win32\*.dll" "$(OutDir)"
+
+
+ copy dlls for assimp
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ GLEW_STATIC ;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+ $(SolutionDir)\External\glew-1.6.0\include;$(SolutionDir)\External\libRocket\Include;$(SolutionDir)\External\assimp\include;$(SolutionDir)\External\Independant JPEG Group\jpeg-6b\;%(AdditionalIncludeDirectories)
+ false
+
+
+ Windows
+ true
+ true
+ true
+
+
+ opengl32.lib;glu32.lib;assimp.lib
+ $(SolutionDir)\External\assimp\lib\assimp_release-dll_win32
+
+
+ xcopy /y "$(SolutionDir)\External\assimp\bin\assimp_release-dll_win32\*.dll" "$(OutDir)"
+
+
+ copy dlls for assimp
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ GLEW_STATIC ;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+ $(SolutionDir)\External\glew-1.6.0\include;$(SolutionDir)\External\libRocket\Include;$(SolutionDir)\External\assimp\include;$(SolutionDir)\External\Independant JPEG Group\jpeg-6b\;%(AdditionalIncludeDirectories)
+ false
+
+
+ Windows
+ true
+ true
+ true
+
+
+ opengl32.lib;glu32.lib;assimp.lib
+ $(SolutionDir)\External\assimp\lib\assimp_release-dll_x64
+
+
+ xcopy /y "$(SolutionDir)\External\assimp\bin\assimp_release-dll_win32\*.dll" "$(OutDir)"
+
+
+ copy dlls for assimp
+
+
+
+
+
+
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/.cproject b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/.cproject
new file mode 100644
index 0000000..06d44ad
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/.cproject
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/.project b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/.project
new file mode 100644
index 0000000..8164332
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/.project
@@ -0,0 +1,27 @@
+
+
+ RuntimeCompiler
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/AUArray.h b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/AUArray.h
new file mode 100644
index 0000000..873598d
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/AUArray.h
@@ -0,0 +1,93 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+#ifndef AUARRAY_DEFINED
+#define AUARRAY_DEFINED
+
+#include
+#include
+
+
+// Here we define a semi-virtualised wrapper for a vector-like object so that it can
+// be used to pass results across DLL boundaries including resizing without memory
+// manager problems.
+// Ideally it should not use std::vector as this may not work if one side was compiled
+// using debug and the other optimised.
+
+template class IAUDynArray
+{
+protected:
+ IAUDynArray() {}
+ ~IAUDynArray() {}
+
+public:
+ virtual void Resize(size_t size) = 0;
+
+ virtual void Add(const T& item) = 0;
+
+ size_t Size() const
+ {
+ return m_vec.size();
+ }
+
+ void Clear()
+ {
+ Resize(0);
+ }
+
+ T& operator[] (size_t i)
+ {
+ return m_vec[i];
+ }
+
+ const T& operator[] (size_t i) const
+ {
+ return m_vec[i];
+ }
+
+protected:
+ std::vector m_vec;
+};
+
+
+template class AUDynArray : public IAUDynArray
+{
+public:
+ AUDynArray(size_t size = 0)
+ {
+ this->m_vec.resize(size);
+ }
+
+ ~AUDynArray()
+ {
+ // Ensure this code is created, despite the templates
+ Resize(0);
+ }
+
+ void Resize(size_t size)
+ {
+ this->m_vec.resize(size);
+ }
+
+ void Add(const T& item)
+ {
+ this->m_vec.push_back(item);
+ }
+};
+
+#endif //AUARRAY_DEFINED
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/BuildTool.cpp b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/BuildTool.cpp
new file mode 100644
index 0000000..43569f7
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/BuildTool.cpp
@@ -0,0 +1,126 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#include "BuildTool.h"
+#include "Compiler.h"
+#include
+#include
+#include "ICompilerLogger.h"
+
+using namespace std;
+using namespace FileSystemUtils;
+
+BuildTool::BuildTool()
+{
+}
+
+
+BuildTool::~BuildTool()
+{
+}
+
+void BuildTool::Clean( const FileSystemUtils::Path& temporaryPath_ ) const
+{
+ // Remove any existing intermediate directory
+ FileSystemUtils::PathIterator pathIter( temporaryPath_ );
+ std::string obj_extension = m_Compiler.GetObjectFileExtension();
+ while( ++pathIter )
+ {
+ if( pathIter.GetPath().Extension() == obj_extension )
+ {
+ if( m_pLogger )
+ {
+ m_pLogger->LogInfo( "Deleting temp RCC++ obj file: %s\n", pathIter.GetPath().c_str() );
+ }
+ pathIter.GetPath().Remove();
+ }
+ }
+}
+
+
+void BuildTool::Initialise( ICompilerLogger * pLogger )
+{
+ m_pLogger = pLogger;
+ m_Compiler.Initialise(pLogger);
+}
+
+void BuildTool::BuildModule( const std::vector& buildFileList_,
+ const CompilerOptions& compilerOptions_,
+ std::vector linkLibraryList_,
+ const FileSystemUtils::Path& moduleName_ )
+{
+ // Initial version is very basic, simply compiles them.
+ Path objectFileExtension = m_Compiler.GetObjectFileExtension();
+ vector compileFileList; // List of files we pass to the compiler
+ compileFileList.reserve( buildFileList_.size() );
+ vector forcedCompileFileList; // List of files which must be compiled even if object file exists
+ vector nonForcedCompileFileList; // List of files which can be linked if already compiled
+
+ // Seperate into seperate file lists of force and non-forced,
+ // so we can ensure we don't have the same file in both
+ for( size_t i = 0; i < buildFileList_.size(); ++i )
+ {
+ Path buildFile = buildFileList_[i].filePath;
+ if( buildFileList_[i].forceCompile )
+ {
+ if( find( forcedCompileFileList.begin(), forcedCompileFileList.end(), buildFile ) == forcedCompileFileList.end() )
+ {
+ forcedCompileFileList.push_back( buildFile );
+ }
+ }
+ else
+ {
+ if( find( nonForcedCompileFileList.begin(), nonForcedCompileFileList.end(), buildFile ) == nonForcedCompileFileList.end() )
+ {
+ nonForcedCompileFileList.push_back( buildFile );
+ }
+ }
+ }
+
+ // Add all forced compile files to build list
+ for( size_t i = 0; i < forcedCompileFileList.size(); ++i )
+ {
+ compileFileList.push_back( forcedCompileFileList[i] );
+ }
+
+ // runtime folder needs to be aware of compilation level and debug/
+
+ // Add non forced files, but only if they don't exist in forced compile list
+ for( size_t i = 0; i < nonForcedCompileFileList.size(); ++i )
+ {
+ Path buildFile = nonForcedCompileFileList[i];
+ if( find( forcedCompileFileList.begin(), forcedCompileFileList.end(), buildFile ) == forcedCompileFileList.end() )
+ {
+ // Check if we have a pre-compiled object version of this file, and if so use that.
+ Path objectFileName = compilerOptions_.intermediatePath / buildFile.Filename();
+ objectFileName.ReplaceExtension(objectFileExtension.c_str());
+
+ if( objectFileName.Exists() && buildFile.Exists() )
+ {
+ FileSystemUtils::filetime_t objTime = objectFileName.GetLastWriteTime();
+ if( objTime > buildFile.GetLastWriteTime() )
+ {
+ // we only want to use the object file if it's newer than the source file
+ buildFile = objectFileName;
+ }
+ }
+ compileFileList.push_back(buildFile);
+ }
+ }
+
+ m_Compiler.RunCompile( compileFileList, compilerOptions_, linkLibraryList_, moduleName_ );
+}
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/BuildTool.h b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/BuildTool.h
new file mode 100644
index 0000000..4abefa1
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/BuildTool.h
@@ -0,0 +1,72 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+
+#include
+#include
+#include "Compiler.h"
+
+#include "FileSystemUtils.h"
+
+class BuildTool
+{
+public:
+ BuildTool();
+ ~BuildTool();
+ void Initialise( ICompilerLogger * pLogger );
+
+ // Clean - cleans up the intermediate files
+ void Clean( const FileSystemUtils::Path& temporaryPath_ ) const;
+
+ struct FileToBuild
+ {
+ FileToBuild( const FileSystemUtils::Path& filePath_ )
+ : filePath( filePath_ )
+ , forceCompile( false )
+ {
+ }
+ FileToBuild( const FileSystemUtils::Path& filePath_, bool forceCompile_ )
+ : filePath( filePath_ )
+ , forceCompile( forceCompile_ )
+ {
+ }
+ FileSystemUtils::Path filePath;
+ bool forceCompile; //if true the file is compiled even if object file is present
+ };
+
+ void BuildModule( const std::vector& buildFileList_,
+ const CompilerOptions& compilerOptions_,
+ std::vector linkLibraryList_,
+ const FileSystemUtils::Path& moduleName_ );
+
+ bool GetIsComplete()
+ {
+ return m_Compiler.GetIsComplete();
+ }
+
+ void SetFastCompileMode( bool bFast )
+ {
+ m_Compiler.SetFastCompileMode( bFast );
+ }
+
+
+private:
+ Compiler m_Compiler;
+ ICompilerLogger* m_pLogger;
+};
+
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/CompileOptions.h b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/CompileOptions.h
new file mode 100644
index 0000000..bba72e3
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/CompileOptions.h
@@ -0,0 +1,49 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+
+enum RCppOptimizationLevel
+{
+ RCCPPOPTIMIZATIONLEVEL_DEFAULT = 0, // RCCPPOPTIMIZATIONLEVEL_DEBUG in DEBUG, RCCPPOPTIMIZATIONLEVEL_PERF in release. This is the default state.
+ RCCPPOPTIMIZATIONLEVEL_DEBUG, // Low optimization, improve debug experiece. Default in DEBUG
+ RCCPPOPTIMIZATIONLEVEL_PERF, // Optimization for performance, debug experience may suffer. Default in RELEASE
+ RCCPPOPTIMIZATIONLEVEL_NOT_SET, // No optimization set in compile, so either underlying compiler default or set through SetAdditionalCompileOptions
+ RCCPPOPTIMIZATIONLEVEL_SIZE, // Size of enum, do not use to set opt level
+};
+
+static const char* RCppOptimizationLevelStrings[] =
+{
+ "DEFAULT",
+ "DEBUG",
+ "PERF",
+ "NOT_SET",
+};
+
+// GetActualOptimizationLevel - translates DEFAULT into DEUG or PERF
+inline RCppOptimizationLevel GetActualOptimizationLevel( RCppOptimizationLevel optimizationLevel_ )
+{
+ if( RCCPPOPTIMIZATIONLEVEL_DEFAULT == optimizationLevel_ )
+ {
+ #ifdef _DEBUG
+ optimizationLevel_ = RCCPPOPTIMIZATIONLEVEL_DEBUG;
+ #else
+ optimizationLevel_ = RCCPPOPTIMIZATIONLEVEL_PERF;
+ #endif
+ }
+ return optimizationLevel_;
+}
\ No newline at end of file
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/Compiler.h b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/Compiler.h
new file mode 100644
index 0000000..3c0f71f
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/Compiler.h
@@ -0,0 +1,73 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+
+#include
+#include
+
+#include "FileSystemUtils.h"
+#include "CompileOptions.h"
+
+class PlatformCompilerImplData;
+struct ICompilerLogger;
+
+struct CompilerOptions
+{
+ std::vector includeDirList;
+ std::vector libraryDirList;
+ std::string compileOptions;
+ std::string linkOptions;
+ RCppOptimizationLevel optimizationLevel;
+ FileSystemUtils::Path baseIntermediatePath;
+ FileSystemUtils::Path intermediatePath;
+ FileSystemUtils::Path compilerLocation;
+};
+
+class Compiler
+{
+public:
+ Compiler();
+ ~Compiler();
+ void Initialise( ICompilerLogger * pLogger );
+
+ // On Win32 the compile command line process can be preserved in between compiles for improved performance,
+ // however this can result in Zombie processes and also prevent handles such as sockets from being closed.
+ // This function is safe to call at any time, but will only have an effect on Win32 compiles from the second
+ // compile on after the call (as the first must launch the process and set the VS environment).
+ //
+ // Defaults to m_bFastCompileMode = false
+ void SetFastCompileMode( bool bFast )
+ {
+ m_bFastCompileMode = bFast;
+
+ // call GetIsComplete() to ensure this stops process
+ GetIsComplete();
+ }
+
+ std::string GetObjectFileExtension() const;
+ void RunCompile( const std::vector& filesToCompile_,
+ const CompilerOptions& compilerOptions_,
+ std::vector linkLibraryList_,
+ const FileSystemUtils::Path& moduleName_ );
+
+
+ bool GetIsComplete() const;
+private:
+ PlatformCompilerImplData* m_pImplData;
+ bool m_bFastCompileMode;
+};
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/Compiler_PlatformPosix.cpp b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/Compiler_PlatformPosix.cpp
new file mode 100644
index 0000000..a1deba0
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/Compiler_PlatformPosix.cpp
@@ -0,0 +1,290 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+//
+// Notes:
+// - We use a single intermediate directory for compiled .obj files, which means
+// we don't support compiling multiple files with the same name. Could fix this
+// with either mangling names to include paths, or recreating folder structure
+//
+//
+
+#include "Compiler.h"
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include "assert.h"
+#include
+
+#include "ICompilerLogger.h"
+
+using namespace std;
+const char c_CompletionToken[] = "_COMPLETION_TOKEN_" ;
+
+class PlatformCompilerImplData
+{
+public:
+ PlatformCompilerImplData()
+ : m_bCompileIsComplete( false )
+ , m_pLogger( 0 )
+ , m_ChildForCompilationPID( 0 )
+ {
+ m_PipeStdOut[0] = 0;
+ m_PipeStdOut[1] = 1;
+ m_PipeStdErr[0] = 0;
+ m_PipeStdErr[1] = 1;
+ }
+
+ volatile bool m_bCompileIsComplete;
+ ICompilerLogger* m_pLogger;
+ pid_t m_ChildForCompilationPID;
+ int m_PipeStdOut[2];
+ int m_PipeStdErr[2];
+};
+
+Compiler::Compiler()
+ : m_pImplData( 0 )
+{
+}
+
+Compiler::~Compiler()
+{
+ delete m_pImplData;
+}
+
+std::string Compiler::GetObjectFileExtension() const
+{
+ return ".o";
+}
+
+bool Compiler::GetIsComplete() const
+{
+ if( !m_pImplData->m_bCompileIsComplete && m_pImplData->m_ChildForCompilationPID )
+ {
+
+ // check for whether process is closed
+ int procStatus;
+ pid_t ret = waitpid( m_pImplData->m_ChildForCompilationPID, &procStatus, WNOHANG);
+ if( ret && ( WIFEXITED(procStatus) || WIFSIGNALED(procStatus) ) )
+ {
+ m_pImplData->m_bCompileIsComplete = true;
+ m_pImplData->m_ChildForCompilationPID = 0;
+
+ // get output and log
+ if( m_pImplData->m_pLogger )
+ {
+ const size_t buffSize = 256 * 80; //should allow for a few lines...
+ char buffer[buffSize];
+ ssize_t numread = 0;
+ while( ( numread = read( m_pImplData->m_PipeStdOut[0], buffer, buffSize-1 ) ) > 0 )
+ {
+ buffer[numread] = 0;
+ m_pImplData->m_pLogger->LogInfo( buffer );
+ }
+
+ while( ( numread = read( m_pImplData->m_PipeStdErr[0], buffer, buffSize-1 ) )> 0 )
+ {
+ buffer[numread] = 0;
+ m_pImplData->m_pLogger->LogError( buffer ); //TODO: seperate warnings from errors.
+ }
+ }
+
+ // close the pipes as this process no longer needs them.
+ close( m_pImplData->m_PipeStdOut[0] );
+ m_pImplData->m_PipeStdOut[0] = 0;
+ close( m_pImplData->m_PipeStdErr[0] );
+ m_pImplData->m_PipeStdErr[0] = 0;
+ }
+ }
+ return m_pImplData->m_bCompileIsComplete;
+}
+
+void Compiler::Initialise( ICompilerLogger * pLogger )
+{
+ m_pImplData = new PlatformCompilerImplData;
+ m_pImplData->m_pLogger = pLogger;
+}
+
+void Compiler::RunCompile( const std::vector& filesToCompile_,
+ const CompilerOptions& compilerOptions_,
+ std::vector linkLibraryList_,
+ const FileSystemUtils::Path& moduleName_ )
+
+{
+ const std::vector& includeDirList = compilerOptions_.includeDirList;
+ const std::vector& libraryDirList = compilerOptions_.libraryDirList;
+ const char* pCompileOptions = compilerOptions_.compileOptions.c_str();
+ const char* pLinkOptions = compilerOptions_.linkOptions.c_str();
+
+ std::string compilerLocation = compilerOptions_.compilerLocation.m_string;
+ if (compilerLocation.size()==0){
+#ifdef __clang__
+ compilerLocation = "clang++ ";
+#else // default to g++
+ compilerLocation = "g++ ";
+#endif //__clang__
+ }
+
+ //NOTE: Currently doesn't check if a prior compile is ongoing or not, which could lead to memory leaks
+ m_pImplData->m_bCompileIsComplete = false;
+
+ //create pipes
+ if ( pipe( m_pImplData->m_PipeStdOut ) != 0 )
+ {
+ if( m_pImplData->m_pLogger )
+ {
+ m_pImplData->m_pLogger->LogError( "Error in Compiler::RunCompile, cannot create pipe - perhaps insufficient memory?\n");
+ }
+ return;
+ }
+ //create pipes
+ if ( pipe( m_pImplData->m_PipeStdErr ) != 0 )
+ {
+ if( m_pImplData->m_pLogger )
+ {
+ m_pImplData->m_pLogger->LogError( "Error in Compiler::RunCompile, cannot create pipe - perhaps insufficient memory?\n");
+ }
+ return;
+ }
+
+ pid_t retPID;
+ switch( retPID = fork() )
+ {
+ case -1: // error, no fork
+ if( m_pImplData->m_pLogger )
+ {
+ m_pImplData->m_pLogger->LogError( "Error in Compiler::RunCompile, cannot fork() process - perhaps insufficient memory?\n");
+ }
+ return;
+ case 0: // child process - carries on below.
+ break;
+ default: // current process - returns to allow application to run whilst compiling
+ close( m_pImplData->m_PipeStdOut[1] );
+ m_pImplData->m_PipeStdOut[1] = 0;
+ close( m_pImplData->m_PipeStdErr[1] );
+ m_pImplData->m_PipeStdErr[1] = 0;
+ m_pImplData->m_ChildForCompilationPID = retPID;
+ return;
+ }
+
+ //duplicate the pipe to stdout, so output goes to pipe
+ dup2( m_pImplData->m_PipeStdErr[1], STDERR_FILENO );
+ dup2( m_pImplData->m_PipeStdOut[1], STDOUT_FILENO );
+ close( m_pImplData->m_PipeStdOut[0] );
+ m_pImplData->m_PipeStdOut[0] = 0;
+ close( m_pImplData->m_PipeStdErr[0] );
+ m_pImplData->m_PipeStdErr[0] = 0;
+
+ std::string compileString = compilerLocation + " " + "-g -fPIC -fvisibility=hidden -shared ";
+
+#ifndef __LP64__
+ compileString += "-m32 ";
+#endif
+
+ RCppOptimizationLevel optimizationLevel = GetActualOptimizationLevel( compilerOptions_.optimizationLevel );
+ switch( optimizationLevel )
+ {
+ case RCCPPOPTIMIZATIONLEVEL_DEFAULT:
+ assert(false);
+ case RCCPPOPTIMIZATIONLEVEL_DEBUG:
+ compileString += "-O0 ";
+ break;
+ case RCCPPOPTIMIZATIONLEVEL_PERF:
+ compileString += "-Os ";
+ break;
+ case RCCPPOPTIMIZATIONLEVEL_NOT_SET:;
+ }
+
+ // Check for intermediate directory, create it if required
+ // There are a lot more checks and robustness that could be added here
+ if( !compilerOptions_.intermediatePath.Exists() )
+ {
+ bool success = compilerOptions_.intermediatePath.CreateDir();
+ if( success && m_pImplData->m_pLogger ) { m_pImplData->m_pLogger->LogInfo("Created intermediate folder \"%s\"\n", compilerOptions_.intermediatePath.c_str()); }
+ else if( m_pImplData->m_pLogger ) { m_pImplData->m_pLogger->LogError("Error creating intermediate folder \"%s\"\n", compilerOptions_.intermediatePath.c_str()); }
+ }
+
+ FileSystemUtils::Path output = moduleName_;
+ bool bCopyOutput = false;
+ if( compilerOptions_.intermediatePath.Exists() )
+ {
+ // add save object files
+ compileString = "cd \"" + compilerOptions_.intermediatePath.m_string + "\"\n" + compileString + " --save-temps ";
+ output = compilerOptions_.intermediatePath / "a.out";
+ bCopyOutput = true;
+ }
+
+
+ // include directories
+ for( size_t i = 0; i < includeDirList.size(); ++i )
+ {
+ compileString += "-I\"" + includeDirList[i].m_string + "\" ";
+ }
+
+ // library and framework directories
+ for( size_t i = 0; i < libraryDirList.size(); ++i )
+ {
+ compileString += "-L\"" + libraryDirList[i].m_string + "\" ";
+ compileString += "-F\"" + libraryDirList[i].m_string + "\" ";
+ }
+
+ if( !bCopyOutput )
+ {
+ // output file
+ compileString += "-o " + output.m_string + " ";
+ }
+
+
+ if( pCompileOptions )
+ {
+ compileString += pCompileOptions;
+ compileString += " ";
+ }
+ if( pLinkOptions && strlen(pLinkOptions) )
+ {
+ compileString += "-Wl,";
+ compileString += pLinkOptions;
+ compileString += " ";
+ }
+
+ // files to compile
+ for( size_t i = 0; i < filesToCompile_.size(); ++i )
+ {
+ compileString += "\"" + filesToCompile_[i].m_string + "\" ";
+ }
+
+ // libraries to link
+ for( size_t i = 0; i < linkLibraryList_.size(); ++i )
+ {
+ compileString += " " + linkLibraryList_[i].m_string + " ";
+ }
+
+ if( bCopyOutput )
+ {
+ compileString += "\n mv \"" + output.m_string + "\" \"" + moduleName_.m_string + "\"\n";
+ }
+
+
+ std::cout << compileString << std::endl << std::endl;
+
+ execl("/bin/sh", "sh", "-c", compileString.c_str(), (const char*)NULL);
+}
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/Compiler_PlatformWindows.cpp b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/Compiler_PlatformWindows.cpp
new file mode 100644
index 0000000..4a90b26
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/Compiler_PlatformWindows.cpp
@@ -0,0 +1,567 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+// RuntimeDLLTest01.cpp : Defines the entry point for the console application.
+//
+// Notes:
+// - We use a single intermediate directory for compiled .obj files, which means
+// we don't support compiling multiple files with the same name. Could fix this
+// with either mangling names to include paths, or recreating folder structure
+//
+//
+
+#include "Compiler.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include
+#include
+#include
+#include
+#include
+#include "FileSystemUtils.h"
+
+#include "assert.h"
+#include
+
+#include "ICompilerLogger.h"
+
+using namespace std;
+using namespace FileSystemUtils;
+
+struct VSVersionInfo
+{
+ int Version;
+ std::string Path;
+};
+
+const std::string c_CompletionToken( "_COMPLETION_TOKEN_" );
+
+void GetPathsOfVisualStudioInstalls( std::vector* pVersions );
+
+void ReadAndHandleOutputThread( LPVOID arg );
+void WriteInput( HANDLE hPipeWrite, std::string& input );
+
+class PlatformCompilerImplData
+{
+public:
+ PlatformCompilerImplData()
+ : m_bCompileIsComplete( false )
+ , m_CmdProcessOutputRead( NULL )
+ , m_CmdProcessInputWrite( NULL )
+ {
+ ZeroMemory( &m_CmdProcessInfo, sizeof(m_CmdProcessInfo) );
+ }
+
+ void InitialiseProcess()
+ {
+ //init compile process
+ STARTUPINFOW si;
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+
+#ifndef _WIN64
+ std::string cmdSetParams = "@PROMPT $ \n\"" + m_VSPath + "Vcvarsall.bat\" x86\n";
+#else
+ std::string cmdSetParams = "@PROMPT $ \n\"" + m_VSPath + "Vcvarsall.bat\" x86_amd64\n";
+#endif
+ // Set up the security attributes struct.
+ SECURITY_ATTRIBUTES sa;
+ sa.nLength= sizeof(SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+
+ // Create the child output pipe.
+ //redirection of output
+ si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+ si.wShowWindow = SW_HIDE;
+ HANDLE hOutputReadTmp = NULL, hOutputWrite = NULL, hErrorWrite = NULL;
+ if (!CreatePipe(&hOutputReadTmp,&hOutputWrite,&sa,20*1024))
+ {
+ if( m_pLogger ) m_pLogger->LogError("[RuntimeCompiler] Failed to create output redirection pipe\n");
+ goto ERROR_EXIT;
+ }
+ si.hStdOutput = hOutputWrite;
+
+ // Create a duplicate of the output write handle for the std error
+ // write handle. This is necessary in case the child application
+ // closes one of its std output handles.
+ if (!DuplicateHandle(GetCurrentProcess(),hOutputWrite,
+ GetCurrentProcess(),&hErrorWrite,0,
+ TRUE,DUPLICATE_SAME_ACCESS))
+ {
+ if( m_pLogger ) m_pLogger->LogError("[RuntimeCompiler] Failed to duplicate error output redirection pipe\n");
+ goto ERROR_EXIT;
+ }
+ si.hStdError = hErrorWrite;
+
+
+ // Create new output read handle and the input write handles. Set
+ // the Properties to FALSE. Otherwise, the child inherits the
+ // properties and, as a result, non-closeable handles to the pipes
+ // are created.
+ if( si.hStdOutput )
+ {
+ if (!DuplicateHandle(GetCurrentProcess(),hOutputReadTmp,
+ GetCurrentProcess(),
+ &m_CmdProcessOutputRead, // Address of new handle.
+ 0,FALSE, // Make it uninheritable.
+ DUPLICATE_SAME_ACCESS))
+ {
+ if( m_pLogger ) m_pLogger->LogError("[RuntimeCompiler] Failed to duplicate output read pipe\n");
+ goto ERROR_EXIT;
+ }
+ CloseHandle( hOutputReadTmp );
+ hOutputReadTmp = NULL;
+ }
+
+
+ HANDLE hInputRead,hInputWriteTmp;
+ // Create a pipe for the child process's STDIN.
+ if (!CreatePipe(&hInputRead, &hInputWriteTmp, &sa, 4096))
+ {
+ if( m_pLogger ) m_pLogger->LogError("[RuntimeCompiler] Failed to create input pipes\n");
+ goto ERROR_EXIT;
+ }
+ si.hStdInput = hInputRead;
+
+ // Create new output read handle and the input write handles. Set
+ // the Properties to FALSE. Otherwise, the child inherits the
+ // properties and, as a result, non-closeable handles to the pipes
+ // are created.
+ if( si.hStdOutput )
+ {
+ if (!DuplicateHandle(GetCurrentProcess(),hInputWriteTmp,
+ GetCurrentProcess(),
+ &m_CmdProcessInputWrite, // Address of new handle.
+ 0,FALSE, // Make it uninheritable.
+ DUPLICATE_SAME_ACCESS))
+ {
+ if( m_pLogger ) m_pLogger->LogError("[RuntimeCompiler] Failed to duplicate input write pipe\n");
+ goto ERROR_EXIT;
+ }
+ }
+ /*
+ // Ensure the write handle to the pipe for STDIN is not inherited.
+ if ( !SetHandleInformation(hInputWrite, HANDLE_FLAG_INHERIT, 0) )
+ {
+ m_pLogger->LogError("[RuntimeCompiler] Failed to make input write pipe non inheritable\n");
+ goto ERROR_EXIT;
+ }
+ */
+
+ wchar_t* pCommandLine = L"cmd /q";
+ //CreateProcessW won't accept a const pointer, so copy to an array
+ wchar_t pCmdLineNonConst[1024];
+ wcscpy_s( pCmdLineNonConst, pCommandLine );
+ CreateProcessW(
+ NULL, //__in_opt LPCTSTR lpApplicationName,
+ pCmdLineNonConst, //__inout_opt LPTSTR lpCommandLine,
+ NULL, //__in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes,
+ NULL, //__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
+ TRUE, //__in BOOL bInheritHandles,
+ 0, //__in DWORD dwCreationFlags,
+ NULL, //__in_opt LPVOID lpEnvironment,
+ NULL, //__in_opt LPCTSTR lpCurrentDirectory,
+ &si, //__in LPSTARTUPINFO lpStartupInfo,
+ &m_CmdProcessInfo //__out LPPROCESS_INFORMATION lpProcessInformation
+ );
+
+ //send initial set up command
+ WriteInput( m_CmdProcessInputWrite, cmdSetParams );
+
+ //launch threaded read.
+ _beginthread( ReadAndHandleOutputThread, 0, this ); //this will exit when process for compile is closed
+
+
+ ERROR_EXIT:
+ if( hOutputReadTmp )
+ {
+ CloseHandle( hOutputReadTmp );
+ }
+ if( hOutputWrite )
+ {
+ CloseHandle( hOutputWrite );
+ }
+ if( hErrorWrite )
+ {
+ CloseHandle( hErrorWrite );
+ }
+ }
+
+ void CleanupProcessAndPipes()
+ {
+ // do not reset m_bCompileIsComplete and other members here, just process and pipes
+ if( m_CmdProcessInfo.hProcess )
+ {
+ TerminateProcess( m_CmdProcessInfo.hProcess, 0 );
+ TerminateThread( m_CmdProcessInfo.hThread, 0 );
+ CloseHandle( m_CmdProcessInfo.hThread );
+ ZeroMemory( &m_CmdProcessInfo, sizeof(m_CmdProcessInfo) );
+ CloseHandle( m_CmdProcessInputWrite );
+ m_CmdProcessInputWrite = 0;
+ CloseHandle( m_CmdProcessOutputRead );
+ m_CmdProcessOutputRead = 0;
+ }
+
+ }
+
+
+ ~PlatformCompilerImplData()
+ {
+ CleanupProcessAndPipes();
+ }
+
+ std::string m_VSPath;
+ PROCESS_INFORMATION m_CmdProcessInfo;
+ HANDLE m_CmdProcessOutputRead;
+ HANDLE m_CmdProcessInputWrite;
+ volatile bool m_bCompileIsComplete;
+ ICompilerLogger* m_pLogger;
+};
+
+Compiler::Compiler()
+ : m_pImplData( 0 )
+ , m_bFastCompileMode( false )
+{
+}
+
+Compiler::~Compiler()
+{
+ delete m_pImplData;
+}
+
+std::string Compiler::GetObjectFileExtension() const
+{
+ return ".obj";
+}
+
+bool Compiler::GetIsComplete() const
+{
+ bool bComplete = m_pImplData->m_bCompileIsComplete;
+ if( bComplete & !m_bFastCompileMode )
+ {
+ m_pImplData->CleanupProcessAndPipes();
+ }
+ return bComplete;
+}
+
+void Compiler::Initialise( ICompilerLogger * pLogger )
+{
+ m_pImplData = new PlatformCompilerImplData;
+ m_pImplData->m_pLogger = pLogger;
+ // get VS compiler path
+ std::vector Versions;
+ GetPathsOfVisualStudioInstalls( &Versions );
+
+ if( !Versions.empty() )
+ {
+ m_pImplData->m_VSPath = Versions[0].Path;
+ }
+ else
+ {
+ m_pImplData->m_VSPath = "";
+ if( m_pImplData->m_pLogger )
+ {
+ m_pImplData->m_pLogger->LogError("No Supported Compiler for RCC++ found.\n");
+ }
+ }
+}
+
+
+void Compiler::RunCompile( const std::vector& filesToCompile_,
+ const CompilerOptions& compilerOptions_,
+ std::vector linkLibraryList_,
+ const FileSystemUtils::Path& moduleName_ )
+{
+ if( m_pImplData->m_VSPath.empty() )
+ {
+ if (m_pImplData->m_pLogger) { m_pImplData->m_pLogger->LogError("No Supported Compiler for RCC++ found, cannot compile changes.\n"); }
+ m_pImplData->m_bCompileIsComplete = true;
+ return;
+ }
+ m_pImplData->m_bCompileIsComplete = false;
+ //optimization and c runtime
+#ifdef _DEBUG
+ std::string flags = "/nologo /Zi /FC /MDd /LDd ";
+#else
+ std::string flags = "/nologo /Zi /FC /MD /LD "; //also need debug information in release
+#endif
+
+ RCppOptimizationLevel optimizationLevel = GetActualOptimizationLevel( compilerOptions_.optimizationLevel );
+ switch( optimizationLevel )
+ {
+ case RCCPPOPTIMIZATIONLEVEL_DEFAULT:
+ assert(false);
+ case RCCPPOPTIMIZATIONLEVEL_DEBUG:
+ flags += "/Od ";
+ break;
+ case RCCPPOPTIMIZATIONLEVEL_PERF:
+ flags += "/O2 /Oi ";
+
+// Add improved debugging options if available: http://randomascii.wordpress.com/2013/09/11/debugging-optimized-codenew-in-visual-studio-2012/
+#if (_MSC_VER >= 1700)
+ flags += "/d2Zi+ ";
+#endif
+ break;
+ case RCCPPOPTIMIZATIONLEVEL_NOT_SET:;
+ }
+
+ if( NULL == m_pImplData->m_CmdProcessInfo.hProcess )
+ {
+ m_pImplData->InitialiseProcess();
+ }
+
+ flags += compilerOptions_.compileOptions;
+ flags += " ";
+
+ std::string linkOptions;
+ bool bHaveLinkOptions = ( 0 != compilerOptions_.linkOptions.length() );
+ if( compilerOptions_.libraryDirList.size() || bHaveLinkOptions )
+ {
+ linkOptions = " /link ";
+ for( size_t i = 0; i < compilerOptions_.libraryDirList.size(); ++i )
+ {
+ linkOptions += " /LIBPATH:\"" + compilerOptions_.libraryDirList[i].m_string + "\"";
+ }
+
+ if( bHaveLinkOptions )
+ {
+ linkOptions += compilerOptions_.linkOptions;
+ linkOptions += " ";
+ }
+ }
+ // faster linking if available: https://randomascii.wordpress.com/2015/07/27/programming-is-puzzles/
+ #if (_MSC_VER >= 1900)
+ if( linkOptions.empty() )
+ {
+ linkOptions = " /link ";
+ }
+ linkOptions += "/DEBUG:FASTLINK ";
+ #endif
+
+ // Check for intermediate directory, create it if required
+ // There are a lot more checks and robustness that could be added here
+ if ( !compilerOptions_.intermediatePath.Exists() )
+ {
+ bool success = compilerOptions_.intermediatePath.CreateDir();
+ if( success && m_pImplData->m_pLogger ) { m_pImplData->m_pLogger->LogInfo("Created intermediate folder \"%s\"\n", compilerOptions_.intermediatePath.c_str()); }
+ else if( m_pImplData->m_pLogger ) { m_pImplData->m_pLogger->LogError("Error creating intermediate folder \"%s\"\n", compilerOptions_.intermediatePath.c_str()); }
+ }
+
+
+ //create include path search string
+ std::string strIncludeFiles;
+ for( size_t i = 0; i < compilerOptions_.includeDirList.size(); ++i )
+ {
+ strIncludeFiles += " /I \"" + compilerOptions_.includeDirList[i].m_string + "\"";
+ }
+
+
+ // When using multithreaded compilation, listing a file for compilation twice can cause errors, hence
+ // we do a final filtering of input here.
+ // See http://msdn.microsoft.com/en-us/library/bb385193.aspx - "Source Files and Build Order"
+
+ // Create compile path search string
+ std::string strFilesToCompile;
+ std::set filteredPaths;
+ for( size_t i = 0; i < filesToCompile_.size(); ++i )
+ {
+ std::string strPath = filesToCompile_[i].m_string;
+ FileSystemUtils::ToLowerInPlace(strPath);
+
+ std::set::const_iterator it = filteredPaths.find(strPath);
+ if (it == filteredPaths.end())
+ {
+ strFilesToCompile += " \"" + strPath + "\"";
+ filteredPaths.insert(strPath);
+ }
+ }
+
+ std::string strLinkLibraries;
+ for( size_t i = 0; i < linkLibraryList_.size(); ++i )
+ {
+ strLinkLibraries += " \"" + linkLibraryList_[i].m_string + "\" ";
+ }
+
+
+
+
+char* pCharTypeFlags = "";
+#ifdef UNICODE
+ pCharTypeFlags = "/D UNICODE /D _UNICODE ";
+#endif
+
+ // /MP - use multiple processes to compile if possible. Only speeds up compile for multiple files and not link
+ std::string cmdToSend = "cl " + flags + pCharTypeFlags
+ + " /MP /Fo\"" + compilerOptions_.intermediatePath.m_string + "\\\\\" "
+ + "/D WIN32 /EHa /Fe" + moduleName_.m_string;
+ cmdToSend += " " + strIncludeFiles + " " + strFilesToCompile + strLinkLibraries + linkOptions
+ + "\necho ";
+ if( m_pImplData->m_pLogger ) m_pImplData->m_pLogger->LogInfo( "%s", cmdToSend.c_str() ); // use %s to prevent any tokens in compile string being interpreted as formating
+ cmdToSend += c_CompletionToken + "\n";
+ WriteInput( m_pImplData->m_CmdProcessInputWrite, cmdToSend );
+}
+
+
+void GetPathsOfVisualStudioInstalls( std::vector* pVersions )
+{
+ //HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\\Setup\VS\
+ std::string keyName = "SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7";
+
+ const size_t NUMNAMESTOCHECK = 6;
+
+ // supporting: VS2005, VS2008, VS2010, VS2011, VS2013, VS2015
+ std::string valueName[NUMNAMESTOCHECK] = {"8.0","9.0","10.0","11.0","12.0","14.0"};
+
+ // we start searching for a compatible compiler from the current version backwards
+ int startVersion = NUMNAMESTOCHECK - 1;
+ //switch around prefered compiler to the one we've used to compile this file
+ const unsigned int MSCVERSION = _MSC_VER;
+ switch( MSCVERSION )
+ {
+ case 1400: //VS 2005
+ startVersion = 0;
+ break;
+ case 1500: //VS 2008
+ startVersion = 1;
+ break;
+ case 1600: //VS 2010
+ startVersion = 2;
+ break;
+ case 1700: //VS 2012
+ startVersion = 3;
+ break;
+ case 1800: //VS 2013
+ startVersion = 4;
+ break;
+ case 1900: //VS 2015
+ startVersion = 5;
+ break;
+ default:
+ assert( false ); //unsupported compiler, find MSCVERSION to add case, increase NUMNAMESTOCHECK and add valueName.
+ }
+
+
+
+ char value[MAX_PATH];
+ DWORD size = MAX_PATH;
+
+ HKEY key;
+ LONG retKeyVal = RegOpenKeyExA(
+ HKEY_LOCAL_MACHINE, //__in HKEY hKey,
+ keyName.c_str(), //__in_opt LPCTSTR lpSubKey,
+ 0, //__reserved DWORD ulOptions,
+ KEY_READ | KEY_WOW64_32KEY, //__in REGSAM samDesired,
+ &key //__out PHKEY phkResult
+ );
+
+ int loopCount = 1;
+ if( startVersion != NUMNAMESTOCHECK - 1 )
+ {
+ // we potentially need to restart search from top
+ loopCount = 2;
+ }
+ for( int loop = 0; loop < loopCount; ++loop )
+ {
+ for( int i = startVersion; i >= 0; --i )
+ {
+
+ LONG retVal = RegQueryValueExA(
+ key, //__in HKEY hKey,
+ valueName[i].c_str(), //__in_opt LPCTSTR lpValueName,
+ NULL, //__reserved LPDWORD lpReserved,
+ NULL , //__out_opt LPDWORD lpType,
+ (LPBYTE)value, //__out_opt LPBYTE lpData,
+ &size //__inout_opt LPDWORD lpcbData
+ );
+ if( ERROR_SUCCESS == retVal )
+ {
+ VSVersionInfo vInfo;
+ vInfo.Version = i + 8;
+ vInfo.Path = value;
+ pVersions->push_back( vInfo );
+ }
+ }
+ startVersion = NUMNAMESTOCHECK - 1; // if we loop around again make sure it's from the top
+ }
+
+ RegCloseKey( key );
+
+ return;
+}
+
+
+void ReadAndHandleOutputThread( LPVOID arg )
+{
+ PlatformCompilerImplData* pImpl = (PlatformCompilerImplData*)arg;
+
+ CHAR lpBuffer[1024];
+ DWORD nBytesRead;
+ bool bReadActive = true;
+ bool bReadOneMore = false;
+ while( bReadActive )
+ {
+ if (!ReadFile(pImpl->m_CmdProcessOutputRead,lpBuffer,sizeof(lpBuffer)-1,
+ &nBytesRead,NULL) || !nBytesRead)
+ {
+ bReadActive = false;
+ if (GetLastError() != ERROR_BROKEN_PIPE) //broken pipe is OK
+ {
+ if( pImpl->m_pLogger ) pImpl->m_pLogger->LogError( "[RuntimeCompiler] Redirect of compile output failed on read\n" );
+ }
+ }
+ else
+ {
+ // Display the characters read in logger.
+ lpBuffer[nBytesRead]=0;
+
+ //fist check for completion token...
+ std::string buffer( lpBuffer );
+ size_t found = buffer.find( c_CompletionToken );
+ if( found != std::string::npos )
+ {
+ //we've found the completion token, which means we quit
+ buffer = buffer.substr( 0, found );
+ if( pImpl->m_pLogger ) pImpl->m_pLogger->LogInfo("[RuntimeCompiler] Complete\n");
+ pImpl->m_bCompileIsComplete = true;
+ }
+ if( bReadActive || buffer.length() ) //don't output blank last line
+ {
+ //check if this is an error
+ size_t errorFound = buffer.find( " : error " );
+ size_t fatalErrorFound = buffer.find( " : fatal error " );
+ if( ( errorFound != std::string::npos ) || ( fatalErrorFound != std::string::npos ) )
+ {
+ if( pImpl->m_pLogger ) pImpl->m_pLogger->LogError( "%s", buffer.c_str() );
+ }
+ else
+ {
+ if( pImpl->m_pLogger ) pImpl->m_pLogger->LogInfo( "%s", buffer.c_str() );
+ }
+ }
+ }
+ }
+
+}
+
+void WriteInput( HANDLE hPipeWrite, std::string& input )
+{
+ DWORD nBytesWritten;
+ DWORD length = (DWORD)input.length();
+ WriteFile( hPipeWrite, input.c_str() , length, &nBytesWritten, NULL );
+}
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/FileChangeNotifier.cpp b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/FileChangeNotifier.cpp
new file mode 100644
index 0000000..e2526b9
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/FileChangeNotifier.cpp
@@ -0,0 +1,196 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#include "FileChangeNotifier.h"
+
+#include
+using namespace std;
+
+#define DEFAULT_MIN_TIME_BETWEEN_RECOMPILES 1.0f
+#define DEFAULT_NOTIFY_DELAY 0.1f
+#define FILE_CHANGE_SPAM_TIME 1.0f
+
+
+FileChangeNotifier::FileChangeNotifier()
+ : m_bActive(true)
+ , m_bRecompilePending(false)
+ , m_fMinTimeBetweenNotifications(DEFAULT_MIN_TIME_BETWEEN_RECOMPILES)
+ , m_fChangeNotifyDelay(DEFAULT_NOTIFY_DELAY)
+ , m_fTimeUntilNextAllowedRecompile(0.0f)
+ , m_fFileChangeSpamTimeRemaining(0.0f)
+ , m_pFileWatcher( new FW::FileWatcher() ) // Create the file watch object
+{
+ m_LastFileChanged = "";
+}
+
+
+FileChangeNotifier::~FileChangeNotifier()
+{
+ delete m_pFileWatcher;
+}
+
+
+void FileChangeNotifier::SetMinTimeBetweenNotifications( float fMinTime )
+{
+ m_fMinTimeBetweenNotifications = max(0.0f, fMinTime);
+}
+
+void FileChangeNotifier::SetChangeNotifyDelay( float fDelay)
+{
+ m_fChangeNotifyDelay = max(0.0f, fDelay);
+}
+
+void FileChangeNotifier::Update( float fDeltaTime )
+{
+ if (m_bActive)
+ {
+ m_pFileWatcher->update();
+ m_fTimeUntilNextAllowedRecompile = max(0.0f, m_fTimeUntilNextAllowedRecompile - fDeltaTime);
+ m_fFileChangeSpamTimeRemaining = max(0.0f, m_fFileChangeSpamTimeRemaining - fDeltaTime);
+
+ if (m_bRecompilePending)
+ {
+ TriggerNotificationIfPossible();
+ }
+ }
+}
+
+
+void FileChangeNotifier::Watch( const FileSystemUtils::Path& filename, IFileChangeListener *pListener )
+{
+ FileSystemUtils::Path fixedFilename = filename.DelimitersToOSDefault(); // Note this doesn't handle ../
+
+ fixedFilename = fixedFilename.GetCleanPath();
+ fixedFilename.ToOSCanonicalCase();
+
+ if( m_fileListenerMap[fixedFilename].insert(pListener).second )
+ {
+ bool bPathIsDir = !fixedFilename.HasExtension();
+ FileSystemUtils::Path pathDir = bPathIsDir ? fixedFilename : fixedFilename.ParentPath();
+ if( m_WatchedDirs.insert( pathDir.m_string ).second )
+ {
+ m_pFileWatcher->addWatch( pathDir.m_string, this );
+ }
+ }
+ pListener->OnRegisteredWithNotifier(this);
+}
+
+
+void FileChangeNotifier::Watch( const char *filename, IFileChangeListener *pListener )
+{
+ Watch(FileSystemUtils::Path(filename), pListener);
+}
+
+void FileChangeNotifier::RemoveListener( IFileChangeListener *pListener )
+{
+ TFileListenerMap::iterator it = m_fileListenerMap.begin();
+ TFileListenerMap::iterator itEnd = m_fileListenerMap.end();
+ while (it != itEnd)
+ {
+ it->second.erase(pListener);
+ ++it;
+ }
+
+ pListener->OnRegisteredWithNotifier(NULL);
+}
+
+void FileChangeNotifier::handleFileAction( FW::WatchID watchid, const FW::String& dir, const FW::String& filename,
+ FW::Action action )
+{
+ if (m_bActive)
+ {
+ FileSystemUtils::Path filePath(filename);
+ if( !filename.HasParentPath() )
+ {
+ filePath = dir / filePath;
+ }
+
+ filePath = filePath.DelimitersToOSDefault();
+ filePath.ToOSCanonicalCase();
+
+
+ // Check for multiple hits on the same file in close succession
+ // (Can be caused by NTFS system making multiple changes even though only
+ // one actual change occurred)
+ bool bIgnoreFileChange = (filePath == m_LastFileChanged) &&
+ m_fFileChangeSpamTimeRemaining > 0.0f;
+ m_LastFileChanged = filePath;
+
+ if (!bIgnoreFileChange)
+ {
+ m_changedFileList.insert(filePath.m_string);
+
+ if (!m_bRecompilePending)
+ {
+ m_bRecompilePending = true;
+ m_fTimeUntilNextAllowedRecompile = max(m_fTimeUntilNextAllowedRecompile, m_fChangeNotifyDelay);
+ }
+
+ m_fFileChangeSpamTimeRemaining = FILE_CHANGE_SPAM_TIME;
+ TriggerNotificationIfPossible();
+ }
+ }
+}
+
+void FileChangeNotifier::TriggerNotificationIfPossible()
+{
+ if (m_fTimeUntilNextAllowedRecompile <= 0.0f)
+ {
+ m_fTimeUntilNextAllowedRecompile = m_fMinTimeBetweenNotifications;
+ m_bRecompilePending = false;
+
+ NotifyListeners();
+
+ m_changedFileList.clear();
+ }
+ else
+ {
+ m_bRecompilePending = true;
+ }
+}
+
+void FileChangeNotifier::NotifyListeners()
+{
+ std::map > interestedListenersMap;
+
+ // Determine which listeners are interested in which changed files
+ TPathNameList::const_iterator fileIt = m_changedFileList.begin();
+ TPathNameList::const_iterator fileItEnd = m_changedFileList.end();
+ while (fileIt != fileItEnd)
+ {
+ TFileChangeListeners& listeners = m_fileListenerMap[*fileIt];
+ TFileChangeListeners::iterator listenerIt = listeners.begin();
+ TFileChangeListeners::iterator listenerItEnd = listeners.end();
+ while (listenerIt != listenerItEnd)
+ {
+ interestedListenersMap[*listenerIt].Add(fileIt->c_str());
+ ++listenerIt;
+ }
+
+ ++fileIt;
+ }
+
+ // Notify each listener with an appropriate file list
+ std::map >::iterator finalIt = interestedListenersMap.begin();
+ std::map >::iterator finalItEnd = interestedListenersMap.end();
+ while (finalIt != finalItEnd)
+ {
+ finalIt->first->OnFileChange(finalIt->second);
+ ++finalIt;
+ }
+}
+
diff --git a/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/FileChangeNotifier.h b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/FileChangeNotifier.h
new file mode 100644
index 0000000..6a0990d
--- /dev/null
+++ b/3rdparty/RuntimeCompiledCpp/RuntimeCompiler/FileChangeNotifier.h
@@ -0,0 +1,111 @@
+//
+// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+#pragma once
+
+#ifndef FILECHANGENOTIFIER_INCLUDED
+#define FILECHANGENOTIFIER_INCLUDED
+
+#include "IFileChangeNotifier.h"
+#include "SimpleFileWatcher/FileWatcher.h"
+#include
+#include