aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--saga/render.cpp10
-rw-r--r--saga/render.h2
-rw-r--r--saga/saga.cpp8
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;
}