Skip to content

Commit

Permalink
- only rerelease folder has music in steam
Browse files Browse the repository at this point in the history
  • Loading branch information
sultim-t committed Oct 1, 2022
1 parent 6c33ddf commit 01194b8
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions Quake/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2232,6 +2232,20 @@ static const wchar_t *rt_folderstocreate[] = {
L"\\id1\\music",
};
static const wchar_t *rt_originalfiles[] = {
L"\\id1\\PAK0.PAK",
L"\\id1\\PAK1.PAK",
L"\\rerelease\\id1\\music\\track02.ogg",
L"\\rerelease\\id1\\music\\track03.ogg",
L"\\rerelease\\id1\\music\\track04.ogg",
L"\\rerelease\\id1\\music\\track05.ogg",
L"\\rerelease\\id1\\music\\track06.ogg",
L"\\rerelease\\id1\\music\\track07.ogg",
L"\\rerelease\\id1\\music\\track08.ogg",
L"\\rerelease\\id1\\music\\track09.ogg",
L"\\rerelease\\id1\\music\\track10.ogg",
L"\\rerelease\\id1\\music\\track11.ogg",
};
static const wchar_t *rt_dstfiles[] = {
L"\\id1\\PAK0.PAK",
L"\\id1\\PAK1.PAK",
L"\\id1\\music\\track02.ogg",
Expand All @@ -2254,18 +2268,20 @@ static qboolean RT_NeedToCopyFromSteam (const char *gamename)
return false;
}

assert (countof (rt_dstfiles) == countof (rt_originalfiles));

wchar_t cur_directory[1024] = L"";
if (GetCurrentDirectoryW (countof (cur_directory), cur_directory) == 0)
{
return false;
}

qboolean filesmissing = false;
for (int i = 0; i < (int)countof (rt_originalfiles); i++)
for (int i = 0; i < (int)countof (rt_dstfiles); i++)
{
wchar_t dst_path[1024] = L"";
wcscat (dst_path, cur_directory);
wcscat (dst_path, rt_originalfiles[i]);
wcscat (dst_path, rt_dstfiles[i]);

qboolean exists = GetFileAttributesW (dst_path) != INVALID_FILE_ATTRIBUTES;
if (!exists)
Expand Down Expand Up @@ -2402,7 +2418,7 @@ static void RT_CopyFromSteamFolder ()

wchar_t dst_path[1024] = L"";
wcscat (dst_path, cur_directory);
wcscat (dst_path, rt_originalfiles[i]);
wcscat (dst_path, rt_dstfiles[i]);

if (!CopyFileW (src_path, dst_path, FALSE))
{
Expand Down

0 comments on commit 01194b8

Please sign in to comment.