[Scummvm-git-logs] scummvm master -> beca5be32b31200bb5b9c918ce30b4419bebd619
sev-
noreply at scummvm.org
Wed Feb 19 01:00:56 UTC 2025
This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
67e1b00869 VIDEO: QTVR: Expose panorama transformations via API
87c5fa30a3 DIRECTOR: XTRAS: Implement QTVRGetClickPanAngles and QTVRGetClickPanLoc methods
04f23ac98f COMMON: FORMATS: Fixed to PNAV atom reading in QuickTime
b947d5c92a VIDEO: QTVR: Expose navigation details via API
f2b08945cd DIRECTOR: XTRAS: Implement 3 more menthods in QTVR Xtra
073818101e DIRECTOR: XTRAS: Fix Get/SetHotSpotID implementation
beca5be32b CONFIGURE: Fix SDL detection on systems without sdl-config
Commit: 67e1b0086927d88ec29f170db76acbac652c0524
https://github.com/scummvm/scummvm/commit/67e1b0086927d88ec29f170db76acbac652c0524
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-19T01:51:15+01:00
Commit Message:
VIDEO: QTVR: Expose panorama transformations via API
Changed paths:
video/qt_decoder.h
video/qtvr_decoder.cpp
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 5c644f0ee0a..1e1d1960b6b 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -34,6 +34,8 @@
#include "common/keyboard.h"
#include "common/scummsys.h"
+#include "graphics/transform_tools.h"
+
#include "video/video_decoder.h"
namespace Common {
@@ -101,6 +103,9 @@ public:
const PanoHotSpot *getRolloverHotspot() { return _rolloverHotspot; }
const PanoHotSpot *getClickedHotspot() { return _clickedHotspot; }
+ Common::Point getPanLoc(int16 x, int16 y);
+ Graphics::FloatPoint getPanAngles(int16 x, int16 y);
+
Common::String getHotSpotName(int id);
void setClickedHotSpot(int id);
const PanoHotSpot *getHotSpotByID(int id);
@@ -364,7 +369,7 @@ private:
void constructPanorama();
Graphics::Surface *constructMosaic(VideoTrackHandler *track, uint w, uint h, Common::String fname);
- int lookupHotspot(int16 x, int16 y);
+ Common::Point projectPoint(int16 x, int16 y);
void setDirty() { _dirty = true; }
@@ -376,11 +381,13 @@ private:
const Graphics::Surface *bufferNextFrame();
+ public:
Graphics::Surface *_constructedPano;
Graphics::Surface *_constructedHotspots;
Graphics::Surface *_projectedPano;
Graphics::Surface *_planarProjection;
+ private:
bool _isPanoConstructed;
bool _dirty;
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 228a0e8cba8..19ba19d0bb9 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -502,9 +502,9 @@ void QuickTimeDecoder::PanoTrackHandler::constructPanorama() {
_decoder->_tiltAngle = 0.0f;
}
-int QuickTimeDecoder::PanoTrackHandler::lookupHotspot(int16 mx, int16 my) {
+Common::Point QuickTimeDecoder::PanoTrackHandler::projectPoint(int16 mx, int16 my) {
if (!_isPanoConstructed)
- return 0;
+ return Common::Point(-1, -1);
uint16 w = _decoder->getWidth(), h = _decoder->getHeight();
@@ -580,7 +580,7 @@ int QuickTimeDecoder::PanoTrackHandler::lookupHotspot(int16 mx, int16 my) {
else if (hotY > _constructedHotspots->w)
hotY = _constructedHotspots->w;
- return (int)_constructedHotspots->getPixel(hotY, hotX);
+ return Common::Point(hotX, hotY);
}
void QuickTimeDecoder::PanoTrackHandler::projectPanorama() {
@@ -1026,16 +1026,42 @@ void QuickTimeDecoder::handlePanoKey(Common::KeyState &state, bool down, bool re
}
}
+Common::Point QuickTimeDecoder::getPanLoc(int16 x, int16 y) {
+ PanoTrackHandler *track = (PanoTrackHandler *)getTrack(_panoTrack->targetTrack);
+
+ return track->projectPoint(x, y);
+}
+
+Graphics::FloatPoint QuickTimeDecoder::getPanAngles(int16 x, int16 y) {
+ PanoTrackHandler *track = (PanoTrackHandler *)getTrack(_panoTrack->targetTrack);
+ PanoSampleDesc *desc = (PanoSampleDesc *)_panoTrack->sampleDescs[0];
+ Common::Point pos = track->projectPoint(x, y);
+
+ Graphics::FloatPoint res;
+
+ res.x = desc->_hPanStart + (desc->_hPanStart - desc->_hPanEnd) / (float)desc->_sceneSizeY * pos.x;
+ res.y = desc->_vPanTop + (desc->_vPanTop - desc->_vPanBottom) / (float)desc->_sceneSizeX * pos.y;
+
+ return res;
+}
+
void QuickTimeDecoder::lookupHotspot(int16 x, int16 y) {
PanoTrackHandler *track = (PanoTrackHandler *)getTrack(_panoTrack->targetTrack);
- int hotspotId = track->lookupHotspot(x, y);
+ Common::Point hotspotPoint = track->projectPoint(x, y);
- if (hotspotId && _currentSample != -1) {
- if (!_rolloverHotspot || _rolloverHotspot->id != hotspotId)
- _rolloverHotspot = _panoTrack->panoSamples[_currentSample].hotSpotTable.get(hotspotId);
- } else {
+ if (hotspotPoint.x < 0) {
_rolloverHotspot = nullptr;
+ } else {
+ int hotspotId = (int)(((PanoTrackHandler *)getTrack(_panoTrack->targetTrack))->_constructedHotspots->getPixel(hotspotPoint.y, hotspotPoint.x));
+
+
+ if (hotspotId && _currentSample != -1) {
+ if (!_rolloverHotspot || _rolloverHotspot->id != hotspotId)
+ _rolloverHotspot = _panoTrack->panoSamples[_currentSample].hotSpotTable.get(hotspotId);
+ } else {
+ _rolloverHotspot = nullptr;
+ }
}
}
Commit: 87c5fa30a3e24f3ee82e725b0fcbabd3415f152c
https://github.com/scummvm/scummvm/commit/87c5fa30a3e24f3ee82e725b0fcbabd3415f152c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-19T01:51:15+01:00
Commit Message:
DIRECTOR: XTRAS: Implement QTVRGetClickPanAngles and QTVRGetClickPanLoc methods
Changed paths:
engines/director/lingo/xtras/qtvrxtra.cpp
diff --git a/engines/director/lingo/xtras/qtvrxtra.cpp b/engines/director/lingo/xtras/qtvrxtra.cpp
index 7012db871c0..aa0ac6101bf 100644
--- a/engines/director/lingo/xtras/qtvrxtra.cpp
+++ b/engines/director/lingo/xtras/qtvrxtra.cpp
@@ -699,11 +699,30 @@ void QtvrxtraXtra::m_QTVRSetClickLoc(int nargs) {
me->_video->handleMouseButton(true, pos.x, pos.y);
}
-XOBJSTUB(QtvrxtraXtra::m_QTVRGetClickPanAngles, 0)
-XOBJSTUB(QtvrxtraXtra::m_QTVRGetClickPanLoc, 0)
+void QtvrxtraXtra::m_QTVRGetClickPanAngles(int nargs) {
+ ARGNUMCHECK(0);
+
+ QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+ Common::Point pos = me->_video->getLastClick();
+ Graphics::FloatPoint loc = me->_video->getPanAngles(pos.x, pos.y);
+
+ g_lingo->push(Common::String::format("%.4f,%.4f", loc.x, loc.y));
+}
+
+void QtvrxtraXtra::m_QTVRGetClickPanLoc(int nargs) {
+ ARGNUMCHECK(0);
+
+ QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+ Common::Point pos = me->_video->getLastClick();
+ Common::Point loc = me->_video->getPanLoc(pos.x, pos.y);
+
+ g_lingo->push(Common::String::format("%d,%d", loc.x, loc.y));
+}
void QtvrxtraXtra::m_QTVRGetHotSpotID(int nargs) {
- ARGNUMCHECK(1);
+ ARGNUMCHECK(0);
QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
Commit: 04f23ac98f69933ebf0e35be941509de91fef5db
https://github.com/scummvm/scummvm/commit/04f23ac98f69933ebf0e35be941509de91fef5db
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-19T01:51:15+01:00
Commit Message:
COMMON: FORMATS: Fixed to PNAV atom reading in QuickTime
Changed paths:
common/formats/quicktime.cpp
common/formats/quicktime.h
diff --git a/common/formats/quicktime.cpp b/common/formats/quicktime.cpp
index 5b7f365055a..8bb75ec5d5b 100644
--- a/common/formats/quicktime.cpp
+++ b/common/formats/quicktime.cpp
@@ -1126,8 +1126,8 @@ int QuickTimeParser::readPHOT(Atom atom) {
pHotSpotTable.hotSpots[i].rect.top = _fd->readSint16BE();
pHotSpotTable.hotSpots[i].rect.left = _fd->readSint16BE();
- pHotSpotTable.hotSpots[i].rect.bottom = _fd->readSint16BE();
pHotSpotTable.hotSpots[i].rect.right = _fd->readSint16BE();
+ pHotSpotTable.hotSpots[i].rect.bottom = _fd->readSint16BE();
pHotSpotTable.hotSpots[i].mouseOverCursorID = _fd->readSint32BE();
pHotSpotTable.hotSpots[i].mouseDownCursorID = _fd->readSint32BE();
@@ -1195,10 +1195,14 @@ int QuickTimeParser::readPNAV(Atom atom) {
_fd->readUint16BE(); // reserved
_fd->readUint32BE(); // reserved2
- pLinkTable.navs[i].rect.top = _fd->readSint16BE();
- pLinkTable.navs[i].rect.left = _fd->readSint16BE();
- pLinkTable.navs[i].rect.bottom = _fd->readSint16BE();
- pLinkTable.navs[i].rect.right = _fd->readSint16BE();
+ pLinkTable.navs[i].navgHPan = readAppleFloatField(_fd);
+ pLinkTable.navs[i].navgVPan = readAppleFloatField(_fd);
+ pLinkTable.navs[i].navgZoom = readAppleFloatField(_fd);
+
+ pLinkTable.navs[i].zoomRect.top = _fd->readSint16BE();
+ pLinkTable.navs[i].zoomRect.left = _fd->readSint16BE();
+ pLinkTable.navs[i].zoomRect.right = _fd->readSint16BE();
+ pLinkTable.navs[i].zoomRect.bottom = _fd->readSint16BE();
_fd->readSint32BE(); // reserved3
diff --git a/common/formats/quicktime.h b/common/formats/quicktime.h
index 44f6d512760..c86430a25f6 100644
--- a/common/formats/quicktime.h
+++ b/common/formats/quicktime.h
@@ -273,11 +273,12 @@ public:
struct PanoNavigation {
uint16 id;
- uint32 hPan;
- uint32 vPan;
- uint32 zoom;
+ // Info for Navigable Movie Controller
+ float navgHPan; // the object's orientation in the scene
+ float navgVPan;
+ float navgZoom;
- Rect rect; // Starting rect for zoom out transitions
+ Rect zoomRect; // Starting rect for zoom out transitions
// Values to set at the destination node
int32 nameStrOffset;
Commit: b947d5c92a25294f4305a9bda118406f7db59a0f
https://github.com/scummvm/scummvm/commit/b947d5c92a25294f4305a9bda118406f7db59a0f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-19T01:51:15+01:00
Commit Message:
VIDEO: QTVR: Expose navigation details via API
Changed paths:
video/qt_decoder.h
video/qtvr_decoder.cpp
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 1e1d1960b6b..8269fb999d8 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -93,6 +93,7 @@ public:
float getFOV() const { return _fov; }
bool setFOV(float fov);
int getCurrentNodeID() { return _currentSample == -1 ? 0 : _panoTrack->panoSamples[_currentSample].hdr.nodeID; }
+ Common::String getCurrentNodeName();
int getCurrentRow() { return _nextVideoTrack->getCurFrame() / _nav.columns; }
void setCurrentRow(int row);
@@ -109,6 +110,7 @@ public:
Common::String getHotSpotName(int id);
void setClickedHotSpot(int id);
const PanoHotSpot *getHotSpotByID(int id);
+ const PanoNavigation *getHotSpotNavByID(int id);
void nudge(const Common::String &direction);
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 19ba19d0bb9..2b478b15f9e 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -225,6 +225,15 @@ bool QuickTimeDecoder::setFOV(float fov) {
return success;
}
+Common::String QuickTimeDecoder::getCurrentNodeName() {
+ if (_currentSample == -1)
+ return Common::String();
+
+ PanoTrackSample *sample = &_panoTrack->panoSamples[_currentSample];
+
+ return sample->strTable.getString(sample->hdr.nameStrOffset);
+}
+
void QuickTimeDecoder::updateAngles() {
if (_qtvrType == QTVRType::OBJECT) {
_panAngle = (float)getCurrentColumn() / (float)_nav.columns * 360.0;
@@ -1078,6 +1087,15 @@ const QuickTimeDecoder::PanoHotSpot *QuickTimeDecoder::getHotSpotByID(int id) {
return _panoTrack->panoSamples[_currentSample].hotSpotTable.get(id);
}
+const QuickTimeDecoder::PanoNavigation *QuickTimeDecoder::getHotSpotNavByID(int id) {
+ const QuickTimeDecoder::PanoHotSpot *hotspot = getHotSpotByID(id);
+
+ if (hotspot->type != HotSpotType::navg)
+ return nullptr;
+
+ return _panoTrack->panoSamples[_currentSample].navTable.get(hotspot->typeData);
+}
+
void QuickTimeDecoder::setClickedHotSpot(int id) {
_clickedHotspot = getHotSpotByID(id);
}
Commit: f2b08945cd71fdb5bb7799261a5f7221f41ad187
https://github.com/scummvm/scummvm/commit/f2b08945cd71fdb5bb7799261a5f7221f41ad187
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-19T01:51:15+01:00
Commit Message:
DIRECTOR: XTRAS: Implement 3 more menthods in QTVR Xtra
Changed paths:
engines/director/lingo/xtras/qtvrxtra.cpp
diff --git a/engines/director/lingo/xtras/qtvrxtra.cpp b/engines/director/lingo/xtras/qtvrxtra.cpp
index aa0ac6101bf..2f457d9c6f7 100644
--- a/engines/director/lingo/xtras/qtvrxtra.cpp
+++ b/engines/director/lingo/xtras/qtvrxtra.cpp
@@ -777,8 +777,43 @@ void QtvrxtraXtra::m_QTVRGetHotSpotViewAngles(int nargs) {
g_lingo->push(Common::String(""));
}
-XOBJSTUB(QtvrxtraXtra::m_QTVRGetObjectViewAngles, 0)
-XOBJSTUB(QtvrxtraXtra::m_QTVRGetObjectZoomRect, 0)
+void QtvrxtraXtra::m_QTVRGetObjectViewAngles(int nargs) {
+ ARGNUMCHECK(0);
+
+ QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+ const Common::QuickTimeParser::PanoHotSpot *hotspot = me->_video->getClickedHotspot();
+
+ if (hotspot) {
+ const Common::QuickTimeParser::PanoNavigation *navg = me->_video->getHotSpotNavByID(hotspot->id);
+
+ if (navg) {
+ g_lingo->push(Common::String::format("%.4f,%.4f", navg->navgHPan, navg->navgVPan));
+ return;
+ }
+ }
+
+ g_lingo->pushVoid();
+}
+
+void QtvrxtraXtra::m_QTVRGetObjectZoomRect(int nargs) {
+ ARGNUMCHECK(0);
+
+ QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+ const Common::QuickTimeParser::PanoHotSpot *hotspot = me->_video->getClickedHotspot();
+
+ if (hotspot) {
+ const Common::QuickTimeParser::PanoNavigation *navg = me->_video->getHotSpotNavByID(hotspot->id);
+
+ if (navg) {
+ g_lingo->push(Common::String::format("%d,%d,%d,%d", navg->zoomRect.left, navg->zoomRect.top, navg->zoomRect.right, navg->zoomRect.bottom));
+ return;
+ }
+ }
+
+ g_lingo->pushVoid();
+}
void QtvrxtraXtra::m_QTVRGetNodeID(int nargs) {
ARGNUMCHECK(0);
@@ -796,7 +831,14 @@ void QtvrxtraXtra::m_QTVRSetNodeID(int nargs) {
me->_video->goToNode(g_lingo->pop().asInt());
}
-XOBJSTUB(QtvrxtraXtra::m_QTVRGetNodeName, 0)
+void QtvrxtraXtra::m_QTVRGetNodeName(int nargs) {
+ ARGNUMCHECK(0);
+
+ QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
+
+ g_lingo->push(me->_video->getCurrentNodeName());
+}
+
XOBJSTUB(QtvrxtraXtra::m_QTVRGetQuality, 0)
XOBJSTUB(QtvrxtraXtra::m_QTVRSetQuality, 1)
XOBJSTUB(QtvrxtraXtra::m_QTVRGetTransitionMode, 0)
Commit: 073818101e78f3358d51e423bc9533c572b0478c
https://github.com/scummvm/scummvm/commit/073818101e78f3358d51e423bc9533c572b0478c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-19T01:51:15+01:00
Commit Message:
DIRECTOR: XTRAS: Fix Get/SetHotSpotID implementation
Changed paths:
engines/director/lingo/xtras/qtvrxtra.cpp
diff --git a/engines/director/lingo/xtras/qtvrxtra.cpp b/engines/director/lingo/xtras/qtvrxtra.cpp
index 2f457d9c6f7..298a557c20a 100644
--- a/engines/director/lingo/xtras/qtvrxtra.cpp
+++ b/engines/director/lingo/xtras/qtvrxtra.cpp
@@ -726,7 +726,9 @@ void QtvrxtraXtra::m_QTVRGetHotSpotID(int nargs) {
QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
- me->_video->setClickedHotSpot(g_lingo->pop().asInt());
+ const Common::QuickTimeParser::PanoHotSpot *hotspot = me->_video->getClickedHotspot();
+
+ g_lingo->push(hotspot ? hotspot->id : 0);
}
void QtvrxtraXtra::m_QTVRSetHotSpotID(int nargs) {
@@ -734,9 +736,7 @@ void QtvrxtraXtra::m_QTVRSetHotSpotID(int nargs) {
QtvrxtraXtraObject *me = (QtvrxtraXtraObject *)g_lingo->_state->me.u.obj;
- const Common::QuickTimeParser::PanoHotSpot *hotspot = me->_video->getClickedHotspot();
-
- g_lingo->push(hotspot ? hotspot->id : 0);
+ me->_video->setClickedHotSpot(g_lingo->pop().asInt());
}
void QtvrxtraXtra::m_QTVRGetHotSpotName(int nargs) {
Commit: beca5be32b31200bb5b9c918ce30b4419bebd619
https://github.com/scummvm/scummvm/commit/beca5be32b31200bb5b9c918ce30b4419bebd619
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-19T02:00:33+01:00
Commit Message:
CONFIGURE: Fix SDL detection on systems without sdl-config
Changed paths:
configure
diff --git a/configure b/configure
index 3c8cded3c87..12f6ccd9d68 100755
--- a/configure
+++ b/configure
@@ -4270,6 +4270,15 @@ EOF
cat > $TMPC << EOF
#include "SDL3/SDL.h"
int main(int argc, char *argv[]) { SDL_Init(0); return 0; }
+EOF
+ else
+ find_sdlconfig
+
+ _sdlversion=`$_sdlconfig --version`
+
+ cat > $TMPC << EOF
+#include "SDL.h"
+int main(int argc, char *argv[]) { SDL_Init(0); return 0; }
EOF
fi
More information about the Scummvm-git-logs
mailing list