[Scummvm-git-logs] scummvm master -> c19577d10da5ebcba14cd0bd8899b8ffd77734ef
sev-
noreply at scummvm.org
Sun Feb 23 16:18:30 UTC 2025
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3275e633e8 DIRECTOR: XLIBS: Unstub minor methods in QTVR Xlib
fff67c6e7c DIRECTOR: XLIBS: Unstub rest of the minor methods in QTVR Xlib
f39956e57e DIRECTOR: LINGO: 'the result' could be anything, not just Int, fixing that
70f430e4a9 DIRECTOR: XLIBS: Implement 'mouseOver' method
c19577d10d DIRECTOR: Fix AmigaOS compilation
Commit: 3275e633e8b6a42d0fbfd8e369cc203a624a96ee
https://github.com/scummvm/scummvm/commit/3275e633e8b6a42d0fbfd8e369cc203a624a96ee
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-23T17:18:17+01:00
Commit Message:
DIRECTOR: XLIBS: Unstub minor methods in 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 cf7c7e8a898..471f5407ebe 100644
--- a/engines/director/lingo/xlibs/qtvr.cpp
+++ b/engines/director/lingo/xlibs/qtvr.cpp
@@ -168,14 +168,57 @@ void QTVR::m_openMovie(int nargs) {
}
XOBJSTUB(QTVR::m_setActive, 0)
-XOBJSTUBNR(QTVR::m_setHPanAngle)
+
+void QTVR::m_setHPanAngle(int nargs) {
+ ARGNUMCHECK(1);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ me->_video->setPanAngle(atof(g_lingo->pop().asString().c_str()));
+}
+
XOBJSTUB(QTVR::m_setNodeID, 0)
XOBJSTUB(QTVR::m_setQuality, 0)
-XOBJSTUBNR(QTVR::m_setRolloverCallback)
-XOBJSTUB(QTVR::m_setTransitionMode, 0)
-XOBJSTUB(QTVR::m_setTransitionSpeed, 0)
-XOBJSTUBNR(QTVR::m_setVPanAngle)
-XOBJSTUBNR(QTVR::m_setZoomAngle)
+
+void QTVR::m_setRolloverCallback(int nargs) {
+ ARGNUMCHECK(1);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ me->_rolloverCallback = g_lingo->pop().asString();
+}
+
+void QTVR::m_setTransitionMode(int nargs) {
+ ARGNUMCHECK(1);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ me->_video->setTransitionMode(g_lingo->pop().asString());
+}
+
+void QTVR::m_setTransitionSpeed(int nargs) {
+ ARGNUMCHECK(1);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ me->_video->setTransitionSpeed(g_lingo->pop().asFloat());
+}
+
+void QTVR::m_setVPanAngle(int nargs) {
+ ARGNUMCHECK(1);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ me->_video->setTiltAngle(atof(g_lingo->pop().asString().c_str()));
+}
+
+void QTVR::m_setZoomAngle(int nargs) {
+ ARGNUMCHECK(1);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ me->_video->setFOV(atof(g_lingo->pop().asString().c_str()));
+}
void QTVR::m_update(int nargs) {
ARGNUMCHECK(0);
diff --git a/engines/director/lingo/xlibs/qtvr.h b/engines/director/lingo/xlibs/qtvr.h
index 6ab03580ebe..4e42722e93a 100644
--- a/engines/director/lingo/xlibs/qtvr.h
+++ b/engines/director/lingo/xlibs/qtvr.h
@@ -77,6 +77,7 @@ public:
Common::Rect _rect;
Video::QuickTimeDecoder *_video = nullptr;
QtvrWidget *_widget = nullptr;
+ Common::String _rolloverCallback;
};
} // End of namespace Director
Commit: fff67c6e7cbd8714d6dd8addc1ffbc1fe2a25781
https://github.com/scummvm/scummvm/commit/fff67c6e7cbd8714d6dd8addc1ffbc1fe2a25781
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-23T17:18:17+01:00
Commit Message:
DIRECTOR: XLIBS: Unstub rest of the minor methods in 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 471f5407ebe..2ac65b14763 100644
--- a/engines/director/lingo/xlibs/qtvr.cpp
+++ b/engines/director/lingo/xlibs/qtvr.cpp
@@ -120,18 +120,87 @@ void QTVR::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
-XOBJSTUBNR(QTVR::m_dispose)
-XOBJSTUB(QTVR::m_getHPanAngle, "")
-XOBJSTUB(QTVR::m_getMovieRect, "")
-XOBJSTUB(QTVR::m_getNodeID, 0)
-XOBJSTUB(QTVR::m_getQuality, 0)
-XOBJSTUB(QTVR::m_getVPanAngle, "")
-XOBJSTUB(QTVR::m_getZoomAngle, "")
+void QTVR::m_dispose(int nargs) {
+ ARGNUMCHECK(0);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ if (me->_video) {
+ me->_video->close();
+ delete me->_video;
+ }
+}
+
+void QTVR::m_getHPanAngle(int nargs) {
+ ARGNUMCHECK(0);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ g_lingo->push(me->_video->getPanAngle());
+}
+
+void QTVR::m_getMovieRect(int nargs) {
+ ARGNUMCHECK(0);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ g_lingo->push(Common::String::format("%d,%d,%d,%d", me->_rect.left, me->_rect.top, me->_rect.right, me->_rect.bottom));
+}
+
+void QTVR::m_getNodeID(int nargs) {
+ ARGNUMCHECK(0);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ g_lingo->push((int)me->_video->getCurrentNodeID());
+}
+
+void QTVR::m_getQuality(int nargs) {
+ ARGNUMCHECK(0);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ g_lingo->push(me->_video->getQuality());
+}
+
+void QTVR::m_getVPanAngle(int nargs) {
+ ARGNUMCHECK(0);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ g_lingo->push(me->_video->getTiltAngle());
+}
+
+void QTVR::m_getZoomAngle(int nargs) {
+ ARGNUMCHECK(0);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ g_lingo->push(me->_video->getFOV());
+}
+
XOBJSTUB(QTVR::m_mouseOver, "")
-XOBJSTUB(QTVR::m_name, "")
+
+void QTVR::m_name(int nargs) {
+ // TODO Clarify that it is indeed hotspot name
+ g_lingo->printArgs("QTVR::m_name", nargs);
+
+ ARGNUMCHECK(0);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ const Common::QuickTimeParser::PanoHotSpot *hotspot = me->_video->getClickedHotspot();
+
+ if (!hotspot) {
+ g_lingo->push(Common::String(""));
+ return;
+ }
+
+ g_lingo->push(me->_video->getHotSpotName(hotspot->id));
+}
void QTVR::m_openMovie(int nargs) {
- g_lingo->printArgs("QtvrxtraXtra::m_QTVROpen", nargs);
+ g_lingo->printArgs("QTVR::m_QTVROpen", nargs);
ARGNUMCHECK(3);
int top = g_lingo->pop().asInt();
@@ -167,7 +236,13 @@ void QTVR::m_openMovie(int nargs) {
g_lingo->push(path.toString());
}
-XOBJSTUB(QTVR::m_setActive, 0)
+void QTVR::m_setActive(int nargs) {
+ ARGNUMCHECK(1);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ me->_active = (g_lingo->pop().asInt() != 0);
+}
void QTVR::m_setHPanAngle(int nargs) {
ARGNUMCHECK(1);
@@ -177,8 +252,21 @@ void QTVR::m_setHPanAngle(int nargs) {
me->_video->setPanAngle(atof(g_lingo->pop().asString().c_str()));
}
-XOBJSTUB(QTVR::m_setNodeID, 0)
-XOBJSTUB(QTVR::m_setQuality, 0)
+void QTVR::m_setNodeID(int nargs) {
+ ARGNUMCHECK(1);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ me->_video->goToNode(g_lingo->pop().asInt());
+}
+
+void QTVR::m_setQuality(int nargs) {
+ ARGNUMCHECK(1);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+
+ me->_video->setQuality(g_lingo->pop().asInt());
+}
void QTVR::m_setRolloverCallback(int nargs) {
ARGNUMCHECK(1);
@@ -225,6 +313,9 @@ void QTVR::m_update(int nargs) {
QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+ if (!me->_active)
+ return;
+
Graphics::Surface const *frame = me->_video->decodeNextFrame();
if (!frame)
@@ -249,6 +340,9 @@ QtvrWidget::QtvrWidget(QTVRXObject *xtra, Graphics::MacWidget *parent, int x, in
}
bool QtvrWidget::processEvent(Common::Event &event) {
+ if (!_active)
+ return false;
+
switch (event.type) {
case Common::EVENT_LBUTTONDOWN:
_xtra->_video->handleMouseButton(true, event.mouse.x - _xtra->_rect.left, event.mouse.y - _xtra->_rect.top);
diff --git a/engines/director/lingo/xlibs/qtvr.h b/engines/director/lingo/xlibs/qtvr.h
index 4e42722e93a..bba72ca7078 100644
--- a/engines/director/lingo/xlibs/qtvr.h
+++ b/engines/director/lingo/xlibs/qtvr.h
@@ -78,6 +78,7 @@ public:
Video::QuickTimeDecoder *_video = nullptr;
QtvrWidget *_widget = nullptr;
Common::String _rolloverCallback;
+ bool _active = true;
};
} // End of namespace Director
Commit: f39956e57e7a571b937a6317d3196666735429cc
https://github.com/scummvm/scummvm/commit/f39956e57e7a571b937a6317d3196666735429cc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-23T17:18:17+01:00
Commit Message:
DIRECTOR: LINGO: 'the result' could be anything, not just Int, fixing that
Changed paths:
engines/director/lingo/lingo-code.cpp
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 035b3bc2eb1..4615086224c 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -1777,8 +1777,7 @@ void LC::call(const Symbol &funcSym, int nargs, bool allowRetVal) {
// Set "the result" to return value!, when a method
// this is for handling result after execution!
Datum top = g_lingo->peek(0);
- if (top.type == INT)
- g_lingo->_theResult = top;
+ g_lingo->_theResult = top;
if (!allowRetVal) {
Datum extra = g_lingo->pop();
Commit: 70f430e4a9c17731b0c1decd659bf2c462b392d4
https://github.com/scummvm/scummvm/commit/70f430e4a9c17731b0c1decd659bf2c462b392d4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-23T17:18:17+01:00
Commit Message:
DIRECTOR: XLIBS: Implement 'mouseOver' method
Changed paths:
engines/director/lingo/xlibs/qtvr.cpp
diff --git a/engines/director/lingo/xlibs/qtvr.cpp b/engines/director/lingo/xlibs/qtvr.cpp
index 2ac65b14763..24539f512fa 100644
--- a/engines/director/lingo/xlibs/qtvr.cpp
+++ b/engines/director/lingo/xlibs/qtvr.cpp
@@ -54,12 +54,12 @@
#include "director/director.h"
#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-builtins.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/qtvr.h"
#include "director/window.h"
-
namespace Director {
const char *const QTVR::xlibName = "QTVRW";
@@ -179,7 +179,102 @@ void QTVR::m_getZoomAngle(int nargs) {
g_lingo->push(me->_video->getFOV());
}
-XOBJSTUB(QTVR::m_mouseOver, "")
+void QTVR::m_mouseOver(int nargs) {
+ ARGNUMCHECK(0);
+
+ QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
+ Common::Point pos = g_director->getCurrentWindow()->getMousePos();
+
+ if (!me->_active || !me->_rect.contains(pos)) {
+ g_lingo->pushVoid();
+ return;
+ }
+
+ // 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 node;
+ bool nodeChanged = false;
+
+ while (true) {
+ Graphics::Surface const *frame = me->_video->decodeNextFrame();
+
+ if (!frame) {
+ g_lingo->pushVoid();
+ return;
+ }
+
+ Graphics::Surface *dither = frame->convertTo(g_director->_wm->_pixelformat, me->_video->getPalette(), 256, g_director->getPalette(), 256, Graphics::kDitherNaive);
+
+ g_director->getCurrentWindow()->getSurface()->copyRectToSurface(
+ dither->getPixels(), dither->pitch, me->_rect.left, me->_rect.top, dither->w, dither->h
+ );
+
+ g_director->getCurrentWindow()->setDirty(true);
+
+ Common::Event event;
+
+ while (g_system->getEventManager()->pollEvent(event)) {
+ if (Common::isMouseEvent(event)) {
+ pos = g_director->getCurrentWindow()->getMousePos();
+
+ if (!me->_rect.contains(pos))
+ break;
+ }
+
+ node = me->_video->getCurrentNodeID();
+ hotspot = me->_video->getRolloverHotspot();
+
+ if (event.type == Common::EVENT_LBUTTONUP) {
+ me->_widget->processEvent(event);
+
+ if (me->_video->getCurrentNodeID() != node)
+ nodeChanged = true;
+
+ hotspot = me->_video->getClickedHotspot();
+
+ if (!hotspot) {
+ if (nodeChanged)
+ g_lingo->push(Common::String::format("jump,%d", node));
+ else
+ g_lingo->push(Common::String("pan ,0"));
+ return;
+ }
+
+ g_lingo->push(Common::String::format("%s,%d", tag2str((uint32)hotspot->type), hotspot->id));
+
+ 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);
+ }
+ }
+
+ LB::b_updateStage(0);
+
+ if (!me->_rect.contains(pos))
+ break;
+
+ if (event.type == Common::EVENT_QUIT) {
+ g_director->processEventQUIT();
+ break;
+ }
+
+ g_director->delayMillis(10);
+ }
+
+ g_lingo->_theResult = 0;
+}
void QTVR::m_name(int nargs) {
// TODO Clarify that it is indeed hotspot name
@@ -313,8 +408,7 @@ void QTVR::m_update(int nargs) {
QTVRXObject *me = (QTVRXObject *)g_lingo->_state->me.u.obj;
- if (!me->_active)
- return;
+ me->_active = true;
Graphics::Surface const *frame = me->_video->decodeNextFrame();
@@ -340,7 +434,7 @@ QtvrWidget::QtvrWidget(QTVRXObject *xtra, Graphics::MacWidget *parent, int x, in
}
bool QtvrWidget::processEvent(Common::Event &event) {
- if (!_active)
+ if (!_xtra->_active)
return false;
switch (event.type) {
Commit: c19577d10da5ebcba14cd0bd8899b8ffd77734ef
https://github.com/scummvm/scummvm/commit/c19577d10da5ebcba14cd0bd8899b8ffd77734ef
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-02-23T17:18:17+01:00
Commit Message:
DIRECTOR: Fix AmigaOS compilation
Changed paths:
engines/director/lingo/xtras/timextra.cpp
diff --git a/engines/director/lingo/xtras/timextra.cpp b/engines/director/lingo/xtras/timextra.cpp
index 83b098db743..83a74819b59 100644
--- a/engines/director/lingo/xtras/timextra.cpp
+++ b/engines/director/lingo/xtras/timextra.cpp
@@ -37,7 +37,7 @@
/*
-- xtra TimeXtra
new object me, any
-* getTime -- add two numbers
+* getTime -- add two numbers
*/
@@ -108,7 +108,7 @@ void TimextraXtra::m_new(int nargs) {
void TimextraXtra::m_getTime(int nargs) {
ARGNUMCHECK(0);
- int seconds = g_system->getMillis() / 1000;
+ int32 seconds = g_system->getMillis() / 1000;
Datum const res(seconds);
g_lingo->push(res);
}
More information about the Scummvm-git-logs
mailing list