mirror of
https://github.com/alexbatalov/fallout2-ce.git
synced 2024-10-02 21:02:02 +00:00
Detect alternative default music directory
This commit is contained in:
parent
8de73ad774
commit
2c7ab7f5c8
@ -4,6 +4,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "db.h"
|
||||
#include "main.h"
|
||||
#include "platform_compat.h"
|
||||
|
||||
@ -121,6 +122,22 @@ bool gameConfigInit(bool isMapper, int argc, char** argv)
|
||||
configSetInt(&gGameConfig, GAME_CONFIG_MAPPER_KEY, GAME_CONFIG_SORT_SCRIPT_LIST_KEY, 0);
|
||||
}
|
||||
|
||||
// CE: Detect alternative default music directory.
|
||||
char alternativeMusicPath[COMPAT_MAX_PATH];
|
||||
strcpy(alternativeMusicPath, "data\\sound\\music\\*.acm");
|
||||
compat_windows_path_to_native(alternativeMusicPath);
|
||||
compat_resolve_path(alternativeMusicPath);
|
||||
|
||||
char** acms;
|
||||
int acmsLength = fileNameListInit(alternativeMusicPath, &acms, 0, 0);
|
||||
if (acmsLength != -1) {
|
||||
if (acmsLength > 0) {
|
||||
configSetString(&gGameConfig, GAME_CONFIG_SOUND_KEY, GAME_CONFIG_MUSIC_PATH1_KEY, "data\\sound\\music\\");
|
||||
configSetString(&gGameConfig, GAME_CONFIG_SOUND_KEY, GAME_CONFIG_MUSIC_PATH2_KEY, "data\\sound\\music\\");
|
||||
}
|
||||
fileNameListFree(&acms, 0);
|
||||
}
|
||||
|
||||
// SFALL: Custom config file name.
|
||||
char* customConfigFileName = nullptr;
|
||||
configGetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_CONFIG_FILE, &customConfigFileName);
|
||||
|
Loading…
Reference in New Issue
Block a user