From 31e434dcf1e46510606efa3025c24c17ace379c6 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 24 Nov 2004 00:14:21 +0000 Subject: 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 --- saga/gfx.cpp | 10 ++++++---- saga/gfx.h | 2 +- saga/saga.cpp | 4 ++-- saga/saga.h | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) (limited to 'saga') 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); -- cgit v1.2.3