[Scummvm-git-logs] scummvm master -> 173189937fc28808ea98f47e5cdd6d335d068cec
sev-
noreply at scummvm.org
Mon Feb 10 23:57:28 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:
a85bb5cc1e TESTBED: (temporarily) enforce QT palette when drawing QTVR
173189937f VIDEO: QTVR: Draw hotspots instead of panorama for testing purposes
Commit: a85bb5cc1e4d79d6e54800e448ec6caeab9725c1
https://github.com/scummvm/scummvm/commit/a85bb5cc1e4d79d6e54800e448ec6caeab9725c1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-11T00:56:16+01:00
Commit Message:
TESTBED: (temporarily) enforce QT palette when drawing QTVR
Changed paths:
engines/testbed/video.cpp
diff --git a/engines/testbed/video.cpp b/engines/testbed/video.cpp
index a0ce9a7b226..dae7f7109e6 100644
--- a/engines/testbed/video.cpp
+++ b/engines/testbed/video.cpp
@@ -31,6 +31,8 @@
#include "graphics/paletteman.h"
#include "gui/browser.h"
+#include "video/qt_data.h"
+
namespace Testbed {
Common::Error Videotests::videoTest(const Common::Path &path) {
@@ -112,7 +114,7 @@ Common::Error Videotests::videoTest(Common::SeekableReadStream *stream, const Co
debug(5, "video time: %d", pos);
if (pixelformat.isCLUT8() && video->hasDirtyPalette()) {
- g_system->getPaletteManager()->setPalette(video->getPalette(), 0, 256);
+ g_system->getPaletteManager()->setPalette(Video::quickTimeDefaultPalette256, 0, 256);
}
const Graphics::Surface *frame = video->decodeNextFrame();
@@ -124,7 +126,7 @@ Common::Error Videotests::videoTest(Common::SeekableReadStream *stream, const Co
Graphics::Surface *conv = nullptr;
if (frame->format != pixelformat) {
- surf = conv = frame->convertTo(pixelformat, video->getPalette());
+ surf = conv = frame->convertTo(pixelformat, Video::quickTimeDefaultPalette256);
}
mw = surf->w;
Commit: 173189937fc28808ea98f47e5cdd6d335d068cec
https://github.com/scummvm/scummvm/commit/173189937fc28808ea98f47e5cdd6d335d068cec
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-11T00:56:55+01:00
Commit Message:
VIDEO: QTVR: Draw hotspots instead of panorama for testing purposes
Changed paths:
video/qtvr_decoder.cpp
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index e45da8878b1..55013e62f8a 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -426,9 +426,11 @@ void QuickTimeDecoder::PanoTrackHandler::constructPanorama() {
warning("sceneNumFrames: %d x %d sceneColorDepth: %d", desc->_sceneNumFramesX, desc->_sceneNumFramesY, desc->_sceneColorDepth);
warning("targetTrackID: %d", _parent->targetTrack);
- VideoTrackHandler *track = (VideoTrackHandler *)(_decoder->getTrack(_decoder->Common::QuickTimeParser::_tracks[desc->_sceneTrackID - 1]->targetTrack));
+ VideoTrackHandler *track = (VideoTrackHandler *)(_decoder->getTrack(_decoder->Common::QuickTimeParser::_tracks[desc->_hotSpotTrackID - 1]->targetTrack));
+ //VideoTrackHandler *track = (VideoTrackHandler *)(_decoder->getTrack(_decoder->Common::QuickTimeParser::_tracks[desc->_sceneTrackID - 1]->targetTrack));
- _constructedPano = constructMosaic(track, desc->_sceneNumFramesX, desc->_sceneNumFramesY, "dumps/pano-full.png");
+ //_constructedPano = constructMosaic(track, desc->_sceneNumFramesX, desc->_sceneNumFramesY, "dumps/pano-full.png");
+ _constructedPano = constructMosaic(track, desc->_hotSpotNumFramesX, desc->_hotSpotNumFramesY, "dumps/pano-hotspot.png");
track = (VideoTrackHandler *)(_decoder->getTrack(_decoder->Common::QuickTimeParser::_tracks[desc->_hotSpotTrackID - 1]->targetTrack));
@@ -442,9 +444,7 @@ void QuickTimeDecoder::PanoTrackHandler::constructPanorama() {
int QuickTimeDecoder::PanoTrackHandler::lookupHotspot(int16 mx, int16 my) {
if (!_isPanoConstructed)
- return -1;
-
- int hotspot = -1;
+ return 0;
uint16 w = _decoder->getWidth(), h = _decoder->getHeight();
@@ -498,11 +498,11 @@ int QuickTimeDecoder::PanoTrackHandler::lookupHotspot(int16 mx, int16 my) {
float yawAngle = atan2(mousePixelVector[0], mousePixelVector[2]);
// panorama is turned 90 degrees, width is height
- int hotX = (yawAngle / (2.0 * M_PI) + _curPanAngle / 360.0f) * (float)_constructedPano->h;
+ int hotX = (yawAngle / (2.0 * M_PI) + _curPanAngle / 360.0f) * (float)_constructedHotspots->h;
- hotX = hotX % _constructedPano->h;
+ hotX = hotX % _constructedHotspots->h;
if (hotX < 0)
- hotX += _constructedPano->h;
+ hotX += _constructedHotspots->h;
// To get the vertical coordinate, need to project the vector on to a unit cylinder.
// To do that, compute the length of the XZ vector,
@@ -513,16 +513,14 @@ int QuickTimeDecoder::PanoTrackHandler::lookupHotspot(int16 mx, int16 my) {
float normalizedYCoordinate = (projectedY - minTiltY) / (maxTiltY - minTiltY);
- int hotY = (int)(normalizedYCoordinate * (float)_constructedPano->w);
+ int hotY = (int)(normalizedYCoordinate * (float)_constructedHotspots->w);
if (hotY < 0)
hotY = 0;
- else if (hotY > _constructedPano->w)
- hotY = _constructedPano->w;
-
- warning("x: %d y: %d (yRatio: %f) (min: %f max: %f) m: [%f, %f, %f] vectorLen: %f", hotX, hotY, yRatio, minTiltY, maxTiltY, mousePixelVector[0], mousePixelVector[1], mousePixelVector[2], xzVectorLen);
+ else if (hotY > _constructedHotspots->w)
+ hotY = _constructedHotspots->w;
- return hotspot;
+ return (int)_constructedHotspots->getPixel(hotY, hotX);
}
void QuickTimeDecoder::PanoTrackHandler::projectPanorama() {
@@ -796,7 +794,7 @@ void QuickTimeDecoder::handlePanoMouseMove(int16 x, int16 y) {
int hotspot = track->lookupHotspot(x, y);
- debug(3, "hotspot: %d", hotspot);
+ debug(0, "hotspot: %d", hotspot);
}
#define REPEAT_DELAY 30000
More information about the Scummvm-git-logs
mailing list