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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef AGS_ENGINE_MAIN_ENGINE_H
24 #define AGS_ENGINE_MAIN_ENGINE_H
25 
26 #include "ags/shared/util/ini_util.h"
27 
28 namespace AGS3 {
29 
30 const char *get_engine_name();
31 const char *get_engine_version();
32 void        show_preload();
33 void        engine_init_game_settings();
34 int         initialize_engine(const AGS::Shared::ConfigTree &startup_opts);
35 
36 struct ScreenSetup;
37 // Try to set new graphics mode deduced from given configuration;
38 // if requested mode fails, tries to find any compatible mode close to the
39 // requested one.
40 bool        engine_try_set_gfxmode_any(const ScreenSetup &setup);
41 // Tries to switch between fullscreen and windowed mode; uses previously saved
42 // setup if it is available, or default settings for the new mode
43 bool        engine_try_switch_windowed_gfxmode();
44 // Update graphic renderer and render frame when window size changes
45 void        engine_on_window_changed(const Size &sz);
46 // Shutdown graphics mode (used before shutting down tha application)
47 void        engine_shutdown_gfxmode();
48 
49 using AGS::Shared::String;
50 // Defines a package file location
51 struct PackLocation {
52 	String Name; // filename, for the reference or to use as an ID
53 	String Path; // full path
54 };
55 // Game resource paths
56 // TODO: the asset path configuration should certainly be revamped at some
57 // point, with uniform method of configuring auxiliary paths and packages.
58 struct ResourcePaths {
59 	PackLocation GamePak;    // main game package
60 	PackLocation AudioPak;   // audio package
61 	PackLocation SpeechPak;  // voice-over package
62 	String       DataDir;    // path to the data directory
63 	// NOTE: optional directories are currently only for compatibility with Editor (game test runs)
64 	// This is bit ugly, but remain so until more flexible configuration is designed
65 	String       DataDir2;   // optional data directory
66 	String       AudioDir2;  // optional audio directory
67 	String       VoiceDir2;  // optional voice-over directory
68 };
69 
70 // (Re-)Assign all known asset search paths to the AssetManager
71 void engine_assign_assetpaths();
72 
73 // Register a callback that will be called before engine is initialised.
74 // Used for apps to register their own plugins and other configuration
75 typedef void (*t_engine_pre_init_callback)(void);
76 extern void engine_set_pre_init_callback(t_engine_pre_init_callback callback);
77 
78 } // namespace AGS3
79 
80 #endif
81