ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
quit.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  */
21 
22 #ifndef AGS_ENGINE_MAIN_QUIT_H
23 #define AGS_ENGINE_MAIN_QUIT_H
24 
25 namespace AGS3 {
26 
27 enum QuitReason {
28  // Flags defining the base reason, could be subtyped by summing
29  // with the other flags:
30  // - normal exit means everything is fine
31  kQuitKind_NormalExit = 0x01,
32  // - game was requested to abort
33  kQuitKind_DeliberateAbort = 0x02,
34  // - something was wrong with the game logic (script)
35  kQuitKind_GameException = 0x04,
36  // - something was wrong with the engine, which it could not handle
37  kQuitKind_EngineException = 0x08,
38 
39  // user closed the window or script command QuitGame was executed
40  kQuit_GameRequest = kQuitKind_NormalExit | 0x10,
41 
42  // user pressed abort game key
43  kQuit_UserAbort = kQuitKind_DeliberateAbort | 0x20,
44 
45  // script command AbortGame was executed
46  kQuit_ScriptAbort = kQuitKind_GameException | 0x10,
47  // game logic has generated a warning and warnings are treated as error
48  kQuit_GameWarning = kQuitKind_GameException | 0x20,
49  // game logic has generated an error (often script error)
50  kQuit_GameError = kQuitKind_GameException | 0x30,
51 
52  // any kind of a fatal engine error
53  kQuit_FatalError = kQuitKind_EngineException
54 };
55 
56 extern void quit_free();
57 
58 } // namespace AGS3
59 
60 #endif
Definition: ags.h:40