Skip to content

Commit

Permalink
Fix iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorton06 committed Feb 10, 2025
1 parent c9faf3a commit 6a76ee6
Show file tree
Hide file tree
Showing 35 changed files with 978 additions and 851 deletions.
17 changes: 12 additions & 5 deletions Editor/Source/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,10 @@ namespace Lumos
auto& guizmoStyle = ImGuizmo::GetStyle();
guizmoStyle.HatchedAxisLineThickness = -1.0f;

#ifdef LUMOS_PLATFORM_IOS
m_TempSceneSaveFilePath = OS::Get().GetAssetPath();
#else
#ifdef LUMOS_PLATFORM_LINUX
m_TempSceneSaveFilePath = std::filesystem::current_path().string();
#elif defined(LUMOS_PLATFORM_IOS)
m_TempSceneSaveFilePath = OS::Get().GetCurrentWorkingDirectory();
#else
m_TempSceneSaveFilePath = std::filesystem::temp_directory_path().string();
#endif
Expand All @@ -190,14 +189,19 @@ namespace Lumos
deleteIniFile = true;
}

m_TempSceneSaveFilePath += "Lumos/";
m_TempSceneSaveFilePath += "/Lumos/";
if(!FileSystem::FolderExists(m_TempSceneSaveFilePath))
std::filesystem::create_directory(m_TempSceneSaveFilePath);

std::vector<std::string> iniLocation = {
StringUtilities::GetFileLocation(OS::Get().GetExecutablePath()) + "Editor.ini",
StringUtilities::GetFileLocation(OS::Get().GetExecutablePath()) + "../../../Editor.ini"
};

#if defined(LUMOS_PLATFORM_IOS)
iniLocation.push_back(StringUtilities::GetFileLocation(OS::Get().GetAssetPath()) + "Editor.ini");
#endif

bool fileFound = false;
std::string filePath;
for(auto& path : iniLocation)
Expand Down Expand Up @@ -228,6 +232,8 @@ namespace Lumos
LINFO("Editor Ini not found");
#ifdef LUMOS_PLATFORM_MACOS
filePath = StringUtilities::GetFileLocation(OS::Get().GetExecutablePath()) + "../../../Editor.ini";
#elif defined(LUMOS_PLATFORM_IOS)
filePath = StringUtilities::GetFileLocation(OS::Get().GetAssetPath()) + "Editor.ini";
#else
filePath = StringUtilities::GetFileLocation(OS::Get().GetExecutablePath()) + "Editor.ini";
#endif
Expand All @@ -238,7 +244,6 @@ namespace Lumos
AddDefaultEditorSettings();
// ImGui::GetIO().IniFilename = "editor.ini";
}
#endif

Application::Init();
Application::SetEditorState(EditorState::Preview);
Expand Down Expand Up @@ -2894,6 +2899,8 @@ namespace Lumos
m_ProjectSettings.m_ProjectRoot = "../../ExampleProject/";
}
}
#elif defined(LUMOS_PLATFORM_IOS)
m_ProjectSettings.m_ProjectRoot = OS::Get().GetAssetPath() + "/ExampleProject/";
#endif

m_ProjectSettings.m_ProjectName = "Example";
Expand Down
27 changes: 15 additions & 12 deletions Editor/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ project "LumosEditor"
"AudioToolbox.framework",
"Foundation.framework",
"SystemConfiguration.framework",
"IOSurface.framework"
}

linkoptions
Expand All @@ -197,12 +198,13 @@ project "LumosEditor"
"../Resources/AppIcons/Assets.xcassets",
"../Lumos/Assets/Shaders",
"../Lumos/Source/Lumos/Platform/iOS/Client/**",
"../ExampleProject/Assets/Scenes",
"../ExampleProject/Assets/Scripts",
"../ExampleProject/Assets/Meshes",
"../ExampleProject/Assets/Sounds",
"../ExampleProject/Assets/Textures",
"../ExampleProject/Example.lmproj"
"../ExampleProject/"
-- "../ExampleProject/Assets/Scenes",
-- "../ExampleProject/Assets/Scripts",
-- "../ExampleProject/Assets/Meshes",
-- "../ExampleProject/Assets/Sounds",
-- "../ExampleProject/Assets/Textures",
-- "../ExampleProject/Example.lmproj"
}

xcodebuildsettings
Expand Down Expand Up @@ -253,12 +255,13 @@ project "LumosEditor"
"../Lumos/Source/Platform/iOS/Client",
"Assets.xcassets",
"Shaders",
"Meshes",
"Scenes",
"Scripts",
"Sounds",
"Textures",
"Example.lmproj"
"ExampleProject"
-- "Meshes",
-- "Scenes",
-- "Scripts",
-- "Sounds",
-- "Textures",
--"Example.lmproj"
}

filter "system:linux"
Expand Down
Binary file modified ExampleProject/Assets/Scenes/Cache/Physics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6a76ee6

Please sign in to comment.