[Scummvm-git-logs] scummvm master -> 6d7225b88227fa1e7413398139fda1d6951cf13f
sev-
noreply at scummvm.org
Fri Feb 14 22:52:17 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8ef6f981fb VIDEO: QTVR: Implement possibility switching to hotspot rendering
6d7225b882 TESTBED: Switch to hotspot rendering in QTVR movies by key 'h'
Commit: 8ef6f981fb75069afa45dca9cf5a71b30542fed3
https://github.com/scummvm/scummvm/commit/8ef6f981fb75069afa45dca9cf5a71b30542fed3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-14T23:51:07+01:00
Commit Message:
VIDEO: QTVR: Implement possibility switching to hotspot rendering
Changed paths:
video/qt_decoder.h
video/qtvr_decoder.cpp
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 44a9883d228..db5cfc0f1d7 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -102,6 +102,8 @@ public:
uint8 getWarpMode() const { return _warpMode; }
void setWarpMode(uint8 warpMode) { _warpMode = warpMode; }
+ void renderHotspots(bool mode);
+
struct NodeData {
uint32 nodeID;
@@ -177,6 +179,7 @@ private:
bool _repeatTimerActive = false;
const PanoHotSpot *_currentHotspot = nullptr;
+ bool _renderHotspots = false;
Graphics::Surface *_scaledSurface;
void scaleSurface(const Graphics::Surface *src, Graphics::Surface *dst,
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index a38519cd15e..78bc214b1bf 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -136,6 +136,12 @@ void QuickTimeDecoder::closeQTVR() {
}
}
+void QuickTimeDecoder::renderHotspots(bool mode) {
+ _renderHotspots = mode;
+
+ ((PanoTrackHandler *)getTrack(_panoTrack->targetTrack))->setDirty();
+}
+
void QuickTimeDecoder::setTargetSize(uint16 w, uint16 h) {
if (!isVR())
error("QuickTimeDecoder::setTargetSize() called on non-VR movie");
@@ -445,8 +451,7 @@ Graphics::Surface *QuickTimeDecoder::PanoTrackHandler::constructMosaic(VideoTrac
}
void QuickTimeDecoder::PanoTrackHandler::initPanorama() {
- //_decoder->goToNode(_decoder->_panoTrack->panoInfo.defNodeID);
- _decoder->goToNode(2);
+ _decoder->goToNode(_decoder->_panoTrack->panoInfo.defNodeID);
}
void QuickTimeDecoder::PanoTrackHandler::constructPanorama() {
@@ -707,8 +712,10 @@ void QuickTimeDecoder::PanoTrackHandler::projectPanorama() {
if (angleT < 0.0f)
angleT += 1.0f;
- int32 panoWidth = _constructedPano->h;
- int32 panoHeight = _constructedPano->w;
+ Graphics::Surface *srcSurf = _decoder->_renderHotspots ? _constructedHotspots : _constructedPano;
+
+ int32 panoWidth = srcSurf->h;
+ int32 panoHeight = srcSurf->w;
uint16 angleOffset = static_cast<uint32>(angleT * panoWidth);
@@ -756,8 +763,15 @@ void QuickTimeDecoder::PanoTrackHandler::projectPanorama() {
for (uint16 y = 0; y < h; y++) {
int32 sourceYCoord = (2 * y + 1) * (bottomSrcCoord - topSrcCoord) / (2 * h) + topSrcCoord;
- uint32 pixel1 = _constructedPano->getPixel(sourceYCoord, leftSrcCoord);
- uint32 pixel2 = _constructedPano->getPixel(sourceYCoord, rightSrcCoord);
+ uint32 pixel1 = srcSurf->getPixel(sourceYCoord, leftSrcCoord);
+ uint32 pixel2 = srcSurf->getPixel(sourceYCoord, rightSrcCoord);
+
+ if (_decoder->_renderHotspots) {
+ const byte *col = &quickTimeDefaultPalette256[pixel1 * 3];
+ pixel1 = _planarProjection->format.RGBToColor(col[0], col[1], col[2]);
+ col = &quickTimeDefaultPalette256[pixel2 * 3];
+ pixel2 = _planarProjection->format.RGBToColor(col[0], col[1], col[2]);
+ }
_planarProjection->setPixel(x1, y, pixel1);
_planarProjection->setPixel(x2, y, pixel2);
Commit: 6d7225b88227fa1e7413398139fda1d6951cf13f
https://github.com/scummvm/scummvm/commit/6d7225b88227fa1e7413398139fda1d6951cf13f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-14T23:51:41+01:00
Commit Message:
TESTBED: Switch to hotspot rendering in QTVR movies by key 'h'
Changed paths:
engines/testbed/video.cpp
diff --git a/engines/testbed/video.cpp b/engines/testbed/video.cpp
index fa34c075f2f..b324a3b30ba 100644
--- a/engines/testbed/video.cpp
+++ b/engines/testbed/video.cpp
@@ -102,6 +102,7 @@ Common::Error Videotests::videoTest(Common::SeekableReadStream *stream, const Co
video->start();
Common::Point mouse;
+ bool renderHotspots = false;
while (!video->endOfVideo()) {
if (video->needsUpdate()) {
@@ -159,6 +160,11 @@ Common::Error Videotests::videoTest(Common::SeekableReadStream *stream, const Co
break;
case Common::EVENT_KEYUP:
case Common::EVENT_KEYDOWN:
+ if (event.kbd == Common::KEYCODE_h && event.type == Common::EVENT_KEYDOWN) {
+ renderHotspots = !renderHotspots;
+ ((Video::QuickTimeDecoder *)video)->renderHotspots(renderHotspots);
+ }
+
((Video::QuickTimeDecoder *)video)->handleKey(event.kbd, event.type == Common::EVENT_KEYDOWN);
break;
default:
More information about the Scummvm-git-logs
mailing list