ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
savescn.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  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Should really be called "moving actors.h"
21  */
22 
23 #ifndef TINSEL_SAVESCN_H
24 #define TINSEL_SAVESCN_H
25 
26 #include "tinsel/actors.h" // SAVED_ACTOR
27 #include "tinsel/dw.h" // SCNHANDLE
28 #include "tinsel/movers.h" // SAVED_MOVER
29 #include "tinsel/pcode.h" // INT_CONTEXT
30 #include "tinsel/play.h"
31 #include "tinsel/polygons.h"
32 #include "tinsel/scroll.h" // SCROLLDATA
33 #include "tinsel/sysvar.h"
34 
35 namespace Tinsel {
36 
37 #define SG_DESC_LEN 40 // Max. saved game description length
38 #define MAX_SAVED_FILES 100
39 
40 struct SAVED_DATA {
41  SCNHANDLE SavedSceneHandle; // Scene handle
42  SCNHANDLE SavedBgroundHandle; // Background handle
43  SAVED_MOVER SavedMoverInfo[MAX_MOVERS]; // Moving actors
44  SAVED_ACTOR SavedActorInfo[MAX_SAVED_ACTORS]; // } Actors
45  int NumSavedActors; // }
46  int SavedLoffset, SavedToffset; // Screen offsets
47  INT_CONTEXT SavedICInfo[MAX_INTERPRET]; // Interpret contexts
48  bool SavedDeadPolys[MAX_POLY];
49  bool SavedControl;
50  SCNHANDLE SavedMidi; // }
51  bool SavedLoop; // } Midi
52  bool SavedNoBlocking;
53  SCROLLDATA SavedNoScrollData;
54 
55  // Tinsel 2 fields
56  Z_POSITIONS zPositions[NUM_ZPOSITIONS];
57  byte savedActorZ[MAX_SAVED_ACTOR_Z];
58  POLY_VOLATILE SavedPolygonStuff[MAX_POLY];
59  uint32 SavedTune[3]; // Music
60  bool bTinselDim;
61  int SavedScrollFocus;
62  int SavedSystemVars[SV_TOPVALID_T3];
63  SOUNDREELS SavedSoundReels[MAX_SOUNDREELS];
64 };
65 
66 
67 enum SRSTATE {
68  SR_IDLE, SR_DORESTORE, SR_DONERESTORE,
69  SR_DOSAVE, SR_DONESAVE, SR_ABORTED
70 };
71 
72 void TinselRestoreScene(bool bFade);
73 void TinselSaveScene(CORO_PARAM);
74 void DoRestoreScene(SAVED_DATA *sd, bool bFadeOut);
75 void DoSaveScene(SAVED_DATA *sd);
76 
77 bool IsRestoringScene();
78 
79 
80 enum letype{
81  LE_NAME, LE_DESC
82 };
83 
84 char *ListEntry(int i, letype which);
85 int getList();
86 void setNeedLoad();
87 
88 void RestoreGame(int num);
89 void SaveGame(char *name, char *desc);
90 
91 void ProcessSRQueue();
92 
93 void RequestSaveGame(char *name, char *desc, SAVED_DATA *sd, int *ssCount, SAVED_DATA *ssData);
94 void RequestRestoreGame(int num, SAVED_DATA *sd, int *ssCount, SAVED_DATA *ssData);
95 
96 void InitializeSaveScenes();
97 void FreeSaveScenes();
98 
99 } // End of namespace Tinsel
100 
101 #endif /* TINSEL_SAVESCN_H */
Definition: savescn.h:40
Definition: scroll.h:37
uint32 SCNHANDLE
Definition: dw.h:31
Definition: movers.h:196
Definition: actors.h:75
Definition: actors.h:65
#define CORO_PARAM
Definition: coroutines.h:107
Definition: actors.h:36
Definition: play.h:34
maximum number of polygons in a scene
Definition: scene.h:35
Definition: polygons.h:72
Definition: pcode.h:54