mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
part4: adapt codebase to changes in lib/
mostly straightforward except for CVSFile / Filesystem. moved the former into the newly created latter component. removed VFSUtil entirely (that functionality is available from lib/file/file_system_util.h) Xeromyces.cpp: simplify buffer handling since smart pointers are now in play. also use WriteBuffer instead of membuffer. This was SVN commit r5519.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include "graphics/ObjectEntry.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Profile.h"
|
||||
#include "ps/VFSUtil.h"
|
||||
#include "ps/Filesystem.h"
|
||||
|
||||
#define LOG_CATEGORY "graphics"
|
||||
|
||||
@@ -150,21 +150,20 @@ void CObjectManager::UnloadObjects()
|
||||
|
||||
|
||||
|
||||
static void GetObjectName_ThunkCb(const char* path, const DirEnt* UNUSED(ent), uintptr_t cbData)
|
||||
static LibError GetObjectName_ThunkCb(const VfsPath& pathname, const FileInfo& UNUSED(fileInfo), uintptr_t cbData)
|
||||
{
|
||||
std::vector<CStr>* names = (std::vector<CStr>*)cbData;
|
||||
CStr name (path);
|
||||
CStr name(pathname.string());
|
||||
names->push_back(name.AfterFirst("actors/"));
|
||||
return INFO::CB_CONTINUE;
|
||||
}
|
||||
|
||||
void CObjectManager::GetAllObjectNames(std::vector<CStr>& names)
|
||||
{
|
||||
vfs_dir_enum("art/actors/", VFS_DIR_RECURSIVE, "*.xml",
|
||||
GetObjectName_ThunkCb, (uintptr_t)&names);
|
||||
fs_ForEachFile(g_VFS, "art/actors/", GetObjectName_ThunkCb, (uintptr_t)&names, "*.xml", DIR_RECURSIVE);
|
||||
}
|
||||
|
||||
void CObjectManager::GetPropObjectNames(std::vector<CStr>& names)
|
||||
{
|
||||
vfs_dir_enum("art/actors/props/", VFS_DIR_RECURSIVE, "*.xml",
|
||||
GetObjectName_ThunkCb, (uintptr_t)&names);
|
||||
fs_ForEachFile(g_VFS, "art/actors/props/", GetObjectName_ThunkCb, (uintptr_t)&names, "*.xml", DIR_RECURSIVE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user