[Scummvm-git-logs] scummvm master -> df3c1d7e534d4bdcfac065b85e54f54a83625c17
neuromancer
neuromancer at users.noreply.github.com
Tue Sep 7 19:03:08 UTC 2021
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:
df3c1d7e53 PRIVATE: added conditional code for PlayStation3 render testing
Commit: df3c1d7e534d4bdcfac065b85e54f54a83625c17
https://github.com/scummvm/scummvm/commit/df3c1d7e534d4bdcfac065b85e54f54a83625c17
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-09-07T21:02:21+02:00
Commit Message:
PRIVATE: added conditional code for PlayStation3 render testing
Changed paths:
engines/private/private.cpp
engines/private/private.h
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 08b29635a0..d46d89cee6 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -200,11 +200,21 @@ Common::Error PrivateEngine::run() {
assert(maps.constants.size() > 0);
// Initialize graphics
+
+#ifdef PLAYSTATION3
+
+ _pixelFormat = Graphics::PixelFormat::createFormatCLUT8();
+ initGraphics(_screenW, _screenH, &_pixelFormat);
+
+#else
+
initGraphics(_screenW, _screenH, nullptr);
_pixelFormat = g_system->getScreenFormat();
if (_pixelFormat == Graphics::PixelFormat::createFormatCLUT8())
return Common::kUnsupportedColorMode;
+#endif
+
_transparentColor = _pixelFormat.RGBToColor(0, 255, 0);
_safeColor = _pixelFormat.RGBToColor(65, 65, 65);
screenRect = Common::Rect(0, 0, _screenW, _screenH);
@@ -1267,9 +1277,34 @@ void PrivateEngine::drawMask(Graphics::Surface *surf) {
_compositeSurface->transBlitFrom(*surf, _origin, _transparentColor);
}
+#ifdef PLAYSTATION3
+
void PrivateEngine::drawScreen() {
Graphics::ManagedSurface *surface = _compositeSurface;
+ const Graphics::Surface *frame;
+ if (_videoDecoder && !_videoDecoder->isPaused()) {
+ frame = _videoDecoder->decodeNextFrame();
+ Common::Point center((_screenW - _videoDecoder->getWidth()) / 2, (_screenH - _videoDecoder->getHeight()) / 2);
+ surface->rawBlitFrom(*frame, Common::Rect(0, 0, frame->w, frame->h), center, (const uint32*) _videoDecoder->getPalette());
+ if (_videoDecoder->getPalette() != nullptr)
+ g_system->getPaletteManager()->setPalette(_videoDecoder->getPalette(), 0, 256);
+
+ }
+
+ if (_mode == 1) {
+ drawScreenFrame();
+ }
+
+ Common::Rect w(_origin.x, _origin.y, _screenW - _origin.x, _screenH - _origin.y);
+ Graphics::Surface sa = surface->getSubArea(w);
+ g_system->copyRectToScreen(sa.getPixels(), sa.pitch, _origin.x, _origin.y, sa.w, sa.h);
+ g_system->updateScreen();
+}
+
+#else
+void PrivateEngine::drawScreen() {
+ Graphics::ManagedSurface *surface = _compositeSurface;
if (_videoDecoder && !_videoDecoder->isPaused()) {
const Graphics::Surface *frame = _videoDecoder->decodeNextFrame();
Graphics::Surface *cframe = frame->convertTo(_pixelFormat, _videoDecoder->getPalette());
@@ -1286,11 +1321,11 @@ void PrivateEngine::drawScreen() {
Common::Rect w(_origin.x, _origin.y, _screenW - _origin.x, _screenH - _origin.y);
Graphics::Surface sa = surface->getSubArea(w);
g_system->copyRectToScreen(sa.getPixels(), sa.pitch, _origin.x, _origin.y, sa.w, sa.h);
- //if (_image->getPalette() != nullptr)
- // g_system->getPaletteManager()->setPalette(_image->getPalette(), _image->getPaletteStartIndex(), _image->getPaletteColorCount());
g_system->updateScreen();
}
+#endif
+
bool PrivateEngine::getRandomBool(uint p) {
uint r = _rnd->getRandomNumber(100);
return (r <= p);
diff --git a/engines/private/private.h b/engines/private/private.h
index 4770ac03e4..ccf42c6981 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -29,6 +29,7 @@
#include "engines/engine.h"
#include "graphics/managed_surface.h"
#include "video/smk_decoder.h"
+#include "graphics/palette.h"
#include "private/grammar.h"
More information about the Scummvm-git-logs
mailing list