1 /*
2 	This file is part of Warzone 2100.
3 	Copyright (C) 1999-2004  Eidos Interactive
4 	Copyright (C) 2005-2020  Warzone 2100 Project
5 
6 	Warzone 2100 is free software; you can redistribute it and/or modify
7 	it under the terms of the GNU General Public License as published by
8 	the Free Software Foundation; either version 2 of the License, or
9 	(at your option) any later version.
10 
11 	Warzone 2100 is distributed in the hope that it will be useful,
12 	but WITHOUT ANY WARRANTY; without even the implied warranty of
13 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 	GNU General Public License for more details.
15 
16 	You should have received a copy of the GNU General Public License
17 	along with Warzone 2100; if not, write to the Free Software
18 	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #ifndef __INCLUDED_SRC_LOADSAVE_H__
22 #define __INCLUDED_SRC_LOADSAVE_H__
23 
24 /***************************************************************************/
25 /*
26  *	Global Definitions
27  */
28 /***************************************************************************/
29 
30 enum LOADSAVE_MODE
31 {
32 	LOAD_FRONTEND_MISSION,
33 	LOAD_MISSIONEND,
34 	LOAD_INGAME_MISSION,
35 	LOAD_FRONTEND_SKIRMISH,
36 	LOAD_INGAME_SKIRMISH,
37 	SAVE_MISSIONEND,
38 	SAVE_INGAME_MISSION,
39 	SAVE_INGAME_SKIRMISH,
40 	LOAD_FRONTEND_MISSION_AUTO = 16,// internal use only
41 	LOAD_MISSIONEND_AUTO,		// internal use only
42 	LOAD_INGAME_MISSION_AUTO,	// internal use only
43 	LOAD_FRONTEND_SKIRMISH_AUTO,	// internal use only
44 	LOAD_INGAME_SKIRMISH_AUTO	// internal use only
45 };
46 
47 /***************************************************************************/
48 /*
49  *	Global Variables
50  */
51 /***************************************************************************/
52 
53 extern bool bLoadSaveUp;							// true when interface is up and should be run.
54 //the name of the save game to load from the front end
55 extern char saveGameName[256];
56 extern char lastSavePath[PATH_MAX];
57 extern bool lastSaveMP;
58 extern char sRequestResult[PATH_MAX];
59 extern bool bRequestLoad;
60 extern bool autosaveEnabled;
61 
62 /***************************************************************************/
63 /*
64  *	Global ProtoTypes
65  */
66 /***************************************************************************/
67 
68 void drawBlueBox(UDWORD x, UDWORD y, UDWORD w, UDWORD h);
69 void drawBlueBoxInset(UDWORD x, UDWORD y, UDWORD w, UDWORD h);
70 
71 bool addLoadSave(LOADSAVE_MODE mode, const char *title);
72 bool closeLoadSave(bool goBack = false);
73 bool runLoadSave(bool bResetMissionWidgets);
74 bool displayLoadSave();
75 
76 void removeWildcards(char *pStr);
77 
78 // return whether the save screen was displayed in the mission results screen
79 bool saveInMissionRes();
80 
81 // return whether the save screen was displayed in the middle of a mission
82 bool saveMidMission();
83 
84 void deleteSaveGame(char *fileName);
85 
86 void loadSaveScreenSizeDidChange(unsigned int oldWidth, unsigned int oldHeight, unsigned int newWidth, unsigned int newHeight);
87 
88 bool findLastSave();
89 
90 bool autoSave();
91 
92 #endif // __INCLUDED_SRC_LOADSAVE_H__
93