From 1c9872a14a5b080ced051cea0e6d68925b486ac4 Mon Sep 17 00:00:00 2001 From: Pietro Lazzarotto Date: Sun, 17 Mar 2019 14:52:10 +0000 Subject: [PATCH 1/5] Updated projects target C++ Sandbox builds and runs correctly --- Dependencies/Box2D/Box2D.vcxproj | 8 ++++---- Dependencies/FreeImage/FreeImage.vcxproj | 12 ++++++------ Dependencies/FreeType/FreeType.vcxproj | 12 ++++++------ Dependencies/gorilla-audio/gorilla-audio.vcxproj | 12 ++++++------ Dependencies/libogg/libogg.vcxproj | 8 ++++---- Dependencies/libvorbis/libvorbis.vcxproj | 8 ++++---- Sandbox/Sandbox.vcxproj | 8 ++++---- Sparky-core/Sparky-core.vcxproj | 10 +++++----- SparkyCLI/SparkyCLI.vcxproj | 7 ++++--- Tools/SPMBuild/SPMBuild.vcxproj | 12 ++++++------ 10 files changed, 49 insertions(+), 48 deletions(-) diff --git a/Dependencies/Box2D/Box2D.vcxproj b/Dependencies/Box2D/Box2D.vcxproj index 2de6f6bd..716d73d9 100644 --- a/Dependencies/Box2D/Box2D.vcxproj +++ b/Dependencies/Box2D/Box2D.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -13,19 +13,19 @@ {BCE9869C-CDE3-4935-99AB-4522493CE0B3} Box2D - 8.1 + 10.0.17763.0 StaticLibrary true - v140 + v141 MultiByte StaticLibrary false - v140 + v141 true MultiByte diff --git a/Dependencies/FreeImage/FreeImage.vcxproj b/Dependencies/FreeImage/FreeImage.vcxproj index a88413d6..2d615cd9 100644 --- a/Dependencies/FreeImage/FreeImage.vcxproj +++ b/Dependencies/FreeImage/FreeImage.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -21,32 +21,32 @@ {6F2FF135-E343-4138-A6FB-2D1F2540A3F8} FreeImage - 8.1 + 10.0.17763.0 StaticLibrary true - v140 + v141 MultiByte StaticLibrary false - v140 + v141 true MultiByte Application true - v140 + v141 MultiByte Application false - v140 + v141 true MultiByte diff --git a/Dependencies/FreeType/FreeType.vcxproj b/Dependencies/FreeType/FreeType.vcxproj index 0c2e2704..c13bc028 100644 --- a/Dependencies/FreeType/FreeType.vcxproj +++ b/Dependencies/FreeType/FreeType.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -21,32 +21,32 @@ {1B0BC2C5-1A09-4017-BDF5-9F9C1718BFE7} FreeType - 8.1 + 10.0.17763.0 DynamicLibrary true - v140 + v141 MultiByte DynamicLibrary false - v140 + v141 true MultiByte Application true - v140 + v141 MultiByte Application false - v140 + v141 true MultiByte diff --git a/Dependencies/gorilla-audio/gorilla-audio.vcxproj b/Dependencies/gorilla-audio/gorilla-audio.vcxproj index cbf98cee..692806ab 100644 --- a/Dependencies/gorilla-audio/gorilla-audio.vcxproj +++ b/Dependencies/gorilla-audio/gorilla-audio.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -21,32 +21,32 @@ {E9A0F826-3688-4461-8E49-7CCC543F9E40} gorillaaudio - 8.1 + 10.0.17763.0 DynamicLibrary true - v140 + v141 MultiByte DynamicLibrary false - v140 + v141 true MultiByte Application true - v140 + v141 MultiByte Application false - v140 + v141 true MultiByte diff --git a/Dependencies/libogg/libogg.vcxproj b/Dependencies/libogg/libogg.vcxproj index c7d5fad8..ec85cbcd 100644 --- a/Dependencies/libogg/libogg.vcxproj +++ b/Dependencies/libogg/libogg.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -22,19 +22,19 @@ {54CE06E0-6313-4F5E-8BDA-4E7815C8743C} libogg - 8.1 + 10.0.17763.0 StaticLibrary true - v140 + v141 MultiByte StaticLibrary false - v140 + v141 true MultiByte diff --git a/Dependencies/libvorbis/libvorbis.vcxproj b/Dependencies/libvorbis/libvorbis.vcxproj index 7f7f4b99..3a15be26 100644 --- a/Dependencies/libvorbis/libvorbis.vcxproj +++ b/Dependencies/libvorbis/libvorbis.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -80,19 +80,19 @@ {8ED62764-0D19-40AC-BC88-E82AADF1189B} libvorbis - 8.1 + 10.0.17763.0 StaticLibrary true - v140 + v141 MultiByte StaticLibrary false - v140 + v141 true MultiByte diff --git a/Sandbox/Sandbox.vcxproj b/Sandbox/Sandbox.vcxproj index 1cddb977..8b352308 100644 --- a/Sandbox/Sandbox.vcxproj +++ b/Sandbox/Sandbox.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -13,19 +13,19 @@ {3A87EAB9-F0FF-4C31-905F-E3D07BF021FF} Sandbox - 8.1 + 10.0.17763.0 Application true - v140 + v141 MultiByte Application false - v140 + v141 true MultiByte diff --git a/Sparky-core/Sparky-core.vcxproj b/Sparky-core/Sparky-core.vcxproj index b7130d3c..1c27241b 100644 --- a/Sparky-core/Sparky-core.vcxproj +++ b/Sparky-core/Sparky-core.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -17,26 +17,26 @@ {C737C239-3A40-4388-9C61-6CF779025785} Sparkycore - 8.1 + 10.0.17763.0 DynamicLibrary true - v140 + v141 MultiByte DynamicLibrary false - v140 + v141 true MultiByte DynamicLibrary false - v140 + v141 true MultiByte diff --git a/SparkyCLI/SparkyCLI.vcxproj b/SparkyCLI/SparkyCLI.vcxproj index c6bd75ee..0d6251e4 100644 --- a/SparkyCLI/SparkyCLI.vcxproj +++ b/SparkyCLI/SparkyCLI.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -15,19 +15,20 @@ v4.5.2 ManagedCProj SparkyCLI + 10.0.17763.0 DynamicLibrary true - v140 + v141 true Unicode DynamicLibrary false - v140 + v141 true Unicode diff --git a/Tools/SPMBuild/SPMBuild.vcxproj b/Tools/SPMBuild/SPMBuild.vcxproj index 0e3efe6a..956e4299 100644 --- a/Tools/SPMBuild/SPMBuild.vcxproj +++ b/Tools/SPMBuild/SPMBuild.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -21,32 +21,32 @@ {B2F249D4-0D02-4FAB-B031-D0C594DF0CE3} SPMBuild - 8.1 + 10.0.17763.0 Application true - v140 + v141 MultiByte Application false - v140 + v141 true MultiByte Application true - v140 + v141 MultiByte Application false - v140 + v141 true MultiByte From 6d33b2a468ba3f4859a1e83142184e553ff062de Mon Sep 17 00:00:00 2001 From: Pietro Lazzarotto Date: Sun, 17 Mar 2019 14:55:59 +0000 Subject: [PATCH 2/5] Fixed broken includes paths --- Sparky-core/src/sp/app/Window.cpp | 162 +++++++++++----------- SparkyCLI/src/app/Application.h | 4 +- SparkyCLI/src/audio/Sound.cpp | 4 +- SparkyCLI/src/audio/Sound.h | 6 +- SparkyCLI/src/audio/SoundManager.cpp | 10 +- SparkyCLI/src/audio/SoundManager.h | 2 +- SparkyCLI/src/graphics/Window.cpp | 18 +-- SparkyCLI/src/graphics/Window.h | 10 +- SparkyCLI/src/graphics/shaders/Shader.cpp | 8 +- SparkyCLI/src/graphics/shaders/Shader.h | 10 +- SparkyCLI/src/maths/Matrix4.cpp | 22 +-- SparkyCLI/src/maths/Matrix4.h | 6 +- SparkyCLI/src/maths/Vector2.cpp | 6 +- SparkyCLI/src/maths/Vector2.h | 6 +- SparkyCLI/src/maths/Vector3.cpp | 6 +- SparkyCLI/src/maths/Vector3.h | 6 +- SparkyCLI/src/maths/Vector4.cpp | 4 +- SparkyCLI/src/maths/Vector4.h | 6 +- 18 files changed, 148 insertions(+), 148 deletions(-) diff --git a/Sparky-core/src/sp/app/Window.cpp b/Sparky-core/src/sp/app/Window.cpp index fe163596..6648da96 100644 --- a/Sparky-core/src/sp/app/Window.cpp +++ b/Sparky-core/src/sp/app/Window.cpp @@ -10,93 +10,93 @@ namespace sp { - using namespace graphics; + using namespace graphics; - std::map Window::s_Handles; + std::map Window::s_Handles; - Window::Window(const String& title, const WindowProperties& properties) - : m_Title(title), m_Properties(properties), m_Handle(nullptr), m_Closed(false), m_EventCallback(nullptr) - { - if (!Init()) - { - SP_ERROR("Failed base Window initialization!"); - return; - } + Window::Window(const String& title, const WindowProperties& properties) + : m_Title(title), m_Properties(properties), m_Handle(nullptr), m_Closed(false), m_EventCallback(nullptr) + { + if (!Init()) + { + SP_ERROR("Failed base Window initialization!"); + return; + } #ifdef SPARKY_PLATFORM_WEB - FontManager::Add(new Font("SourceSansPro", "res/SourceSansPro-Light.ttf", 32)); + FontManager::Add(new Font("SourceSansPro", "res/SourceSansPro-Light.ttf", 32)); #else - FontManager::SetScale(maths::vec2(m_Properties.width / 32.0f, m_Properties.height / 18.0f)); // TODO: Seriously - FontManager::Add(new Font("SourceSansPro", internal::DEFAULT_FONT, internal::DEFAULT_FONT_SIZE, 32)); + FontManager::SetScale(maths::vec2(m_Properties.width / 32.0f, m_Properties.height / 18.0f)); // TODO: Seriously + FontManager::Add(new Font("SourceSansPro", internal::DEFAULT_FONT, internal::DEFAULT_FONT_SIZE, 32)); #endif - FreeImage_Initialise(); - - audio::SoundManager::Init(); - m_InputManager = new InputManager(); - } - - Window::~Window() - { - FontManager::Clean(); - TextureManager::Clean(); - audio::SoundManager::Clean(); - } - - bool Window::Init() - { - if (!PlatformInit()) - { - SP_FATAL("Failed to initialize platform!"); - return false; - } - - Renderer::Init(); - - SetTitle(m_Title); - return true; - } - - void Window::SetVsync(bool enabled) - { - // TODO: Not implemented - m_Vsync = enabled; - - } - - void Window::Clear() const - { - Renderer::Clear(RENDERER_BUFFER_COLOR | RENDERER_BUFFER_DEPTH); - } - - void Window::Update() - { - PlatformUpdate(); - audio::SoundManager::Update(); - } - - bool Window::Closed() const - { - return m_Closed; - } - - void Window::SetEventCallback(const WindowEventCallback& callback) - { - m_EventCallback = callback; - m_InputManager->SetEventCallback(m_EventCallback); - } - - void Window::RegisterWindowClass(void* handle, Window* window) - { - s_Handles[handle] = window; - } - - Window* Window::GetWindowClass(void* handle) - { - if (handle == nullptr) - return s_Handles.begin()->second; - - return s_Handles[handle]; - } + FreeImage_Initialise(); + + audio::SoundManager::Init(); + m_InputManager = new InputManager(); + } + + Window::~Window() + { + FontManager::Clean(); + TextureManager::Clean(); + audio::SoundManager::Clean(); + } + + bool Window::Init() + { + if (!PlatformInit()) + { + SP_FATAL("Failed to initialize platform!"); + return false; + } + + Renderer::Init(); + + SetTitle(m_Title); + return true; + } + + void Window::SetVsync(bool enabled) + { + // TODO: Not implemented + m_Vsync = enabled; + + } + + void Window::Clear() const + { + Renderer::Clear(RENDERER_BUFFER_COLOR | RENDERER_BUFFER_DEPTH); + } + + void Window::Update() + { + PlatformUpdate(); + audio::SoundManager::Update(); + } + + bool Window::Closed() const + { + return m_Closed; + } + + void Window::SetEventCallback(const WindowEventCallback& callback) + { + m_EventCallback = callback; + m_InputManager->SetEventCallback(m_EventCallback); + } + + void Window::RegisterWindowClass(void* handle, Window* window) + { + s_Handles[handle] = window; + } + + Window* Window::GetWindowClass(void* handle) + { + if (handle == nullptr) + return s_Handles.begin()->second; + + return s_Handles[handle]; + } } \ No newline at end of file diff --git a/SparkyCLI/src/app/Application.h b/SparkyCLI/src/app/Application.h index e406b49f..3a4db28d 100644 --- a/SparkyCLI/src/app/Application.h +++ b/SparkyCLI/src/app/Application.h @@ -2,11 +2,11 @@ #include "..\SparkyCLI.h" -#include +#include namespace SparkyCLI { - public ref class Application : public ManagedClass + public ref class Application : public ManagedClass { public: Application(System::String^ name, uint width, uint height); diff --git a/SparkyCLI/src/audio/Sound.cpp b/SparkyCLI/src/audio/Sound.cpp index cfca45ed..9078c495 100644 --- a/SparkyCLI/src/audio/Sound.cpp +++ b/SparkyCLI/src/audio/Sound.cpp @@ -2,14 +2,14 @@ namespace SparkyCLI { - Sound::Sound(sparky::audio::Sound* instance) + Sound::Sound(sp::audio::Sound* instance) : ManagedClass(instance) { } Sound::Sound(System::String^ name, System::String^ filename) { - m_Instance = new sparky::audio::Sound(string_to_std_string(name), string_to_std_string(filename)); + m_Instance = new sp::audio::Sound(string_to_std_string(name), string_to_std_string(filename)); } void Sound::Play() diff --git a/SparkyCLI/src/audio/Sound.h b/SparkyCLI/src/audio/Sound.h index c563ebb1..1e2e7072 100644 --- a/SparkyCLI/src/audio/Sound.h +++ b/SparkyCLI/src/audio/Sound.h @@ -2,14 +2,14 @@ #include "..\SparkyCLI.h" -#include