MCPcopy Create free account
hub / github.com/crossuo/crossuo / UopReadIndexFile

Method UopReadIndexFile

xuocore/uodata.cpp:1231–1274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1229}
1230
1231void CFileManager::UopReadIndexFile(
1232 size_t indexMaxCount,
1233 const std::function<CIndexObject *(int)> &getIdxObj,
1234 const char *uopFileName,
1235 int padding,
1236 const char *extesion,
1237 CUopMappedFile &uopFile,
1238 int startIndex)
1239{
1240 astr_t p = uopFileName;
1241 std::transform(p.begin(), p.end(), p.begin(), ::tolower);
1242
1243 bool isGump = (astr_t("gumpartlegacymul") == p);
1244 char basePath[100];
1245 snprintf(basePath, sizeof(basePath), "build/%s/%%0%ii%s", p.c_str(), padding, extesion);
1246
1247 for (int i = startIndex; i < (int)indexMaxCount; i++)
1248 {
1249 char filename[200];
1250 snprintf(filename, sizeof(filename), basePath, (int)i);
1251
1252 auto block = uopFile.GetAsset(filename);
1253 if (block != nullptr)
1254 {
1255 CIndexObject *obj = getIdxObj((int)i);
1256 obj->Address = uintptr_t(uopFile.Start + block->Offset + block->MetadataSize);
1257 obj->DataSize = block->DecompressedSize;
1258 obj->UopBlock = block;
1259 //obj->ID = -1;
1260
1261 if (isGump)
1262 {
1263 obj->Address += 8;
1264 obj->DataSize -= 8;
1265
1266 uopFile.ResetPtr();
1267 uopFile.Move(checked_cast<intptr_t>(block->Offset + block->MetadataSize));
1268
1269 obj->Width = uopFile.ReadUInt32LE();
1270 obj->Height = uopFile.ReadUInt32LE();
1271 }
1272 }
1273 }
1274}
1275
1276UopAnimationHeader CFileManager::UopReadAnimationHeader()
1277{

Callers

nothing calls this directly

Calls 8

transformFunction · 0.85
c_strMethod · 0.80
GetAssetMethod · 0.80
ReadUInt32LEMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
ResetPtrMethod · 0.45
MoveMethod · 0.45

Tested by

no test coverage detected