Skip to content

Commit

Permalink
Update Project to C++20
Browse files Browse the repository at this point in the history
  • Loading branch information
KredeGC committed Sep 8, 2024
1 parent 21eac5b commit bc2d5b2
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Erebor/imgui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,6 @@ DockSpace ID=0x3FC20BEE Window=0x9A404470 Pos=0,45 Size=1920,995 Split=Y
DockNode ID=0x0000000A Parent=0x3FC20BEE SizeRef=1920,350 Split=X Selected=0xBF096F38
DockNode ID=0x0000000B Parent=0x0000000A SizeRef=381,324 Selected=0x50413B2F
DockNode ID=0x00000008 Parent=0x0000000A SizeRef=1537,324 Split=X Selected=0xBF096F38
DockNode ID=0x00000006 Parent=0x00000008 SizeRef=1048,350 Selected=0xBF096F38
DockNode ID=0x00000006 Parent=0x00000008 SizeRef=1048,350 Selected=0x49278EEE
DockNode ID=0x0000000C Parent=0x00000008 SizeRef=487,350 Selected=0x7EA89797

2 changes: 1 addition & 1 deletion Mahakam/premake5.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project "Mahakam"
kind "StaticLib"
language "C++"
cppdialect "C++17"
cppdialect "C++20"
staticruntime "off"
pic "on"

Expand Down
2 changes: 1 addition & 1 deletion Mahakam/src/Mahakam/Asset/AssetDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ namespace Mahakam
{
if (!FileUtility::Exists(filepath))
{
MH_WARN("Could not import assets. Does the '{0}' folder exist?", filepath.u8string());
MH_WARN("Could not import assets. Does the '{0}' folder exist?", filepath.string());
return;
}

Expand Down
2 changes: 2 additions & 0 deletions Mahakam/src/Mahakam/Core/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ namespace Mahakam

void Application::Run()
{
m_LastFrameTime = m_Window->GetTime();

while (m_Running)
{
double time = m_Window->GetTime();
Expand Down
2 changes: 1 addition & 1 deletion Mahakam/src/Mahakam/Editor/Resource/ResourceRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ namespace Mahakam
{
if (!FileUtility::Exists(filepath))
{
MH_WARN("Could not import assets. Does the '{0}' folder exist?", filepath.u8string());
MH_WARN("Could not import assets. Does the '{0}' folder exist?", filepath.string());
return;
}

Expand Down
9 changes: 9 additions & 0 deletions Mahakam/src/Mahakam/Scene/ComponentRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ namespace Mahakam
#ifndef MH_STANDALONE
Icon = icon;
OnPropertyDraw = onPropertyDraw;
#endif
}

template<typename T>
inline void SetEditor(const T* icon = nullptr, void (*onPropertyDraw)(Entity) = nullptr)
{
#ifndef MH_STANDALONE
Icon = reinterpret_cast<const char*>(icon);
OnPropertyDraw = onPropertyDraw;
#endif
}
};
Expand Down
4 changes: 4 additions & 0 deletions Mahakam/src/Mahakam/Scene/SceneDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ namespace Mahakam
class PhysicsContext;
class TextureCube;

// TODO: Scene should hold the AssetDatabase, AudioEngine and PhysicsEngine
// This way, when a scene is destroyed everything is destroyed with it
// Should be careful with assets though, so we don't unload assets that are used in multiple scenes

class Scene
{
private:
Expand Down
2 changes: 1 addition & 1 deletion Mahakam/vendor/glslang/premake5.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project "glslang"
kind "StaticLib"
language "C++"
cppdialect "C++17"
cppdialect "C++20"
staticruntime "off"
pic "on"

Expand Down
2 changes: 1 addition & 1 deletion Mahakam/vendor/imgui/premake5.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project "ImGui"
kind "StaticLib"
language "C++"
cppdialect "C++17"
cppdialect "C++20"
staticruntime "off"
pic "on"

Expand Down
2 changes: 1 addition & 1 deletion Mahakam/vendor/imguizmo/premake5.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project "ImGuizmo"
kind "StaticLib"
language "C++"
cppdialect "C++17"
cppdialect "C++20"
staticruntime "off"
pic "on"

Expand Down
2 changes: 1 addition & 1 deletion Mahakam/vendor/spirv_cross/premake5.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project "spirv_cross"
kind "StaticLib"
language "C++"
cppdialect "C++17"
cppdialect "C++20"
staticruntime "off"
pic "on"

Expand Down
2 changes: 1 addition & 1 deletion Sandbox/premake5.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project "Sandbox"
kind "SharedLib"
language "C++"
cppdialect "C++17"
cppdialect "C++20"
staticruntime "off"
pic "on"

Expand Down
5 changes: 5 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Make Erebor into an asset importer instead of an editor
Make Sandbox the editor
Editor windows should be part of Mahakam
Scenes should hold the AssetDatabase, AudioEngine and PhysicsEngine
Maybe replace Bullet with Jolt?
2 changes: 1 addition & 1 deletion generate-standalone.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
call vendor\bin\premake\premake5.exe vs2019 --toolset=msc --target=windows --standalone
call vendor\bin\premake\premake5.exe vs2022 --toolset=msc --target=windows --standalone
pause
2 changes: 1 addition & 1 deletion generate.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
call ..\premake5\bin\premake5.exe vs2019 --toolset=msc
call ..\premake5\bin\premake5.exe vs2022 --toolset=msc
pause

0 comments on commit bc2d5b2

Please sign in to comment.