aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorEugene Sandulenko2004-11-24 00:14:21 +0000
committerEugene Sandulenko2004-11-24 00:14:21 +0000
commit31e434dcf1e46510606efa3025c24c17ace379c6 (patch)
treeaddc1c7b6b9b2489eb9aca49e21ee0c729671adb /saga
parent6414ec92a2a3509946ae4ec35a3a77e76ad152df (diff)
downloadscummvm-rg350-31e434dcf1e46510606efa3025c24c17ace379c6.tar.gz
scummvm-rg350-31e434dcf1e46510606efa3025c24c17ace379c6.tar.bz2
scummvm-rg350-31e434dcf1e46510606efa3025c24c17ace379c6.zip
Fix a`ll engines. They work, though current fix is just temporary.
There are plans to add some brains to GameDetector class, which will let us avoid passing detector to init() method. svn-id: r15873
Diffstat (limited to 'saga')
-rw-r--r--saga/gfx.cpp10
-rw-r--r--saga/gfx.h2
-rw-r--r--saga/saga.cpp4
-rw-r--r--saga/saga.h2
4 files changed, 10 insertions, 8 deletions
diff --git a/saga/gfx.cpp b/saga/gfx.cpp
index 7a7a5397c6..436ddfdb2e 100644
--- a/saga/gfx.cpp
+++ b/saga/gfx.cpp
@@ -35,11 +35,13 @@
namespace Saga {
-Gfx::Gfx(OSystem *system, int width, int height) {
+Gfx::Gfx(OSystem *system, int width, int height, GameDetector &detector) : _system(system) {
SURFACE back_buf;
- _system = system;
- _system->initSize(width, height);
+ _system->beginGFXTransaction();
+ _vm->initCommonGFX(detector);
+ _system->initSize(width, height);
+ _system->endGFXTransaction();
debug(0, "Init screen %dx%d", width, height);
// Convert surface data to R surface data
@@ -61,7 +63,7 @@ Gfx::Gfx(OSystem *system, int width, int height) {
// For now, always show the mouse cursor.
setCursor(1);
- g_system->showMouse(true);
+ _system->showMouse(true);
}
/*
diff --git a/saga/gfx.h b/saga/gfx.h
index 8bccae32c8..7188d7f134 100644
--- a/saga/gfx.h
+++ b/saga/gfx.h
@@ -98,7 +98,7 @@ bool hitTestPoly(const Point *points, unsigned int npoints, const Point& test_po
class Gfx {
public:
- Gfx(OSystem *system, int width, int height);
+ Gfx(OSystem *system, int width, int height, GameDetector &detector);
SURFACE *getBackBuffer();
int getWhite();
int getBlack();
diff --git a/saga/saga.cpp b/saga/saga.cpp
index 236ed78ae2..b71c1313d1 100644
--- a/saga/saga.cpp
+++ b/saga/saga.cpp
@@ -124,7 +124,7 @@ void SagaEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
-int SagaEngine::init() {
+int SagaEngine::init(GameDetector &detector) {
_soundEnabled = 1;
_musicEnabled = 1;
@@ -183,7 +183,7 @@ int SagaEngine::init() {
// Initialize graphics
GAME_DISPLAYINFO disp_info;
GAME_GetDisplayInfo(&disp_info);
- _gfx = new Gfx(_system, disp_info.logical_w, disp_info.logical_h);
+ _gfx = new Gfx(_system, disp_info.logical_w, disp_info.logical_h, detector);
// Graphics should be initialized before music
int midiDriver = GameDetector::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE);
diff --git a/saga/saga.h b/saga/saga.h
index e140839740..7a7abe765b 100644
--- a/saga/saga.h
+++ b/saga/saga.h
@@ -89,7 +89,7 @@ class SagaEngine : public Engine {
protected:
int go();
- int init();
+ int init(GameDetector &detector);
public:
SagaEngine(GameDetector * detector, OSystem * syst);