Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for loading JKA assets. #159

Merged
merged 10 commits into from May 1, 2023
8 changes: 4 additions & 4 deletions CVARS.rst
Expand Up @@ -55,12 +55,12 @@ New and Modified Cvars

..

:Name: fs_noJKA
:Name: fs_loadJKA
:Values: "0", "1"
:Default: "0"
:Default: "1"
:Description:
Disables loading of JKA assets even when fs_assetsPathJKA point to a valid
JKA folder.
Enables loading of JKA assets when fs_assetsPathJKA point to a valid JKA
folder.

-----------
Client-Side
Expand Down
8 changes: 4 additions & 4 deletions src/qcommon/files.cpp
Expand Up @@ -237,7 +237,7 @@ static cvar_t *fs_homepath;
static cvar_t *fs_basepath;
static cvar_t *fs_assetspath;
static cvar_t *fs_assetspathJKA;
static cvar_t *fs_noJKA;
static cvar_t *fs_loadJKA;
static cvar_t *fs_basegame;
static cvar_t *fs_copyfiles;
static cvar_t *fs_gamedirvar;
Expand Down Expand Up @@ -3332,7 +3332,7 @@ static void FS_Startup( const char *gameName ) {

assetsPathJKA = Sys_DefaultAssetsPathJKA();
fs_assetspathJKA = Cvar_Get("fs_assetspathJKA", assetsPathJKA ? assetsPathJKA : "", CVAR_INIT | CVAR_VM_NOWRITE);
Daggolin marked this conversation as resolved.
Show resolved Hide resolved
Daggolin marked this conversation as resolved.
Show resolved Hide resolved
fs_noJKA = Cvar_Get("fs_noJKA", "0", CVAR_ARCHIVE);
fs_loadJKA = Cvar_Get("fs_loadJKA", "1", CVAR_ARCHIVE);

if (!FS_AllPath_Base_FileExists("assets5.pk3")) {
// assets files found in none of the paths
Expand All @@ -3351,7 +3351,7 @@ static void FS_Startup( const char *gameName ) {
}

// Try to load JKA assets if a path has been specified
if (fs_assetspathJKA->string[0] && !fs_noJKA->integer) {
if (fs_assetspathJKA->string[0] && !fs_loadJKA->integer) {
Daggolin marked this conversation as resolved.
Show resolved Hide resolved
FS_AddAssetsDirectoryJKA(fs_assetspathJKA->string, BASEGAME);
}

Expand Down Expand Up @@ -3846,7 +3846,7 @@ void FS_InitFilesystem( void ) {
Com_StartupVariable( "fs_basepath" );
Com_StartupVariable( "fs_homepath" );
Com_StartupVariable( "fs_assetspathJKA" );
Com_StartupVariable( "fs_noJKA" );
Com_StartupVariable( "fs_loadJKA" );
#if !defined(PORTABLE)
Com_StartupVariable( "fs_assetspath" );
#endif
Expand Down