GRIM: Save and update the shadow color.

This commit is contained in:
Giulio Camuffo 2011-04-24 15:41:40 +02:00
parent 3cabc321c1
commit 9215899549
7 changed files with 24 additions and 0 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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();

View File

@ -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<float *>(face->_normal._coords));
tglBegin(TGL_POLYGON);

View File

@ -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();

View File

@ -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);

View File

@ -41,6 +41,7 @@ MODULE_OBJS := \
costume.o \
detection.o \
font.o \
gfx_base.o \
gfx_opengl.o \
gfx_tinygl.o \
grim.o \