[Scummvm-git-logs] scummvm master -> 91a521be3f2ada9d0e85fba63d83036db387d79b
sev-
noreply at scummvm.org
Mon Feb 24 00:16:35 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:
10b7804675 VIDEO: QTVR: Expose hotspotid as is
91a521be3f DIRECTOR: XLIBS: Changed callback notation for QTVR Xlib
Commit: 10b7804675ce426e3a4de24b9f7d7ee0c4e8b77d
https://github.com/scummvm/scummvm/commit/10b7804675ce426e3a4de24b9f7d7ee0c4e8b77d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-24T01:11:41+01:00
Commit Message:
VIDEO: QTVR: Expose hotspotid as is
Changed paths:
video/qt_decoder.h
video/qtvr_decoder.cpp
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index d3bff2fc89d..941e6ac2cbc 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -106,7 +106,9 @@ public:
int getZoomState() { return _zoomState; }
const PanoHotSpot *getRolloverHotspot() { return _rolloverHotspot; }
+ int getRolloverHotspotID() { return _rolloverHotspotID; }
const PanoHotSpot *getClickedHotspot() { return _clickedHotspot; }
+ int getClickedHotspotID() { return _clickedHotspotID; }
Common::Point getPanLoc(int16 x, int16 y);
Graphics::FloatPoint getPanAngles(int16 x, int16 y);
@@ -229,7 +231,9 @@ private:
bool _repeatTimerActive = false;
const PanoHotSpot *_rolloverHotspot = nullptr;
+ int _rolloverHotspotID = 0;
const PanoHotSpot *_clickedHotspot = nullptr;
+ int _clickedHotspotID = 0;
bool _renderHotspots = false;
Graphics::Surface *_scaledSurface;
diff --git a/video/qtvr_decoder.cpp b/video/qtvr_decoder.cpp
index 5519f27aee2..eb75c49982e 100644
--- a/video/qtvr_decoder.cpp
+++ b/video/qtvr_decoder.cpp
@@ -963,6 +963,8 @@ void QuickTimeDecoder::lookupHotspot(int16 x, int16 y) {
} else {
int hotspotId = (int)(((PanoTrackHandler *)getTrack(_panoTrack->targetTrack))->_constructedHotspots->getPixel(hotspotPoint.y, hotspotPoint.x));
+ _rolloverHotspotID = hotspotId;
+
if (hotspotId && _currentSample != -1) {
if (!_rolloverHotspot || _rolloverHotspot->id != hotspotId)
_rolloverHotspot = _panoTrack->panoSamples[_currentSample].hotSpotTable.get(hotspotId);
@@ -1001,6 +1003,7 @@ const QuickTimeDecoder::PanoNavigation *QuickTimeDecoder::getHotSpotNavByID(int
void QuickTimeDecoder::setClickedHotSpot(int id) {
_clickedHotspot = getHotSpotByID(id);
+ _clickedHotspotID = id;
}
@@ -1133,6 +1136,7 @@ void QuickTimeDecoder::handlePanoMouseButton(bool isDown, int16 x, int16 y, bool
_mouseDrag.y = y;
_clickedHotspot = _rolloverHotspot;
+ _clickedHotspotID = _rolloverHotspotID;
}
if (!repeat && !isDown && _rolloverHotspot && _prevMouse == _mouseDrag) {
Commit: 91a521be3f2ada9d0e85fba63d83036db387d79b
https://github.com/scummvm/scummvm/commit/91a521be3f2ada9d0e85fba63d83036db387d79b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-24T01:14:39+01:00
Commit Message:
DIRECTOR: XLIBS: Changed callback notation for QTVR Xlib
Changed paths:
engines/director/lingo/xlibs/qtvr.cpp
engines/director/lingo/xlibs/qtvr.h
diff --git a/engines/director/lingo/xlibs/qtvr.cpp b/engines/director/lingo/xlibs/qtvr.cpp
index 24539f512fa..727b422ec58 100644
--- a/engines/director/lingo/xlibs/qtvr.cpp
+++ b/engines/director/lingo/xlibs/qtvr.cpp
@@ -55,6 +55,7 @@
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-builtins.h"
+#include "director/lingo/lingo-code.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/qtvr.h"
@@ -191,12 +192,7 @@ void QTVR::m_mouseOver(int nargs) {
}
// Execute handler on first call to MouseOver
- const Common::QuickTimeParser::PanoHotSpot *hotspot = me->_video->getRolloverHotspot();
-
- if (!me->_rolloverCallback.empty()) {
- g_lingo->push(hotspot ? hotspot->id : 0);
- g_lingo->executeHandler(me->_rolloverCallback, 1);
- }
+ int hotspot;
int node;
bool nodeChanged = false;
@@ -228,7 +224,7 @@ void QTVR::m_mouseOver(int nargs) {
}
node = me->_video->getCurrentNodeID();
- hotspot = me->_video->getRolloverHotspot();
+ hotspot = me->_video->getRolloverHotspotID();
if (event.type == Common::EVENT_LBUTTONUP) {
me->_widget->processEvent(event);
@@ -236,7 +232,7 @@ void QTVR::m_mouseOver(int nargs) {
if (me->_video->getCurrentNodeID() != node)
nodeChanged = true;
- hotspot = me->_video->getClickedHotspot();
+ hotspot = me->_video->getClickedHotspotID();
if (!hotspot) {
if (nodeChanged)
@@ -246,17 +242,18 @@ void QTVR::m_mouseOver(int nargs) {
return;
}
- g_lingo->push(Common::String::format("%s,%d", tag2str((uint32)hotspot->type), hotspot->id));
+ const Common::QuickTimeParser::PanoHotSpot *hotspotData = me->_video->getHotSpotByID(hotspot);
+ g_lingo->push(Common::String::format("%s,%d", hotspotData ? tag2str((uint32)hotspotData->type) : "undf", hotspot));
return;
}
me->_widget->processEvent(event);
- if (!me->_rolloverCallback.empty() && hotspot != me->_video->getRolloverHotspot()) {
- g_lingo->push(hotspot ? hotspot->id : 0);
-
- g_lingo->executeHandler(me->_rolloverCallback, 1);
+ if (!me->_rolloverCallbackMethod.empty()) {
+ g_lingo->push(hotspot);
+ g_lingo->push(me->_rolloverCallbackObject);
+ LC::call(me->_rolloverCallbackMethod, 2, false);
}
}
@@ -364,11 +361,12 @@ void QTVR::m_setQuality(int nargs) {
}
void QTVR::m_setRolloverCallback(int nargs) {
- ARGNUMCHECK(1);
+ ARGNUMCHECK(2);
QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
- me->_rolloverCallback = g_lingo->pop().asString();
+ me->_rolloverCallbackMethod = g_lingo->pop().asString();
+ me->_rolloverCallbackObject = g_lingo->pop();
}
void QTVR::m_setTransitionMode(int nargs) {
diff --git a/engines/director/lingo/xlibs/qtvr.h b/engines/director/lingo/xlibs/qtvr.h
index bba72ca7078..903b3562f1b 100644
--- a/engines/director/lingo/xlibs/qtvr.h
+++ b/engines/director/lingo/xlibs/qtvr.h
@@ -77,7 +77,8 @@ public:
Common::Rect _rect;
Video::QuickTimeDecoder *_video = nullptr;
QtvrWidget *_widget = nullptr;
- Common::String _rolloverCallback;
+ Datum _rolloverCallbackObject;
+ Common::String _rolloverCallbackMethod;
bool _active = true;
};
More information about the Scummvm-git-logs
mailing list