aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorMax Horn2004-11-23 00:03:25 +0000
committerMax Horn2004-11-23 00:03:25 +0000
commitaad9f122c0c37b152e70a01da48dc86a441ef819 (patch)
treea8dbee1f4e1e57de1ee5088e707f295df4986d12 /sword2
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 'sword2')
-rw-r--r--sword2/sword2.cpp15
-rw-r--r--sword2/sword2.h5
2 files changed, 9 insertions, 11 deletions
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp
index 289b6675a4..05ba3bf340 100644
--- a/sword2/sword2.cpp
+++ b/sword2/sword2.cpp
@@ -223,7 +223,7 @@ void Sword2Engine::setupPersistentResources() {
_resman->openResource(CUR_PLAYER_ID);
}
-void Sword2Engine::mainInit() {
+int Sword2Engine::init() {
// Get some falling RAM and put it in your pocket, never let it slip
// away
@@ -288,7 +288,7 @@ void Sword2Engine::mainInit() {
// will either have killed the music, or done a crossfade.
if (_quit)
- return;
+ return 0;
if (result)
startGame();
@@ -296,9 +296,11 @@ void Sword2Engine::mainInit() {
startGame();
_graphics->initialiseRenderCycle();
+
+ return 0;
}
-void Sword2Engine::mainRun() {
+int Sword2Engine::go() {
while (1) {
if (_debugger->isAttached())
_debugger->onFrame();
@@ -370,11 +372,8 @@ void Sword2Engine::mainRun() {
buildDisplay();
#endif
}
-}
-
-void Sword2Engine::go() {
- mainInit();
- mainRun();
+
+ return 0;
}
void Sword2Engine::closeGame() {
diff --git a/sword2/sword2.h b/sword2/sword2.h
index 2a8018ef6a..e775195dd4 100644
--- a/sword2/sword2.h
+++ b/sword2/sword2.h
@@ -170,9 +170,8 @@ private:
public:
Sword2Engine(GameDetector *detector, OSystem *syst);
~Sword2Engine();
- void go();
- void mainInit();
- void mainRun();
+ int go();
+ int init();
void setupPersistentResources();