[Scummvm-cvs-logs] scummvm master -> 2a1193a6b1d19664b876fb98568fa677463781a6

clone2727 clone2727 at gmail.com
Tue Jun 12 15:35:35 CEST 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2a1193a6b1 VIDEO: Make rpza decode to its own pixel format


Commit: 2a1193a6b1d19664b876fb98568fa677463781a6
    https://github.com/scummvm/scummvm/commit/2a1193a6b1d19664b876fb98568fa677463781a6
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2012-06-12T06:34:24-07:00

Commit Message:
VIDEO: Make rpza decode to its own pixel format

Changed paths:
    video/codecs/rpza.cpp
    video/codecs/rpza.h



diff --git a/video/codecs/rpza.cpp b/video/codecs/rpza.cpp
index df57382..acc1b7f 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 809a69f..f082d25 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






More information about the Scummvm-git-logs mailing list