Browse Source

Removed /permissive flag

Fixed errors pertaining to conformance mode
Fixed icon file location path in resource file
Paul A. 9 months ago
parent
commit
b990a3ad4e

+ 2 - 0
.gitignore

@@ -49,3 +49,5 @@ compileData.scor.t0000
 !Praxis3D/Data/Sounds/Default/**
 !Praxis3D/Data/Sounds/Default/**
 *.exp
 *.exp
 Builds/x64/Release/Praxis3D.exp
 Builds/x64/Release/Praxis3D.exp
+
+Builds/x64/Release/Praxis3D.lib

BIN
Builds/x64/Release/Praxis3D.exp


BIN
Builds/x64/Release/Praxis3D.lib


+ 1 - 1
Dependencies/include/imgui_tex_inspect/imgui_tex_inspect_internal.h

@@ -82,7 +82,7 @@ struct Inspector
     bool Initialized = false;
     bool Initialized = false;
 
 
     // Texture
     // Texture
-    ImTextureID Texture = ImTextureID{};
+    ImTextureID Texture = 0;
     ImVec2 TextureSize = {0, 0};        // Size in texels of texture
     ImVec2 TextureSize = {0, 0};        // Size in texels of texture
     float PixelAspectRatio = 1;         // Values other than 1 not supported yet
     float PixelAspectRatio = 1;         // Values other than 1 not supported yet
 
 

+ 1 - 1
Praxis3D/Praxis3D.vcxproj

@@ -100,7 +100,7 @@
       <SDLCheck>true</SDLCheck>
       <SDLCheck>true</SDLCheck>
       <LanguageStandard>stdcpp20</LanguageStandard>
       <LanguageStandard>stdcpp20</LanguageStandard>
       <PreprocessorDefinitions>NOMINMAX;NDEBUG;_RELEASE;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;CUSTOM_IMGUIFILEDIALOG_CONFIG="..\\..\\..\\Praxis3D\Source\EngineDefinitions.h";GLM_FORCE_CTOR_INIT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>NOMINMAX;NDEBUG;_RELEASE;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;CUSTOM_IMGUIFILEDIALOG_CONFIG="..\\..\\..\\Praxis3D\Source\EngineDefinitions.h";GLM_FORCE_CTOR_INIT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>false</ConformanceMode>
+      <ConformanceMode>true</ConformanceMode>
       <AdditionalOptions>/bigobj /MP8 %(AdditionalOptions)</AdditionalOptions>
       <AdditionalOptions>/bigobj /MP8 %(AdditionalOptions)</AdditionalOptions>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       <WholeProgramOptimization>true</WholeProgramOptimization>
       <WholeProgramOptimization>true</WholeProgramOptimization>

BIN
Praxis3D/Praxis3D1.rc


+ 1 - 1
Praxis3D/Source/ComponentConstructorInfo.h

@@ -17,7 +17,7 @@ struct ComponentsConstructionInfo
 		m_parent = 0;
 		m_parent = 0;
 	}
 	}
 
 
-	ComponentsConstructionInfo(ComponentsConstructionInfo &p_other)
+	ComponentsConstructionInfo(const ComponentsConstructionInfo &p_other)
 	{
 	{
 		completeCopy(p_other);
 		completeCopy(p_other);
 	}
 	}

+ 1 - 1
Praxis3D/Source/EditorWindow.cpp

@@ -6103,7 +6103,7 @@ void EditorWindow::updateHierarchyList()
             for(decltype(newChildrenFromPreviousRun.size()) childrenSize = newChildrenFromPreviousRun.size(), childrenIndex = 0; childrenIndex < childrenSize; childrenIndex++)
             for(decltype(newChildrenFromPreviousRun.size()) childrenSize = newChildrenFromPreviousRun.size(), childrenIndex = 0; childrenIndex < childrenSize; childrenIndex++)
             {
             {
                 // Go over each entity left, that haven't been added as children
                 // Go over each entity left, that haven't been added as children
-                auto &parentlessEntity = parentlessEntityList.begin();
+                auto parentlessEntity = parentlessEntityList.begin();
                 while(parentlessEntity != parentlessEntityList.end())
                 while(parentlessEntity != parentlessEntityList.end())
                 {
                 {
                     // If the entity ID of the current child and the parent entity ID of the parent-less entity matches, add the parent-less entity as a child
                     // If the entity ID of the current child and the parent entity ID of the parent-less entity matches, add the parent-less entity as a child

+ 4 - 22
Praxis3D/Source/TaskManager.cpp

@@ -216,29 +216,11 @@ void TaskManager::issueJobsForSystemTasks(SystemTask **p_tasks, unsigned int p_c
 				//if(getPerformanceHint(p_tasks[currentTask]) == (PerformanceHint)perfHint)
 				//if(getPerformanceHint(p_tasks[currentTask]) == (PerformanceHint)perfHint)
 				//{
 				//{
 					// This task can be run on an arbitrary thread - allocate it 
 					// This task can be run on an arbitrary thread - allocate it 
-					//TaskManagerGlobal::GenericCallbackTask<TaskManager::JobFunct> *systemTask
-					//	= new(m_systemTasksRoot->allocate_additional_child_of(*m_systemTasksRoot))
-					//	TaskManagerGlobal::GenericCallbackTask<TaskManager::JobFunct>(systemTaskCallback, p_tasks[currentTask]);
-
-					//std::bind(p_func, currentTask, std::forward<T_Type>(p_args)...)
-
-					//auto test = std::bind(&SystemTask::update, p_tasks[currentTask], p_deltaTime);
-
-					//TaskManagerGlobal::GenericCallbackTask2<std::function<void(SystemTask *)>> *systemTask = new(m_systemTasksRoot->allocate_additional_child_of(*m_systemTasksRoot)) TaskManagerGlobal::GenericCallbackTask2<std::function<void(SystemTask *)>>(std::bind(&SystemTask::update, p_tasks[currentTask], p_deltaTime));
-					//TaskManagerGlobal::GenericCallbackTask2<std::function<void()>> *systemTask = new(m_systemTasksRoot->allocate_additional_child_of(*m_systemTasksRoot)) TaskManagerGlobal::GenericCallbackTask2<std::function<void()>>(std::bind(&SystemTask::update, p_tasks[currentTask], p_deltaTime));
-
-					//TaskManagerGlobal::GenericCallbackTask3<void(SystemTask::*)(SystemTask*, float), SystemTask*, float> *systemTask = new(m_systemTasksRoot->allocate_additional_child_of(*m_systemTasksRoot))
-					//	TaskManagerGlobal::GenericCallbackTask3<void(SystemTask::*)(SystemTask*, float), SystemTask*, float>(&SystemTask::update, p_tasks[currentTask], p_deltaTime);
+					auto *systemTask = new(m_systemTasksRoot->allocate_additional_child_of(*m_systemTasksRoot)) TaskManagerGlobal::GenericCallbackTask(&SystemTask::update, p_tasks[currentTask], p_deltaTime);
 
 
-					//auto test = std::bind(&SystemTask::update, p_tasks[currentTask], p_deltaTime);
-
-					TaskManagerGlobal::GenericCallbackTaskFunctor<decltype(std::bind(&SystemTask::update, p_tasks[currentTask], p_deltaTime))> *systemTask
-						= new(m_systemTasksRoot->allocate_additional_child_of(*m_systemTasksRoot))
-						TaskManagerGlobal::GenericCallbackTaskFunctor<decltype(std::bind(&SystemTask::update, p_tasks[currentTask], p_deltaTime))>(std::bind(&SystemTask::update, p_tasks[currentTask], p_deltaTime));
-
-
-					//TaskManagerGlobal::GenericCallbackTask<TaskManager::JobFunct> *systemTask
-					//	= new(m_systemTasksRoot->allocate_additional_child_of(*m_systemTasksRoot))TaskManagerGlobal::GenericCallbackTask<TaskManager::JobFunct>(systemTaskCallback2, std::function<void(SystemTask*, float)>(&SystemTask::update), p_tasks[currentTask], p_deltaTime);
+					//TaskManagerGlobal::GenericCallbackTaskFunctor<decltype(std::bind(&SystemTask::update, p_tasks[currentTask], p_deltaTime))> *systemTask
+					//	= new(m_systemTasksRoot->allocate_additional_child_of(*m_systemTasksRoot))
+					//	TaskManagerGlobal::GenericCallbackTaskFunctor<decltype(std::bind(&SystemTask::update, p_tasks[currentTask], p_deltaTime))>(std::bind(&SystemTask::update, p_tasks[currentTask], p_deltaTime));
 
 
 					// TODO ASSERT ERROR
 					// TODO ASSERT ERROR
 					assert(systemTask != nullptr);
 					assert(systemTask != nullptr);

+ 36 - 44
Praxis3D/Source/TaskManager.h

@@ -30,6 +30,41 @@ inline PerformanceHint getPerformanceHint(SystemTask *p_task)
 	return Task_NoPerformanceHint;
 	return Task_NoPerformanceHint;
 }
 }
 
 
+namespace TaskManagerGlobal
+{
+	// Stores a function pointer (usually TaskManager::JobFunct) and a single parameter
+	template <typename Func, typename... Args>
+	class GenericCallbackTask : public tbb::task
+	{
+	private:
+		Func m_function;
+		std::tuple<Args...> m_arguments; // Store arguments in a tuple
+
+	public:
+		// Constructor: Use perfect forwarding to capture the function and its arguments.
+		template <typename F, typename... A>
+		GenericCallbackTask(F &&p_function, A&&... p_arguments)
+			: m_function(std::forward<F>(p_function))
+			, m_arguments(std::forward_as_tuple(std::forward<A>(p_arguments)...)) // Use forward_as_tuple
+		{
+		}
+
+		tbb::task *execute()
+		{
+			//TODO ERROR
+			assert(m_function != nullptr);
+
+			std::apply(m_function, m_arguments);
+
+			return NULL;
+		}
+	};
+
+	// Helper function to make creating the functor easier (deduction guide)
+	template <typename F, typename... Args>
+	GenericCallbackTask(F &&, Args&&...) -> GenericCallbackTask<F, Args...>;
+}
+
 class TaskManager
 class TaskManager
 {
 {
 public:
 public:
@@ -141,11 +176,7 @@ public:
 			}
 			}
 			else
 			else
 			{
 			{
-				auto test = std::bind(p_func, p_tasks[currentTask], std::forward<T_Args>(p_args)...);
-
-				TaskManagerGlobal::GenericCallbackTaskFunctor<decltype(test)> *systemTask
-					= new(m_systemTasksRoot->allocate_additional_child_of(*m_systemTasksRoot))
-					TaskManagerGlobal::GenericCallbackTaskFunctor<decltype(test)>(test);
+				auto *systemTask = new(m_systemTasksRoot->allocate_additional_child_of(*m_systemTasksRoot)) TaskManagerGlobal::GenericCallbackTask(p_func, p_tasks[currentTask], std::forward<T_Args>(p_args)...);
 				
 				
 				// TODO ASSERT ERROR
 				// TODO ASSERT ERROR
 				assert(systemTask != nullptr);
 				assert(systemTask != nullptr);
@@ -260,45 +291,6 @@ namespace TaskManagerGlobal
 		void *m_param;
 		void *m_param;
 	};
 	};
 
 
-	// Stores a function pointer (usually TaskManager::JobFunct) and a single parameter
-	template<typename T_Func>
-	class GenericCallbackTask : public tbb::task, public GenericCallbackData
-	{
-	public:
-		GenericCallbackTask(T_Func p_ptr, void *p_param) : GenericCallbackData(p_param), m_ptr(p_ptr) { }
-
-		tbb::task *execute()
-		{
-			//TODO ERROR
-			assert(m_ptr != nullptr);
-
-			m_ptr(m_param);
-
-			return NULL;
-		}
-
-	protected:
-		T_Func m_ptr;
-	};
-
-	// Stores a function pointer (to be used with std::bind, so the function pointer already contains all the parameters it needs)
-	template<typename T_Func>
-	class GenericCallbackTaskFunctor : public tbb::task
-	{
-	public:
-		GenericCallbackTaskFunctor(T_Func &p_func) : m_func(p_func) { }
-
-		tbb::task *execute()
-		{
-			m_func();
-
-			return NULL;
-		}
-
-	private:
-		T_Func m_func;
-	};
-
 	class SynchronizeTask : public tbb::task
 	class SynchronizeTask : public tbb::task
 	{
 	{
 	public:
 	public:

+ 1 - 1
Praxis3D/Source/TaskScheduler.h

@@ -21,7 +21,7 @@ public:
 
 
 	// Calls any member function of SystemTask that is passed as an argument, and forwards all passed parameters
 	// Calls any member function of SystemTask that is passed as an argument, and forwards all passed parameters
 	template<typename T_Func, typename... T_Args>
 	template<typename T_Func, typename... T_Args>
-	void execute(T_Func &p_func, T_Args&&... p_args)
+	void execute(T_Func &&p_func, T_Args&&... p_args)
 	{
 	{
 		// If multithreading is enabled, execute tasks over threads in parallel
 		// If multithreading is enabled, execute tasks over threads in parallel
 		if(m_multithreadingEnabled)
 		if(m_multithreadingEnabled)

+ 0 - 0
praxis icon.ico → Praxis3D_icon.ico