2012-01-06 23:29:45 +01:00
|
|
|
/* ResidualVM - A 3D game interpreter
|
2011-04-24 15:58:33 +02:00
|
|
|
*
|
2012-01-06 23:29:45 +01:00
|
|
|
* ResidualVM is the legal property of its developers, whose names
|
2011-04-24 15:58:33 +02:00
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "engines/grim/gfx_base.h"
|
|
|
|
#include "engines/grim/savegame.h"
|
2011-05-13 17:55:14 -07:00
|
|
|
#include "engines/grim/colormap.h"
|
2011-04-24 15:58:33 +02:00
|
|
|
|
|
|
|
namespace Grim {
|
|
|
|
|
2011-07-29 23:02:52 +02:00
|
|
|
GfxBase::GfxBase() :
|
|
|
|
_renderBitmaps(true),
|
2011-12-12 18:57:17 +01:00
|
|
|
_renderZBitmaps(true),
|
|
|
|
_shadowModeActive(false) {
|
2011-07-29 23:02:52 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-12-12 18:57:17 +01:00
|
|
|
void GfxBase::setShadowMode() {
|
|
|
|
_shadowModeActive = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GfxBase::clearShadowMode() {
|
|
|
|
_shadowModeActive = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GfxBase::isShadowModeActive() {
|
|
|
|
return _shadowModeActive;
|
|
|
|
}
|
|
|
|
|
2011-04-24 15:58:33 +02:00
|
|
|
void GfxBase::saveState(SaveGame *state) {
|
|
|
|
state->beginSection('DRVR');
|
|
|
|
|
|
|
|
byte r, g, b;
|
|
|
|
getShadowColor(&r, &g, &b);
|
|
|
|
state->writeByte(r),
|
|
|
|
state->writeByte(g),
|
|
|
|
state->writeByte(b),
|
2011-10-02 19:07:16 +02:00
|
|
|
state->writeLEBool(_renderBitmaps);
|
|
|
|
state->writeLEBool(_renderZBitmaps);
|
2011-04-24 15:58:33 +02:00
|
|
|
|
|
|
|
state->endSection();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GfxBase::restoreState(SaveGame *state) {
|
|
|
|
state->beginSection('DRVR');
|
|
|
|
|
|
|
|
byte r, g, b;
|
|
|
|
r = state->readByte();
|
|
|
|
g = state->readByte();
|
|
|
|
b = state->readByte();
|
|
|
|
setShadowColor(r, g ,b);
|
2011-10-02 19:07:16 +02:00
|
|
|
_renderBitmaps = state->readLEBool();
|
|
|
|
_renderZBitmaps = state->readLEBool();
|
2011-04-24 15:58:33 +02:00
|
|
|
|
|
|
|
state->endSection();
|
|
|
|
}
|
|
|
|
|
2011-07-29 23:02:52 +02:00
|
|
|
void GfxBase::renderBitmaps(bool render) {
|
|
|
|
_renderBitmaps = render;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GfxBase::renderZBitmaps(bool render) {
|
|
|
|
_renderZBitmaps = render;
|
|
|
|
}
|
|
|
|
|
2011-04-24 15:58:33 +02:00
|
|
|
}
|