diff options
author | Jonathan Gray | 2004-08-01 12:06:12 +0000 |
---|---|---|
committer | Jonathan Gray | 2004-08-01 12:06:12 +0000 |
commit | c8d90189093bb270a9ce1abf7bd47e125a7732bf (patch) | |
tree | ef331b8e59ddf9530d90b64c9b1c545c4098dd85 | |
parent | 0bbeb61f5e74437c2105b0aff042caeacb34bc8d (diff) | |
download | scummvm-rg350-c8d90189093bb270a9ce1abf7bd47e125a7732bf.tar.gz scummvm-rg350-c8d90189093bb270a9ce1abf7bd47e125a7732bf.tar.bz2 scummvm-rg350-c8d90189093bb270a9ce1abf7bd47e125a7732bf.zip |
init _gfx in a less hacky manner
svn-id: r14420
-rw-r--r-- | saga/render.cpp | 10 | ||||
-rw-r--r-- | saga/render.h | 2 | ||||
-rw-r--r-- | saga/saga.cpp | 8 |
3 files changed, 13 insertions, 7 deletions
diff --git a/saga/render.cpp b/saga/render.cpp index 6e67305667..31fb51ab56 100644 --- a/saga/render.cpp +++ b/saga/render.cpp @@ -49,16 +49,18 @@ int Render::reg(void) { return R_SUCCESS; } -Render::Render(SagaEngine *vm, OSystem *system) : _vm(vm), _system(system), _initialized(false) { +Render::Render(SagaEngine *vm, OSystem *system, Gfx *gfx) { + _vm = vm; + _system = system; + _gfx = gfx; + _initialized = false; + R_GAME_DISPLAYINFO disp_info; int tmp_w, tmp_h, tmp_bytepp; // Initialize system graphics GAME_GetDisplayInfo(&disp_info); - _vm->_gfx = new Gfx(system, disp_info.logical_w, disp_info.logical_h); - _gfx = _vm->_gfx; - // Initialize FPS timer callback g_timer->installTimerProc(&fpsTimerCallback, 1000000, this); diff --git a/saga/render.h b/saga/render.h index f3c3760065..8bbfb4a4e3 100644 --- a/saga/render.h +++ b/saga/render.h @@ -52,7 +52,7 @@ struct R_BUFFER_INFO { class Render { public: int reg(void); - Render(SagaEngine *vm, OSystem *system); + Render(SagaEngine *vm, OSystem *system, Gfx *gfx); ~Render(void); bool initialized(); int drawScene(void); diff --git a/saga/saga.cpp b/saga/saga.cpp index 13340a00fb..2f763b69dd 100644 --- a/saga/saga.cpp +++ b/saga/saga.cpp @@ -33,7 +33,7 @@ #include "saga.h" #include "timer.h" -#include "gfx_mod.h" +#include "gfx.h" #include "rscfile_mod.h" #include "render.h" #include "actor_mod.h" @@ -191,7 +191,11 @@ void SagaEngine::go() { } // Initialize graphics - _render = new Render(this, _system); + R_GAME_DISPLAYINFO disp_info; + GAME_GetDisplayInfo(&disp_info); + _gfx = new Gfx(_system, disp_info.logical_w, disp_info.logical_h); + + _render = new Render(this, _system, _gfx); if (!_render->initialized()) { return; } |