aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorMax Horn2004-11-23 00:03:25 +0000
committerMax Horn2004-11-23 00:03:25 +0000
commitaad9f122c0c37b152e70a01da48dc86a441ef819 (patch)
treea8dbee1f4e1e57de1ee5088e707f295df4986d12 /saga
parent8ac347fd952a3811e6a948dfca3dec081882c335 (diff)
downloadscummvm-rg350-aad9f122c0c37b152e70a01da48dc86a441ef819.tar.gz
scummvm-rg350-aad9f122c0c37b152e70a01da48dc86a441ef819.tar.bz2
scummvm-rg350-aad9f122c0c37b152e70a01da48dc86a441ef819.zip
Added Engine::init() method; added return value to Engine::go()
svn-id: r15865
Diffstat (limited to 'saga')
-rw-r--r--saga/saga.cpp20
-rw-r--r--saga/saga.h3
2 files changed, 16 insertions, 7 deletions
diff --git a/saga/saga.cpp b/saga/saga.cpp
index dc3353e6ec..236ed78ae2 100644
--- a/saga/saga.cpp
+++ b/saga/saga.cpp
@@ -124,9 +124,7 @@ void SagaEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
-void SagaEngine::go() {
- int msec = 0;
-
+int SagaEngine::init() {
_soundEnabled = 1;
_musicEnabled = 1;
@@ -156,7 +154,7 @@ void SagaEngine::go() {
// Detect game and open resource files
if (GAME_Init() != SUCCESS) {
- return;
+ return -1;
}
// Initialize engine modules
@@ -174,7 +172,8 @@ void SagaEngine::go() {
if (!_scene->initialized()) {
warning("Couldn't initialize scene module");
- return;
+ // TODO/FIXME: We are leaking here
+ return -1;
}
// System initialization
@@ -214,7 +213,8 @@ void SagaEngine::go() {
_render = new Render(this, _system);
if (!_render->initialized()) {
- return;
+ // TODO/FIXME: We are leaking here
+ return -1;
}
// Initialize system specific sound
@@ -232,6 +232,12 @@ void SagaEngine::go() {
_render->reg();
_anim->reg();
+ return 0;
+}
+
+int SagaEngine::go() {
+ int msec = 0;
+
_previousTicks = _system->getMillis();
_sprite->loadList(ITE_MAIN_SPRITES, &_mainSprites);
@@ -265,6 +271,8 @@ void SagaEngine::go() {
_render->drawScene();
_system->delayMillis(10);
}
+
+ return 0;
}
void SagaEngine::shutdown() {
diff --git a/saga/saga.h b/saga/saga.h
index 8b68088afa..e140839740 100644
--- a/saga/saga.h
+++ b/saga/saga.h
@@ -88,7 +88,8 @@ class SagaEngine : public Engine {
void errorString(const char *buf_input, char *buf_output);
protected:
- void go();
+ int go();
+ int init();
public:
SagaEngine(GameDetector * detector, OSystem * syst);