1 /** @file dd_main.h 2 * 3 * @authors Copyright © 2003-2017 Jaakko Keränen <jaakko.keranen@iki.fi> 4 * @authors Copyright © 2006-2015 Daniel Swanson <danij@dengine.net> 5 * 6 * @par License 7 * GPL: http://www.gnu.org/licenses/gpl.html 8 * 9 * <small>This program is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by the 11 * Free Software Foundation; either version 2 of the License, or (at your 12 * option) any later version. This program is distributed in the hope that it 13 * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 15 * Public License for more details. You should have received a copy of the GNU 16 * General Public License along with this program; if not, see: 17 * http://www.gnu.org/licenses</small> 18 */ 19 20 #ifndef DENG_MAIN_H 21 #define DENG_MAIN_H 22 23 #include <QList> 24 #include <QMap> 25 #include <de/LibraryFile> 26 #include <de/String> 27 #include <doomsday/resource/resources.h> 28 #include <doomsday/gameapi.h> 29 #include <doomsday/plugins.h> 30 #include <doomsday/Games> 31 32 #ifdef __CLIENT__ 33 # include "resource/clientresources.h" 34 #endif 35 #include "audio/audiosystem.h" 36 #include "world/clientserverworld.h" 37 #include "ui/infine/infinesystem.h" 38 39 namespace de { class File1; } 40 41 extern de::dint verbose; 42 extern de::dint isDedicated; // true if __SERVER__ 43 #ifdef __CLIENT__ 44 extern de::dint symbolicEchoMode; 45 #endif 46 47 de::dint DD_EarlyInit(); 48 void DD_FinishInitializationAfterWindowReady(); 49 50 void DD_ConsoleRegister(); 51 52 /** 53 * Print an error message and quit. 54 */ 55 DENG2_NORETURN void App_Error(char const *error, ...); 56 57 DENG2_NORETURN void App_AbnormalShutdown(char const *error); 58 59 /// Returns the application's global audio subsystem. 60 AudioSystem &App_AudioSystem(); 61 62 /// Returns the application's global InFineSystem. 63 InFineSystem &App_InFineSystem(); 64 65 #ifdef __CLIENT__ 66 /// Returns the application's resources. 67 ClientResources &App_Resources(); 68 #else 69 /// Returns the application's resources. 70 Resources &App_Resources(); 71 #endif 72 73 /// Returns the application's global WorldSystem. 74 ClientServerWorld &App_World(); 75 76 #undef Con_Open 77 78 /** 79 * Attempt to change the 'open' state of the console. 80 * @note In dedicated mode the console cannot be closed. 81 */ 82 void Con_Open(de::dint yes); 83 84 void DD_CheckTimeDemo(); 85 void DD_UpdateEngineState(); 86 87 // 88 // Game modules ------------------------------------------------------------------- 89 // 90 91 int DD_ActivateGameWorker(void *context); 92 93 /** 94 * Returns the application's global Games (collection). 95 */ 96 Games &App_Games(); 97 98 /** 99 * Returns the current game from the application's global collection. 100 */ 101 Game const &App_CurrentGame(); 102 103 /** 104 * Frees the info structures for all registered games. 105 */ 106 void App_ClearGames(); 107 108 // 109 // Misc/utils --------------------------------------------------------------------- 110 // 111 112 /** 113 * Attempts to read help strings from the game-specific help file. 114 */ 115 void DD_ReadGameHelp(); 116 117 /// @return Symbolic name of the material scheme associated with @a textureSchemeName. 118 AutoStr *DD_MaterialSchemeNameForTextureScheme(Str const *textureSchemeName); 119 120 /// @overload 121 de::String DD_MaterialSchemeNameForTextureScheme(de::String textureSchemeName); 122 123 #ifdef __CLIENT__ 124 fontschemeid_t DD_ParseFontSchemeName(char const *str); 125 #endif 126 127 #endif // DENG_MAIN_H 128