diff --git a/engines/grim/gfx_base.h b/engines/grim/gfx_base.h index 08843bd7ca3..d1e949b6fe7 100644 --- a/engines/grim/gfx_base.h +++ b/engines/grim/gfx_base.h @@ -33,6 +33,7 @@ namespace Grim { struct Shadow; +class SaveGame; class GfxBase { public: @@ -66,6 +67,7 @@ public: virtual void setShadowMode() = 0; virtual void clearShadowMode() = 0; virtual void setShadowColor(byte r, byte g, byte b) = 0; + virtual void getShadowColor(byte *r, byte *g, byte *b) = 0; virtual void set3DMode() = 0; @@ -110,6 +112,9 @@ public: virtual const char *getVideoDeviceName() = 0; + virtual void saveState(SaveGame *state); + virtual void restoreState(SaveGame *state); + protected: int _screenWidth, _screenHeight, _screenBPP; bool _isFullscreen; diff --git a/engines/grim/gfx_opengl.cpp b/engines/grim/gfx_opengl.cpp index cfa10ec02a7..c9a7a249522 100644 --- a/engines/grim/gfx_opengl.cpp +++ b/engines/grim/gfx_opengl.cpp @@ -330,6 +330,12 @@ void GfxOpenGL::setShadowColor(byte r, byte g, byte b) { _shadowColorB = b; } +void GfxOpenGL::getShadowColor(byte *r, byte *g, byte *b) { + *r = _shadowColorR; + *g = _shadowColorG; + *b = _shadowColorB; +} + void GfxOpenGL::set3DMode() { glMatrixMode(GL_MODELVIEW); glEnable(GL_DEPTH_TEST); diff --git a/engines/grim/gfx_opengl.h b/engines/grim/gfx_opengl.h index 1d9b936c6dc..0731026e9ac 100644 --- a/engines/grim/gfx_opengl.h +++ b/engines/grim/gfx_opengl.h @@ -65,6 +65,7 @@ byte *setupScreen(int screenW, int screenH, bool fullscreen); void setShadowMode(); void clearShadowMode(); void setShadowColor(byte r, byte g, byte b); + void getShadowColor(byte *r, byte *g, byte *b); void set3DMode(); diff --git a/engines/grim/gfx_tinygl.cpp b/engines/grim/gfx_tinygl.cpp index 0751e6e7bfd..a1b0643fca2 100644 --- a/engines/grim/gfx_tinygl.cpp +++ b/engines/grim/gfx_tinygl.cpp @@ -447,6 +447,12 @@ void GfxTinyGL::setShadowColor(byte r, byte g, byte b) { _shadowColorB = b; } +void GfxTinyGL::getShadowColor(byte *r, byte *g, byte *b) { + *r = _shadowColorR; + *g = _shadowColorG; + *b = _shadowColorB; +} + void GfxTinyGL::drawModelFace(const Model::Face *face, float *vertices, float *vertNormals, float *textureVerts) { tglNormal3fv(const_cast(face->_normal._coords)); tglBegin(TGL_POLYGON); diff --git a/engines/grim/gfx_tinygl.h b/engines/grim/gfx_tinygl.h index 596c4c346d0..758026dd7bf 100644 --- a/engines/grim/gfx_tinygl.h +++ b/engines/grim/gfx_tinygl.h @@ -58,6 +58,7 @@ public: void setShadowMode(); void clearShadowMode(); void setShadowColor(byte r, byte g, byte b); + void getShadowColor(byte *r, byte *g, byte *b); void set3DMode(); diff --git a/engines/grim/grim.cpp b/engines/grim/grim.cpp index 48fe38e1cef..387177b3153 100644 --- a/engines/grim/grim.cpp +++ b/engines/grim/grim.cpp @@ -1012,6 +1012,8 @@ void GrimEngine::savegameRestore() { restorePrimitives(_savedState); restoreActors(_savedState); + g_driver->restoreState(_savedState); + //Chore_Restore(_savedState); //Resource_Restore(_savedState); //Text_Restore(_savedState); @@ -1213,6 +1215,8 @@ void GrimEngine::savegameSave() { savePrimitives(_savedState); saveActors(_savedState); + g_driver->saveState(_savedState); + //Chore_Save(_savedState); //Resource_Save(_savedState); //Text_Save(_savedState); diff --git a/engines/grim/module.mk b/engines/grim/module.mk index b0e77f2a443..1ef19a235be 100644 --- a/engines/grim/module.mk +++ b/engines/grim/module.mk @@ -41,6 +41,7 @@ MODULE_OBJS := \ costume.o \ detection.o \ font.o \ + gfx_base.o \ gfx_opengl.o \ gfx_tinygl.o \ grim.o \