- put the entire filesystem code into a namespace and created some subdirectories.
This commit is contained in:
parent
94c9ee4593
commit
ebb71cebf1
108 changed files with 308 additions and 225 deletions
|
|
@ -1018,7 +1018,7 @@ void uppercopy(char* to, const char* from)
|
|||
|
||||
FString GetStringFromLump(int lump)
|
||||
{
|
||||
FileData fd = fileSystem.ReadFile(lump);
|
||||
auto fd = fileSystem.ReadFile(lump);
|
||||
FString ScriptBuffer(fd.GetString(), fd.GetSize());
|
||||
ScriptBuffer.Truncate(strlen(ScriptBuffer.GetChars())); // this is necessary to properly truncate the generated string to not contain 0 bytes.
|
||||
return ScriptBuffer;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include "zstring.h"
|
||||
#include "files.h"
|
||||
|
||||
#if !defined(GUID_DEFINED)
|
||||
#define GUID_DEFINED
|
||||
|
|
@ -82,7 +83,6 @@ inline constexpr double Scale(double a, double b, double c)
|
|||
return (a * b) / c;
|
||||
}
|
||||
|
||||
class FileReader;
|
||||
struct MD5Context;
|
||||
|
||||
void md5Update(FileReader& file, MD5Context& md5, unsigned len);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
inline ZMusicCustomReader *GetMusicReader(FileReader& fr)
|
||||
{
|
||||
using FileSys::FileReaderInterface;
|
||||
auto zcr = new ZMusicCustomReader;
|
||||
|
||||
zcr->handle = fr.GetInterface();
|
||||
|
|
|
|||
|
|
@ -139,11 +139,11 @@ void D_AddWildFile(std::vector<std::string>& wadfiles, const char* value, const
|
|||
else
|
||||
{
|
||||
// Try pattern matching
|
||||
FileList list;
|
||||
FileSys::FileList list;
|
||||
auto path = ExtractFilePath(value);
|
||||
auto name = ExtractFileBase(value, true);
|
||||
if (path.IsEmpty()) path = ".";
|
||||
if (ScanDirectory(list, path, name, true))
|
||||
if (FileSys::ScanDirectory(list, path, name, true))
|
||||
{
|
||||
for(auto& entry : list)
|
||||
{
|
||||
|
|
@ -193,8 +193,8 @@ void D_AddConfigFiles(std::vector<std::string>& wadfiles, const char* section, c
|
|||
|
||||
void D_AddDirectory(std::vector<std::string>& wadfiles, const char* dir, const char *filespec, FConfigFile* config)
|
||||
{
|
||||
FileList list;
|
||||
if (ScanDirectory(list, dir, "*.wad", true))
|
||||
FileSys::FileList list;
|
||||
if (FileSys::ScanDirectory(list, dir, "*.wad", true))
|
||||
{
|
||||
for (auto& entry : list)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -929,7 +929,7 @@ int ReadPalette(int lumpnum, uint8_t* buffer)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
FileData lump = fileSystem.ReadFile(lumpnum);
|
||||
auto lump = fileSystem.ReadFile(lumpnum);
|
||||
auto lumpmem = lump.GetBytes();
|
||||
memset(buffer, 0, 768);
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#ifndef __S_PLAYLIST_H__
|
||||
#define __S_PLAYLIST_H__
|
||||
|
||||
class FileReader;
|
||||
#include "files.h"
|
||||
|
||||
class FPlayList
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include <string>
|
||||
#include "tarray.h"
|
||||
#include "utf8.h"
|
||||
#include "filesystem.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define PRINTFISH(x) __attribute__((format(printf, 2, x)))
|
||||
|
|
@ -117,8 +118,6 @@ enum ELumpNum
|
|||
{
|
||||
};
|
||||
|
||||
class FileSystem;
|
||||
|
||||
class FString
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue