Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,125 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "common/system.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/b/backdrop.h"
/**************************************************
*
* USED IN:
* A Trip To The Sky
* Die Hexenakademie
*
**************************************************/
/*
-- Backdrop XObject
-- Draws a backdrop behind the Director stage
-- Version 2.0.1, September 27, 1994
-- ©1993-94 Electronic Ink
I mNew
X mDispose
X mShow
X mHide
X mPaint
V mSetColor, index [or] r,g,b
V mSetBgColor, index [or] r,g,b
V mSetPattern, patNum [or] patName
XI mSetPPat, ppatID
V mSetPicture, castPict [or] pictID [or] pictFile
XI mHideInBack, trueOrFalse
XI mHideMessages, trueOrFalse
XS mRegister, serialNumber
*/
namespace Director {
const char *const BackdropXObj::xlibName = "Backdrop";
const XlibFileDesc BackdropXObj::fileNames[] = {
{ "Backdrop", nullptr },
{ "backdrop.obj", nullptr },
{ "Backdrop XObj", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", BackdropXObj::m_new, 0, 0, 400 },
{ "dispose", BackdropXObj::m_dispose, 0, 0, 400 },
{ "show", BackdropXObj::m_show, 0, 0, 400 },
{ "hide", BackdropXObj::m_hide, 0, 0, 400 },
{ "paint", BackdropXObj::m_paint, 0, 0, 400 },
{ "setColor", BackdropXObj::m_setColor, 0, 0, 400 },
{ "setBgColor", BackdropXObj::m_setBgColor, 0, 0, 400 },
{ "setPattern", BackdropXObj::m_setPattern, 0, 0, 400 },
{ "setPPat", BackdropXObj::m_setPPat, 1, 1, 400 },
{ "setPicture", BackdropXObj::m_setPicture, 0, 0, 400 },
{ "hideInBack", BackdropXObj::m_hideInBack, 1, 1, 400 },
{ "hideMessages", BackdropXObj::m_hideMessages, 1, 1, 400 },
{ "register", BackdropXObj::m_register, 1, 1, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
static const BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
BackdropXObject::BackdropXObject(ObjectType ObjectType) :Object<BackdropXObject>("Backdrop") {
_objType = ObjectType;
}
void BackdropXObj::open(ObjectType type, const Common::Path &path) {
BackdropXObject::initMethods(xlibMethods);
BackdropXObject *xobj = new BackdropXObject(type);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void BackdropXObj::close(ObjectType type) {
BackdropXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void BackdropXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("BackdropXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(BackdropXObj::m_dispose)
XOBJSTUBNR(BackdropXObj::m_show)
XOBJSTUBNR(BackdropXObj::m_hide)
XOBJSTUBNR(BackdropXObj::m_paint)
XOBJSTUB(BackdropXObj::m_setColor, 0)
XOBJSTUB(BackdropXObj::m_setBgColor, 0)
XOBJSTUB(BackdropXObj::m_setPattern, 0)
XOBJSTUBNR(BackdropXObj::m_setPPat)
XOBJSTUB(BackdropXObj::m_setPicture, 0)
XOBJSTUBNR(BackdropXObj::m_hideInBack)
XOBJSTUBNR(BackdropXObj::m_hideMessages)
XOBJSTUBNR(BackdropXObj::m_register)
}

View File

@@ -0,0 +1,58 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_BACKDROP_H
#define DIRECTOR_LINGO_XLIBS_BACKDROP_H
namespace Director {
class BackdropXObject : public Object<BackdropXObject> {
public:
BackdropXObject(ObjectType objType);
};
namespace BackdropXObj {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_dispose(int nargs);
void m_show(int nargs);
void m_hide(int nargs);
void m_paint(int nargs);
void m_setColor(int nargs);
void m_setBgColor(int nargs);
void m_setPattern(int nargs);
void m_setPPat(int nargs);
void m_setPicture(int nargs);
void m_hideInBack(int nargs);
void m_hideMessages(int nargs);
void m_register(int nargs);
} // End of namespace BackdropXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,90 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*************************************
*
* USED IN:
* Angel Gate demo
*
*************************************/
/*
* -- Picter, a simple demo XObject, v1.0
* I mNew
* XIII mGpal, h, l, s
* XIIIIII mLine, y1, y2, y3, y4, y5, c
* II mGetDate, value
* X mClear
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/b/barakeobj.h"
namespace Director {
const char *const BarakeObj::xlibName = "BarakeObj";
const XlibFileDesc BarakeObj::fileNames[] = {
{ "BarakeObj", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", BarakeObj::m_new, 0, 0, 400 }, // D4
{ "Clear", BarakeObj::m_clear, 0, 0, 400 }, // D4
{ "Gpal", BarakeObj::m_gpal, 3, 3, 400 }, // D4
{ "Line", BarakeObj::m_line, 6, 6, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void BarakeObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
BarakeObject::initMethods(xlibMethods);
BarakeObject *xobj = new BarakeObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void BarakeObj::close(ObjectType type) {
if (type == kXObj) {
BarakeObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
BarakeObject::BarakeObject(ObjectType ObjectType) :Object<BarakeObject>("BarakeObj") {
_objType = ObjectType;
}
void BarakeObj::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
void BarakeObj::m_clear(int nargs) {
}
XOBJSTUBNR(BarakeObj::m_gpal)
XOBJSTUBNR(BarakeObj::m_line)
} // End of namespace Director

View File

@@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_BARAKEOBJ_H
#define DIRECTOR_LINGO_XLIBS_BARAKEOBJ_H
namespace Director {
class BarakeObject : public Object<BarakeObject> {
public:
BarakeObject(ObjectType objType);
};
namespace BarakeObj {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_clear(int nargs);
void m_gpal(int nargs);
void m_line(int nargs);
} // End of namespace BarakeObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,281 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*************************************
*
* USED IN:
* teamxtreme1-win
* teamxtreme2-win
*
*************************************/
/*
* -- BatQt quicktime factory. 9Aug94 RNB
* BatQt
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance
* S mName --Returns the XObject name
* I mStatus --Returns an integer status code
* SI mError, code --Returns an error string
* S mLastError --Returns last error string
* ISI mOpen --Opens the specified movie
* IIIS mPlay --Play the movie, after setting parms
* I mStop --Stop the movie
* S mGetTimeRange --Gets the current time range
* S mGetMovieBox --Gets the current bounds box of the movie
* I mGetTime --Gets the current time of the movie
* SI mSetTime --Sets the current time of the movie
* SI mSetVolume --Sets the volume of the movie
* I mLength --Gets the length of the movie
* IIIII mSetMovieBox --Sets the bounding box of the movie
* III mSetTimeRange -- Sets the active segment of the movie
* II mAddCallback -- Adds a callback for the movie
* II mRemoveCallback -- Removes a callback for the movie
* I mResetCallbacks -- Resets the sent status of the callbacks
* XS mSetBatch -- Applies a set of batch commands
*/
#include "graphics/paletteman.h"
#include "video/qt_decoder.h"
#include "director/director.h"
#include "director/util.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/b/batqt.h"
namespace Director {
// The name is different from the obj filename.
const char *const BatQT::xlibName = "batQT";
const XlibFileDesc BatQT::fileNames[] = {
{ "batQT", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", BatQT::m_new, 0, 0, 400 }, // D4
{ "dispose", BatQT::m_dispose, 1, 1, 400 }, // D4
{ "name", BatQT::m_name, 0, 0, 400 }, // D4
{ "status", BatQT::m_status, 0, 0, 400 }, // D4
{ "error", BatQT::m_error, 1, 1, 400 }, // D4
{ "lastError", BatQT::m_lastError, 0, 0, 400 }, // D4
{ "open", BatQT::m_open, 2, 2, 400 }, // D4
{ "play", BatQT::m_play, 3, 3, 400 }, // D4
{ "stop", BatQT::m_stop, 0, 0, 400 }, // D4
{ "getTimeRange", BatQT::m_getTimeRange, 0, 0, 400 }, // D4
{ "getMovieBox", BatQT::m_getMovieBox, 0, 0, 400 }, // D4
{ "getTime", BatQT::m_getTime, 0, 0, 400 }, // D4
{ "setTime", BatQT::m_setTime, 1, 1, 400 }, // D4
{ "setVolume", BatQT::m_setVolume, 1, 1, 400 }, // D4
{ "length", BatQT::m_length, 0, 0, 400 }, // D4
{ "setMovieBox", BatQT::m_setMovieBox, 4, 4, 400 }, // D4
{ "setTimeRange", BatQT::m_setTimeRange, 2, 2, 400 }, // D4
{ "addCallback", BatQT::m_addCallback, 1, 1, 400 }, // D4
{ "removeCallback", BatQT::m_removeCallback,1, 1, 400 }, // D4
{ "resetCallbacks", BatQT::m_resetCallbacks,0, 0, 400 }, // D4
{ "setBatch", BatQT::m_setBatch, 1, 1, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void BatQT::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
BatQTXObject::initMethods(xlibMethods);
BatQTXObject *xobj = new BatQTXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void BatQT::close(ObjectType type) {
if (type == kXObj) {
BatQTXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
BatQTXObject::BatQTXObject(ObjectType ObjectType) : Object<BatQTXObject>("BatQt") {
_objType = ObjectType;
_video = nullptr;
}
BatQTXObject::~BatQTXObject() {
if (_video) {
delete _video;
_video = nullptr;
}
}
void BatQT::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
void BatQT::m_dispose(int nargs) {
debug(5, "BatQT::m_dispose");
BatQTXObject *me = static_cast<BatQTXObject *>(g_lingo->_state->me.u.obj);
if (me->_video) {
delete me->_video;
me->_video = nullptr;
}
}
XOBJSTUB(BatQT::m_name, "")
XOBJSTUB(BatQT::m_status, 0)
XOBJSTUB(BatQT::m_error, "")
XOBJSTUB(BatQT::m_lastError, "")
void BatQT::m_open(int nargs) {
ARGNUMCHECK(2);
Datum unk = g_lingo->pop();
Datum path = g_lingo->pop();
TYPECHECK(path, STRING);
BatQTXObject *me = static_cast<BatQTXObject *>(g_lingo->_state->me.u.obj);
Common::Path normPath = findPath(path.asString());
if (!normPath.empty()) {
me->_video = new Video::QuickTimeDecoder();
debugC(5, kDebugXObj, "BatQT::m_open: Loading QT file %s", normPath.toString().c_str());
if (me->_video->loadFile(normPath)) {
me->_movieBox = Common::Rect(me->_video->getWidth(), me->_video->getHeight());
if (g_director->_pixelformat.bytesPerPixel == 1) {
// Director supports playing back RGB and paletted video in 256 colour mode.
// In both cases they are dithered to match the Director palette.
me->_video->setDitheringPalette(g_director->getPalette());
}
} else {
warning("BatQT::m_open: Could not load QT file %s", normPath.toString().c_str());
}
} else {
warning("BatQT::m_open: Could not resolve path %s", path.asString().c_str());
}
g_lingo->push(0);
}
void BatQT::m_play(int nargs) {
ARGNUMCHECK(3);
Datum unk3 = g_lingo->pop();
Datum unk2 = g_lingo->pop();
Datum unk1 = g_lingo->pop();
TYPECHECK(unk1, INT);
TYPECHECK(unk2, INT);
TYPECHECK(unk3, STRING);
BatQTXObject *me = static_cast<BatQTXObject *>(g_lingo->_state->me.u.obj);
if (me->_video) {
debugC(5, kDebugXObj, "BatQT::m_play: Starting playback");
me->_video->start();
} else {
warning("BatQT::m_play: No video loaded");
}
g_lingo->push(0);
}
void BatQT::m_stop(int nargs) {
ARGNUMCHECK(0);
BatQTXObject *me = static_cast<BatQTXObject *>(g_lingo->_state->me.u.obj);
if (me->_video) {
debugC(5, kDebugXObj, "BatQT::m_stop: Stopping playback");
me->_video->stop();
} else {
warning("BatQT::m_stop: No video loaded");
}
g_lingo->push(0);
}
XOBJSTUB(BatQT::m_getTimeRange, "")
void BatQT::m_getMovieBox(int nargs) {
BatQTXObject *me = static_cast<BatQTXObject *>(g_lingo->_state->me.u.obj);
Common::String result = Common::String::format(
"%d,%d,%d,%d",
me->_movieBox.left,
me->_movieBox.top,
me->_movieBox.width(),
me->_movieBox.height()
);
debugC(5, kDebugXObj, "BatQT::m_getMovieBox: %s", result.c_str());
g_lingo->push(result);
}
void BatQT::m_getTime(int nargs) {
ARGNUMCHECK(0);
BatQTXObject *me = static_cast<BatQTXObject *>(g_lingo->_state->me.u.obj);
Datum result(0);
if (me->_video) {
// Game uses a polling loop of m_getTime to measure progress,
// therefore we need to render the frames in here
if (me->_video->needsUpdate()) {
const Graphics::Surface *frame = me->_video->decodeNextFrame();
if (frame) {
Graphics::Surface *temp = frame->scale(me->_movieBox.width(), me->_movieBox.height(), false);
g_system->copyRectToScreen(temp->getPixels(), temp->pitch, me->_movieBox.left, me->_movieBox.top, temp->w, temp->h);
g_system->updateScreen();
delete temp;
}
}
result = Datum(me->_video->getCurFrame() + 1);
debugC(5, kDebugXObj, "BatQT::m_getTime: %d", result.asInt());
} else {
warning("BatQT::m_getTime: No video loaded");
}
g_lingo->push(result);
}
XOBJSTUB(BatQT::m_setTime, "")
XOBJSTUB(BatQT::m_setVolume, "")
void BatQT::m_length(int nargs) {
ARGNUMCHECK(0);
BatQTXObject *me = static_cast<BatQTXObject *>(g_lingo->_state->me.u.obj);
Datum result(0);
if (me->_video) {
result = Datum((int)me->_video->getFrameCount());
debugC(5, kDebugXObj, "BatQT::m_length: %d", result.asInt());
}
g_lingo->push(result);
}
void BatQT::m_setMovieBox(int nargs) {
ARGNUMCHECK(4);
Datum h = g_lingo->pop();
Datum w = g_lingo->pop();
Datum y = g_lingo->pop();
Datum x = g_lingo->pop();
TYPECHECK(h, INT);
TYPECHECK(w, INT);
TYPECHECK(y, INT);
TYPECHECK(x, INT);
BatQTXObject *me = static_cast<BatQTXObject *>(g_lingo->_state->me.u.obj);
me->_movieBox.left = x.asInt();
me->_movieBox.top = y.asInt();
me->_movieBox.setWidth(w.asInt());
me->_movieBox.setHeight(h.asInt());
debugC(5, kDebugXObj, "BatQT::m_setMovieBox: %d,%d,%d,%d", me->_movieBox.left, me->_movieBox.top, me->_movieBox.width(), me->_movieBox.height());
g_lingo->push(0);
}
XOBJSTUB(BatQT::m_setTimeRange, 0)
XOBJSTUB(BatQT::m_addCallback, 0)
XOBJSTUB(BatQT::m_removeCallback, 0)
XOBJSTUB(BatQT::m_resetCallbacks, 0)
XOBJSTUBNR(BatQT::m_setBatch)
} // End of namespace Director

View File

@@ -0,0 +1,76 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_BATQT_H
#define DIRECTOR_LINGO_XLIBS_BATQT_H
#include "common/rect.h"
namespace Video {
class QuickTimeDecoder;
}
namespace Director {
class BatQTXObject : public Object<BatQTXObject> {
public:
BatQTXObject(ObjectType objType);
~BatQTXObject();
Video::QuickTimeDecoder *_video;
Common::Rect _movieBox;
};
namespace BatQT {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_dispose(int nargs);
void m_name(int nargs);
void m_status(int nargs);
void m_error(int nargs);
void m_lastError(int nargs);
void m_open(int nargs);
void m_play(int nargs);
void m_stop(int nargs);
void m_getTimeRange(int nargs);
void m_getMovieBox(int nargs);
void m_getTime(int nargs);
void m_setTime(int nargs);
void m_setVolume(int nargs);
void m_length(int nargs);
void m_setMovieBox(int nargs);
void m_setTimeRange(int nargs);
void m_addCallback(int nargs);
void m_removeCallback(int nargs);
void m_resetCallbacks(int nargs);
void m_setBatch(int nargs);
} // End of namespace BatQT
} // End of namespace Director
#endif

View File

@@ -0,0 +1,97 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "common/system.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/b/bimxobj.h"
/**************************************************
*
* USED IN:
* Karma: Curse of the 12 Caves
*
**************************************************/
/*
* -- BIM16 External Factory. 14JULY94
* --BIM
* I mNew --Creates a new instance of the XObject
* ISII mPlay, FileName, x, y --Play Flc file
* ISIII mPlayTo, FileName, x, y, frame --Play Flc file
* ISIII mVideo, FileName, x, y, delay --Play Flc file
* ISIIII mStretch, FileName, destx, desty, destw, desth --Play Flc file
* I mDispose --Disposes of XObject instance
*/
namespace Director {
const char *const BIMXObj::xlibName = "BIM";
const XlibFileDesc BIMXObj::fileNames[] = {
{ "FLC", nullptr },
{ "BIM", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{"new", BIMXObj::m_new, 0, 0, 400},
{"play", BIMXObj::m_play, 3, 3, 400},
{"playTo", BIMXObj::m_playTo, 4, 4, 400},
{"video", BIMXObj::m_video, 4, 4, 400},
{"stretch", BIMXObj::m_stretch, 5, 5, 400},
{nullptr, nullptr, 0, 0, 0}
};
static const BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
BIMXObject::BIMXObject(const ObjectType objType) :Object<BIMXObject>("BIM") {
_objType = objType;
}
void BIMXObj::open(ObjectType type, const Common::Path &path) {
BIMXObject::initMethods(xlibMethods);
BIMXObject *xobj = new BIMXObject(type);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void BIMXObj::close(ObjectType type) {
BIMXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void BIMXObj::m_new(const int nargs) {
g_lingo->printSTUBWithArglist("BIMXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUB(BIMXObj::m_play, 0)
XOBJSTUB(BIMXObj::m_playTo, 0)
XOBJSTUB(BIMXObj::m_video, 0)
XOBJSTUB(BIMXObj::m_stretch, 0)
}

View File

@@ -0,0 +1,50 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_FLC_H
#define DIRECTOR_LINGO_XLIBS_FLC_H
namespace Director {
class BIMXObject : public Object<BIMXObject> {
public:
BIMXObject(ObjectType objType);
};
namespace BIMXObj {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_play(int nargs);
void m_playTo(int nargs);
void m_video(int nargs);
void m_stretch(int nargs);
} // End of namespace BIMXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,110 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "common/system.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/b/blitpict.h"
/**************************************************
*
* USED IN:
* teamxtreme1
* teamxtreme2
*
**************************************************/
/*
-- BlitPict effects factory. 29Jun94 RNB
BlitPict
I mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
S mName --Returns the XObject name (BlitPict)
I mStatus --Returns an integer status code
SI mError, code --Returns an error string
S mLastError --Returns last error string
SSIIIII mInit --Initializer
SOIIII mCopy --Initializes from an existing object
IIIIIOIIIIIIII mDraw --Draws to a destinitation
IIIIIIIIIIII mSparkle --Draws a sparkle from a bitmap
*/
namespace Director {
const char *const BlitPictXObj::xlibName = "BlitPict";
const XlibFileDesc BlitPictXObj::fileNames[] = {
{ "blitpict", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", BlitPictXObj::m_new, 0, 0, 400 },
{ "dispose", BlitPictXObj::m_dispose, 0, 0, 400 },
{ "name", BlitPictXObj::m_name, 0, 0, 400 },
{ "status", BlitPictXObj::m_status, 0, 0, 400 },
{ "error", BlitPictXObj::m_error, 1, 1, 400 },
{ "lastError", BlitPictXObj::m_lastError, 0, 0, 400 },
{ "init", BlitPictXObj::m_init, 6, 6, 400 },
{ "copy", BlitPictXObj::m_copy, 5, 5, 400 },
{ "draw", BlitPictXObj::m_draw, 13, 13, 400 },
{ "sparkle", BlitPictXObj::m_sparkle, 11, 11, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
BlitPictXObject::BlitPictXObject(ObjectType ObjectType) :Object<BlitPictXObject>("BlitPict") {
_objType = ObjectType;
}
void BlitPictXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
BlitPictXObject::initMethods(xlibMethods);
BlitPictXObject *xobj = new BlitPictXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void BlitPictXObj::close(ObjectType type) {
if (type == kXObj) {
BlitPictXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void BlitPictXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("BlitPictXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(BlitPictXObj::m_dispose)
XOBJSTUB(BlitPictXObj::m_name, "")
XOBJSTUB(BlitPictXObj::m_status, 0)
XOBJSTUB(BlitPictXObj::m_error, "")
XOBJSTUB(BlitPictXObj::m_lastError, "")
XOBJSTUB(BlitPictXObj::m_init, "")
XOBJSTUB(BlitPictXObj::m_copy, "")
XOBJSTUB(BlitPictXObj::m_draw, 0)
XOBJSTUB(BlitPictXObj::m_sparkle, 0)
}

View File

@@ -0,0 +1,55 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_BLITPICT_H
#define DIRECTOR_LINGO_XLIBS_BLITPICT_H
namespace Director {
class BlitPictXObject : public Object<BlitPictXObject> {
public:
BlitPictXObject(ObjectType objType);
};
namespace BlitPictXObj {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_dispose(int nargs);
void m_name(int nargs);
void m_status(int nargs);
void m_error(int nargs);
void m_lastError(int nargs);
void m_init(int nargs);
void m_copy(int nargs);
void m_draw(int nargs);
void m_sparkle(int nargs);
} // End of namespace BlitPictXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,103 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "common/system.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/b/blockthedrawingxobj.h"
/**************************************************
*
* USED IN:
* wttf
*
**************************************************/
/*
-- BlockTheDrawingXObj v 1.0d2 (c) 1995 Samizdat Productions.
-- All Rights Reserved.
-- Written by Christopher P. Kelly.
I mNew
IIIII mSetRect
I mInstallPatch
I mRemovePatch
I mDisposeMem
*/
namespace Director {
const char *BlockTheDrawingXObj::xlibName = "BlockTheDrawingXObj";
const XlibFileDesc BlockTheDrawingXObj::fileNames[] = {
{ "BlockTheDrawingXObj", nullptr },
{ nullptr, nullptr },
};
static MethodProto xlibMethods[] = {
{ "new", BlockTheDrawingXObj::m_new, 0, 0, 400 },
{ "setRect", BlockTheDrawingXObj::m_setRect, 4, 4, 400 },
{ "installPatch", BlockTheDrawingXObj::m_installPatch, 0, 0, 400 },
{ "removePatch", BlockTheDrawingXObj::m_removePatch, 0, 0, 400 },
{ "disposeMem", BlockTheDrawingXObj::m_disposeMem, 0, 0, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
static BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
BlockTheDrawingXObject::BlockTheDrawingXObject(ObjectType ObjectType) :Object<BlockTheDrawingXObject>("BlockTheDrawingXObj") {
_objType = ObjectType;
}
void BlockTheDrawingXObj::open(ObjectType type, const Common::Path &path) {
BlockTheDrawingXObject::initMethods(xlibMethods);
BlockTheDrawingXObject *xobj = new BlockTheDrawingXObject(type);
if (type == kXtraObj) {
g_lingo->_openXtras.push_back(xlibName);
g_lingo->_openXtraObjects.push_back(xobj);
}
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void BlockTheDrawingXObj::close(ObjectType type) {
BlockTheDrawingXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void BlockTheDrawingXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("BlockTheDrawingXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUB(BlockTheDrawingXObj::m_setRect, 0)
XOBJSTUB(BlockTheDrawingXObj::m_installPatch, 0)
XOBJSTUB(BlockTheDrawingXObj::m_removePatch, 0)
XOBJSTUB(BlockTheDrawingXObj::m_disposeMem, 0)
}

View File

@@ -0,0 +1,50 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_B_BLOCKTHEDRAWINGXOBJ_H
#define DIRECTOR_LINGO_XLIBS_B_BLOCKTHEDRAWINGXOBJ_H
namespace Director {
class BlockTheDrawingXObject : public Object<BlockTheDrawingXObject> {
public:
BlockTheDrawingXObject(ObjectType objType);
};
namespace BlockTheDrawingXObj {
extern const char *xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_setRect(int nargs);
void m_installPatch(int nargs);
void m_removePatch(int nargs);
void m_disposeMem(int nargs);
} // End of namespace BlockTheDrawingXObj
} // End of namespace Director
#endif