Commit 16e40778 authored by D-AIRY's avatar D-AIRY

Added demo level

parent 3e399ff4
......@@ -204,6 +204,7 @@ source/s4g/tests/
build/*
!engine/
!demos/
!gamesource/
build/gamesource/*
/build/gamesource/shaders/cache/*
......
[ent_0]
team = -842150451
rotation = 0.000000 0.000000 0.000000 1.000000
parent =
origin = -3.925758 1.000896 -18.142702
name =
flags = 0
classname = info_player_spawn
[ent_1]
use_trimesh = 0
skin = 0
scale = 1.000000
rotation = 0.000000 0.081049 0.000000 -0.996710
parent =
origin = -6.353374 3.468264 6.488859
name =
model = meshes/transparent/plane1.dse
is_static = 1
glow_color_ref =
glow_color = 0.000000 0.000000 0.000000
flags = 0
classname = prop_static
auto_physbox = 1
[meta]
count = 10
[ent_2]
use_trimesh = 0
skin = 0
scale = 1.000000
rotation = 0.000000 0.081049 0.000000 -0.996710
parent =
origin = -9.025822 3.468264 -9.834812
name =
model = meshes/transparent/plane1.dse
is_static = 1
glow_color_ref =
glow_color = 0.000000 0.000000 0.000000
flags = 0
classname = prop_static
auto_physbox = 1
[ent_3]
use_trimesh = 1
skin = 0
scale = 1.000000
rotation = 0.000000 0.000000 0.000000 1.000000
parent =
origin = 0.000000 0.000000 0.000000
name = base
model = meshes/transparent/base.dse
is_static = 1
glow_color_ref =
glow_color = 0.000000 0.000000 0.000000
flags = 0
classname = prop_static
auto_physbox = 1
[ent_4]
use_trimesh = 0
skin = 0
scale = 1.000000
rotation = 0.000000 -0.029537 0.000000 -0.999564
parent =
origin = 0.551506 3.468264 -6.024114
name =
model = meshes/transparent/plane2.dse
is_static = 1
glow_color_ref =
glow_color = 0.000000 0.000000 0.000000
flags = 0
classname = prop_static
auto_physbox = 1
[ent_5]
use_trimesh = 0
skin = 0
scale = 1.000000
rotation = 0.000000 0.682918 0.000000 -0.730495
parent =
origin = -4.130323 3.495506 -11.273858
name =
model = meshes/transparent/plane2.dse
is_static = 1
glow_color_ref =
glow_color = 0.000000 0.000000 0.000000
flags = 0
classname = prop_static
auto_physbox = 1
[ent_6]
use_trimesh = 0
skin = 0
scale = 2.000000
rotation = 0.000000 0.000000 0.000000 1.000000
parent =
origin = -6.141287 0.000000 6.633917
name =
model = meshes/transparent/box3.dse
is_static = 1
glow_color_ref =
glow_color = 0.000000 0.000000 0.000000
flags = 0
classname = prop_static
auto_physbox = 1
[ent_7]
use_trimesh = 0
skin = 0
scale = 2.000000
rotation = 0.000000 0.000000 0.000000 1.000000
parent =
origin = -0.163496 0.000000 7.586028
name =
model = meshes/transparent/box1.dse
is_static = 1
glow_color_ref =
glow_color = 0.000000 0.000000 0.000000
flags = 0
classname = prop_static
auto_physbox = 1
[ent_8]
use_trimesh = 0
skin = 0
scale = 2.000000
rotation = 0.000000 0.000000 0.000000 1.000000
parent =
origin = -9.934603 0.000000 15.668315
name =
model = meshes/transparent/box2.dse
is_static = 1
glow_color_ref =
glow_color = 0.000000 0.000000 0.000000
flags = 0
classname = prop_static
auto_physbox = 1
[ent_9]
use_trimesh = 0
skin = 0
scale = 2.000000
rotation = 0.000000 0.000000 0.000000 1.000000
parent =
origin = -9.126783 0.000000 -11.453623
name =
model = meshes/transparent/box1.dse
is_static = 1
glow_color_ref =
glow_color = 0.000000 0.000000 0.000000
flags = 0
classname = prop_static
auto_physbox = 1
[level]
type = indoor
local_name = transparent
[terrax]
vp_layout = 0
grid_step = 6
grid_show = 1
cam3_view = 1
cam3_scale = 0.017939
cam3_pos = -5.900388 -2.482251 -1000.000000
cam3_dir = -0.000000 -0.000000 -0.000000
cam2_view = 2
cam2_scale = 0.068271
cam2_pos = 1000.000000 -0.134729 -14.557329
cam2_dir = 0.000000 1.#QNAN0 0.000000
cam1_view = 0
cam1_scale = 0.304896
cam1_pos = -26.377651 1000.000000 2.464243
cam1_dir = -1.570796 -0.000000 0.000000
cam0_view = -1
cam0_scale = 1.000000
cam0_pos = 2.478239 10.869446 -34.316093
cam0_dir = -0.169332 -0.145141 -0.000000
[tp_combineglass001a]
type = 0
is_unlit = 0
physmaterial = 0
vs = mtrlgeom_base.vs
ps = mtrltp_base.ps
alpha_test = 0
texture = tp_combineglass001a.dds
mask = 0
mirco_diff_r = 0
mirco_diff_g = 0
mirco_diff_b = 0
mirco_diff_a = 0
detail_r = 0
detail_g = 0
detail_b = 0
detail_a = 0
param_ligth = 0
roughness = 0.3
f0 = 0.4
thickness = 0.500000
penetration = 0.000000
hit_chance = 1.000000
density = 1500.000000
transparent = 1
vs_world = 1
vs_view = 0
vs_projection = 0
vs_worldview = 0
vs_worldviewprojection = 1
vs_poscam = 0
vs_timedelta = 0
vs_winsize = 0
vs_userdata = 0
vs_userdata_value_x = 0.000000
vs_userdata_value_y = 0.000000
vs_userdata_value_z = 0.000000
vs_userdata_value_w = 0.000000
vs_userdata_trans_in_ps = 0
ps_world = 0
ps_view = 0
ps_projection = 0
ps_worldview = 0
ps_worldviewprojection = 0
ps_poscam = 0
ps_timedelta = 0
ps_winsize = 0
ps_userdata = 0
ps_userdata_value_x = 0.000000
ps_userdata_value_y = 0.000000
ps_userdata_value_z = 0.000000
ps_userdata_value_w = 0.000000
ps_userdata_trans_in_vs = 0
type_reflect = 0
[tp_gate_door_glass]
type = 0
is_unlit = 0
physmaterial = 0
vs = mtrlgeom_base.vs
ps = mtrltp_base.ps
alpha_test = 0
texture = tp_gate_door_glass.dds
mask = 0
mirco_diff_r = 0
mirco_diff_g = 0
mirco_diff_b = 0
mirco_diff_a = 0
detail_r = 0
detail_g = 0
detail_b = 0
detail_a = 0
param_ligth = 0
roughness = 0.3
f0 = 0.4
thickness = 0.500000
penetration = 0.000000
hit_chance = 1.000000
density = 1500.000000
transparent = 1
vs_world = 1
vs_view = 0
vs_projection = 0
vs_worldview = 0
vs_worldviewprojection = 1
vs_poscam = 0
vs_timedelta = 0
vs_winsize = 0
vs_userdata = 0
vs_userdata_value_x = 0.000000
vs_userdata_value_y = 0.000000
vs_userdata_value_z = 0.000000
vs_userdata_value_w = 0.000000
vs_userdata_trans_in_ps = 0
ps_world = 0
ps_view = 0
ps_projection = 0
ps_worldview = 0
ps_worldviewprojection = 0
ps_poscam = 0
ps_timedelta = 0
ps_winsize = 0
ps_userdata = 0
ps_userdata_value_x = 0.000000
ps_userdata_value_y = 0.000000
ps_userdata_value_z = 0.000000
ps_userdata_value_w = 0.000000
ps_userdata_trans_in_vs = 0
type_reflect = 0
[tp_glasswindowbreak070a]
type = 0
is_unlit = 0
physmaterial = 0
vs = mtrlgeom_base.vs
ps = mtrltp_base.ps
alpha_test = 0
texture = tp_glasswindowbreak070a.dds
mask = 0
mirco_diff_r = 0
mirco_diff_g = 0
mirco_diff_b = 0
mirco_diff_a = 0
detail_r = 0
detail_g = 0
detail_b = 0
detail_a = 0
param_ligth = 0
roughness = 0.3
f0 = 0.4
thickness = 0.500000
penetration = 0.000000
hit_chance = 1.000000
density = 1500.000000
transparent = 1
vs_world = 1
vs_view = 0
vs_projection = 0
vs_worldview = 0
vs_worldviewprojection = 1
vs_poscam = 0
vs_timedelta = 0
vs_winsize = 0
vs_userdata = 0
vs_userdata_value_x = 0.000000
vs_userdata_value_y = 0.000000
vs_userdata_value_z = 0.000000
vs_userdata_value_w = 0.000000
vs_userdata_trans_in_ps = 0
ps_world = 0
ps_view = 0
ps_projection = 0
ps_worldview = 0
ps_worldviewprojection = 0
ps_poscam = 0
ps_timedelta = 0
ps_winsize = 0
ps_userdata = 0
ps_userdata_value_x = 0.000000
ps_userdata_value_y = 0.000000
ps_userdata_value_z = 0.000000
ps_userdata_value_w = 0.000000
ps_userdata_trans_in_vs = 0
type_reflect = 0
[tp_sga_window_center_up]
type = 0
is_unlit = 0
physmaterial = 0
vs = mtrlgeom_base.vs
ps = mtrltp_base.ps
ps = mtrltp_refract.ps
alpha_test = 0
texture = tp_sga_window_center_up.dds
mask = 0
mirco_diff_r = 0
mirco_diff_g = 0
mirco_diff_b = 0
mirco_diff_a = 0
detail_r = tp_sga_window_center_up_dudv.dds
detail_g = 0
detail_b = 0
detail_a = 0
param_ligth = 0
roughness = 0.3
f0 = 0.4
thickness = 0.500000
penetration = 0.000000
hit_chance = 1.000000
density = 1500.000000
transparent = 1
refractive = 1
vs_world = 1
vs_view = 0
vs_projection = 0
vs_worldview = 0
vs_worldviewprojection = 1
vs_poscam = 0
vs_timedelta = 0
vs_winsize = 0
vs_userdata = 0
vs_userdata_value_x = 0.000000
vs_userdata_value_y = 0.000000
vs_userdata_value_z = 0.000000
vs_userdata_value_w = 0.000000
vs_userdata_trans_in_ps = 0
ps_world = 0
ps_view = 0
ps_projection = 0
ps_worldview = 0
ps_worldviewprojection = 0
ps_poscam = 0
ps_timedelta = 0
ps_winsize = 0
ps_userdata = 0
ps_userdata_value_x = 0.000000
ps_userdata_value_y = 0.000000
ps_userdata_value_z = 0.000000
ps_userdata_value_w = 0.000000
ps_userdata_trans_in_vs = 0
type_reflect = 0
......@@ -44,6 +44,7 @@ CCore::CCore(const char *szName)
m_pFileSystem = new CFileSystem();
m_pFileSystem->addRoot("engine");
m_pFileSystem->addRoot("gamesource");
m_pFileSystem->addRoot("demos");
UINT uGamePathId = m_pFileSystem->addRoot("local");
m_pFileSystem->setWritableRoot(uGamePathId);
......
......@@ -75,15 +75,7 @@ bool XMETHODCALLTYPE CResourceManager::getModel(const char *szName, IXResourceMo
if(m_mapModelLoaders.KeyExists(AAString(szLowcaseExt), &pNode))
{
auto &aLoaders = *pNode->Val;
#if 1
CFile *pFile = new CFile();
if(pFile->open(szName, CORE_FILE_BIN) < 0)
{
mem_delete(pFile);
}
#else
IFile *pFile = m_pCore->getFileSystem()->openFileBin(szName);
#endif
IFile *pFile = m_pCore->getFileSystem()->openFile(szName);
if(!pFile)
{
LibReport(REPORT_MSG_LEVEL_ERROR, "File not found '%s'\n", szName);
......
......@@ -407,7 +407,14 @@ bool CEntityManager::import(const char * file, bool shouldSendProgress)
char sect[32];
CBaseEntity * pEnt = NULL;
Array<CBaseEntity*> tmpList;
if(conf->open(file))
char szFullPath[1024];
if(!Core_GetIXCore()->getFileSystem()->resolvePath(file, szFullPath, sizeof(szFullPath)))
{
goto err;
}
if(conf->open(szFullPath))
{
goto err;
}
......
......@@ -155,19 +155,23 @@ BOOL EnumLevels(CLevelInfo *pInfo)
strncpy(pInfo->m_szName, szLevelName, MAX_LEVEL_STRING - 1);
{
char szFullPath[1024];
char szFullPath[1024], szFSPath[1024];
sprintf(szFullPath, "levels/%s/%s.lvl", pInfo->m_szName, pInfo->m_szName);
ISXConfig *pConfig = Core_OpConfig(szFullPath);
if(pConfig->keyExists("level", "local_name"))
if(Core_GetIXCore()->getFileSystem()->resolvePath(szFullPath, szFSPath, sizeof(szFSPath)))
{
strncpy(pInfo->m_szLocalName, pConfig->getKey("level", "local_name"), MAX_LEVEL_STRING - 1);
}
else
{
strncpy(pInfo->m_szLocalName, pInfo->m_szName, MAX_LEVEL_STRING - 1);
ISXConfig *pConfig = Core_OpConfig(szFSPath);
if(pConfig->keyExists("level", "local_name"))
{
strncpy(pInfo->m_szLocalName, pConfig->getKey("level", "local_name"), MAX_LEVEL_STRING - 1);
}
else
{
strncpy(pInfo->m_szLocalName, pInfo->m_szName, MAX_LEVEL_STRING - 1);
}
mem_release(pConfig);
}
mem_release(pConfig);
sprintf(szFullPath, "levels/%s/preview.bmp", pInfo->m_szName);
pInfo->m_bHasPreview = FileExistsFile(szFullPath);
......
......@@ -513,10 +513,10 @@ bool CMaterials::loadMtl(const char *szName, CMaterial **ppMtrl, XSHADER_DEFAULT
CMaterial *pMtrl = *ppMtrl;
char szPath[1024];
sprintf(szPath, "%s%s/%s.mtl", Core_RStringGet(G_RI_STRING_PATH_GS_MTRLS), sDir.c_str(), sName.c_str());
char szPath[1024], szTmpPath[1024];
sprintf(szTmpPath, "materials/%s/%s.mtl", sDir.c_str(), sName.c_str());
if (FileExistsFile(szPath))
if(Core_GetIXCore()->getFileSystem()->resolvePath(szTmpPath, szPath, sizeof(szPath)))
{
ISXConfig *pConfig = Core_OpConfig(szPath);
......
......@@ -12,7 +12,7 @@ struct CLevelInfo
//bool m_bHasPreview;
bool m_isIndoor;
HANDLE m_hFind = NULL; //!< для внутреннего использования
IFileIterator *m_pIterator = NULL; //!< для внутреннего использования
};
BOOL GetLastWriteTime(const char *szFile, LPTSTR lpszString)
......@@ -55,80 +55,55 @@ BOOL EnumLevels(CLevelInfo *pInfo)
pInfo->m_szLocalName[0] = 0;
pInfo->m_szLastEdit[0] = 0;
WIN32_FIND_DATA fd;
bool bFound = false;
if(!pInfo->m_hFind)
const char *szDirName = NULL;
if(!pInfo->m_pIterator)
{
if((pInfo->m_hFind = ::FindFirstFile((String(Core_RStringGet(G_RI_STRING_PATH_GS_LEVELS)) + "*").c_str(), &fd)) != INVALID_HANDLE_VALUE)
{
bFound = true;
}
pInfo->m_pIterator = Core_GetIXCore()->getFileSystem()->getFolderList("levels/");
}
else
if(pInfo->m_pIterator && (szDirName = pInfo->m_pIterator->next()))
{
if(::FindNextFile(pInfo->m_hFind, &fd))
{
bFound = true;
}
}
if(bFound)
{
while(!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || (!strcmp(fd.cFileName, ".") || !strcmp(fd.cFileName, "..")))
{
bFound = false;
if(::FindNextFile(pInfo->m_hFind, &fd))
{
if((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && strcmp(fd.cFileName, ".") && strcmp(fd.cFileName, ".."))
{
bFound = true;
break;
}
}
else
{
break;
}
}
bFound = true;
}
if(!bFound)
{
if(INVALID_HANDLE_VALUE != pInfo->m_hFind)
{
::FindClose(pInfo->m_hFind);
}
mem_release(pInfo->m_pIterator);
return(FALSE);
}
strncpy(pInfo->m_szName, fd.cFileName, MAX_LEVEL_STRING - 1);
const char *szLevelName = basename(szDirName);
strncpy(pInfo->m_szName, szLevelName, MAX_LEVEL_STRING - 1);
{
char szFullPath[1024];
sprintf(szFullPath, "%s%s/%s.lvl", Core_RStringGet(G_RI_STRING_PATH_GS_LEVELS), pInfo->m_szName, pInfo->m_szName);
GetLastWriteTime(szFullPath, pInfo->m_szLastEdit);
char szFullPath[1024], szFSPath[1024];
sprintf(szFullPath, "levels/%s/%s.lvl", pInfo->m_szName, pInfo->m_szName);
ISXConfig *pConfig = Core_OpConfig(szFullPath);
if(pConfig->keyExists("level", "local_name"))
if(Core_GetIXCore()->getFileSystem()->resolvePath(szFullPath, szFSPath, sizeof(szFSPath)))
{
strncpy(pInfo->m_szLocalName, pConfig->getKey("level", "local_name"), MAX_LEVEL_STRING - 1);
}
else
{
strncpy(pInfo->m_szLocalName, fd.cFileName, MAX_LEVEL_STRING - 1);
}
GetLastWriteTime(szFSPath, pInfo->m_szLastEdit);
if(pConfig->keyExists("level", "type"))
{
pInfo->m_isIndoor = !!strcasecmp(pConfig->getKey("level", "type"), "outdoor");
}
else
{
pInfo->m_isIndoor = true;
ISXConfig *pConfig = Core_OpConfig(szFSPath);
if(pConfig->keyExists("level", "local_name"))
{
strncpy(pInfo->m_szLocalName, pConfig->getKey("level", "local_name"), MAX_LEVEL_STRING - 1);
}
else
{
strncpy(pInfo->m_szLocalName, pInfo->m_szName, MAX_LEVEL_STRING - 1);
}
if(pConfig->keyExists("level", "type"))
{
pInfo->m_isIndoor = !!strcasecmp(pConfig->getKey("level", "type"), "outdoor");
}
else
{
pInfo->m_isIndoor = true;
}
mem_release(pConfig);
}
mem_release(pConfig);
//sprintf(szFullPath, "%s%s/preview.bmp", Core_RStringGet(G_RI_STRING_PATH_GS_LEVELS), pInfo->m_szName);
//pInfo->m_bHasPreview = FileExistsFile(szFullPath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment