From 69cd41881e380ea787dc988617e786117c7f2360 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 23 Nov 2022 12:11:53 +0100 Subject: [PATCH] Move common VPK types to dedicated public header --- r5dev/public/ipackedstore.h | 54 +++++++++++++++++++++++++++ r5dev/vproj/clientsdk.vcxproj | 1 + r5dev/vproj/clientsdk.vcxproj.filters | 3 ++ r5dev/vproj/dedicated.vcxproj | 1 + r5dev/vproj/dedicated.vcxproj.filters | 3 ++ r5dev/vproj/gamesdk.vcxproj | 1 + r5dev/vproj/gamesdk.vcxproj.filters | 3 ++ 7 files changed, 66 insertions(+) create mode 100644 r5dev/public/ipackedstore.h diff --git a/r5dev/public/ipackedstore.h b/r5dev/public/ipackedstore.h new file mode 100644 index 00000000..76a5118b --- /dev/null +++ b/r5dev/public/ipackedstore.h @@ -0,0 +1,54 @@ +#ifndef IPACKEDSTORE_H +#define IPACKEDSTORE_H + +enum class EPackedLoadFlags : int +{ + LOAD_NONE, + LOAD_VISIBLE = 1 << 0, // Visible to FileSystem. + LOAD_CACHE = 1 << 8, // Only set for assets not stored in the depot directory. + LOAD_TEXTURE_UNK0 = 1 << 18, + LOAD_TEXTURE_UNK1 = 1 << 19, + LOAD_TEXTURE_UNK2 = 1 << 20, +}; + +enum class EPackedTextureFlags : short +{ + TEXTURE_NONE, + TEXTURE_DEFAULT = 1 << 3, + TEXTURE_ENVIRONMENT_MAP = 1 << 10, +}; + +struct FileHandleTracker_t +{ + int m_nFileNumber; + int m_nCurOfs; + HANDLE m_hFileHandle; +}; + +struct pFileHandleTracker_t +{ + FileHandleTracker_t self[1024]; +}; + +#pragma pack(push, 1) +struct VPKFileEntry_t +{ + char* m_pszDirectory; + char* m_pszFileName; + char* m_pszExtension; + uint8_t unknown[0x38]; +}; + +struct VPKData_t +{ + int m_nHandle; + char pad[1]; + char m_szPath[255]; + uint8_t unknown2[0x134]; + int32_t m_nEntries; + uint8_t unknown3[12]; + VPKFileEntry_t* m_pEntries; +}; +#pragma pack(pop) + +#endif // IPACKEDSTORE_H \ No newline at end of file diff --git a/r5dev/vproj/clientsdk.vcxproj b/r5dev/vproj/clientsdk.vcxproj index 3f64329c..59572699 100644 --- a/r5dev/vproj/clientsdk.vcxproj +++ b/r5dev/vproj/clientsdk.vcxproj @@ -281,6 +281,7 @@ + diff --git a/r5dev/vproj/clientsdk.vcxproj.filters b/r5dev/vproj/clientsdk.vcxproj.filters index f5c075e9..c8f22e50 100644 --- a/r5dev/vproj/clientsdk.vcxproj.filters +++ b/r5dev/vproj/clientsdk.vcxproj.filters @@ -1817,6 +1817,9 @@ sdk\tier1 + + sdk\public + diff --git a/r5dev/vproj/dedicated.vcxproj b/r5dev/vproj/dedicated.vcxproj index edebca88..4dd31609 100644 --- a/r5dev/vproj/dedicated.vcxproj +++ b/r5dev/vproj/dedicated.vcxproj @@ -231,6 +231,7 @@ + diff --git a/r5dev/vproj/dedicated.vcxproj.filters b/r5dev/vproj/dedicated.vcxproj.filters index 9be49629..25a9de74 100644 --- a/r5dev/vproj/dedicated.vcxproj.filters +++ b/r5dev/vproj/dedicated.vcxproj.filters @@ -1266,6 +1266,9 @@ sdk\tier1 + + sdk\public + diff --git a/r5dev/vproj/gamesdk.vcxproj b/r5dev/vproj/gamesdk.vcxproj index ad2e4b59..a006d62b 100644 --- a/r5dev/vproj/gamesdk.vcxproj +++ b/r5dev/vproj/gamesdk.vcxproj @@ -308,6 +308,7 @@ + diff --git a/r5dev/vproj/gamesdk.vcxproj.filters b/r5dev/vproj/gamesdk.vcxproj.filters index 87f6d2bb..5ee7eccf 100644 --- a/r5dev/vproj/gamesdk.vcxproj.filters +++ b/r5dev/vproj/gamesdk.vcxproj.filters @@ -1913,6 +1913,9 @@ sdk\tier1 + + sdk\public +