Minor Update - V9.1.0
[FEAT] : + Import Assets in project copy file in project
This commit is contained in:
parent
eea7b4c067
commit
3930c5eff7
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="RiderProjectSettingsUpdater">
|
<component name="RiderProjectSettingsUpdater">
|
||||||
<option name="singleClickDiffPreview" value="1" />
|
<option name="vcsConfiguration" value="2" />
|
||||||
<option name="vcsConfiguration" value="3" />
|
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
72
.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
generated
72
.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
generated
@ -5,13 +5,13 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="">
|
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="">
|
||||||
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/enginecustom/assets/scene.ker" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/assets/scene.ker" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/object.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/object.h" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/Systemclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/Systemclass.cpp" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/Systemclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/Systemclass.cpp" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/object.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/object.cpp" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@ -44,30 +44,38 @@
|
|||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent">{
|
<component name="PropertiesComponent"><![CDATA[{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
"C++ Project.enginecustom.executor": "Run",
|
"C++ Project.enginecustom.executor": "Run",
|
||||||
"C/C++ Project.enginecustom.executor": "Run",
|
"C/C++ Project.enginecustom.executor": "Run",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
"git-widget-placeholder": "main",
|
"git-widget-placeholder": "main",
|
||||||
"ignore.virus.scanning.warn.message": "true",
|
"ignore.virus.scanning.warn.message": "true",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"node.js.selected.package.tslint": "(autodetect)",
|
"node.js.selected.package.tslint": "(autodetect)",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"settings.editor.selected.configurable": "preferences.pluginManager",
|
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||||
"vue.rearranger.settings.migration": "true"
|
"vue.rearranger.settings.migration": "true"
|
||||||
|
},
|
||||||
|
"keyToStringList": {
|
||||||
|
"rider.external.source.directories": [
|
||||||
|
"C:\\Users\\arivas\\AppData\\Roaming\\JetBrains\\Rider2024.1\\resharper-host\\DecompilerCache",
|
||||||
|
"C:\\Users\\arivas\\AppData\\Roaming\\JetBrains\\Rider2024.1\\resharper-host\\SourcesCache",
|
||||||
|
"C:\\Users\\arivas\\AppData\\Local\\Symbols\\src"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}</component>
|
}]]></component>
|
||||||
<component name="RunManager" selected="C/C++ Project.enginecustom">
|
<component name="RunManager" selected="C++ Project.enginecustom">
|
||||||
<configuration name="KhaoticDemo" type="CppProject" factoryName="C++ Project">
|
<configuration name="KhaoticDemo" type="CppProject" factoryName="C++ Project">
|
||||||
<configuration_1 setup="1">
|
<configuration_1>
|
||||||
<option name="CONFIGURATION" value="Debug" />
|
<option name="CONFIGURATION" value="Debug" />
|
||||||
<option name="PLATFORM" value="x64" />
|
<option name="PLATFORM" value="x64" />
|
||||||
|
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||||
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||||
<option name="EXE_PATH" value="$(LocalDebuggerCommand)" />
|
<option name="EXE_PATH" value="$(LocalDebuggerCommand)" />
|
||||||
<option name="PROGRAM_PARAMETERS" value="$(LocalDebuggerCommandArguments)" />
|
<option name="PROGRAM_PARAMETERS" value="$(LocalDebuggerCommandArguments)" />
|
||||||
@ -75,19 +83,18 @@
|
|||||||
<option name="PASS_PARENT_ENVS" value="1" />
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
|
||||||
</configuration_1>
|
</configuration_1>
|
||||||
<option name="DEFAULT_PROJECT_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
<option name="DEFAULT_PROJECT_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
|
||||||
<option name="AUTO_SELECT_PRIORITY" value="0" />
|
<option name="AUTO_SELECT_PRIORITY" value="0" />
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="Build" />
|
<option name="Build" />
|
||||||
</method>
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration name="enginecustom" type="CppProject" factoryName="C++ Project">
|
<configuration name="enginecustom" type="CppProject" factoryName="C++ Project">
|
||||||
<configuration_1 setup="1">
|
<configuration_1>
|
||||||
<option name="CONFIGURATION" value="Debug" />
|
<option name="CONFIGURATION" value="Debug" />
|
||||||
<option name="PLATFORM" value="x64" />
|
<option name="PLATFORM" value="x64" />
|
||||||
|
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||||
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||||
<option name="EXE_PATH" value="$(LocalDebuggerCommand)" />
|
<option name="EXE_PATH" value="$(LocalDebuggerCommand)" />
|
||||||
<option name="PROGRAM_PARAMETERS" value="$(LocalDebuggerCommandArguments)" />
|
<option name="PROGRAM_PARAMETERS" value="$(LocalDebuggerCommandArguments)" />
|
||||||
@ -95,10 +102,20 @@
|
|||||||
<option name="PASS_PARENT_ENVS" value="1" />
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
|
||||||
</configuration_1>
|
</configuration_1>
|
||||||
|
<configuration_2>
|
||||||
|
<option name="CONFIGURATION" value="Release" />
|
||||||
|
<option name="PLATFORM" value="x64" />
|
||||||
|
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||||
|
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||||
|
<option name="EXE_PATH" value="$(TargetPath)" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$(ProjectDir)" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||||
|
</configuration_2>
|
||||||
<option name="DEFAULT_PROJECT_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
<option name="DEFAULT_PROJECT_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
|
||||||
<option name="AUTO_SELECT_PRIORITY" value="0" />
|
<option name="AUTO_SELECT_PRIORITY" value="0" />
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="Build" />
|
<option name="Build" />
|
||||||
@ -140,6 +157,7 @@
|
|||||||
<workItem from="1742314944369" duration="79000" />
|
<workItem from="1742314944369" duration="79000" />
|
||||||
<workItem from="1742318452773" duration="2258000" />
|
<workItem from="1742318452773" duration="2258000" />
|
||||||
<workItem from="1742331065936" duration="3030000" />
|
<workItem from="1742331065936" duration="3030000" />
|
||||||
|
<workItem from="1742371397157" duration="5389000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
|
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
|
@ -1 +0,0 @@
|
|||||||
1 isosphere 0 14.4537 0 1 1 1 F:\Github_Repo\khaotic-engine-Reborn\enginecustom\assets\Model\OBJ\isosphere.obj
|
|
@ -170,7 +170,6 @@ private:
|
|||||||
void ConstructSkybox(); // Construct the skybox
|
void ConstructSkybox(); // Construct the skybox
|
||||||
void UpdateSkyboxPosition(); // Update the skybox position
|
void UpdateSkyboxPosition(); // Update the skybox position
|
||||||
bool RenderSkybox(XMMATRIX view, XMMATRIX projection); // Render the skybox
|
bool RenderSkybox(XMMATRIX view, XMMATRIX projection); // Render the skybox
|
||||||
|
|
||||||
|
|
||||||
public :
|
public :
|
||||||
std::vector<ID3D11ShaderResourceView*> textures;
|
std::vector<ID3D11ShaderResourceView*> textures;
|
||||||
|
@ -153,12 +153,7 @@ void SystemClass::Run()
|
|||||||
int result_scene = MessageBox(NULL, L"Do you want to load a saved scene?", L"Load Scene", MB_YESNO | MB_ICONQUESTION);
|
int result_scene = MessageBox(NULL, L"Do you want to load a saved scene?", L"Load Scene", MB_YESNO | MB_ICONQUESTION);
|
||||||
if (result_scene == IDYES)
|
if (result_scene == IDYES)
|
||||||
{
|
{
|
||||||
std::wstring scenePath = m_Application->GetScenePath();
|
m_Application->LoadScene();
|
||||||
if (!scenePath.empty())
|
|
||||||
{
|
|
||||||
m_Application->SetScenePath(m_Application->ConvertWStringToString(scenePath));
|
|
||||||
m_Application->LoadScene();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -537,31 +532,4 @@ void SystemClass::SendPath(wchar_t* path, std::filesystem::path WFolder)
|
|||||||
{
|
{
|
||||||
m_Application->SetPath(path);
|
m_Application->SetPath(path);
|
||||||
m_Application->SetWFolder(WFolder);
|
m_Application->SetWFolder(WFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemClass::GetScenePath()
|
|
||||||
{
|
|
||||||
OPENFILENAME ofn;
|
|
||||||
wchar_t szFile[260];
|
|
||||||
|
|
||||||
ZeroMemory(&ofn, sizeof(ofn));
|
|
||||||
ofn.lStructSize = sizeof(ofn);
|
|
||||||
ofn.hwndOwner = m_hwnd;
|
|
||||||
ofn.lpstrFile = szFile;
|
|
||||||
ofn.lpstrFile[0] = '\0';
|
|
||||||
ofn.nMaxFile = sizeof(szFile);
|
|
||||||
ofn.lpstrFilter = L"Ker Scene\0*.ker\0";
|
|
||||||
ofn.nFilterIndex = 1;
|
|
||||||
ofn.lpstrFileTitle = NULL;
|
|
||||||
ofn.nMaxFileTitle = 0;
|
|
||||||
ofn.lpstrInitialDir = NULL;
|
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
|
|
||||||
|
|
||||||
if (GetOpenFileName(&ofn) == TRUE)
|
|
||||||
{
|
|
||||||
std::filesystem::path filepath = ofn.lpstrFile;
|
|
||||||
// convert to string
|
|
||||||
std::string path = filepath.string();
|
|
||||||
m_Application->SetScenePath(path);
|
|
||||||
}
|
|
||||||
}
|
|
@ -2275,7 +2275,6 @@ void ApplicationClass::LoadScene()
|
|||||||
{
|
{
|
||||||
SetScenePath(ConvertWStringToString(scenePath));
|
SetScenePath(ConvertWStringToString(scenePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (m_scenePath.empty())
|
if (m_scenePath.empty())
|
||||||
{
|
{
|
||||||
|
@ -171,8 +171,66 @@ void imguiManager::WidgetAddObject(ApplicationClass* app)
|
|||||||
|
|
||||||
if (GetOpenFileName(&ofn))
|
if (GetOpenFileName(&ofn))
|
||||||
{
|
{
|
||||||
std::wstring wstr(ofn.lpstrFile);
|
std::wstring filepath = ofn.lpstrFile;
|
||||||
app->AddKobject(wstr);
|
|
||||||
|
WCHAR exePath[MAX_PATH];
|
||||||
|
GetModuleFileName(NULL,exePath,MAX_PATH);
|
||||||
|
std::wstring exeDir = exePath;
|
||||||
|
size_t pos = exeDir.find_last_of(L"\\/");
|
||||||
|
if(pos != std::wstring::npos)
|
||||||
|
{
|
||||||
|
exeDir = exeDir.substr(0, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::wstring targetDir = exeDir + L"\\Content\\Assets\\Kobject";
|
||||||
|
|
||||||
|
|
||||||
|
DWORD ftyp = GetFileAttributesW(targetDir.c_str());
|
||||||
|
if( ftyp == INVALID_FILE_ATTRIBUTES)
|
||||||
|
{
|
||||||
|
std::wstring contentDir = exeDir + L"\\Content";
|
||||||
|
if (GetFileAttributes(contentDir.c_str()) == INVALID_FILE_ATTRIBUTES)
|
||||||
|
{
|
||||||
|
CreateDirectory(contentDir.c_str(), NULL);
|
||||||
|
}
|
||||||
|
std::wstring assetsDir = contentDir + L"\\Assets";
|
||||||
|
if (GetFileAttributes(assetsDir.c_str()) == INVALID_FILE_ATTRIBUTES)
|
||||||
|
{
|
||||||
|
CreateDirectory(assetsDir.c_str(), NULL);
|
||||||
|
}
|
||||||
|
std::wstring kobjectDir = assetsDir + L"\\Kobject";
|
||||||
|
if (GetFileAttributes(kobjectDir.c_str()) == INVALID_FILE_ATTRIBUTES)
|
||||||
|
{
|
||||||
|
CreateDirectory(kobjectDir.c_str(), NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t posFile = filepath.find_last_of(L"\\/");
|
||||||
|
std::wstring filename = (posFile != std::wstring::npos) ? filepath.substr(posFile + 1) : filepath;
|
||||||
|
|
||||||
|
std::wstring targetPath = targetDir + L"\\" + filename;
|
||||||
|
|
||||||
|
if (!CopyFile(filepath.c_str(), targetPath.c_str(), FALSE))
|
||||||
|
{
|
||||||
|
// En cas d'erreur, vous pouvez gérer ici l'erreur (par exemple afficher un message)
|
||||||
|
MessageBox(NULL, L"Erreur lors de la copie du fichier.", L"Erreur", MB_OK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// On récupère le chemin relatif par rapport à exeDir
|
||||||
|
std::wstring relativePath = targetPath.substr(exeDir.size());
|
||||||
|
|
||||||
|
// Suppression du premier caractère s'il s'agit d'un antislash
|
||||||
|
if (!relativePath.empty() && (relativePath[0] == L'\\' || relativePath[0] == L'/'))
|
||||||
|
{
|
||||||
|
relativePath.erase(0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remplacer les antislashs par des slashs
|
||||||
|
std::replace(relativePath.begin(), relativePath.end(), L'\\', L'/');
|
||||||
|
app->AddKobject(relativePath);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user