[Scummvm-git-logs] scummvm master -> e74ef17a6d39267dec6fe9dc72985157cfcc362f

rvanlaar noreply at scummvm.org
Mon Feb 21 18:24:09 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e74ef17a6d DIRECTOR: LINGO: wip XPlayAnim for PACo


Commit: e74ef17a6d39267dec6fe9dc72985157cfcc362f
    https://github.com/scummvm/scummvm/commit/e74ef17a6d39267dec6fe9dc72985157cfcc362f
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-02-21T19:20:01+01:00

Commit Message:
DIRECTOR: LINGO: wip XPlayAnim for PACo

XPlayAnim is implemented as a lingo function.
It will currently only display the last frame in the current Palette.

Note: XPlayAnim should be an XObj. For that we first need to implement
loading Xobjects from rsrc files.

Changed paths:
    engines/director/lingo/lingo-builtins.cpp
    engines/director/lingo/lingo-builtins.h


diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 1a2d1f2b7ed..68ca9d830f1 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -22,6 +22,8 @@
 #include "common/system.h"
 #include "common/tokenizer.h"
 
+#include "video/paco_decoder.h"
+
 #include "gui/message.h"
 
 #include "graphics/macgui/macwindowmanager.h"
@@ -224,6 +226,8 @@ static BuiltinProto builtins[] = {
 	{ "scummvmAssert",	LB::b_scummvmassert,1, 2, 200, HBLTIN },
 	{ "scummvmAssertEqual",	LB::b_scummvmassertequal,2,3,200,HBLTIN },
 
+	// Expose Paco
+	{ "XPlayAnim", LB::b_xPlayAnim, 3,3, 300, HBLTIN },
 	// XCMD/XFCN (HyperCard), normally exposed
 	{ "GetVolumes", LB::b_getVolumes, 0, 0, 400, FBLTIN },
 
@@ -2694,6 +2698,26 @@ void LB::b_scummvmassertequal(int nargs) {
 	assert(result == 1);
 }
 
+void LB::b_xPlayAnim(int nargs){
+	int y = g_lingo->pop().asInt();
+	int x = g_lingo->pop().asInt();
+	Common::String filename = g_lingo->pop().asString();
+
+	warning("LB::b_xPlayAnim: x: %i y: %i", x, y);
+	Video::PacoDecoder *video = new Video::PacoDecoder();
+	video->loadFile(Common::Path(filename, g_director->_dirSeparator));
+
+	while (!video->endOfVideo()) {
+		warning("LB::b_xPlayAnim: loop");
+		Graphics::Surface const *frame = video->decodeNextFrame();
+		Graphics::ManagedSurface *surface = g_director->getCurrentWindow()->getSurface();
+		surface->copyRectToSurface(frame->getPixels(), frame->pitch, x, y, frame->w, frame->h);
+
+		g_system->updateScreen();
+		g_system->delayMillis(10);
+	}
+}
+
 void LB::b_getVolumes(int nargs) {
 	// Right now, only "Journeyman Project 2: Buried in Time" is known to check
 	// for its volume name.
diff --git a/engines/director/lingo/lingo-builtins.h b/engines/director/lingo/lingo-builtins.h
index 5694b9bbc48..b9bdadedf4d 100644
--- a/engines/director/lingo/lingo-builtins.h
+++ b/engines/director/lingo/lingo-builtins.h
@@ -194,6 +194,8 @@ void b_numberofwords(int nargs);
 void b_scummvmassert(int nargs);
 void b_scummvmassertequal(int nargs);
 
+void b_xPlayAnim(int nargs);
+
 // XCMD/XFCN (HyperCard), normally exposed
 void b_getVolumes(int nargs);
 




More information about the Scummvm-git-logs mailing list