ScummVM API documentation
kernel.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
/*
23
* This code is based on Broken Sword 2.5 engine
24
*
25
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
26
*
27
* Licensed under GNU GPL v2
28
*
29
*/
30
31
/*
32
* BS_Kernel
33
* ---------
34
* This is the main class of the engine.
35
* This class creates and manages all other Engine elements: the sound engine, graphics engine ...
36
* It is not necessary to release all the items individually, this is performed by the Kernel class.
37
*
38
* Autor: Malte Thiesen
39
*/
40
41
#ifndef SWORD25_KERNEL_H
42
#define SWORD25_KERNEL_H
43
44
#include "common/scummsys.h"
45
#include "common/random.h"
46
#include "common/stack.h"
47
#include "common/textconsole.h"
48
#include "common/util.h"
49
#include "engines/engine.h"
50
51
#include "sword25/kernel/common.h"
52
#include "sword25/kernel/resmanager.h"
53
54
namespace
Sword25
{
55
56
// Class definitions
57
class
Service;
58
class
Geometry;
59
class
GraphicEngine;
60
class
ScriptEngine;
61
class
SoundEngine;
62
class
InputEngine;
63
class
PackageManager;
64
class
MoviePlayer;
65
72
class
Kernel
{
73
public
:
74
78
uint
getMilliTicks
();
79
83
bool
getInitSuccess
()
const
{
84
return
_initSuccess;
85
}
89
ResourceManager
*
getResourceManager
() {
90
return
_resourceManager;
91
}
97
int
getRandomNumber
(
int
min,
int
max);
101
GraphicEngine
*
getGfx
();
105
SoundEngine
*
getSfx
();
109
InputEngine
*
getInput
();
113
PackageManager
*
getPackage
();
117
ScriptEngine
*
getScript
();
118
122
MoviePlayer
*
getFMV
();
123
128
void
sleep
(uint msecs)
const
;
129
133
static
Kernel
*
getInstance
() {
134
if
(!_instance)
135
_instance =
new
Kernel
();
136
return
_instance;
137
}
138
144
static
void
deleteInstance
() {
145
if
(_instance) {
146
delete
_instance;
147
_instance = NULL;
148
}
149
}
150
154
void
crash
()
const
{
155
error
(
"Kernel::Crash"
);
156
}
157
158
private
:
159
// -----------------------------------------------------------------------------
160
// Constructor / destructor
161
// Private singleton methods
162
// -----------------------------------------------------------------------------
163
164
Kernel
();
165
virtual
~
Kernel
();
166
167
// -----------------------------------------------------------------------------
168
// Singleton instance
169
// -----------------------------------------------------------------------------
170
static
Kernel
*_instance;
171
172
bool
_initSuccess;
// Specifies whether the engine was set up correctly
173
174
// Random number generator
175
// -----------------------
176
Common::RandomSource
_rnd;
177
178
// Resourcemanager
179
// ---------------
180
ResourceManager
*_resourceManager;
181
182
GraphicEngine
*_gfx;
183
SoundEngine
*_sfx;
184
InputEngine
*_input;
185
PackageManager
*_package;
186
ScriptEngine
*_script;
187
Geometry
*_geometry;
188
MoviePlayer
*_fmv;
189
190
bool
registerScriptBindings();
191
};
192
193
}
// End of namespace Sword25
194
195
#endif
Sword25::Kernel::crash
void crash() const
Definition:
kernel.h:154
Sword25::Geometry
Definition:
geometry.h:41
Sword25::PackageManager
Definition:
packagemanager.h:71
Sword25::Kernel::getMilliTicks
uint getMilliTicks()
Sword25::Kernel::getInput
InputEngine * getInput()
Common::RandomSource
Definition:
random.h:44
Sword25::SoundEngine
Definition:
soundengine.h:80
Sword25::ScriptEngine
Definition:
script.h:46
Sword25::Kernel::deleteInstance
static void deleteInstance()
Definition:
kernel.h:144
Sword25::Kernel::getInstance
static Kernel * getInstance()
Definition:
kernel.h:133
Sword25::Kernel::getPackage
PackageManager * getPackage()
Sword25::Kernel::getInitSuccess
bool getInitSuccess() const
Definition:
kernel.h:83
Sword25
Definition:
console.h:27
Sword25::Kernel
Definition:
kernel.h:72
Sword25::MoviePlayer
Definition:
movieplayer.h:48
Sword25::Kernel::getRandomNumber
int getRandomNumber(int min, int max)
Sword25::ResourceManager
Definition:
resmanager.h:48
Sword25::Kernel::getFMV
MoviePlayer * getFMV()
Sword25::Kernel::getSfx
SoundEngine * getSfx()
error
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Sword25::Kernel::getResourceManager
ResourceManager * getResourceManager()
Definition:
kernel.h:89
Sword25::Kernel::sleep
void sleep(uint msecs) const
Sword25::InputEngine
Class definitions.
Definition:
inputengine.h:54
Sword25::Kernel::getGfx
GraphicEngine * getGfx()
Sword25::Kernel::getScript
ScriptEngine * getScript()
Sword25::GraphicEngine
Definition:
graphicengine.h:83
engines
sword25
kernel
kernel.h
Generated on Fri Nov 15 2024 09:16:46 for ScummVM API documentation by
1.8.13