Small fix and improvement for Jukebox path detection
This commit is contained in:
parent
cc12616895
commit
b39c297762
|
@ -3,6 +3,7 @@ D2X-Rebirth Changelog
|
||||||
20100614
|
20100614
|
||||||
--------
|
--------
|
||||||
include/args.h, include/physfsx.h, main/inferno.c, main/menu.c, main/movie.c, main/songs.c, main/songs.h, main/switch.c, main/config.c, main/config.h, main/gameseq.c, main/digiobj.c, main/digi.h, main/game.c, main/gamecntl.c, misc/args.c, CHANGELOG.txt, d2x.ini, arch/sdl/digi_mixer.c, arch/sdl/digi_mixer_music.c, arch/sdl/init.c, arch/sdl/jukebox.c, arch/sdl/digi.c, arch/sdl/digi_audio.c, arch/include/digi_audio.h, arch/include/digi_mixer.h, arch/include/digi_mixer_music.h, arch/include/jukebox.h: Increased SDL_mixer music abilities to play non-hmp from HOGs, having Level-music path to play, options to specify non-level tracks and added various playing order methods; Abstracted SDL_mixer- and Redbook-interfaces; Simplified program flow through all music functions
|
include/args.h, include/physfsx.h, main/inferno.c, main/menu.c, main/movie.c, main/songs.c, main/songs.h, main/switch.c, main/config.c, main/config.h, main/gameseq.c, main/digiobj.c, main/digi.h, main/game.c, main/gamecntl.c, misc/args.c, CHANGELOG.txt, d2x.ini, arch/sdl/digi_mixer.c, arch/sdl/digi_mixer_music.c, arch/sdl/init.c, arch/sdl/jukebox.c, arch/sdl/digi.c, arch/sdl/digi_audio.c, arch/include/digi_audio.h, arch/include/digi_mixer.h, arch/include/digi_mixer_music.h, arch/include/jukebox.h: Increased SDL_mixer music abilities to play non-hmp from HOGs, having Level-music path to play, options to specify non-level tracks and added various playing order methods; Abstracted SDL_mixer- and Redbook-interfaces; Simplified program flow through all music functions
|
||||||
|
arch/sdl/jukebox.c: Small fix and improvement for Jukebox path detection
|
||||||
|
|
||||||
20100503
|
20100503
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -68,13 +68,26 @@ void jukebox_load() {
|
||||||
strncat(GameCfg.CMLevelMusicPath, sep, PATH_MAX - 1 - strlen(GameCfg.CMLevelMusicPath));
|
strncat(GameCfg.CMLevelMusicPath, sep, PATH_MAX - 1 - strlen(GameCfg.CMLevelMusicPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
PHYSFSX_getRealPath(GameCfg.CMLevelMusicPath,absolute_path);
|
PHYSFS_addToSearchPath(GameCfg.CMLevelMusicPath, 0);
|
||||||
PHYSFS_addToSearchPath(absolute_path, 0);
|
|
||||||
|
|
||||||
// as mountpoints are no option (yet), make sure only files originating from GameCfg.CMLevelMusicPath are aded to the list.
|
// as mountpoints are no option (yet), make sure only files originating from GameCfg.CMLevelMusicPath are aded to the list.
|
||||||
JukeboxSongs = PHYSFSX_findabsoluteFiles("", absolute_path, music_exts);
|
JukeboxSongs = PHYSFSX_findabsoluteFiles("", GameCfg.CMLevelMusicPath, music_exts);
|
||||||
|
|
||||||
if (JukeboxSongs != NULL) {
|
// If we do not find anything, try to see if given path is child of Searchpath
|
||||||
|
if (JukeboxSongs != NULL)
|
||||||
|
{
|
||||||
|
for (count = 0; JukeboxSongs[count]!=NULL; count++) {}
|
||||||
|
if (!count)
|
||||||
|
{
|
||||||
|
PHYSFSX_getRealPath(GameCfg.CMLevelMusicPath,absolute_path);
|
||||||
|
PHYSFS_addToSearchPath(absolute_path, 0);
|
||||||
|
JukeboxSongs = PHYSFSX_findabsoluteFiles("", absolute_path, music_exts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
count = 0;
|
||||||
|
|
||||||
|
if (JukeboxSongs != NULL)
|
||||||
|
{
|
||||||
for (count = 0; JukeboxSongs[count]!=NULL; count++) {}
|
for (count = 0; JukeboxSongs[count]!=NULL; count++) {}
|
||||||
if (count)
|
if (count)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue