[Scummvm-cvs-logs] scummvm master -> b72d1b9bc75786290369d59fc6bbe96a928760fe
sev-
sev at scummvm.org
Mon Nov 16 07:16:42 CET 2015
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
691b11be64 IMAGE: Fix 16bpp MS Video1 output
54feebacb1 BBVS: Fix 16bpp video output
cfc626d78d GRAPHICS: Implemented utility function to print PixelFormat
b72d1b9bc7 BBVS: Add debug output
Commit: 691b11be645d525b4eb77cc7ae175005517104fc
https://github.com/scummvm/scummvm/commit/691b11be645d525b4eb77cc7ae175005517104fc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2015-11-16T04:54:57+01:00
Commit Message:
IMAGE: Fix 16bpp MS Video1 output
Changed paths:
image/codecs/msvideo1.cpp
image/codecs/msvideo1.h
diff --git a/image/codecs/msvideo1.cpp b/image/codecs/msvideo1.cpp
index 0e668d7..439f219 100644
--- a/image/codecs/msvideo1.cpp
+++ b/image/codecs/msvideo1.cpp
@@ -37,7 +37,7 @@ namespace Image {
MSVideo1Decoder::MSVideo1Decoder(uint16 width, uint16 height, byte bitsPerPixel) : Codec() {
_surface = new Graphics::Surface();
_surface->create(width, height, (bitsPerPixel == 8) ? Graphics::PixelFormat::createFormatCLUT8() :
- Graphics::PixelFormat(2, 5, 5, 5, 0, 0, 5, 10, 0));
+ Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0));
_bitsPerPixel = bitsPerPixel;
}
@@ -216,9 +216,8 @@ void MSVideo1Decoder::decode16(Common::SeekableReadStream &stream) {
const Graphics::Surface *MSVideo1Decoder::decodeFrame(Common::SeekableReadStream &stream) {
if (_bitsPerPixel == 8)
decode8(stream);
- else {
+ else
decode16(stream);
- }
return _surface;
}
diff --git a/image/codecs/msvideo1.h b/image/codecs/msvideo1.h
index a28cc4d..f52b1f3 100644
--- a/image/codecs/msvideo1.h
+++ b/image/codecs/msvideo1.h
@@ -38,7 +38,7 @@ public:
~MSVideo1Decoder();
const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream);
- Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); }
+ Graphics::PixelFormat getPixelFormat() const { return _surface->format; }
private:
byte _bitsPerPixel;
Commit: 54feebacb19fed877b205cf68be0e38acc9e8eff
https://github.com/scummvm/scummvm/commit/54feebacb19fed877b205cf68be0e38acc9e8eff
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2015-11-16T04:55:33+01:00
Commit Message:
BBVS: Fix 16bpp video output
Changed paths:
engines/bbvs/videoplayer.cpp
diff --git a/engines/bbvs/videoplayer.cpp b/engines/bbvs/videoplayer.cpp
index 9ea73ad..0594db8 100644
--- a/engines/bbvs/videoplayer.cpp
+++ b/engines/bbvs/videoplayer.cpp
@@ -58,7 +58,12 @@ void BbvsEngine::playVideo(int videoNum) {
if (videoDecoder->needsUpdate()) {
const Graphics::Surface *frame = videoDecoder->decodeNextFrame();
if (frame) {
- _system->copyRectToScreen(frame->getPixels(), frame->pitch, 0, 0, frame->w, frame->h);
+ if (frame->format.bytesPerPixel > 1) {
+ const Graphics::Surface *frame1 = frame->convertTo(_system->getScreenFormat());
+ _system->copyRectToScreen(frame1->getPixels(), frame1->pitch, 0, 0, frame1->w, frame1->h);
+ } else {
+ _system->copyRectToScreen(frame->getPixels(), frame->pitch, 0, 0, frame->w, frame->h);
+ }
_system->updateScreen();
}
}
Commit: cfc626d78d23ae80a69d145621942f2cae6371f4
https://github.com/scummvm/scummvm/commit/cfc626d78d23ae80a69d145621942f2cae6371f4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2015-11-16T07:00:09+01:00
Commit Message:
GRAPHICS: Implemented utility function to print PixelFormat
Changed paths:
A graphics/pixelformat.cpp
graphics/module.mk
graphics/pixelformat.h
diff --git a/graphics/module.mk b/graphics/module.mk
index 2705322..b6919cf 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -12,6 +12,7 @@ MODULE_OBJS := \
fonts/ttf.o \
fonts/winfont.o \
maccursor.o \
+ pixelformat.o \
primitives.o \
scaler.o \
scaler/thumbnail_intern.o \
diff --git a/graphics/pixelformat.cpp b/graphics/pixelformat.cpp
new file mode 100644
index 0000000..e7b5401
--- /dev/null
+++ b/graphics/pixelformat.cpp
@@ -0,0 +1,96 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "graphics/pixelformat.h"
+#include "common/debug.h"
+
+namespace Graphics {
+
+Common::String PixelFormat::toString() {
+ if (bytesPerPixel == 1)
+ return "CLUT8";
+
+ int component[4];
+ char tmp[10];
+ tmp[0] = tmp[1] = 0;
+
+ component[0] = rShift;
+ component[1] = gShift;
+ component[2] = bShift;
+ component[3] = aShift;
+
+ Common::String letters, digits;
+
+ for (int c = 0; c < 4; c++) {
+ int compPos = -1;
+ int minshift = 100;
+
+ // Find minimal component
+ for (int i = 0; i < 4; i++)
+ if (component[i] >= 0 && component[i] < minshift) {
+ minshift = component[i];
+ compPos = i;
+ }
+
+ // Clean duplicates
+ for (int i = 0; i < 4; i++)
+ if (component[i] == minshift)
+ component[i] = -1;
+
+ switch (compPos) {
+ case 0:
+ if (rLoss != 8) {
+ letters += "R";
+ tmp[0] = '0' + 8 - rLoss;
+ digits += tmp;
+ }
+ break;
+ case 1:
+ if (gLoss != 8) {
+ letters += "G";
+ tmp[0] = '0' + 8 - gLoss;
+ digits += tmp;
+ }
+ break;
+ case 2:
+ if (bLoss != 8) {
+ letters += "B";
+ tmp[0] = '0' + 8 - bLoss;
+ digits += tmp;
+ }
+ break;
+ case 3:
+ if (aLoss != 8) {
+ letters += "A";
+ tmp[0] = '0' + 8 - aLoss;
+ digits += tmp;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ return letters + digits;
+}
+
+} // End of namespace Graphics
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 00db670..3e6c53b 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -24,6 +24,7 @@
#define GRAPHICS_PIXELFORMAT_H
#include "common/scummsys.h"
+#include "common/str.h"
namespace Graphics {
@@ -260,6 +261,8 @@ struct PixelFormat {
// Unsupported
return 0;
}
+
+ Common::String toString();
};
} // End of namespace Graphics
Commit: b72d1b9bc75786290369d59fc6bbe96a928760fe
https://github.com/scummvm/scummvm/commit/b72d1b9bc75786290369d59fc6bbe96a928760fe
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2015-11-16T07:00:58+01:00
Commit Message:
BBVS: Add debug output
Changed paths:
engines/bbvs/videoplayer.cpp
diff --git a/engines/bbvs/videoplayer.cpp b/engines/bbvs/videoplayer.cpp
index 0594db8..f417f27 100644
--- a/engines/bbvs/videoplayer.cpp
+++ b/engines/bbvs/videoplayer.cpp
@@ -43,6 +43,8 @@ void BbvsEngine::playVideo(int videoNum) {
return;
}
+ debug(0, "Screen format: %s", _system->getScreenFormat().toString().c_str());
+
Video::VideoDecoder *videoDecoder = new Video::AVIDecoder();
if (!videoDecoder->loadFile(videoFilename)) {
delete videoDecoder;
More information about the Scummvm-git-logs
mailing list