diff options
author | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-08-16 01:12:59 +0100 |
---|---|---|
committer | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-08-16 01:12:59 +0100 |
commit | 082f3893215797268d7ac8c1000ebe371f276af7 (patch) | |
tree | b5cc677a49635a9244559e235d4915c064c9f6c4 /NorthstarDLL/filesystem.h | |
parent | b30a385fc25dad05e568ae8538f5aa3656c5c8d4 (diff) | |
download | NorthstarLauncher-082f3893215797268d7ac8c1000ebe371f276af7.tar.gz NorthstarLauncher-082f3893215797268d7ac8c1000ebe371f276af7.zip |
lots of stuff idk
Diffstat (limited to 'NorthstarDLL/filesystem.h')
-rw-r--r-- | NorthstarDLL/filesystem.h | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/NorthstarDLL/filesystem.h b/NorthstarDLL/filesystem.h index 59b9c5eb..abfdd14b 100644 --- a/NorthstarDLL/filesystem.h +++ b/NorthstarDLL/filesystem.h @@ -1,77 +1,77 @@ -#pragma once
-#include "sourceinterface.h"
-
-// taken from ttf2sdk
-typedef void* FileHandle_t;
-
-#pragma pack(push, 1)
-struct VPKFileEntry
-{
- char* directory;
- char* filename;
- char* extension;
- unsigned char unknown[0x38];
-};
-#pragma pack(pop)
-
-#pragma pack(push, 1)
-struct VPKData
-{
- unsigned char unknown[5];
- char path[255];
- unsigned char unknown2[0x134];
- int32_t numEntries;
- unsigned char unknown3[12];
- VPKFileEntry* entries;
-};
-#pragma pack(pop)
-
-enum SearchPathAdd_t
-{
- PATH_ADD_TO_HEAD, // First path searched
- PATH_ADD_TO_TAIL, // Last path searched
-};
-
-class CSearchPath
-{
- public:
- unsigned char unknown[0x18];
- const char* debugPath;
-};
-
-class IFileSystem
-{
- public:
- struct VTable
- {
- void* unknown[10];
- void (*AddSearchPath)(IFileSystem* fileSystem, const char* pPath, const char* pathID, SearchPathAdd_t addType);
- void* unknown2[84];
- bool (*ReadFromCache)(IFileSystem* fileSystem, const char* path, void* result);
- void* unknown3[15];
- VPKData* (*MountVPK)(IFileSystem* fileSystem, const char* vpkPath);
- };
-
- struct VTable2
- {
- int (*Read)(IFileSystem::VTable2** fileSystem, void* pOutput, int size, FileHandle_t file);
- void* unknown[1];
- FileHandle_t (*Open)(
- IFileSystem::VTable2** fileSystem, const char* pFileName, const char* pOptions, const char* pathID, int64_t unknown);
- void (*Close)(IFileSystem* fileSystem, FileHandle_t file);
- void* unknown2[6];
- bool (*FileExists)(IFileSystem::VTable2** fileSystem, const char* pFileName, const char* pPathID);
- };
-
- VTable* m_vtable;
- VTable2* m_vtable2;
-};
-
-// use the R2 namespace for game funcs
-namespace R2
-{
- extern SourceInterface<IFileSystem>* g_pFilesystem;
-
- std::string ReadVPKFile(const char* path);
- std::string ReadVPKOriginalFile(const char* path);
-} // namespace R2
+#pragma once +#include "sourceinterface.h" + +// taken from ttf2sdk +typedef void* FileHandle_t; + +#pragma pack(push, 1) +struct VPKFileEntry +{ + char* directory; + char* filename; + char* extension; + unsigned char unknown[0x38]; +}; +#pragma pack(pop) + +#pragma pack(push, 1) +struct VPKData +{ + unsigned char unknown[5]; + char path[255]; + unsigned char unknown2[0x134]; + int32_t numEntries; + unsigned char unknown3[12]; + VPKFileEntry* entries; +}; +#pragma pack(pop) + +enum SearchPathAdd_t +{ + PATH_ADD_TO_HEAD, // First path searched + PATH_ADD_TO_TAIL, // Last path searched +}; + +class CSearchPath +{ + public: + unsigned char unknown[0x18]; + const char* debugPath; +}; + +class IFileSystem +{ + public: + struct VTable + { + void* unknown[10]; + void (*AddSearchPath)(IFileSystem* fileSystem, const char* pPath, const char* pathID, SearchPathAdd_t addType); + void* unknown2[84]; + bool (*ReadFromCache)(IFileSystem* fileSystem, const char* path, void* result); + void* unknown3[15]; + VPKData* (*MountVPK)(IFileSystem* fileSystem, const char* vpkPath); + }; + + struct VTable2 + { + int (*Read)(IFileSystem::VTable2** fileSystem, void* pOutput, int size, FileHandle_t file); + void* unknown[1]; + FileHandle_t (*Open)( + IFileSystem::VTable2** fileSystem, const char* pFileName, const char* pOptions, const char* pathID, int64_t unknown); + void (*Close)(IFileSystem* fileSystem, FileHandle_t file); + void* unknown2[6]; + bool (*FileExists)(IFileSystem::VTable2** fileSystem, const char* pFileName, const char* pPathID); + }; + + VTable* m_vtable; + VTable2* m_vtable2; +}; + +// use the R2 namespace for game funcs +namespace R2 +{ + extern SourceInterface<IFileSystem>* g_pFilesystem; + + std::string ReadVPKFile(const char* path); + std::string ReadVPKOriginalFile(const char* path); +} // namespace R2 |