ScummVM API documentation
mission.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * Additional copyright for this file:
8  * Copyright (C) 1999-2000 Revolution Software Ltd.
9  * This code is based on source code created by Revolution Software,
10  * used with permission.
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef ICB_MISSION
28 #define ICB_MISSION
29 
30 #include "engines/icb/common/px_common.h"
31 #include "engines/icb/session.h"
32 #include "engines/icb/string_vest.h"
33 
34 namespace ICB {
35 
36 #define SR_VERSION 17
37 
38 // save_game_max is :
39 // 8192 (1 memory card block) - 256 (PSX system data) - 8 (PSX engine data)
40 #define SAVE_GAME_MAX_SIZE (8192 - 256 - 8)
41 
42 // total number of sessions allowed per mission
43 #define MAX_sessions 5
44 #define MAX_fvars (MAX_voxel_list * 4)
45 #define MAX_lvars 30
46 
48 public:
49  int32 lvar_value[MAX_lvars];
50  uint32 total_lvars; // worth doing to reduce save game size
51 
52  _object_status status_flag;
53 };
54 
56 public:
57  char session__name[ENGINE_STRING_LEN]; // eg land_train
58 
59  uint32 number_of_micro_objects;
60  _micro_object micro_objects[MAX_session_objects];
61 
62  int32 fvars[MAX_fvars];
63 };
64 
65 enum __load_result { __NO_SUCH_FILE, __WRONG_VERSION, __GLOBAL_MISMATCH, __LOAD_OK };
66 
67 class _mission {
68 
69 public:
70  _mission();
71  ~_mission();
72 
73  void ___init_mission(const char *mission, const char *session);
74  void ___delete_mission();
75 
76  void End_mission();
77 
78  inline const char *Fetch_mission_name();
79  inline const char *Fetch_h_mission_name();
80  inline const char *Fetch_tiny_mission_name();
81  inline const char *Fetch_tiny_session_name();
82  uint32 Game_cycle();
83  void Create_display();
84  void Set_new_session_name(const char *ascii);
85  void Set_init_nico_name(const char *ascii);
86  bool8 Is_there_init_nico();
87  const char *Return_init_nico_name();
88  void Reset_init_nico();
89  void Save_micro_session();
90  void Restore_micro_session_coords(bool8 from_disk);
91  void Restore_micro_session_vars();
92  void Save_game_position(const char *filename, const char *slot_label, uint32 timeplayed);
93  void Restore_micro_session_from_save_game(Common::SeekableReadStream *stream);
94  void SavePlatformSpecific(Common::WriteStream *stream);
95  void LoadPlatformSpecific(Common::SeekableReadStream *stream);
96 
97  _game_session *session; // pointer to current game session object
98 
99  // camera stuff
100  uint32 camera_follow_id_overide; // id of a character to watch - if 0 defaults to player
101  // here because we want it to hold across session boundaries
102  // This flag keeps track of whether or not the Remora was active when an fn_set_watch()
103  // was issued, so it can be put back how it was.
104  int32 remora_save_mode;
105 
106  uint32 ad_time; // actor draw timer flags used for debugging
107  uint32 lt_time; // actor draw timer flags used for debugging
108  uint32 set_time; // setdraw timer flags used for debugging
109  uint32 flip_time; // back buffer blit timer used for debugging
110  uint32 cycle_time; // The length of time the last cycle took
111  uint32 logic_time; // Time spent in logic
112  uint32 resman_logic_time; // Time spent in logic
113  uint32 los_time;
114  uint32 event_time;
115  uint32 sound_time;
116  uint32 xtra_mega_time;
117  uint32 nActorsDrawn;
118  uint32 nActorsConsidered;
119 
120  // points to the name of a new session
121  char new_session_name[TINY_NAME_LEN];
122  char init_nico_name[TINY_NAME_LEN];
123  int32 old_hits_value; // we carry across the lvars from the previous session - this is getting tweeky
124 
125  bool8 chi_following; // is a chi object following the player? Used for session changes
126 
127  // player requires these to cross sessions
128  uint32 num_bullets;
129  uint32 num_clips;
130  uint32 num_medi;
131 
132  bool8 inited_globals; // yes or no - used to init the globals
133 
134 private:
135  char mission_name[ENGINE_STRING_LEN]; // full path
136  char tiny_mission_name[TINY_NAME_LEN]; // eg land_train
137  char tiny_session_name[TINY_NAME_LEN]; // eg car_5
138 
139  uint32 mission_terminate;
140  char h_mission_name[8]; // filename of the hash'ed version of mission_name
141 
142  uint32 mission_status; // 0 ok
143  // 1 terminate the mission - mission has finished
144 
145  uint32 number_sessions_saved;
146  _micro_session micro_sessions[MAX_sessions];
147 
148  bool8 new_session; // yes new session
149  bool8 init_nico; // yes new session nico
150 };
151 
152 bool8 Setup_new_mission(const char *mission_name, const char *session_name);
153 bool8 Setup_camtest_mission();
154 __load_result Load_game(const char *filename);
155 
156 inline const char *_mission::Fetch_mission_name() { return (mission_name); }
157 
158 inline const char *_mission::Fetch_tiny_mission_name() { return (tiny_mission_name); }
159 
160 inline const char *_mission::Fetch_tiny_session_name() { return (tiny_session_name); }
161 
162 inline const char *_mission::Fetch_h_mission_name() { return (h_mission_name); }
163 
164 } // End of namespace ICB
165 
166 #endif
Definition: stream.h:77
Definition: actor.h:32
Definition: mission.h:47
Definition: stream.h:745
Definition: session.h:173
Definition: mission.h:67
Definition: mission.h:55