ScummVM API documentation
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
35namespace Tinsel {
36
37#define SG_DESC_LEN 40 // Max. saved game description length
38#define MAX_SAVED_FILES 100
39
40struct 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
67enum SRSTATE {
68 SR_IDLE, SR_DORESTORE, SR_DONERESTORE,
69 SR_DOSAVE, SR_DONESAVE, SR_ABORTED
70};
71
72void TinselRestoreScene(bool bFade);
73void TinselSaveScene(CORO_PARAM);
74void DoRestoreScene(SAVED_DATA *sd, bool bFadeOut);
75void DoSaveScene(SAVED_DATA *sd);
76
77bool IsRestoringScene();
78
79
80enum letype{
81 LE_NAME, LE_DESC
82};
83
84char *ListEntry(int i, letype which);
85int getList();
86void setNeedLoad();
87
88void RestoreGame(int num);
89void SaveGame(char *name, char *desc);
90
91void ProcessSRQueue();
92
93void RequestSaveGame(char *name, char *desc, SAVED_DATA *sd, int *ssCount, SAVED_DATA *ssData);
94void RequestRestoreGame(int num, SAVED_DATA *sd, int *ssCount, SAVED_DATA *ssData);
95
96void InitializeSaveScenes();
97void FreeSaveScenes();
98
99} // End of namespace Tinsel
100
101#endif /* TINSEL_SAVESCN_H */
#define CORO_PARAM
Definition: coroutines.h:107
Definition: actors.h:36
@ MAX_POLY
maximum number of polygons in a scene
Definition: scene.h:35
uint32 SCNHANDLE
Definition: dw.h:31
Definition: pcode.h:54
Definition: polygons.h:72
Definition: actors.h:65
Definition: savescn.h:40
Definition: movers.h:196
Definition: scroll.h:37
Definition: play.h:34
Definition: actors.h:75