]> icculus.org git repositories - btb/d2x.git/blob - main/mission.h
recognize .msn mission files. patch from Martin Schaffner <maschaffner@gmx.ch>
[btb/d2x.git] / main / mission.h
1 /* $Id: mission.h,v 1.2 2002-08-07 07:34:09 btb Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 #ifndef _MISSION_H
16 #define _MISSION_H
17
18 #include <pstypes.h>
19
20 #define MAX_MISSIONS                    300
21 #define MAX_LEVELS_PER_MISSION          30
22 #define MAX_SECRET_LEVELS_PER_MISSION   6
23 #define MISSION_NAME_LEN                25
24
25 //mission list entry
26 typedef struct mle {
27         char    filename[9];                // path and filename without extension
28         char    mission_name[MISSION_NAME_LEN+1];
29         ubyte   anarchy_only_flag;          // if true, mission is anarchy only
30         ubyte   location;                   // see defines below
31         ubyte   descent_version;            // descent 1 or descent 2?
32 } mle;
33
34 //values that describe where a mission is located
35 #define ML_CURDIR       0
36 #define ML_MISSIONDIR   1
37 #define ML_CDROM        2
38
39 extern mle Mission_list[MAX_MISSIONS];
40
41 extern int Current_mission_num;
42 extern char *Current_mission_filename,*Current_mission_longname;
43
44 //arrays of name of the level files
45 extern char Level_names[MAX_LEVELS_PER_MISSION][FILENAME_LEN];
46 extern char Secret_level_names[MAX_SECRET_LEVELS_PER_MISSION][FILENAME_LEN];
47
48 //fills in the global list of missions.  Returns the number of missions
49 //in the list.  If anarchy_mode set, don't include non-anarchy levels.
50 //if there is only one mission, this function will call load_mission on it.
51 int build_mission_list(int anarchy_mode);
52
53 //loads the specfied mission from the mission list.  build_mission_list()
54 //must have been called.  If build_mission_list() returns 0, this function
55 //does not need to be called.  Returns true if mission loaded ok, else false.
56 int load_mission(int mission_num);
57
58 //loads the named mission if exists.
59 //Returns true if mission loaded ok, else false.
60 int load_mission_by_name(char *mission_name);
61
62 #endif