Be safer not interrupting other ports of descent or the original MS-DOS game when it comes to reading song files: Try reading from MISSION_NAME.sngdxx to have a way reading a song file for a specific mission outside the mission's HOG, next try reading from descent.sngdxx which shall serve as an alternative song file specifically for DXX and then try descent.sng. This should give authors enough possibilities to add OSTs for all different versions of the game without the need to publish different versions of their missions

This commit is contained in:
zicodxx 2011-03-06 21:02:48 +01:00
parent d7d7661cd6
commit dcae49a319
2 changed files with 10 additions and 3 deletions

View file

@ -1,5 +1,9 @@
D1X-Rebirth Changelog
20110306
--------
main/songs.c: Be safer not interrupting other ports of descent or the original MS-DOS game when it comes to reading song files: Try reading from MISSION_NAME.sngdxx to have a way reading a song file for a specific mission outside the mission's HOG, next try reading from descent.sngdxx which shall serve as an alternative song file specifically for DXX and then try descent.sng. This should give authors enough possibilities to add OSTs for all different versions of the game without the need to publish different versions of their missions
20110224
--------
2d/canvas.c: Fix for last revision: Correctly initialize cv_fade_level and cv_blend_func when creating initializing a canvas

View file

@ -73,13 +73,16 @@ void songs_init()
d_free(BIMSongs);
memset(sng_file, '\0', sizeof(sng_file));
if (Current_mission != NULL)
if (Current_mission != NULL) // try MISSION_NAME.sngdxx - might be rarely used but handy if you want a songfile for a specific mission outside of the mission hog file. use special extension to not crash with other ports of the game
{
snprintf(sng_file, strlen(Current_mission_filename)+5, "%s.sng", Current_mission_filename);
snprintf(sng_file, strlen(Current_mission_filename)+8, "%s.sngdxx", Current_mission_filename);
fp = cfopen(sng_file, "rb");
}
if (fp == NULL)
if (fp == NULL) // try descent.sngdxx - a songfile specifically for dxx which level authors CAN use (dxx does not care if descent.sng contains MP3/OGG/etc. as well) besides the normal descent.sng containing files other versions of the game cannot play. this way a mission can contain a DOS-Descent compatible OST (hmp files) as well as a OST using MP3, OGG, etc.
fp = cfopen( "descent.sngdxx", "rb" );
if (fp == NULL) // try to open regular descent.sng
fp = cfopen( "descent.sng", "rb" );
if ( fp == NULL ) // No descent.sng available. Define a default song-set