예제 #1
0
파일: mission.c 프로젝트: paud/d2x-xl
//returns 1 if file read ok, else 0
int ReadMissionFile (char *filename, int count, int location)
{
	char	filename2 [100];
	CFILE *fp;
	char	*p, temp [FILENAME_LEN],*t;

switch (location) {
	case ML_MISSIONDIR:
	case ML_ALTHOGDIR:
		strcpy(filename2, gameFolders.szMissionDirs [location]);
		break;

	case ML_CDROM:
		songs_stop_redbook();		//so we can read from the CD
		strcpy(filename2,CDROM_dir);
		break;

	default:
		Int3();		//fall through

	case ML_CURDIR:
		strcpy(filename2,"");
		break;
}
strcat(filename2, filename);
fp = CFOpen (filename2, "", "rb", 0);
if (!fp)
	return 0;

strcpy(temp,filename);
if ((t = strchr(temp, '.')) == NULL)
	return 0;	//missing extension
gameData.missions.list [count].descent_version = (t [3] == '2') ? 2 : 1;
*t = '\0';
// look if it's .mn2 or .msn
strcpy( gameData.missions.list [count].filename, temp);
gameData.missions.list [count].anarchy_only_flag = 0;
gameData.missions.list [count].location = location;

p = GetParmValue("name",fp);
if (!p) {		//try enhanced mission
	CFSeek(fp,0,SEEK_SET);
	p = GetParmValue ("xname", fp);
	}
if (!p) {       //try super-enhanced mission!
	CFSeek(fp,0,SEEK_SET);
	p = GetParmValue( "zname", fp);
	}
if (!p && (gameStates.app.bNostalgia < 3)) {       //try super-enhanced mission!
	CFSeek(fp,0,SEEK_SET);
	p = GetParmValue ("d2x-name", fp);
	}

if (p) {
	char *t;
	if (t = strchr (p, ';'))
		*t-- = 0;
	else
		t = p + strlen (p) - 1;
	while (isspace (*t) || (t - p > MISSION_NAME_LEN)) 
		*t-- = '\0';
	if (gameOpts->menus.bShowLevelVersion) {
		sprintf (gameData.missions.list [count].mission_name, "[%d] %s", gameData.missions.list [count].descent_version, p);
		strcat (temp, filename);
		}
	else
		strcpy(gameData.missions.list [count].mission_name,p);
	}
else {
	CFClose(fp);
	return 0;
	}
p = GetParmValue("type",fp);
//get mission type
if (p)
	gameData.missions.list [count].anarchy_only_flag = MsnIsTok (p,"anarchy");
CFClose(fp);
return 1;
}
예제 #2
0
파일: songs.c 프로젝트: paud/d2x-xl
//stop any songs - midi or redbook - that are currently playing
void SongsStopAll(void)
{
	DigiStopCurrentSong();	// Stop midi song, if playing
	songs_stop_redbook();			// Stop CD, if playing
}
예제 #3
0
//stop any songs - midi or redbook - that are currently playing
void songs_stop_all(void)
{
	digi_stop_current_song();	// Stop midi song, if playing
	
	songs_stop_redbook();			// Stop CD, if playing
}