|
6 | 6 | #include <vgui/ISurface.h> |
7 | 7 | #include "vpklib/packedstore.h" |
8 | 8 | #include "fmtstr.h" |
| 9 | +#include "tier2/fileutils.h" |
9 | 10 |
|
10 | 11 | // memdbgon must be the last include file in a .cpp file!!! |
11 | 12 | #include "tier0/memdbgon.h" |
@@ -90,29 +91,19 @@ void CRD_PNG_Texture::CleanLocalCachedTextures(const char* szDirectory) |
90 | 91 | if (CommandLine()->FindParm("-override_vpk")) |
91 | 92 | return; |
92 | 93 |
|
93 | | - static char szGameRootPath[MAX_PATH]; |
94 | | - static bool bPathInitialized = false; |
| 94 | + static char pak01Path[ MAX_PATH ]; |
| 95 | + static char pak02Path[ MAX_PATH ]; |
| 96 | + static bool bPathsInitialized = false; |
95 | 97 |
|
96 | | - if (!bPathInitialized) |
| 98 | + if ( !bPathsInitialized ) |
97 | 99 | { |
98 | | - const char* szGameInfoPath = "gameinfo.txt"; |
99 | | - if (g_pFullFileSystem->FileExists(szGameInfoPath, "MOD")) |
100 | | - { |
101 | | - char szFullPath[MAX_PATH]; |
102 | | - g_pFullFileSystem->RelativePathToFullPath(szGameInfoPath, "MOD", szFullPath, sizeof(szFullPath)); |
103 | | - V_ExtractFilePath(szFullPath, szGameRootPath, sizeof(szGameRootPath)); |
104 | | - V_FixSlashes(szGameRootPath); |
105 | | - V_AppendSlash(szGameRootPath, sizeof(szGameRootPath)); |
106 | | - bPathInitialized = true; |
107 | | - } |
108 | | - else |
109 | | - { |
110 | | - return; |
111 | | - } |
| 100 | + GetModSubdirectory( "pak01", pak01Path, sizeof( pak01Path ) ); |
| 101 | + GetModSubdirectory( "pak02", pak02Path, sizeof( pak02Path ) ); |
| 102 | + bPathsInitialized = true; |
112 | 103 | } |
113 | 104 |
|
114 | | - static CPackedStore s_pak01(CFmtStr("%spak01", szGameRootPath), g_pFullFileSystem); |
115 | | - static CPackedStore s_pak02(CFmtStr("%spak02", szGameRootPath), g_pFullFileSystem); |
| 105 | + static CPackedStore s_pak01( pak01Path, g_pFullFileSystem ); |
| 106 | + static CPackedStore s_pak02( pak02Path, g_pFullFileSystem ); |
116 | 107 |
|
117 | 108 | struct CleanupRule { |
118 | 109 | std::initializer_list<const char*> extensions; |
|
0 commit comments