| 298 | //========================================================================== |
| 299 | |
| 300 | int FileSystem::AddFromBuffer(const char* name, char* data, int size, int id, int flags) |
| 301 | { |
| 302 | FileReader fr; |
| 303 | FileData blob(data, size); |
| 304 | fr.OpenMemoryArray(blob); |
| 305 | |
| 306 | // wrap this into a single lump resource file (should be done a little better later.) |
| 307 | auto rf = new FResourceFile(name, fr, stringpool); |
| 308 | auto Entries = rf->AllocateEntries(1); |
| 309 | Entries[0].FileName = rf->NormalizeFileName(ExtractBaseName(name, true).c_str()); |
| 310 | Entries[0].ResourceID = -1; |
| 311 | Entries[0].Length = size; |
| 312 | |
| 313 | Files.push_back(rf); |
| 314 | FileInfo.resize(FileInfo.size() + 1); |
| 315 | FileSystem::LumpRecord* lump_p = &FileInfo.back(); |
| 316 | lump_p->SetFromLump(rf, 0, (int)Files.size() - 1, stringpool); |
| 317 | return (int)FileInfo.size() - 1; |
| 318 | } |
| 319 | |
| 320 | //========================================================================== |
| 321 | // |
no test coverage detected