diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3049412 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "vs/SDL"] + path = vs/SDL + url = https://github.com/libsdl-org/SDL.git +[submodule "vs/glew"] + path = vs/glew + url = gitea@gitea.veleslabs.org:jan.mrna/glew.git +[submodule "vs/SDL_image"] + path = vs/SDL_image + url = https://github.com/libsdl-org/SDL_image.git diff --git a/cpp/src/log.hpp b/cpp/src/log.hpp index e8bcffe..2f1cb6d 100644 --- a/cpp/src/log.hpp +++ b/cpp/src/log.hpp @@ -2,13 +2,21 @@ #include -#define LOG_CRITICAL(...) Log::critical(__PRETTY_FUNCTION__, ": ", __VA_ARGS__) -#define LOG_ERROR(...) Log::error(__PRETTY_FUNCTION__, ": ", __VA_ARGS__) -#define LOG_WARNING(...) Log::warning(__PRETTY_FUNCTION__, ": ", __VA_ARGS__) -#define LOG_INFO(...) Log::info(__PRETTY_FUNCTION__, ": ", __VA_ARGS__) -#define LOG_DEBUG(...) Log::debug(__PRETTY_FUNCTION__, ": ", __VA_ARGS__) +#if defined(__GNUC__) || defined(__clang__) +# define PRETTY_FUNC __PRETTY_FUNCTION__ +#elif defined(_MSC_VER) +# define PRETTY_FUNC __FUNCTION__ +#else +# define PRETTY_FUNC __func__ +#endif + +#define LOG_CRITICAL(...) Log::critical(PRETTY_FUNC, ": ", __VA_ARGS__) +#define LOG_ERROR(...) Log::error(PRETTY_FUNC, ": ", __VA_ARGS__) +#define LOG_WARNING(...) Log::warning(PRETTY_FUNC, ": ", __VA_ARGS__) +#define LOG_INFO(...) Log::info(PRETTY_FUNC, ": ", __VA_ARGS__) +#define LOG_DEBUG(...) Log::debug(PRETTY_FUNC, ": ", __VA_ARGS__) #define LOG_PROFILING_DEBUG(...) \ - Log::profiling_debug(__PRETTY_FUNCTION__, ": ", __VA_ARGS__) + Log::profiling_debug(PRETTY_FUNC, ": ", __VA_ARGS__) namespace Log { enum class LevelTypes { diff --git a/cpp/src/math.hpp b/cpp/src/math.hpp index d48eaaf..f7e5f5e 100644 --- a/cpp/src/math.hpp +++ b/cpp/src/math.hpp @@ -9,6 +9,11 @@ constexpr double EQUALITY_LIMIT = 1e-6; +#ifdef _WIN32 +#include +#define M_PI std::numbers::pi +#endif + template struct Vec2D { public: Vec2D() = default; diff --git a/vs/SDL b/vs/SDL new file mode 160000 index 0000000..3e9e22f --- /dev/null +++ b/vs/SDL @@ -0,0 +1 @@ +Subproject commit 3e9e22f17dcc234cf77e73af47982905bd9b6912 diff --git a/vs/SDL_image b/vs/SDL_image new file mode 160000 index 0000000..eeae8a6 --- /dev/null +++ b/vs/SDL_image @@ -0,0 +1 @@ +Subproject commit eeae8a64dfc065918fc259a7afe271bce8bcaadc diff --git a/vs/glew b/vs/glew new file mode 160000 index 0000000..02505d6 --- /dev/null +++ b/vs/glew @@ -0,0 +1 @@ +Subproject commit 02505d6cc1397c7420b46cf58685a68db4ca46d8 diff --git a/vs/pathfinding_demo/pathfinding_demo.sln b/vs/pathfinding_demo/pathfinding_demo.sln new file mode 100644 index 0000000..9e471cb --- /dev/null +++ b/vs/pathfinding_demo/pathfinding_demo.sln @@ -0,0 +1,61 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34622.214 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pathfinding_demo", "pathfinding_demo.vcxproj", "{E14D159C-08E1-46E4-BD63-6157EDBC70DC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3", "..\SDL\VisualC\SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glew_static", "..\glew\build\vc15\glew_static.vcxproj", "{664E6F0D-6784-4760-9565-D54F8EB1EDF4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_image", "..\SDL_image\VisualC\SDL_image.vcxproj", "{2BD5534E-00E2-4BEA-AC96-D9A92EA24696}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E14D159C-08E1-46E4-BD63-6157EDBC70DC}.Debug|x64.ActiveCfg = Debug|x64 + {E14D159C-08E1-46E4-BD63-6157EDBC70DC}.Debug|x64.Build.0 = Debug|x64 + {E14D159C-08E1-46E4-BD63-6157EDBC70DC}.Debug|x86.ActiveCfg = Debug|Win32 + {E14D159C-08E1-46E4-BD63-6157EDBC70DC}.Debug|x86.Build.0 = Debug|Win32 + {E14D159C-08E1-46E4-BD63-6157EDBC70DC}.Release|x64.ActiveCfg = Release|x64 + {E14D159C-08E1-46E4-BD63-6157EDBC70DC}.Release|x64.Build.0 = Release|x64 + {E14D159C-08E1-46E4-BD63-6157EDBC70DC}.Release|x86.ActiveCfg = Release|Win32 + {E14D159C-08E1-46E4-BD63-6157EDBC70DC}.Release|x86.Build.0 = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x86.ActiveCfg = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x86.Build.0 = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x86.ActiveCfg = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x86.Build.0 = Release|Win32 + {664E6F0D-6784-4760-9565-D54F8EB1EDF4}.Debug|x64.ActiveCfg = Debug|x64 + {664E6F0D-6784-4760-9565-D54F8EB1EDF4}.Debug|x64.Build.0 = Debug|x64 + {664E6F0D-6784-4760-9565-D54F8EB1EDF4}.Debug|x86.ActiveCfg = Debug|Win32 + {664E6F0D-6784-4760-9565-D54F8EB1EDF4}.Debug|x86.Build.0 = Debug|Win32 + {664E6F0D-6784-4760-9565-D54F8EB1EDF4}.Release|x64.ActiveCfg = Release|x64 + {664E6F0D-6784-4760-9565-D54F8EB1EDF4}.Release|x64.Build.0 = Release|x64 + {664E6F0D-6784-4760-9565-D54F8EB1EDF4}.Release|x86.ActiveCfg = Release|Win32 + {664E6F0D-6784-4760-9565-D54F8EB1EDF4}.Release|x86.Build.0 = Release|Win32 + {2BD5534E-00E2-4BEA-AC96-D9A92EA24696}.Debug|x64.ActiveCfg = Debug|x64 + {2BD5534E-00E2-4BEA-AC96-D9A92EA24696}.Debug|x64.Build.0 = Debug|x64 + {2BD5534E-00E2-4BEA-AC96-D9A92EA24696}.Debug|x86.ActiveCfg = Debug|Win32 + {2BD5534E-00E2-4BEA-AC96-D9A92EA24696}.Debug|x86.Build.0 = Debug|Win32 + {2BD5534E-00E2-4BEA-AC96-D9A92EA24696}.Release|x64.ActiveCfg = Release|x64 + {2BD5534E-00E2-4BEA-AC96-D9A92EA24696}.Release|x64.Build.0 = Release|x64 + {2BD5534E-00E2-4BEA-AC96-D9A92EA24696}.Release|x86.ActiveCfg = Release|Win32 + {2BD5534E-00E2-4BEA-AC96-D9A92EA24696}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7CCA451E-D4BA-48B4-AAD0-8AC02333FD9D} + EndGlobalSection +EndGlobal diff --git a/vs/pathfinding_demo/pathfinding_demo.vcxproj b/vs/pathfinding_demo/pathfinding_demo.vcxproj new file mode 100644 index 0000000..c7828c9 --- /dev/null +++ b/vs/pathfinding_demo/pathfinding_demo.vcxproj @@ -0,0 +1,167 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + {664e6f0d-6784-4760-9565-d54f8eb1edf4} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + {2bd5534e-00e2-4bea-ac96-d9a92ea24696} + + + + 17.0 + Win32Proj + {e14d159c-08e1-46e4-bd63-6157edbc70dc} + pathfindingdemo + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + GLEW_STATIC + true + stdcpplatest + ..\glew\include;..\SDL\include;..\SDL_image\include;..\;%(AdditionalIncludeDirectories) + + + Console + true + ..\glew\lib\Debug\x64;%(AdditionalLibraryDirectories) + opengl32.lib;glu32.lib;glew32sd.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + GLEW_STATIC + true + stdcpplatest + ..\glew\include;..\SDL\include;..\SDL_image\include;..\;%(AdditionalIncludeDirectories) + + + Console + true + true + true + ..\glew\lib\Debug\x64;%(AdditionalLibraryDirectories) + opengl32.lib;glu32.lib;glew32sd.lib;%(AdditionalDependencies) + + + + + Level3 + true + GLEW_STATIC + true + stdcpplatest + ..\glew\include;..\SDL\include;..\SDL_image\include;..\;%(AdditionalIncludeDirectories) + + + Console + true + ..\glew\lib\Debug\x64;%(AdditionalLibraryDirectories) + opengl32.lib;glu32.lib;glew32sd.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + GLEW_STATIC + true + stdcpplatest + ..\glew\include;..\SDL\include;..\SDL_image\include;..\;%(AdditionalIncludeDirectories) + + + Console + true + true + true + ..\glew\lib\Debug\x64;%(AdditionalLibraryDirectories) + opengl32.lib;glu32.lib;glew32sd.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/vs/pathfinding_demo/pathfinding_demo.vcxproj.filters b/vs/pathfinding_demo/pathfinding_demo.vcxproj.filters new file mode 100644 index 0000000..fca6151 --- /dev/null +++ b/vs/pathfinding_demo/pathfinding_demo.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {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 + + + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/vs/pathfinding_demo/pathfinding_demo.vcxproj.user b/vs/pathfinding_demo/pathfinding_demo.vcxproj.user new file mode 100644 index 0000000..fcaf9b4 --- /dev/null +++ b/vs/pathfinding_demo/pathfinding_demo.vcxproj.user @@ -0,0 +1,19 @@ + + + + $(ProjectDir)\..\..\cpp + WindowsLocalDebugger + + + $(ProjectDir)\..\..\cpp + WindowsLocalDebugger + + + $(ProjectDir)\..\..\cpp + WindowsLocalDebugger + + + $(ProjectDir)\..\..\cpp + WindowsLocalDebugger + + \ No newline at end of file