1 #ifndef _XML_LEVEL_SCRIPT_
2 #define _XML_LEVEL_SCRIPT_
3 /*
4 
5 	Copyright (C) 1991-2001 and beyond by Bungie Studios, Inc.
6 	and the "Aleph One" developers.
7 
8 	This program is free software; you can redistribute it and/or modify
9 	it under the terms of the GNU General Public License as published by
10 	the Free Software Foundation; either version 3 of the License, or
11 	(at your option) any later version.
12 
13 	This program is distributed in the hope that it will be useful,
14 	but WITHOUT ANY WARRANTY; without even the implied warranty of
15 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 	GNU General Public License for more details.
17 
18 	This license is contained in the file "COPYING",
19 	which is included with this source code; it is available online at
20 	http://www.gnu.org/licenses/gpl.html
21 
22 	Support for XML scripts in map files
23 	by Loren Petrich,
24 	April 16, 2000
25 
26 	The reason for a separate object is that it will be necessary to execute certain commands
27 	only on certain levels.
28 
29 Nov 25, 2000 (Loren Petrich)
30 	Added support for specifying movies for levels, as Jesse Simko had requested.
31 */
32 
33 
34 #include "FileHandler.h"
35 
36 // Loads all those in resource 128 in a map file (or some appropriate equivalent)
37 void LoadLevelScripts(FileSpecifier& MapFile);
38 
39 // Runs a script for some level; loads Pfhortran,
40 // runs level-specific MML...
41 void ResetLevelScript();
42 void RunLevelScript(int LevelIndex);
43 void RunScriptChunks();
44 
45 // Intended to be run at the end of a game
46 void RunEndScript();
47 
48 // Intended for restoring old parameter values, because MML sets values at a variety
49 // of different places, and it may be easier to simply set stuff back to defaults
50 // by including those defaults in the script.
51 void RunRestorationScript();
52 
53 // Finds the level movie and the end movie, to be used in show_movie()
54 // The first is for some level,
55 // while the second is for the end of a game
56 void FindLevelMovie(short index);
57 
58 // Gets the pointer of a movie to play at a level, as a pointer to the file specifier.
59 // A NULL pointer means no movie to play.
60 // Its arg is the playback size, which will not be changed if not specified explicitly.
61 FileSpecifier *GetLevelMovie(float& PlaybackSize);
62 
63 // handle new embedded MML and Lua scripts
64 void SetMMLS(uint8* data, size_t length);
65 void SetLUAS(uint8* data, size_t length);
66 uint8* GetMMLS(size_t& length);
67 uint8* GetLUAS(size_t& length);
68 
69 // For selecting the end-of-game screens --
70 // what fake level index for them, and how many to display
71 // (resource numbers increasing in sequence)
72 extern short EndScreenIndex;
73 extern short NumEndScreens;
74 
75 class InfoTree;
76 void parse_mml_default_levels(const InfoTree& root);
77 void reset_mml_default_levels();
78 
79 #endif
80