aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision/graphics
diff options
context:
space:
mode:
authorFilippos Karapetis2014-12-24 22:40:54 +0200
committerFilippos Karapetis2014-12-24 22:56:55 +0200
commite8e21fabe4dbe4effdfb3df05fd3fae75940f1c5 (patch)
tree7e135df3450bd88d6a792acfc758f5ed3150822a /engines/zvision/graphics
parent84341a889cfafc4c7ecef6cf7d6841df8353fe4b (diff)
downloadscummvm-rg350-e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5.tar.gz
scummvm-rg350-e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5.tar.bz2
scummvm-rg350-e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5.zip
ZVISION: Set all the internal graphics operations to use RGB555 (1/2)
This is the first part of the changes to make the engine use RGB555 internally again. This is done to simplify the rendering pipeline - the engine will use RGB555 internally, but will output to RGB565. The overall changes have been broken into two commits, thus this first commit will break all the game colors
Diffstat (limited to 'engines/zvision/graphics')
-rw-r--r--engines/zvision/graphics/effect.h2
-rw-r--r--engines/zvision/graphics/effects/fog.cpp10
-rw-r--r--engines/zvision/graphics/effects/light.cpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/engines/zvision/graphics/effect.h b/engines/zvision/graphics/effect.h
index c6653c6037..234cd8209d 100644
--- a/engines/zvision/graphics/effect.h
+++ b/engines/zvision/graphics/effect.h
@@ -37,7 +37,7 @@ class Effect {
public:
Effect(ZVision *engine, uint32 key, Common::Rect region, bool ported) : _engine(engine), _key(key), _region(region), _ported(ported) {
- _surface.create(_region.width(), _region.height(), _engine->_pixelFormat);
+ _surface.create(_region.width(), _region.height(), _engine->_resourcePixelFormat);
}
virtual ~Effect() {}
diff --git a/engines/zvision/graphics/effects/fog.cpp b/engines/zvision/graphics/effects/fog.cpp
index f59e82a4a0..c28bdde330 100644
--- a/engines/zvision/graphics/effects/fog.cpp
+++ b/engines/zvision/graphics/effects/fog.cpp
@@ -79,10 +79,10 @@ const Graphics::Surface *FogFx::draw(const Graphics::Surface &srcSubRect) {
if (it->inEffect) {
// Not 100% equivalent, but looks nice and not buggy
uint8 sr, sg, sb;
- _engine->_pixelFormat.colorToRGB(lineBuf[i], sr, sg, sb);
+ _engine->_resourcePixelFormat.colorToRGB(lineBuf[i], sr, sg, sb);
uint16 fogColor = *(uint16 *)_fog.getBasePtr((i + _pos) % _fog.w, j);
uint8 dr, dg, db;
- _engine->_pixelFormat.colorToRGB(_colorMap[fogColor & 0x1F], dr, dg, db);
+ _engine->_resourcePixelFormat.colorToRGB(_colorMap[fogColor & 0x1F], dr, dg, db);
uint16 fr = dr + sr;
if (fr > 255)
fr = 255;
@@ -92,7 +92,7 @@ const Graphics::Surface *FogFx::draw(const Graphics::Surface &srcSubRect) {
uint16 fb = db + sb;
if (fb > 255)
fb = 255;
- lineBuf[i] = _engine->_pixelFormat.RGBToColor(fr, fg, fb);
+ lineBuf[i] = _engine->_resourcePixelFormat.RGBToColor(fr, fg, fb);
}
cnt++;
if (cnt >= it->count) {
@@ -138,14 +138,14 @@ void FogFx::update() {
// Not 100% equivalent, but looks nice and not buggy
- _colorMap[31] = _engine->_pixelFormat.RGBToColor(_r << 3, _g << 3, _b << 3);
+ _colorMap[31] = _engine->_resourcePixelFormat.RGBToColor(_r << 3, _g << 3, _b << 3);
for (uint8 i = 0; i < 31; i++) {
float perc = (float)i / 31.0;
uint8 cr = (float)_r * perc;
uint8 cg = (float)_g * perc;
uint8 cb = (float)_b * perc;
- _colorMap[i] = _engine->_pixelFormat.RGBToColor(cr << 3, cg << 3, cb << 3);
+ _colorMap[i] = _engine->_resourcePixelFormat.RGBToColor(cr << 3, cg << 3, cb << 3);
}
}
diff --git a/engines/zvision/graphics/effects/light.cpp b/engines/zvision/graphics/effects/light.cpp
index 00b3811d65..bf6513292f 100644
--- a/engines/zvision/graphics/effects/light.cpp
+++ b/engines/zvision/graphics/effects/light.cpp
@@ -59,10 +59,10 @@ const Graphics::Surface *LightFx::draw(const Graphics::Surface &srcSubRect) {
if (_pos < 0) {
uint8 cc = ((-_pos) & 0x1F) << 3;
- dcolor = _engine->_pixelFormat.RGBToColor(cc, cc, cc);
+ dcolor = _engine->_resourcePixelFormat.RGBToColor(cc, cc, cc);
} else {
uint8 cc = (_pos & 0x1F) << 3;
- dcolor = _engine->_pixelFormat.RGBToColor(cc, cc, cc);
+ dcolor = _engine->_resourcePixelFormat.RGBToColor(cc, cc, cc);
}
for (uint16 j = 0; j < _surface.h; j++) {