Mercurial > fife-parpg
comparison engine/core/controller/engine.h @ 0:4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
author | mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sun, 29 Jun 2008 18:44:17 +0000 |
parents | |
children | 90005975cdbb |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4a0efb7baf70 |
---|---|
1 /*************************************************************************** | |
2 * Copyright (C) 2005-2008 by the FIFE team * | |
3 * http://www.fifengine.de * | |
4 * This file is part of FIFE. * | |
5 * * | |
6 * FIFE is free software; you can redistribute it and/or modify * | |
7 * it under the terms of the GNU General Public License as published by * | |
8 * the Free Software Foundation; either version 2 of the License, or * | |
9 * (at your option) any later version. * | |
10 * * | |
11 * This program is distributed in the hope that it will be useful, * | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |
14 * GNU General Public License for more details. * | |
15 * * | |
16 * You should have received a copy of the GNU General Public License * | |
17 * along with this program; if not, write to the * | |
18 * Free Software Foundation, Inc., * | |
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * | |
20 ***************************************************************************/ | |
21 | |
22 #ifndef FIFE_ENGINE_H | |
23 #define FIFE_ENGINE_H | |
24 | |
25 // Standard C++ library includes | |
26 #include <map> | |
27 #include <string> | |
28 #include <vector> | |
29 | |
30 // 3rd party library includes | |
31 #include <SDL.h> | |
32 | |
33 // FIFE includes | |
34 // These includes are split up in two parts, separated by one empty line | |
35 // First block: files included from the FIFE root src directory | |
36 // Second block: files included from the same folder | |
37 #include "enginesettings.h" | |
38 | |
39 namespace gcn { | |
40 class Graphics; | |
41 } | |
42 | |
43 namespace FIFE { | |
44 | |
45 class SoundManager; | |
46 class RenderBackend; | |
47 class GUIManager; | |
48 class VFS; | |
49 class VFSSourceFactory; | |
50 class EventManager; | |
51 class TimeManager; | |
52 class ImagePool; | |
53 class AnimationPool; | |
54 class View; | |
55 class Model; | |
56 class LogManager; | |
57 class GuiFont; | |
58 class VFS; | |
59 class Cursor; | |
60 | |
61 | |
62 /** Engine acts as a controller to the whole system | |
63 * Responsibilities of the engine are: | |
64 * - Construct and initialize engine internals | |
65 * - Clean-up when the program ends | |
66 * - Act as an entry point to the engine subsystems | |
67 */ | |
68 class Engine { | |
69 public: | |
70 /** Constructor | |
71 */ | |
72 Engine(); | |
73 | |
74 /** Destructor | |
75 */ | |
76 virtual ~Engine(); | |
77 | |
78 /** Gets settings class for engine | |
79 */ | |
80 EngineSettings& getSettings(); | |
81 | |
82 /** Initializes the engine | |
83 */ | |
84 void init(); | |
85 | |
86 /** Initializes the continuous processing of the engine | |
87 * Call this only once in your program | |
88 */ | |
89 void initializePumping(); | |
90 | |
91 /** Finalizes the continuous processing of the engine | |
92 * Call this only once in your program, after you have called | |
93 * initializePumping + (pump() * N times) | |
94 */ | |
95 void finalizePumping(); | |
96 | |
97 /** Runs one cycle for the engine | |
98 */ | |
99 void pump(); | |
100 | |
101 /** Provides access point to the SoundManager | |
102 */ | |
103 SoundManager* getSoundManager() { return m_soundmanager; } | |
104 | |
105 /** Provides access point to the EventManager | |
106 */ | |
107 EventManager* getEventManager() { return m_eventmanager; } | |
108 | |
109 /** Provides access point to the TimeManager | |
110 */ | |
111 TimeManager* getTimeManager() { return m_timemanager; } | |
112 | |
113 /** Provides access point to the GuiManager | |
114 */ | |
115 GUIManager* getGuiManager() { return m_guimanager; } | |
116 | |
117 /** Provides access point to the ImagePool | |
118 */ | |
119 ImagePool* getImagePool() { return m_imagepool; } | |
120 | |
121 /** Provides access point to the AnimationPool | |
122 */ | |
123 AnimationPool* getAnimationPool() { return m_animpool; } | |
124 | |
125 /** Provides access point to the SoundClipPool | |
126 */ | |
127 SoundClipPool* getSoundClipPool() { return m_soundclippool; } | |
128 | |
129 /** Provides access point to the RenderBackend | |
130 */ | |
131 RenderBackend* getRenderBackend() { return m_renderbackend; } | |
132 | |
133 /** Provides access point to the Model | |
134 */ | |
135 Model* getModel() { return m_model; } | |
136 | |
137 /** Provides access point to the View | |
138 */ | |
139 View* getView() { return m_view; } | |
140 | |
141 /** Provides access point to the LogManager | |
142 */ | |
143 LogManager* getLogManager() { return m_logmanager; } | |
144 | |
145 /** Returns default font used in the engine | |
146 */ | |
147 GuiFont* getDefaultFont() { return m_defaultfont; } | |
148 | |
149 /** Provides access point to the VFS | |
150 */ | |
151 VFS* getVFS() { return m_vfs; } | |
152 | |
153 /** Returns cursor used in the engine | |
154 */ | |
155 Cursor* getCursor() { return m_cursor; } | |
156 | |
157 private: | |
158 void preInit(); | |
159 | |
160 RenderBackend* m_renderbackend; | |
161 GUIManager* m_guimanager; | |
162 EventManager* m_eventmanager; | |
163 SoundManager* m_soundmanager; | |
164 TimeManager* m_timemanager; | |
165 ImagePool* m_imagepool; | |
166 AnimationPool* m_animpool; | |
167 SoundClipPool* m_soundclippool; | |
168 VFS* m_vfs; | |
169 Model* m_model; | |
170 gcn::Graphics* m_gui_graphics; | |
171 View* m_view; | |
172 LogManager* m_logmanager; | |
173 GuiFont* m_defaultfont; | |
174 Cursor* m_cursor; | |
175 | |
176 | |
177 EngineSettings m_settings; | |
178 }; | |
179 | |
180 }//FIFE | |
181 | |
182 #endif |