introduces ios support? still needs metal

This commit is contained in:
2025-06-29 01:21:55 +03:00
parent af4f0c3cad
commit cdeaac7c0c
79 changed files with 2176 additions and 1349 deletions

View File

@@ -44,6 +44,10 @@ public:
static void AddFile( const char *psz );
};
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void IFileSystem::InitFilesystem()
{
fs_basedir = ICommandLine::ParamValue("-basedir");
@@ -59,6 +63,10 @@ void IFileSystem::InitFilesystem()
AddGameDirectory(fs_gamedir);
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void CFileSystem::AddFile( const char *psz )
{
CUtlString extension = Plat_GetExtension(psz);
@@ -68,6 +76,9 @@ void CFileSystem::AddFile( const char *psz )
};
}
//-----------------------------------------------------------------------------
// Adds directory which can contain pack files
//-----------------------------------------------------------------------------
void IFileSystem::AddGameDirectory( const char *psz )
{
FileDirectory_t dir = {};
@@ -81,6 +92,10 @@ void IFileSystem::AddGameDirectory( const char *psz )
};
};
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
bool IFileSystem::LoadPackFile( const char *szFilename )
{
Pack_t pack = {};
@@ -109,10 +124,6 @@ bool IFileSystem::LoadPackFile( const char *szFilename )
pack.handle = f;
pack.files = CUtlVector<PackDirectory_t>(nNumFiles);
V_memcpy(pack.files.GetData(),pDirs, header.size);
for (auto &i: pack.files)
{
V_printf(" LOADED %s\n",i.name);
}
V_free(pDirs);
nNumFiles = header.size/sizeof(PackDirectory_t);
@@ -124,10 +135,19 @@ bool IFileSystem::LoadPackFile( const char *szFilename )
return true;
}
//-----------------------------------------------------------------------------
// Creates path
//-----------------------------------------------------------------------------
void IFileSystem::CreatePath( const char *szPath )
{
}
//-----------------------------------------------------------------------------
// Opens file
// If it is located in a pack then it can only be read
//-----------------------------------------------------------------------------
FileHandle_t IFileSystem::Open( const char *szFilename, EFileOptions options )
{
if (options == IFILE_READ)
@@ -172,6 +192,9 @@ FileHandle_t IFileSystem::Open( const char *szFilename, EFileOptions options )
return 0;
}
//-----------------------------------------------------------------------------
// Closes file
//-----------------------------------------------------------------------------
void IFileSystem::Close( FileHandle_t file )
{
/* close only fs files */
@@ -182,10 +205,18 @@ void IFileSystem::Close( FileHandle_t file )
delete file;
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
size_t IFileSystem::Size( FileHandle_t file )
{
return file->nSize;
}
//-----------------------------------------------------------------------------
// Reads nSize bytes of file
//-----------------------------------------------------------------------------
size_t IFileSystem::Read( FileHandle_t file, void *pOutput, size_t nSize)
{
if (file->file)
@@ -200,10 +231,18 @@ size_t IFileSystem::Read( FileHandle_t file, void *pOutput, size_t nSize)
return readsize;
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
size_t IFileSystem::ReadLine( FileHandle_t file, void *pOutput, size_t nSize)
{
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
size_t IFileSystem::Write( FileHandle_t file, void *pInput, size_t nSize)
{