Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
engine
Manage
Activity
Members
Labels
Plan
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sip
engine
Commits
c9884730
Commit
c9884730
authored
Dec 16, 2018
by
Byurrrer
Browse files
Options
Downloads
Patches
Plain Diff
начал добавлять поддержку нескольких директорий для ресурсов, но обернул в комментарии
parent
f6661934
No related branches found
No related tags found
1 merge request
!1
Version 0.10.1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
source/SkyXEngine_Build/SkyXEngine_Build.cpp
+1
-0
1 addition, 0 deletions
source/SkyXEngine_Build/SkyXEngine_Build.cpp
source/core/sxcore.cpp
+64
-0
64 additions, 0 deletions
source/core/sxcore.cpp
source/core/sxcore.h
+12
-0
12 additions, 0 deletions
source/core/sxcore.h
with
77 additions
and
0 deletions
source/SkyXEngine_Build/SkyXEngine_Build.cpp
+
1
−
0
View file @
c9884730
...
...
@@ -11,6 +11,7 @@ See the license in LICENSE
int
WINAPI
WinMain
(
HINSTANCE
hInstance
,
HINSTANCE
hPrevInstance
,
LPTSTR
lpCmdLine
,
int
nCmdShow
)
{
//MessageBox(0, 0, 0, 0);
SkyXEngine_PreviewCreate
();
SkyXEngine_Init
(
0
,
0
,
lpCmdLine
);
SkyXEngine_PreviewKill
();
...
...
This diff is collapsed.
Click to expand it.
source/core/sxcore.cpp
+
64
−
0
View file @
c9884730
...
...
@@ -24,6 +24,10 @@ See the license in LICENSE
#include
"PerfMon.h"
#include
<common/file_utils.h>
#include
"GRegisterIndex.h"
//##########################################################################
char
g_szCoreName
[
CORE_NAME_MAX_LEN
];
...
...
@@ -222,6 +226,66 @@ IFile* Core_OpFile(const char *szPath, int iType)
}
//##########################################################################
/*
Array<String> g_aResourcePathes;
SX_LIB_API void Core_ResPathAdd(const char *szPath)
{
if (szPath)
g_aResourcePathes.push_back(String(Core_RStringGet(G_RI_STRING_PATH_EXE)) + szPath + "/");
}
SX_LIB_API void Core_ResPathClear()
{
g_aResourcePathes.clear();
}
SX_LIB_API const char* Core_ResPathGetLast(int iRegisterPath)
{
if (g_aResourcePathes.size() > 0)
{
if (iRegisterPath >= 0)
return (g_aResourcePathes[g_aResourcePathes.size() - 1] + Core_RStringGet(iRegisterPath)).c_str();
else
return g_aResourcePathes[g_aResourcePathes.size() - 1].c_str();
}
return 0;
}
SX_LIB_API const char* Core_ResPathGetFullPathByRel(const char *szRelPath)
{
for (int i = 0, il = g_aResourcePathes.size(); i < il; ++i)
{
String sResPath = g_aResourcePathes[(il - 1) - i];
String sFullPath = sResPath + szRelPath;
if (FileExistsFile(sFullPath.c_str()))
return sFullPath.c_str();
}
return 0;
}
SX_LIB_API const char* Core_ResPathGetFullPathByRel2(const char *szRelPathPart1, const char *szRelPathPart2)
{
return Core_ResPathGetFullPathByRel((String(szRelPathPart1) + szRelPathPart2).c_str());
}
SX_LIB_API const char* Core_ResPathGetFullPathByRelIndex(int iRegisterPath, const char *szRelPath)
{
return Core_ResPathGetFullPathByRel((String(Core_RStringGet(G_RI_STRING_PATH_GS_CONFIGS)) + szRelPath).c_str());
}
SX_LIB_API const char* Core_ResPathGetFullPathByRelIndex2(int iRegisterPath, const char *szRelPathPart1, const char *szRelPathPart2)
{
return Core_ResPathGetFullPathByRelIndex(G_RI_STRING_PATH_GS_CONFIGS, (String(szRelPathPart1) + szRelPathPart2).c_str());
}
*/
//##########################################################################
ISXConfig
*
Core_CrConfig
()
{
return
new
CConfig
();
...
...
This diff is collapsed.
Click to expand it.
source/core/sxcore.h
+
12
−
0
View file @
c9884730
...
...
@@ -402,6 +402,18 @@ SX_LIB_API IFile* Core_OpFile(const char* szPath, int iType);
//##########################################################################
/*SX_LIB_API void Core_ResPathAdd(const char *szPath);
SX_LIB_API void Core_ResPathClear();
SX_LIB_API const char* Core_ResPathGetLast(int iRegisterPath=-1);
SX_LIB_API const char* Core_ResPathGetFullPathByRel(const char *szRelPath);
SX_LIB_API const char* Core_ResPathGetFullPathByRel2(const char *szRelPathPart1, const char *szRelPathPart2);
SX_LIB_API const char* Core_ResPathGetFullPathByRelIndex(int iRegisterPath, const char *szRelPath);
SX_LIB_API const char* Core_ResPathGetFullPathByRelIndex2(int iRegisterPath, const char *szRelPathPart1, const char *szRelPathPart2);*/
//##########################################################################
/*! интерфейс для работы с файлами конфигурации (ini)
\warning секции и ключи хранятся в виде дерева, и нет гарантии что может быть доступ по порядковому номеру,
можно получить общее количество секций/ключей, дальше плясать */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment