aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--video/codecs/rpza.cpp22
-rw-r--r--video/codecs/rpza.h3
2 files changed, 6 insertions, 19 deletions
diff --git a/video/codecs/rpza.cpp b/video/codecs/rpza.cpp
index df5738202e..acc1b7f358 100644
--- a/video/codecs/rpza.cpp
+++ b/video/codecs/rpza.cpp
@@ -28,22 +28,17 @@
#include "common/system.h"
#include "common/stream.h"
#include "common/textconsole.h"
-#include "graphics/colormasks.h"
namespace Video {
RPZADecoder::RPZADecoder(uint16 width, uint16 height) : Codec() {
- _pixelFormat = g_system->getScreenFormat();
-
// We need to increase the surface size to a multiple of 4
uint16 wMod = width % 4;
- if(wMod != 0)
+ if (wMod != 0)
width += 4 - wMod;
- debug(2, "RPZA corrected width: %d", width);
-
_surface = new Graphics::Surface();
- _surface->create(width, height, _pixelFormat);
+ _surface->create(width, height, getPixelFormat());
}
RPZADecoder::~RPZADecoder() {
@@ -59,18 +54,11 @@ RPZADecoder::~RPZADecoder() {
} \
totalBlocks--; \
if (totalBlocks < 0) \
- error("block counter just went negative (this should not happen)") \
+ error("rpza block counter just went negative (this should not happen)") \
-// Convert from RGB555 to the format specified by the screen
#define PUT_PIXEL(color) \
- if ((int32)blockPtr < _surface->w * _surface->h) { \
- byte r = 0, g = 0, b = 0; \
- Graphics::colorToRGB<Graphics::ColorMasks<555> >(color, r, g, b); \
- if (_pixelFormat.bytesPerPixel == 2) \
- *((uint16 *)_surface->pixels + blockPtr) = _pixelFormat.RGBToColor(r, g, b); \
- else \
- *((uint32 *)_surface->pixels + blockPtr) = _pixelFormat.RGBToColor(r, g, b); \
- } \
+ if ((int32)blockPtr < _surface->w * _surface->h) \
+ WRITE_UINT16((uint16 *)_surface->pixels + blockPtr, color); \
blockPtr++
const Graphics::Surface *RPZADecoder::decodeImage(Common::SeekableReadStream *stream) {
diff --git a/video/codecs/rpza.h b/video/codecs/rpza.h
index 809a69f444..f082d25549 100644
--- a/video/codecs/rpza.h
+++ b/video/codecs/rpza.h
@@ -34,11 +34,10 @@ public:
~RPZADecoder();
const Graphics::Surface *decodeImage(Common::SeekableReadStream *stream);
- Graphics::PixelFormat getPixelFormat() const { return _pixelFormat; }
+ Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); }
private:
Graphics::Surface *_surface;
- Graphics::PixelFormat _pixelFormat;
};
} // End of namespace Video