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,120 @@
/* 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:
* Gahan Wilson's Ultimate Haunted House
*
*************************************/
/*
* -- copyright 1994 by Byron Priess Multimedia, authored by MayoSmith and Lee
* aiff
* I mNew --Read Docs to avoid Hard Drive failure
* X mDispose --Disposes of XObject instance
* S mName --Returns the XObject name (Widget)
* I mStatus --Returns an integer status code
* SI mError, code --Returns an error string
* S mLastError --Returns last error string
* III mAdd, arg1, arg2 --Returns arg1+arg2
* SSI mFirst, str, nchars --Return the first nchars of string str
* V mMul, f1, f2 --Returns f1*f2 as floating point
* X mGlobals --Sample code to Read & Modify globals
* X mSymbols --Sample code to work with Symbols
* X mSendPerform --Sample code to show SendPerform call
* X mFactory --Sample code to find Factory objects
* IS mDuration, str --Read Docs to avoid Hard Drive failure
*/
#include "common/macresman.h"
#include "audio/decoders/aiff.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/a/aiff.h"
namespace Director {
const char *const AiffXObj::xlibName = "aiff";
const XlibFileDesc AiffXObj::fileNames[] = {
{ "AIFF", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", AiffXObj::m_new, 0, 0, 400 }, // D4
{ "Duration", AiffXObj::m_duration, 1, 1, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void AiffXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
AiffXObject::initMethods(xlibMethods);
AiffXObject *xobj = new AiffXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void AiffXObj::close(ObjectType type) {
if (type == kXObj) {
AiffXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
AiffXObject::AiffXObject(ObjectType ObjectType) :Object<AiffXObject>("Aiff") {
_objType = ObjectType;
}
void AiffXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("AiffXObj::new", nargs);
g_lingo->push(g_lingo->_state->me);
}
void AiffXObj::m_duration(int nargs) {
Common::String filePath = g_lingo->pop().asString();
Common::SeekableReadStream *aiffStream = Common::MacResManager::openFileOrDataFork(findPath(filePath));
if (!aiffStream) {
warning("AiffXObj::m_duration: Failed to open %s", filePath.c_str());
g_lingo->push(0);
return;
}
Audio::AIFFHeader *aiffHeader = Audio::AIFFHeader::readAIFFHeader(aiffStream, DisposeAfterUse::NO);
if (!aiffHeader) {
warning("AiffXObj::m_duration: No AIFF header found for %s", filePath.c_str());
g_lingo->push(0);
delete aiffStream;
return;
}
int duration = (aiffHeader->getFrameCount() / (float)aiffHeader->getFrameRate()) * 60;
delete aiffHeader;
delete aiffStream;
g_lingo->push(Datum(duration));
}
} // 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_AIFF_H
#define DIRECTOR_LINGO_XLIBS_AIFF_H
namespace Director {
class AiffXObject : public Object<AiffXObject> {
public:
AiffXObject(ObjectType objType);
};
namespace AiffXObj {
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_duration(int nargs);
} // End of namespace AiffXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,321 @@
/* 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:
* Classical Cats
* The Daedalus Encounter
* Refixion II
*
*************************************/
/*
-! Category compactDisc
* -! Title AppleCD SC
* -! Protocol Ortho-Play 1.6.1
* --© 1990,1991 MacroMind, Inc. Alan McNeil
* ------------------------------------------------------
* --AppleCD SC, version 2.5.6
* --Mar 7 1994
* --including AppleCD SC Plus volume control
* ------------------------------------------------------
* X mNew
* X mDispose
* --
* I mGetMaxNodes
* SI mGetNodeTitle NodeNum
* II mSelectNode NodeNum
* --
* I mService
* I mGetValue
* I mCancel
* S mExplain
* I mIdle
* --
* X mReadStatus
* X mReadPos
* XI mSearchTo position
* X mPlay
* X mStill
* X mStop
* X mScanForward
* X mScanReverse
* X mEject
* --
* I mGetFirstTrack
* I mGetLastTrack
* II mGetFirstFrame tracknum
* II mGetLastFrame tracknum
* I mGetTrack
* XII mAudioEnable number number
* I mGetFrameResolution
* --
* II mSetInPoint frame
* II mSetOutPoint frame
* II mSetDuration frames
* --
* X mPlayCue
* X mPlaySegment
* --
* S mTitle
* SI mTrackName tracknum
* IS mSetTitle string
* IIS mSetTrackName tracknum string
* II mGetTrackType tracknum
* III mSetVolume leftVolume rightVolume
* II mGetVolume leftFlag
* --
*/
#include "backends/audiocd/audiocd.h"
#include "common/file.h"
#include "common/formats/cue.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/a/applecdxobj.h"
namespace Director {
const char *const AppleCDXObj::xlibName = "AppleCD";
const XlibFileDesc AppleCDXObj::fileNames[] = {
{ "AppleCD", nullptr },
{ "AppleCD XObj", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", AppleCDXObj::m_new, 0, 0, 300 }, // D3
{ "dispose", AppleCDXObj::m_dispose, 0, 0, 300 }, // D3
{ "Service", AppleCDXObj::m_service, 0, 0, 300 }, // D4
{ "Still", AppleCDXObj::m_still, 0, 0, 300 }, // D3
{ "ReadStatus", AppleCDXObj::m_readStatus, 0, 0, 300 }, // D3
{ "GetValue", AppleCDXObj::m_getValue, 0, 0, 300 }, // D3
{ "Eject", AppleCDXObj::m_eject, 0, 0, 300 }, // D3
{ "GetFirstTrack", AppleCDXObj::m_getFirstTrack, 0, 0, 300 }, // D3
{ "GetLastTrack", AppleCDXObj::m_getLastTrack, 0, 0, 300 }, // D3
{ "GetFirstFrame", AppleCDXObj::m_getFirstFrame, 1, 1, 300 }, // D3
{ "GetLastFrame", AppleCDXObj::m_getLastFrame, 1, 1, 300 }, // D3
{ "SetInPoint", AppleCDXObj::m_setInPoint, 1, 1, 300 }, // D3
{ "SetOutPoint", AppleCDXObj::m_setOutPoint, 1, 1, 300 }, // D3
{ "PlayCue", AppleCDXObj::m_playCue, 0, 0, 300 }, // D3
{ "PlaySegment", AppleCDXObj::m_playSegment, 0, 0, 300 }, // D3
{ "ReadPos", AppleCDXObj::m_readPos, 0, 0, 300 }, // D3
{ nullptr, nullptr, 0, 0, 0 }
};
void AppleCDXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
AppleCDXObject::initMethods(xlibMethods);
AppleCDXObject *xobj = new AppleCDXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void AppleCDXObj::close(ObjectType type) {
if (type == kXObj) {
AppleCDXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
AppleCDXObject::AppleCDXObject(ObjectType ObjectType) :Object<AppleCDXObject>("AppleCD") {
_objType = ObjectType;
_inpoint = 0;
_outpoint = 0;
Common::File cuefile;
if (cuefile.open("disc.cue")) {
Common::String cuestring = cuefile.readString(0, cuefile.size());
_cue = Common::SharedPtr<Common::CueSheet>(new Common::CueSheet(cuestring.c_str()));
}
}
void AppleCDXObj::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
void AppleCDXObj::m_dispose(int nargs) {
g_director->_system->getAudioCDManager()->stop();
}
void AppleCDXObj::m_still(int nargs) {
g_director->_system->getAudioCDManager()->stop();
}
// Not implemented yet; needs to be able to return appropriate values
// for playing/paused.
void AppleCDXObj::m_service(int nargs) {
g_lingo->push(Datum(0));
}
void AppleCDXObj::m_readStatus(int nargs) {
}
void AppleCDXObj::m_getValue(int nargs) {
AppleCDXObject *me = static_cast<AppleCDXObject *>(g_lingo->_state->me.u.obj);
g_lingo->push(Datum(me->_returnValue));
}
void AppleCDXObj::m_setInPoint(int nargs) {
AppleCDXObject *me = static_cast<AppleCDXObject *>(g_lingo->_state->me.u.obj);
int inpoint = g_lingo->pop().asInt();
debug(5, "AppleCDXObj::setInPoint: %i", inpoint);
me->_inpoint = inpoint;
}
void AppleCDXObj::m_setOutPoint(int nargs) {
AppleCDXObject *me = static_cast<AppleCDXObject *>(g_lingo->_state->me.u.obj);
int outpoint = g_lingo->pop().asInt();
debug(5, "AppleCDXObj::setOutPoint: %i", outpoint);
me->_outpoint = outpoint;
}
void AppleCDXObj::m_playCue(int nargs) {
// Essentially a noop for us; this asks the drive to seek to that point,
// then poll until it does. We don't have seek times, so we'll
// simply noop.
}
void AppleCDXObj::m_playSegment(int nargs) {
// Performs playback at the pre-specified absolute point on the disc,
// using the values from setInPoint and setOutPoint
AppleCDXObject *me = static_cast<AppleCDXObject *>(g_lingo->_state->me.u.obj);
g_director->_system->getAudioCDManager()->playAbsolute(me->_inpoint, -1, 0, 0);
}
void AppleCDXObj::m_readPos(int nargs) {
AppleCDXObject *me = static_cast<AppleCDXObject *>(g_lingo->_state->me.u.obj);
AudioCDManager::Status status = g_director->_system->getAudioCDManager()->getStatus();
if (me->_cue) {
// ScummVM currently doesn't support specifying the exact frame, so we pretend we're at the first frame of the song
Common::CueSheet::CueTrack *track = me->_cue->getTrack(status.track);
if (track != nullptr) {
me->_returnValue = track->indices[0];
}
}
}
void AppleCDXObj::m_getFirstTrack(int nargs) {
AppleCDXObject *me = static_cast<AppleCDXObject *>(g_lingo->_state->me.u.obj);
if (me->_cue) {
Common::Array<Common::CueSheet::CueTrack> tracks = me->_cue->tracks();
// If we have a set of tracks parsed, return the first track's number
int index;
if (tracks.size() >= 1) {
index = tracks[0].number;
} else {
index = 1;
}
debug(5, "AppleCDXObj::m_getFirstTrack: returning %i", index);
g_lingo->push(Datum(index));
} else {
// If we don't have a TOC, just assume the first track is 1
debug(5, "AppleCDXObj::m_getFirstTrack: returning default");
g_lingo->push(Datum(1));
}
}
void AppleCDXObj::m_getLastTrack(int nargs) {
AppleCDXObject *me = static_cast<AppleCDXObject *>(g_lingo->_state->me.u.obj);
if (me->_cue) {
Common::Array<Common::CueSheet::CueTrack> tracks = me->_cue->tracks();
// If we have a set of tracks parsed, return the final track's number
int index;
if (tracks.size() >= 1) {
index = tracks.back().number;
} else {
index = 1;
}
debug(5, "AppleCDXObj::m_getLastTrack: returning %i", index);
} else {
// If we don't have a TOC, just assume the last track is 1
debug(5, "AppleCDXObj::m_getLastTrack: returning default");
g_lingo->push(Datum(1));
}
}
void AppleCDXObj::m_getFirstFrame(int nargs) {
AppleCDXObject *me = static_cast<AppleCDXObject *>(g_lingo->_state->me.u.obj);
int trackNum = g_lingo->pop().asInt();
if (me->_cue) {
Common::CueSheet::CueTrack *track = me->_cue->getTrack(trackNum);
// We use index 1 here because index 0 is typically the
// pregap, and we don't want to describe the first sector of the
// pregap as being the first sector of the track. Most discs
// will have only two indices, and the second index is where the
// actual track begins.
int index = track->indices.size() > 1 ? track->indices[1] : track->indices[0];
debug(5, "AppleCDXObj::m_getFirstFrame(%i): returning %i", trackNum, index);
g_lingo->push(Datum(index));
} else {
// If we don't have a TOC, just provide a stub value
debug(5, "AppleCDXObj::m_getFirstFrame(%i): returning default", trackNum);
g_lingo->push(Datum(0));
}
}
// Currently calculated based on the start of the next track, since
// cuesheets don't contain the duration of a song.
void AppleCDXObj::m_getLastFrame(int nargs) {
AppleCDXObject *me = static_cast<AppleCDXObject *>(g_lingo->_state->me.u.obj);
int trackNum = g_lingo->pop().asInt();
if (me->_cue) {
// We look for the pregap of the next track, if there is one.
// TODO opening the actual audio track and getting its length
// in sectors would produce a more accurate result for the final track
Common::CueSheet::CueTrack *track = me->_cue->getTrack(trackNum + 1);
int index;
if (track) {
// Don't use the pregap if there is no pregap
index = track->indices[0] == -1 ? track->indices[1] : track->indices[0];
} else {
debug(5, "AppleCDXObj::m_getLastFrame(%i): no track at trackNum %i, setting index to 0", trackNum, trackNum + 1);
index = 0;
}
debug(5, "AppleCDXObj::m_getLastFrame(%i): returning %i", trackNum, index);
g_lingo->push(Datum(index));
} else {
// If we don't have a TOC, just provide a stub value
debug(5, "AppleCDXObj::m_getLastFrame(%i): returning default", trackNum);
g_lingo->push(Datum(0));
}
}
void AppleCDXObj::m_eject(int nargs) {
debug(5, "AppleCDXObj::eject: Ejecting CD");
}
} // End of namespace Director

View File

@@ -0,0 +1,74 @@
/* 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_APPLECDXOBJ_H
#define DIRECTOR_LINGO_XLIBS_APPLECDXOBJ_H
#include "common/ptr.h"
namespace Common {
class CueSheet;
}
namespace Director {
class AppleCDXObject : public Object<AppleCDXObject> {
public:
AppleCDXObject(ObjectType objType);
int _inpoint;
int _outpoint;
// Instead of immediately returning values, methods which return
// a value store it internally and return it via a subsequent
// call to mGetValue.
int _returnValue;
Common::SharedPtr<Common::CueSheet> _cue;
};
namespace AppleCDXObj {
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_still(int nargs);
void m_service(int nargs);
void m_readStatus(int nargs);
void m_getValue(int nargs);
void m_setInPoint(int nargs);
void m_setOutPoint(int nargs);
void m_playCue(int nargs);
void m_playSegment(int nargs);
void m_readPos(int nargs);
void m_getFirstTrack(int nargs);
void m_getLastTrack(int nargs);
void m_getFirstFrame(int nargs);
void m_getLastFrame(int nargs);
void m_eject(int nargs);
} // End of namespace AppleCDXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,140 @@
/* 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/types.h"
#include "gui/message.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/a/askuser.h"
namespace Director {
/**************************************************
*
* USED IN:
* DEVO Presents: Adventures of the Smart Patrol
*
**************************************************/
/*
* -- AskUser XObject. Copyright 1996 Inscape v1.0 24May96 BDL
* AskUser
* I mNew --Creates a new instance
* X mDispose --Disposes XObject instance
* SSSS mAsk --Data to display in the message box.
*/
const char *const AskUser::xlibName = "AskUser";
const XlibFileDesc AskUser::fileNames[] = {
{ "AskUser", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", AskUser::m_new, 0, 0, 400 }, // D4
{ "ask", AskUser::m_ask, 3, 3, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
AskUserXObject::AskUserXObject(ObjectType ObjectType) :Object<AskUserXObject>("AskUser") {
_objType = ObjectType;
}
void AskUser::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
AskUserXObject::initMethods(xlibMethods);
AskUserXObject *xobj = new AskUserXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void AskUser::close(ObjectType type) {
if (type == kXObj) {
AskUserXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void AskUser::m_new(int nargs) {
g_lingo->printSTUBWithArglist("AskUser::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
void AskUser::m_ask(int nargs) {
if (nargs != 3) {
warning("AskUser::m_ask: expected 3 arguments");
g_lingo->dropStack(nargs);
g_lingo->push(Datum("Ok"));
return;
}
Datum text = g_lingo->pop();
Datum caption = g_lingo->pop(); // ScummVM doesn't have a title for message boxes, not used
Datum mbType = g_lingo->pop();
if (text.type != STRING) {
warning("AskUser::m_ask: expected text to be a string, not %s", text.type2str());
g_lingo->push(Datum("Ok"));
return;
}
if (mbType.type != STRING) {
warning("AskUser::m_ask: expected mbType to be a string, not %s", mbType.type2str());
g_lingo->push(Datum("Ok"));
return;
}
Common::U32String defaultButton;
Common::U32StringArray altButtons;
if (mbType.u.s->equals("YesNoCancel")) {
defaultButton = Common::U32String("Yes");
altButtons.push_back(Common::U32String("No"));
altButtons.push_back(Common::U32String("Cancel"));
} else if (mbType.u.s->equals("YesNo")) {
defaultButton = Common::U32String("Yes");
altButtons.push_back(Common::U32String("No"));
} else if (mbType.u.s->equals("OkCancel")) {
defaultButton = Common::U32String("OK");
altButtons.push_back(Common::U32String("Cancel"));
} else if (mbType.u.s->equals("Ok")) {
defaultButton = Common::U32String("OK");
} else {
warning("AskUser::m_ask: unhandled mbType %s, falling back to Ok", mbType.u.s->c_str());
defaultButton = Common::U32String("OK");
}
g_director->_wm->clearHandlingWidgets();
GUI::MessageDialog dialog(Common::U32String(text.u.s->c_str()), defaultButton, altButtons);
int result = dialog.runModal();
if (result == GUI::kMessageOK) {
g_lingo->push(Datum(Common::String(defaultButton)));
} else if ((result >= GUI::kMessageAlt) && (result < GUI::kMessageAlt + (int)altButtons.size())) {
g_lingo->push(Datum(Common::String(altButtons[result - GUI::kMessageAlt])));
} else {
warning("AskUser::m_ask: got unexpected dialog result of %d", result);
g_lingo->push(Datum("Ok"));
}
}
}

View File

@@ -0,0 +1,48 @@
/* 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_ASKUSER_H
#define DIRECTOR_LINGO_XLIBS_ASKUSER_H
namespace Director {
class AskUserXObject : public Object<AskUserXObject> {
public:
AskUserXObject(ObjectType objType);
};
namespace AskUser {
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_ask(int nargs);
} // End of namespace AskUser
} // End of namespace Director
#endif

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

View File

@@ -0,0 +1,491 @@
/* 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:
* The Apartment 2.0
* Cellofania
*
*************************************/
/*
* --AppleAudioCD, CDAudio, 1.0, 4/3/90
* --
* --© 1989, 1990 MacroMind, Inc.
* -- by Jeff Tanner
* --
* ------------------------------------------------------
* ------------------------------------------------------
* -- An Apple CD SC Player must be mounted
* -- in order for this XObject to operate properly.
* -- The easiest way to check for mounting is to
* -- check the desktop for the CD icon.
* ------------------------------------------------------
* ------------------------------------------------------
* -- This XObject recognizes only the first player in the SCSI chain .
* ------------------------------------------------------
* ------------------------------------------------------
* --=METHODS=--
* X mNew --Creates a new instance of the XObject.
* X mDispose --Disposes of the instance.
* S mName --Returns name of the XObject.
* ------------------------------------------------------
* ------------------------------------------------------
* -- PLAY CD METHODS:
* S mPlay --Plays current track from the beginning.
* SI mPlayTrack, trackNum --Plays the specified track from the beginning.
* SS mPlayName, trackName --Plays by track name.
* -- Note: The full pathname is unnecessary.
* -- The track names for tracks 1 - 9 are
* -- "TRACK<space><space>trackNum" and for tracks 10 to 99 are
* -- "TRACK<space>trackNum".
* SIII mPlayAbsTime, minute, second, frame --Starts play at absolute time position on current CD-ROM.
* --
* SIIIIII mPlaySegment, startMin, startSec, startFrm, stopMin, stopSec, stopFrm
* -- < startMin, startSec, startFrm > - Start time
* -- < stopMin, stopSec, stopFrm > - Stop time
* SII mAskPlay, leftDialog, topDialog --With a file dialog box,
* -- selects an Audio track to play.
* -- < leftDialog, topDialog > - Where to place the file dialog box
* ------------------------------------------------------
* S mStepFwd --Steps forward one track and Plays.
* S mStepBwd --Steps back one track and Plays.
* --
* S mPause --Pauses the player.
* -- When this method is called a second time,
* -- the player will continue in normal play mode.
* S mContinue --Continues the mode prior to calling mPause.
* --
* S mStop --Stops play.
* SI mStopTrack, trackNum --Stops when the selected track finishes playing.
* SIII mStopAbsTime, minute, second, frame --Stops play at a specified absolute time position.
* S mRemoveStop -- Removes stop conditions.
* -- Stop conditions are set with these methods:
* -- mPlaySegment
* -- mStopTrack
* -- mStopAbsTime
* --
* S mEject --Ejects CD-ROM from drive.
* --
* ------------------------------------------------------
* ------------------------------------------------------
* -- STATUS METHODS:
* S mStatus --Returns status of Audio CD player.
* -- Returns message strings:
* -- Audio play in progress
* -- Audio pause in operation
* -- Audio muting on
* -- Audio play operation completed
* -- Error occurred during audio play
* -- Not currently playing
* --
* S mPlayMode --Returns a play mode from audio track.
* -- The play mode describes how to play the audio track.
* -- Returns message strings:
* -- Muting on (no audio)
* -- Right channel through right channel only
* -- Left channel through right channel only
* -- Left and right channels through right channel only
* -- Right channel through left channel only
* -- Right channel through left and right channel
* -- Right channel through left channel,
* -- Left channel through right channel
* -- Right channel through left channel,
* -- Left and right channels through right channel
* -- Left channel through left channel only
* -- Left channel through left channel,
* -- Right channel through right channel (Stereo)
* -- Left channel through left and right channel
* -- Left channel through left channel,
* -- Left and right channels through right channel
* -- Left and right channels through left channel only
* -- Left and right channels through left channel,
* -- Right channel through right channel
* -- Left and right channels through left channel,
* -- Left channel through right channel
* -- Left and right channels through
* -- both left channel and right channel (Mono)
* --
* S mCurrentFormat --Returns the format of the current track.
* -- Returns message strings:
* -- 2 audio channels without preemphasis
* -- 2 audio channels with preemphasis
* -- 4 audio channels without preemphasis
* -- 4 audio channels with preemphasis
* -- Data track
* --
* ------------------------------------------------------
* ------------------------------------------------------
* --
* I mCurrentTrack --Returns number of the current track.
* S mCurrentTime --Returns the current absolute time (min:sec:frm).
* --
* I mFirstTrack -- Returns first track number on current CD-ROM.
* I mLastTrack -- Returns last track number on current CD-ROM.
* S mTotalTime -- Returns total time on current CD-ROM (min:sec:frm)
* ------------------------------------------------------
* ------------------------------------------------------
* -- SCANNING METHODS:
* -- Starting at a specific time:
* -- min, sec, and frm parameters are to indicate
* -- the absolute time to start scan.
* -- monitorP - if true, it will stop scan moment mouse
* -- is released, and continue playing at current position.
* -- However, this will inhibit all other events.
* -- Otherwise use mStopScan method.
* SIIII mScanFwd min, sec, frm, monitorP -- Fast forward scan
* SIIII mScanBwd min, sec, frm, monitorP -- Fast reverse scan
* --
* S mStopScan --Stops scan and continues playing at current position.
* --
* -- End description of AppleAudioCD XObject methods.
* ------------------------------------------------------
* ------------------------------------------------------
*/
#include "backends/audiocd/audiocd.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/c/cdromxobj.h"
namespace Director {
const char *const CDROMXObj::xlibName = "AppleAudioCD";
const XlibFileDesc CDROMXObj::fileNames[] = {
{ "CD-ROM XObj", nullptr },
{ "AppleAudioCD", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", CDROMXObj::m_new, 0, 0, 200 }, // D2
{ "Name", CDROMXObj::m_name, 0, 0, 200 }, // D2
{ "Play", CDROMXObj::m_play, 0, 0, 200 }, // D2
{ "PlayTrack", CDROMXObj::m_playTrack, 1, 1, 200 }, // D2
{ "PlayName", CDROMXObj::m_playName, 1, 1, 200 }, // D2
{ "PlayAbsTime", CDROMXObj::m_playAbsTime, 3, 3, 200 }, // D2
{ "PlaySegment", CDROMXObj::m_playSegment, 6, 6, 200 }, // D2
{ "AskPlay", CDROMXObj::m_askPlay, 2, 2, 200 }, // D2
{ "StepFwd", CDROMXObj::m_stepFwd, 0, 0, 200 }, // D2
{ "StepBwd", CDROMXObj::m_stepBwd, 0, 0, 200 }, // D2
{ "Pause", CDROMXObj::m_pause, 0, 0, 200 }, // D2
{ "Continue", CDROMXObj::m_continue, 0, 0, 200 }, // D2
{ "Stop", CDROMXObj::m_stop, 0, 0, 200 }, // D2
{ "StopTrack", CDROMXObj::m_stopTrack, 1, 1, 200 }, // D2
{ "StopAbsTime", CDROMXObj::m_stopAbsTime, 3, 3, 200 }, // D2
{ "RemoveStop", CDROMXObj::m_removeStop, 0, 0, 200 }, // D2
{ "Eject", CDROMXObj::m_eject, 0, 0, 200 }, // D2
{ "Status", CDROMXObj::m_status, 0, 0, 200 }, // D2
{ "PlayMode", CDROMXObj::m_playMode, 0, 0, 200 }, // D2
{ "CurrentFormat", CDROMXObj::m_currentFormat, 0, 0, 200 }, // D2
{ "CurrentTrack", CDROMXObj::m_currentTrack, 0, 0, 200 }, // D2
{ "CurrentTime", CDROMXObj::m_currentTime, 0, 0, 200 }, // D2
{ "FirstTrack", CDROMXObj::m_firstTrack, 0, 0, 200 }, // D2
{ "LastTrack", CDROMXObj::m_lastTrack, 0, 0, 200 }, // D2
{ "TotalTime", CDROMXObj::m_totalTime, 0, 0, 200 }, // D2
{ "ScanFwd", CDROMXObj::m_scanFwd, 4, 4, 200 }, // D2
{ "ScanBwd", CDROMXObj::m_scanBwd, 4, 4, 200 }, // D2
{ "StopScan", CDROMXObj::m_stopScan, 0, 0, 200 }, // D2
{ nullptr, nullptr, 0, 0, 0 }
};
void CDROMXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
CDROMXObject::initMethods(xlibMethods);
CDROMXObject *xobj = new CDROMXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void CDROMXObj::close(ObjectType type) {
if (type == kXObj) {
CDROMXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
g_director->_system->getAudioCDManager()->close();
}
}
CDROMXObject::CDROMXObject(ObjectType ObjectType) :Object<CDROMXObject>("AppleAudioCD") {
_objType = ObjectType;
// Initialize _cdda_status
_cdda_status.playing = false;
_cdda_status.track = 0;
_cdda_status.start = 0;
_cdda_status.duration = 0;
_cdda_status.numLoops = 0;
_cdda_status.volume = Audio::Mixer::kMaxChannelVolume;
_cdda_status.balance = 0;
}
void CDROMXObj::m_new(int nargs) {
g_director->_system->getAudioCDManager()->open();
g_lingo->printSTUBWithArglist("CDROMXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
// Returns the name of the XObj
void CDROMXObj::m_name(int nargs) {
g_lingo->push(Datum("AppleAudioCD"));
}
void CDROMXObj::m_play(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
// This is a request to play the current track from the start,
// which we can't do if there's no track information.
if (me->_cdda_status.track == 0)
return;
g_director->_system->getAudioCDManager()->play(me->_cdda_status.track, -1, 0, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_playTrack(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
int track = g_lingo->pop().asInt();
g_director->_system->getAudioCDManager()->play(track - 1, -1, 0, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
// Name format is "TRACK NN", with one-digit tracks padded with a leading space
void CDROMXObj::m_playName(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
Common::String track = g_lingo->pop().asString();
if (track.size() < 8) {
warning("CDROMXObj::m_playName: specified name has an invalid format (provided string was %s)", track.c_str());
return;
}
Common::String trackNum = track.substr(6, 2);
// Remove the leading string as needed
if (trackNum.substr(0, 1) == " ")
trackNum = trackNum.substr(1, 1);
int trackNumI = atoi(trackNum.c_str());
if (trackNumI < 1) {
warning("CDROMXObj::m_playName: track number failed to parse (provided string was %s)", track.c_str());
}
g_director->_system->getAudioCDManager()->play(trackNumI - 1, -1, 0, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_playAbsTime(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
Datum min = g_lingo->pop();
Datum sec = g_lingo->pop();
Datum frac = g_lingo->pop();
int startFrame = (min.asInt() * 60 * 75) + (sec.asInt() * 75) + frac.asInt();
debug(5, "CDROMXObj::m_playAbsTime: playing at frame %i", startFrame);
g_director->_system->getAudioCDManager()->playAbsolute(startFrame, -1, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
g_lingo->push(Datum());
}
void CDROMXObj::m_playSegment(int nargs) {
Datum startMin = g_lingo->pop();
Datum startSec = g_lingo->pop();
Datum startFrac = g_lingo->pop();
Datum endMin = g_lingo->pop();
Datum endSec = g_lingo->pop();
Datum endFrac = g_lingo->pop();
// Can't implement this without implementing a full CD TOC, since
// it doesn't interact with songs at the "track" level.
debug(5, "STUB: CDROMXObj::m_playSegment Request to play starting at %i:%i.%i and ending at %i:%i.%i", startMin.asInt(), startSec.asInt(), startFrac.asInt(), endMin.asInt(), endSec.asInt(), endFrac.asInt());
g_lingo->push(Datum());
}
XOBJSTUBV(CDROMXObj::m_askPlay)
void CDROMXObj::m_stepFwd(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
g_director->_system->getAudioCDManager()->play(me->_cdda_status.track + 1, -1, 0, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_stepBwd(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
int track = me->_cdda_status.track - 1;
if (track < 1)
track = 1;
g_director->_system->getAudioCDManager()->play(track, -1, 0, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_pause(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
// Leaves a trace of the current position so we can resume from it
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
me->_cdda_status.playing = false;
g_director->_system->getAudioCDManager()->stop();
}
void CDROMXObj::m_continue(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
// Can only resume if there's data to resume from
if (me->_cdda_status.track == 0)
return;
g_director->_system->getAudioCDManager()->play(me->_cdda_status.track, -1, me->_cdda_status.start, 0);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_stop(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
g_director->_system->getAudioCDManager()->stop();
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_stopTrack(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
Datum track = g_lingo->pop();
AudioCDManager::Status status = g_director->_system->getAudioCDManager()->getStatus();
if (!status.playing)
return;
// stopTrack isn't "stop now", but "stop after this track".
// This play command ensures we continue from here and end with this
// track, regardless of previous commands.
g_director->_system->getAudioCDManager()->play(status.track, 1, status.start, status.start + status.duration);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_stopAbsTime(int nargs) {
Datum min = g_lingo->pop();
Datum sec = g_lingo->pop();
Datum frac = g_lingo->pop();
// Can't implement this without implementing a full CD TOC, since
// it doesn't interact with songs at the "track" level.
debug(5, "STUB: CDROMXObj::m_stopAbsTime Request to play starting at %i:%i.%i", min.asInt(), sec.asInt(), frac.asInt());
g_lingo->dropStack(nargs);
g_lingo->push(Datum());
}
void CDROMXObj::m_removeStop(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
Datum track = g_lingo->pop();
AudioCDManager::Status status = g_director->_system->getAudioCDManager()->getStatus();
if (!status.playing)
return;
g_director->_system->getAudioCDManager()->play(status.track, -1, status.start, status.start + status.duration);
me->_cdda_status = g_director->_system->getAudioCDManager()->getStatus();
}
void CDROMXObj::m_eject(int nargs) {
warning("If you had had a CD drive, it would have ejected just now.");
}
// Valid strings are:
// "Audio play in progress"
// "Audio pause in operation"
// "Audio muting on"
// "Audio play operation completed"
// "Error occurred during audio play"
// "Not currently playing"
void CDROMXObj::m_status(int nargs) {
// A fuller implementation could also track data to return the
// "pause" and "completed" states.
if (g_director->_system->getAudioCDManager()->isPlaying())
g_lingo->push(Datum("Audio play in progress"));
else
g_lingo->push(Datum("Not currently playing"));
}
// Valid strings are:
// "Muting on (no audio)"
// "Right channel through right channel only"
// "Left channel through right channel only"
// "Left and right channels through right channel only"
// "Right channel through left channel only"
// "Right channel through left and right channel"
// "Right channel through left channel"
// "Left channel through right channel"
// "Right channel through left channel"
// "Left and right channels through right channel"
// "Left channel through left channel only"
// "Left channel through left channel"
// "Right channel through right channel (Stereo)"
// "Left channel through left and right channel"
// "Left channel through left channel"
// "Left and right channels through right channel"
// "Left and right channels through left channel only"
// "Left and right channels through left channel"
// "Left and right channels through left channel"
// "Right channel through right channel"
// "Left and right channels through left channel"
// "Left channel through right channel"
// "Left and right channels through"
// "both left channel and right channel (Mono)"
void CDROMXObj::m_playMode(int nargs) {
// For now, nothing to change modes is implemented, so just return
// a default
g_lingo->push(Datum("Right channel through right channel (Stereo)"));
}
// Valid strings are:
// "audio channels without preemphasis"
// "audio channels with preemphasis"
void CDROMXObj::m_currentFormat(int nargs) {
// Preemphasis not implemented, so just return this
g_lingo->push(Datum("audio channels without preemphasis"));
}
void CDROMXObj::m_currentTrack(int nargs) {
CDROMXObject *me = static_cast<CDROMXObject *>(g_lingo->_state->me.u.obj);
g_lingo->push(Datum(me->_cdda_status.track));
}
XOBJSTUBV(CDROMXObj::m_currentTime)
// The next few methods depend on full TOC implementation, so they
// can't be implemented right now.
XOBJSTUBV(CDROMXObj::m_firstTrack)
XOBJSTUBV(CDROMXObj::m_lastTrack)
XOBJSTUBV(CDROMXObj::m_totalTime)
// The scan methods depend on absolute timing, so they also require
// a full TOC.
XOBJSTUBV(CDROMXObj::m_scanFwd)
XOBJSTUBV(CDROMXObj::m_scanBwd)
XOBJSTUBV(CDROMXObj::m_stopScan)
} // 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_CDROMXOBJ_H
#define DIRECTOR_LINGO_XLIBS_CDROMXOBJ_H
#include "backends/audiocd/audiocd.h"
namespace Director {
class CDROMXObject : public Object<CDROMXObject> {
public:
CDROMXObject(ObjectType objType);
AudioCDManager::Status _cdda_status;
};
namespace CDROMXObj {
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_name(int nargs);
void m_play(int nargs);
void m_playTrack(int nargs);
void m_playName(int nargs);
void m_playAbsTime(int nargs);
void m_playSegment(int nargs);
void m_askPlay(int nargs);
void m_stepFwd(int nargs);
void m_stepBwd(int nargs);
void m_pause(int nargs);
void m_continue(int nargs);
void m_stop(int nargs);
void m_stopTrack(int nargs);
void m_stopAbsTime(int nargs);
void m_removeStop(int nargs);
void m_eject(int nargs);
void m_status(int nargs);
void m_playMode(int nargs);
void m_currentFormat(int nargs);
void m_currentTrack(int nargs);
void m_currentTime(int nargs);
void m_firstTrack(int nargs);
void m_lastTrack(int nargs);
void m_totalTime(int nargs);
void m_scanFwd(int nargs);
void m_scanBwd(int nargs);
void m_stopScan(int nargs);
} // End of namespace CDROMXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,60 @@
/* 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/c/closebleedwindowxcmd.h"
/**************************************************
*
* USED IN:
* the7colors
*
**************************************************/
namespace Director {
const char *const CloseBleedWindowXCMD::xlibName = "CloseBleedWindow";
const XlibFileDesc CloseBleedWindowXCMD::fileNames[] = {
{ "CloseBleedWindow", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "CloseBleedWindow", CloseBleedWindowXCMD::m_CloseBleedWindow, -1, 0, 300, CBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void CloseBleedWindowXCMD::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void CloseBleedWindowXCMD::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
XOBJSTUB(CloseBleedWindowXCMD::m_CloseBleedWindow, 0)
}

View File

@@ -0,0 +1,41 @@
/* 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_CLOSEBLEEDWINDOWXCMD_H
#define DIRECTOR_LINGO_XLIBS_CLOSEBLEEDWINDOWXCMD_H
namespace Director {
namespace CloseBleedWindowXCMD {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_CloseBleedWindow(int nargs);
} // End of namespace CloseBleedWindowXCMD
} // 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/>.
*
*/
#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/c/colorcursorxobj.h"
/**************************************************
*
* USED IN:
* Jewels of the Oracle - Mac
*
**************************************************/
/*
-- ColorCursor, and X-Object for using color cursor resources
-- by Chris Perkins 1993. (CPerkins@aol.com)
I mNew
XI mGetSetCursor, crsrID -- crsrID is the resource ID number of a 'crsr' type resource
X mReleaseCursor -- CALL THIS BEFORE DISPOSING OBJECT or using the lingo <cursor> routine
*/
namespace Director {
const char *const ColorCursorXObj::xlibName = "colorcursorxobj";
const XlibFileDesc ColorCursorXObj::fileNames[] = {
{ "CCURSOR.XOB", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", ColorCursorXObj::m_new, 0, 0, 400 },
{ "dispose", ColorCursorXObj::m_dispose, 0, 0, 400 },
{ "getsetcursor", ColorCursorXObj::m_getSetCursor, 1, 1, 400 },
{ "releasecursor", ColorCursorXObj::m_releaseCursor, 0, 0, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
ColorCursorXObject::ColorCursorXObject(ObjectType ObjectType) :Object<ColorCursorXObject>("ColorCursorXObj") {
_objType = ObjectType;
}
void ColorCursorXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
ColorCursorXObject::initMethods(xlibMethods);
ColorCursorXObject *xobj = new ColorCursorXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void ColorCursorXObj::close(ObjectType type) {
if (type == kXObj) {
ColorCursorXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void ColorCursorXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("ColorCursorXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(ColorCursorXObj::m_dispose)
XOBJSTUBNR(ColorCursorXObj::m_getSetCursor)
XOBJSTUBNR(ColorCursorXObj::m_releaseCursor)
}

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_COLORCURSORXOBJ_H
#define DIRECTOR_LINGO_XLIBS_COLORCURSORXOBJ_H
namespace Director {
class ColorCursorXObject : public Object<ColorCursorXObject> {
public:
ColorCursorXObject(ObjectType objType);
};
namespace ColorCursorXObj {
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_getSetCursor(int nargs);
void m_releaseCursor(int nargs);
} // End of namespace ColorCursorXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,114 @@
/* 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:
* Star Trek TNG Episode Guide
*
**********************************************/
/*
* -- Color External Factory. 16Feb93 PTM
* Color
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance
* X mSetOurColors --Set Trek-happy colors
* X mRestoreColors --Restore real windows colors
* S mName --Returns the XObject name (Widget)
* I mStatus --Returns an integer status code
* SI mError, code --Returns an error string
* S mLastError --Returns last error string
* III mAdd, arg1, arg2 --Returns arg1+arg2
* SSI mFirst, str, nchars --Return the first nchars of string str
* V mMul, f1, f2 --Returns f1*f2 as floating point
* X mGlobals --Sample code to Read & Modify globals
* X mSymbols --Sample code to work with Symbols
* X mSendPerform --Sample code to show SendPerform call
* X mFactory --Sample code to find Factory objects
* II mGetSysColor, attrib -- gets rgb attrib as a long
* III mSetSysColor, attrib, rgbVal -- sets r,g,b as a long
* IIIII mSetSysColorRGB, attrib, r, g, b -- sets r,g,b as a 3 longs
* III mSetSysColorIndex, attrib, nIndex -- sets nth palette entry
*/
#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/c/colorxobj.h"
namespace Director {
const char *const ColorXObj::xlibName = "Color";
const XlibFileDesc ColorXObj::fileNames[] = {
{ "color", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", ColorXObj::m_new, 1, 1, 400 }, // D4
{ "dispose", ColorXObj::m_dispose, 0, 0, 400 }, // D4
{ "setOurColors", ColorXObj::m_setOurColors, 0, 0, 400 }, // D4
{ "restoreColors", ColorXObj::m_restoreColors, 0, 0, 400 }, // D4
{ "getSysColor", ColorXObj::m_getSysColor, 1, 1, 400 }, // D4
{ "setSysColor", ColorXObj::m_setSysColor, 2, 2, 400 }, // D4
{ "setSysColorRGB", ColorXObj::m_setSysColorRGB, 4, 4, 400 }, // D4
{ "setSysColorIndex", ColorXObj::m_setSysColorIndex, 2, 2, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
ColorXObject::ColorXObject(ObjectType ObjectType) :Object<ColorXObject>("Color") {
_objType = ObjectType;
}
void ColorXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
ColorXObject::initMethods(xlibMethods);
ColorXObject *xobj = new ColorXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void ColorXObj::close(ObjectType type) {
if (type == kXObj) {
ColorXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void ColorXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("ColorXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUB(ColorXObj::m_dispose, 0)
XOBJSTUBNR(ColorXObj::m_setOurColors)
XOBJSTUBNR(ColorXObj::m_restoreColors)
XOBJSTUB(ColorXObj::m_getSysColor, 0)
XOBJSTUB(ColorXObj::m_setSysColor, 0)
XOBJSTUB(ColorXObj::m_setSysColorRGB, 0)
XOBJSTUB(ColorXObj::m_setSysColorIndex, 0)
} // End of namespace Director

View File

@@ -0,0 +1,53 @@
/* 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_COLORXOBJ_H
#define DIRECTOR_LINGO_XLIBS_COLORXOBJ_H
namespace Director {
namespace ColorXObj {
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_setOurColors(int nargs);
void m_restoreColors(int nargs);
void m_getSysColor(int nargs);
void m_setSysColor(int nargs);
void m_setSysColorRGB(int nargs);
void m_setSysColorIndex(int nargs);
} // End of namespace ColorXObj
class ColorXObject : public Object<ColorXObject> {
public:
ColorXObject(ObjectType objType);
};
} // End of namespace Director
#endif

View File

@@ -0,0 +1,122 @@
/* 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/c/consumer.h"
/*
* Used in: Bob Winkle Solves Life's Greatest Mysteries
*
-- Consumer dialog xobject. 02Aug95 JA
Consumer
I mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
S mName --Returns the XObject name (Consumer)
SII mSettingsDlg --Shows the settings dialog and returns results
ISIS mPopHotword --Pops up a hot word window
SSSSS mExplore --Shows the Eplore dialog
SSSS mPrefSetValue --Set a preference file entry
SSS mPrefGetValue --Get a preference file entry
SSSSSS mContentLock --Shows the content lock dialog
SSI mGetRecord --Retrieves a data file record
SSS mGetWinIniEntry --Retrieves an entry from the WIN.INI
I mAboutDlg --Displays the About Box
IS mRegisterDlg --Displays the Registration Dialog
I mLockedDlg --Displays the Term Locked Dialog
II mCheckCD --Checks for the presence of the CD
I mHackMenu --Hack to destroy menu
*/
namespace Director {
const char *const ConsumerXObj::xlibName = "Consumer";
const XlibFileDesc ConsumerXObj::fileNames[] = {
{ "consumer", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", ConsumerXObj::m_new, 0, 0, 400 }, // D4
{ "dispose", ConsumerXObj::m_dispose, 0, 0, 400 }, // D4
{ "name", ConsumerXObj::m_name, 0, 0, 400 }, // D4
{ "settingsDlg", ConsumerXObj::m_settingsDlg, 2, 2, 400 }, // D4
{ "popHotword", ConsumerXObj::m_popHotword, 3, 3, 400 }, // D4
{ "explore", ConsumerXObj::m_explore, 4, 4, 400 }, // D4
{ "prefSetValue", ConsumerXObj::m_prefSetValue, 3, 3, 400 }, // D4
{ "prefGetValue", ConsumerXObj::m_prefGetValue, 2, 2, 400 }, // D4
{ "contentLock", ConsumerXObj::m_contentLock, 5, 5, 400 }, // D4
{ "getRecord", ConsumerXObj::m_getRecord, 2, 2, 400 }, // D4
{ "getWinIniEntry", ConsumerXObj::m_getWinIniEntry, 2, 2, 400 }, // D4
{ "aboutDlg", ConsumerXObj::m_aboutDlg, 0, 0, 400 }, // D4
{ "registerDlg", ConsumerXObj::m_registerDlg, 1, 1, 400 }, // D4
{ "lockedDlg", ConsumerXObj::m_lockedDlg, 0, 0, 400 }, // D4
{ "checkCD", ConsumerXObj::m_checkCD, 1, 1, 400 }, // D4
{ "hackMenu", ConsumerXObj::m_hackMenu, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
ConsumerXObject::ConsumerXObject(ObjectType ObjectType) :Object<ConsumerXObject>("Consumer") {
_objType = ObjectType;
}
void ConsumerXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
ConsumerXObject::initMethods(xlibMethods);
ConsumerXObject *xobj = new ConsumerXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void ConsumerXObj::close(ObjectType type) {
if (type == kXObj) {
ConsumerXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void ConsumerXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("ConsumerXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(ConsumerXObj::m_dispose)
XOBJSTUB(ConsumerXObj::m_name, "Consumer")
XOBJSTUB(ConsumerXObj::m_settingsDlg, "")
XOBJSTUB(ConsumerXObj::m_popHotword, 0)
XOBJSTUB(ConsumerXObj::m_explore, "")
XOBJSTUB(ConsumerXObj::m_prefSetValue, "")
XOBJSTUB(ConsumerXObj::m_prefGetValue, "")
XOBJSTUB(ConsumerXObj::m_contentLock, "")
XOBJSTUB(ConsumerXObj::m_getRecord, "0,0,0") // used to bypass the locked question check
XOBJSTUB(ConsumerXObj::m_getWinIniEntry, "")
XOBJSTUB(ConsumerXObj::m_aboutDlg, 0)
XOBJSTUB(ConsumerXObj::m_registerDlg, 0)
XOBJSTUB(ConsumerXObj::m_lockedDlg, 0)
XOBJSTUB(ConsumerXObj::m_checkCD, 1)
XOBJSTUB(ConsumerXObj::m_hackMenu, 0)
}

View File

@@ -0,0 +1,61 @@
/* 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_CONSUMER_H
#define DIRECTOR_LINGO_XLIBS_CONSUMER_H
namespace Director {
class ConsumerXObject : public Object<ConsumerXObject> {
public:
ConsumerXObject(ObjectType objType);
};
namespace ConsumerXObj {
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_settingsDlg(int nargs);
void m_popHotword(int nargs);
void m_explore(int nargs);
void m_prefSetValue(int nargs);
void m_prefGetValue(int nargs);
void m_contentLock(int nargs);
void m_getRecord(int nargs);
void m_getWinIniEntry(int nargs);
void m_aboutDlg(int nargs);
void m_registerDlg(int nargs);
void m_lockedDlg(int nargs);
void m_checkCD(int nargs);
void m_hackMenu(int nargs);
} // End of namespace ConsumerXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,88 @@
/* 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/c/cursorxobj.h"
/**************************************************
*
* USED IN:
* Jewels of the Oracle - Win
*
**************************************************/
/*
-- Cursor External Factory. 16/03/95 - AAF - Changed to play concatenated movies
Cursor
I mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
XSS mSetCursor, cursorName, windowName --Sets the window cursor
*/
namespace Director {
const char *const CursorXObj::xlibName = "Cursor";
const XlibFileDesc CursorXObj::fileNames[] = {
{ "CURSOR", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", CursorXObj::m_new, 0, 0, 400 },
{ "dispose", CursorXObj::m_dispose, 0, 0, 400 },
{ "setCursor", CursorXObj::m_setCursor, 2, 2, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
CursorXObject::CursorXObject(ObjectType ObjectType) :Object<CursorXObject>("Cursor") {
_objType = ObjectType;
}
void CursorXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
CursorXObject::initMethods(xlibMethods);
CursorXObject *xobj = new CursorXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void CursorXObj::close(ObjectType type) {
if (type == kXObj) {
CursorXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void CursorXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("CursorXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(CursorXObj::m_dispose)
XOBJSTUBNR(CursorXObj::m_setCursor)
}

View File

@@ -0,0 +1,48 @@
/* 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_CURSORXOBJ_H
#define DIRECTOR_LINGO_XLIBS_CURSORXOBJ_H
namespace Director {
class CursorXObject : public Object<CursorXObject> {
public:
CursorXObject(ObjectType objType);
};
namespace CursorXObj {
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_setCursor(int nargs);
} // End of namespace CursorXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,63 @@
/* 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:
* Secrets of the Pyramids (Mac)
* Mindscape's Wonder Land (Mac)
* Grackon's Curse (Mac)
* Return to Jurassic (Mac)
* Ednovation demos (Mac)
*
*************************************/
#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/d/darkenscreen.h"
namespace Director {
const char *const DarkenScreen::xlibName = "darkenScreen";
const XlibFileDesc DarkenScreen::fileNames[] = {
{ "darkenScreen", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "darkenScreen", DarkenScreen::m_darkenscreen, 0, 0, 300, HBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void DarkenScreen::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void DarkenScreen::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
XOBJSTUBNR(DarkenScreen::m_darkenscreen)
} // End of namespace Director

View File

@@ -0,0 +1,41 @@
/* 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_DARKENSCREEN_H
#define DIRECTOR_LINGO_XLIBS_DARKENSCREEN_H
namespace Director {
namespace DarkenScreen {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_darkenscreen(int nargs);
} // End of namespace DarkenScreen
} // End of namespace Director
#endif

View File

@@ -0,0 +1,145 @@
/* 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/d/dateutil.h"
/**************************************************
*
* USED IN:
* Amusement Planet Phantasmagoria
*
**************************************************/
/*
-- DateUtil v1.0
I mNew --Make a new instance
S mGetTime --Get current Time String
S mGetDate --Get current Date String
S mGetDateTime -- Get concatnated Date and Time String
I mGetSecond -- Second in number
*/
namespace Director {
const char *const DateUtilXObj::xlibName = "DateUtil";
const XlibFileDesc DateUtilXObj::fileNames[] = {
{ "DateUtil", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", DateUtilXObj::m_new, 0, 0, 400 },
{ "getTime", DateUtilXObj::m_getTime, 0, 0, 400 },
{ "getDate", DateUtilXObj::m_getDate, 0, 0, 400 },
{ "getDateTime", DateUtilXObj::m_getDateTime, 0, 0, 400 },
{ "getSecond", DateUtilXObj::m_getSecond, 0, 0, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
static const BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
DateUtilXObject::DateUtilXObject(ObjectType ObjectType) :Object<DateUtilXObject>("DateUtil") {
_objType = ObjectType;
}
void DateUtilXObj::open(ObjectType type, const Common::Path &path) {
DateUtilXObject::initMethods(xlibMethods);
DateUtilXObject *xobj = new DateUtilXObject(type);
if (type == kXtraObj)
g_lingo->_openXtras.push_back(xlibName);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void DateUtilXObj::close(ObjectType type) {
DateUtilXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void DateUtilXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("DateUtilXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
// Amusement Planet Phantasmagoria calls this method, treating its return
// value as a single string, and reading chars 1-4, 6-7, 9-10, and 12-14
// as the values we set here.
void DateUtilXObj::m_getDate(int nargs) {
TimeDate time;
g_system->getTimeAndDate(time);
Common::String day;
switch (time.tm_wday) {
case 0:
day = Common::String("SUN");
break;
case 1:
day = Common::String("MON");
break;
case 2:
day = Common::String("TUE");
break;
case 3:
day = Common::String("WED");
break;
case 4:
day = Common::String("THU");
break;
case 5:
day = Common::String("FRI");
break;
case 6:
day = Common::String("SAT");
break;
}
// Phantasmagoria's get_season() suggests months start from 1.
Common::String out = Common::String::format("%04d:%02d:%02d:%s", time.tm_year + 1900, time.tm_mon + 1, time.tm_mday, day.c_str());
g_lingo->push(Datum(out));
}
// Amusement Planet Phantasmagoria calls this method, treating its return
// value as a single string, and reading chars 1-2, 4-5 and 7-8 as the
// values we set here.
void DateUtilXObj::m_getTime(int nargs) {
TimeDate time;
g_system->getTimeAndDate(time);
Common::String out = Common::String::format("%02d:%02d:%02d", time.tm_hour, time.tm_min, time.tm_sec);
g_lingo->push(Datum(out));
}
// These two methods are never called in Phantasmagoria.
XOBJSTUB(DateUtilXObj::m_getDateTime, "")
XOBJSTUB(DateUtilXObj::m_getSecond, 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_DATEUTIL_H
#define DIRECTOR_LINGO_XLIBS_DATEUTIL_H
namespace Director {
class DateUtilXObject : public Object<DateUtilXObject> {
public:
DateUtilXObject(ObjectType objType);
};
namespace DateUtilXObj {
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_getTime(int nargs);
void m_getDate(int nargs);
void m_getDateTime(int nargs);
void m_getSecond(int nargs);
} // End of namespace DateUtilXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,164 @@
/* 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 "audio/mixer.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/d/developerStack.h"
/*************************************
*
* USED IN:
* overringunder: Over-Ring-Under
*
*************************************/
/*************************************
*
* Developer Stack 1.3r
* Issue date 11/05/88
*
* This stack is © 1987,88 Steve Drazga & AnalytX. The individual XCMDs
* and scripts are copyrighted by the original authors as stated their description.
*
* This issue of Developer Stack may be freely distributed by individuals in its
* original form with all original messages. DO NOT DISTRIBUTE MODIFIED COPIES!
* User groups may distribute it for regular disk fees. Other organizations
* desiring to charge for the distribution of Developer Stack should contact AnalytX.
*
* Developer Stack is intended for educational & training purposes only and
* no warranty is made as to the suitablity of anything included in this stack
* for any specific purpose. For support on any individual contributions, please
* contact the creator directly.
*
*/
/*
* XMCDs:
*
* Alert
* BarButton
* ChangeMenu
* CheckMenu
* ClipToPICTRes
* Color
* CombineFile
* CommInit
* CommWrite
* DeleteFile2
* DeProtect
* DispPict
* DoList
* doRestart
* DragOn
* DrawPict
* Ejector
* EnableMenu
* GetDANames
* HyperSND
* Import
* ImportPict
* InitMidi
* MungeMCTB
* OSErr
* PrintClip
* Progress
* ResCopy
* ResetMIDI
* ResetPrinter
* sendSerial
* SetVolume -- Done
* ShowMenu
* ShutDown
* SoundCapToRes
* Speak
* StdFile
* Stripper
* Tabs2Spaces
* Talk
* TitleBar
* TxMIDI
*/
/*
* This XCMD sets the current volume level of the Macintosh.
*
* This XCMD is ©1988 by Steve Drazga and all rights are reserved.
* It may be used in any non-commercial, shareware, or commercial stacks
* as long as the following conditions are met:
*
* 1) Within the credits of the stack the phrase 'Portions © 1988 Steve Drazga" should be included.
*
* 2) Send a copy of your finished stack to me at:
* Steve Drazga
* AnalytX
* Box 388
* Southampton, PA 18966
*
* If you need custom XCMDs/XFCNs, stacks, or HyperCard training for your organization contact:
* AnalytX at (215) 750-0792.
*
*
* Syntax:
* SetVolume "©1988SDrazga",<newVolume>
* The first parameter must be the copyright notice (the © symbol is option-g).
* The second parameter is the new volume level (0-7)
*
* Example usage: SetVolume "©1988SDrazga",
*
*************************************/
namespace Director {
const char *const DeveloperStack::xlibName = "SetVolume";
const XlibFileDesc DeveloperStack::fileNames[] = {
{ "SetVolume", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "SetVolume", DeveloperStack::b_setvolume, 2, 2, 300, HBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void DeveloperStack::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void DeveloperStack::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
void DeveloperStack::b_setvolume(int nargs) {
int volume = g_lingo->pop().asInt();
Common::String copyright = g_lingo->pop().asString();
debug(5, "LB::b_setvolume: copyright: %s vol: %d", copyright.c_str(), volume);
volume = CLIP<int>(volume, 0, 7);
g_director->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, Audio::Mixer::kMaxMixerVolume / 7 * volume);
}
} // End of namespace Director

View File

@@ -0,0 +1,41 @@
/* 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_DEVELOPERSTACK_H
#define DIRECTOR_LINGO_XLIBS_DEVELOPERSTACK_H
namespace Director {
namespace DeveloperStack {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void b_setvolume(int nargs);
} // End of namespace DeveloperStack
} // End of namespace Director
#endif

View File

@@ -0,0 +1,142 @@
/* 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:
* Total Distortion
*
*************************************/
/*
* -- Dialogs XObject. Written by Scott Kildall. Copyright (c) Red Eye Software, December 11th, 1994.
* Compuserve:72703,451 AOL:KILDALL APPLELINK:S.KILDALL
* Internet:72703.451@compuserve.com
* Licensed for the MediaBook CD for Director
* Published by gray matter design (415) 243-0394
*
* Dialogs
* X mNew --Creates a new instance of the XObject
* SSSS mPutFile, Dialog Title, Default Name, Default Extension --Displays a save dialog box
* SSSS mGetFile, Dialog Title, Default Name, Default Extension --Displays an open dialog box
*
* -- How it is called:
* set GameFileFULLPATH to gDialogsObj(mPutFile, "Save your Total Distortion Game File!", "TDGame", "TDG")
* set GameFileFULLPATH to gDialogsObj(mGetFile, "Find your Total Distortion Game File!", "*.TDG", "TDG")
*/
#include "gui/filebrowser-dialog.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/d/dialogsxobj.h"
namespace Director {
const char *const DialogsXObj::xlibNames[] = {
"DialogS",
nullptr
};
const XlibFileDesc DialogsXObj::fileNames[] = {
{ "DialogS", nullptr },
{ "shaREQUE", nullptr }, // TD loads this up using openXLib("@:shaREQUE.DLL")
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", DialogsXObj::m_new, 0, 0, 400 }, // D4
{ "GetFile", DialogsXObj::m_getFile, 3, 3, 400 }, // D4
{ "PutFile", DialogsXObj::m_putFile, 3, 3, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void DialogsXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
DialogsXObject::initMethods(xlibMethods);
DialogsXObject *xobj = new DialogsXObject(kXObj);
for (uint i = 0; xlibNames[i]; i++) {
g_lingo->exposeXObject(xlibNames[i], xobj);
}
}
}
void DialogsXObj::close(ObjectType type) {
if (type == kXObj) {
DialogsXObject::cleanupMethods();
for (uint i = 0; xlibNames[i]; i++) {
g_lingo->_globalvars[xlibNames[i]] = Datum();
}
}
}
DialogsXObject::DialogsXObject(ObjectType ObjectType) : Object<DialogsXObject>("DialogS") {
_objType = ObjectType;
}
void DialogsXObj::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
void DialogsXObj::m_putFile(int nargs) {
Common::String extn = g_lingo->pop().asString();
Common::String name = g_lingo->pop().asString();
Common::String title = g_lingo->pop().asString();
Common::String prefix = savePrefix();
Common::String mask = prefix + "*." + extn + ".txt";
Common::String filename = name;
GUI::FileBrowserDialog browser(title.c_str(), "txt", GUI::kFBModeSave, mask.c_str());
if (browser.runModal() > 0) {
filename = browser.getResult();
if (!filename.matchString(mask)) // If user choose to create new file (rather than overwriting existing one)
filename = Common::String::format("C:\\%s%s", prefix.c_str(), filename.c_str());
else {
// Here user chose existing save file to be overwritten, so format it before sending! (To prevent duplicate extensions)
const Common::String suffx = "." + extn;
Common::replace(filename, suffx, "");
}
}
warning("DialogsXObj::m_putFile return filename: %s", filename.c_str());
g_lingo->push(Datum(filename));
}
void DialogsXObj::m_getFile(int nargs) {
Common::String extn = g_lingo->pop().asString();
Common::String name = g_lingo->pop().asString();
Common::String title = g_lingo->pop().asString();
Common::String prefix = savePrefix();
Common::String mask = prefix + "*." + extn + ".txt";
Common::String fileName = name;
GUI::FileBrowserDialog browser(title.c_str(), "txt", GUI::kFBModeLoad, mask.c_str());
if (browser.runModal() > 0) {
Common::String path = browser.getResult();
fileName = Common::String::format("C:\\%s", path.c_str()); // Create fullpath from this name, as: C:\filename.TDG.txt!
}
warning("DialogsXObj::m_getFile return filename: %s", fileName.c_str());
g_lingo->push(Datum(fileName));
}
} // End of namespace Director

View File

@@ -0,0 +1,47 @@
/* 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_DIALOGSXOBJ_H
#define DIRECTOR_LINGO_XLIBS_DIALOGSXOBJ_H
namespace Director {
class DialogsXObject : public Object<DialogsXObject> {
public:
DialogsXObject(ObjectType objType);
};
namespace DialogsXObj {
extern const char *const xlibNames[];
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_putFile(int nargs);
void m_getFile(int nargs);
} // End of namespace DialogsXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,114 @@
/* 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/d/dirutil.h"
/*
-- DIRUTIL External Factory. 16Feb93 PTM
DIRUTIL
I mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
S mName --Returns the XObject name (dirutil)
I mStatus --Returns an integer status code
SI mError, code --Returns an error string
S mLastError --Returns last error string
ISI mSetAttrib,filename,attrib --Sets the Attibute of attr
IS mGetAttrib,filename --Gets the Attibute of filename
II mGetDriveType,drivenumber --Gets the type of a drive selected
I mQTVersion --Returns an integer status code
S mQTVersionStr --Returns version as a string
II mIsCdrom,drivenumber --Return true if drive CDROM
S mAuthors --Information on authors
XI mSetErrorMode,mode --sets windoze error mode
*/
namespace Director {
const char *const DirUtilXObj::xlibName = "DirUtil";
const XlibFileDesc DirUtilXObj::fileNames[] = {
{ "dirutil", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", DirUtilXObj::m_new, 0, 0, 400 }, // D4
{ "dispose", DirUtilXObj::m_dispose, 0, 0, 400 }, // D4
{ "name", DirUtilXObj::m_name, 0, 0, 400 }, // D4
{ "status", DirUtilXObj::m_status, 0, 0, 400 }, // D4
{ "error", DirUtilXObj::m_error, 1, 1, 400 }, // D4
{ "lastError", DirUtilXObj::m_lastError, 0, 0, 400 }, // D4
{ "setAttrib", DirUtilXObj::m_setAttrib, 2, 2, 400 }, // D4
{ "getAttrib", DirUtilXObj::m_getAttrib, 1, 1, 400 }, // D4
{ "getDriveType", DirUtilXObj::m_getDriveType, 1, 1, 400 }, // D4
{ "qTVersion", DirUtilXObj::m_qTVersion, 0, 0, 400 }, // D4
{ "qTVersionStr", DirUtilXObj::m_qTVersionStr, 0, 0, 400 }, // D4
{ "isCdrom", DirUtilXObj::m_isCdrom, 1, 1, 400 }, // D4
{ "authors", DirUtilXObj::m_authors, 0, 0, 400 }, // D4
{ "setErrorMode", DirUtilXObj::m_setErrorMode, 1, 1, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
DirUtilXObject::DirUtilXObject(ObjectType ObjectType) :Object<DirUtilXObject>("DirUtil") {
_objType = ObjectType;
}
void DirUtilXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
DirUtilXObject::initMethods(xlibMethods);
DirUtilXObject *xobj = new DirUtilXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void DirUtilXObj::close(ObjectType type) {
if (type == kXObj) {
DirUtilXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
void DirUtilXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("DirUtilXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(DirUtilXObj::m_dispose)
XOBJSTUB(DirUtilXObj::m_name, "")
XOBJSTUB(DirUtilXObj::m_status, 0)
XOBJSTUB(DirUtilXObj::m_error, "")
XOBJSTUB(DirUtilXObj::m_lastError, "")
XOBJSTUB(DirUtilXObj::m_setAttrib, 0)
XOBJSTUB(DirUtilXObj::m_getAttrib, 0)
XOBJSTUB(DirUtilXObj::m_getDriveType, 0)
XOBJSTUB(DirUtilXObj::m_qTVersion, 0)
XOBJSTUB(DirUtilXObj::m_qTVersionStr, "2.03.51")
XOBJSTUB(DirUtilXObj::m_isCdrom, 0)
XOBJSTUB(DirUtilXObj::m_authors, "")
XOBJSTUBNR(DirUtilXObj::m_setErrorMode)
}

View File

@@ -0,0 +1,59 @@
/* 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_DIRUTIL_H
#define DIRECTOR_LINGO_XLIBS_DIRUTIL_H
namespace Director {
class DirUtilXObject : public Object<DirUtilXObject> {
public:
DirUtilXObject(ObjectType objType);
};
namespace DirUtilXObj {
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_setAttrib(int nargs);
void m_getAttrib(int nargs);
void m_getDriveType(int nargs);
void m_qTVersion(int nargs);
void m_qTVersionStr(int nargs);
void m_isCdrom(int nargs);
void m_authors(int nargs);
void m_setErrorMode(int nargs);
} // End of namespace DirUtilXObj
} // 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/d/dllglue.h"
/**************************************************
*
* USED IN:
* Virtual Nightclub
* Puppet Motel
*
**************************************************/
/*
-- DLLGlue External Factory. Dec 1994 PTH (P.HAMILTON@APPLELINK.COM)
--DLLGlue
ISSSS mNew lib, proc, ret, args --Creates a new instance of the XObject
S mName --Returns the XObject name (DLLGlue)
V mCall --Returns an integer status code
I mStatus --Returns an integer status code
SI mError, code --Returns an error string (for above codes)
S mLastError --Returns last error string
I mWindowHandle --Returns handle for DPW stage window
S mComment --Return UserCode comment
X mDebug --write debugging info to message window
*/
namespace Director {
const char *const DLLGlueXObj::xlibName = "DLLGlue";
const XlibFileDesc DLLGlueXObj::fileNames[] = {
{ "DLLGLUE", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", DLLGlueXObj::m_new, 4, 4, 400 },
{ "name", DLLGlueXObj::m_name, 0, 0, 400 },
{ "call", DLLGlueXObj::m_call, 0, 0, 400 },
{ "status", DLLGlueXObj::m_status, 0, 0, 400 },
{ "error", DLLGlueXObj::m_error, 1, 1, 400 },
{ "lastError", DLLGlueXObj::m_lastError, 0, 0, 400 },
{ "windowHandle", DLLGlueXObj::m_windowHandle, 0, 0, 400 },
{ "comment", DLLGlueXObj::m_comment, 0, 0, 400 },
{ "debug", DLLGlueXObj::m_debug, 0, 0, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
static const BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
DLLGlueXObject::DLLGlueXObject(ObjectType ObjectType) :Object<DLLGlueXObject>("DLLGlue") {
_objType = ObjectType;
}
void DLLGlueXObj::open(ObjectType type, const Common::Path &path) {
DLLGlueXObject::initMethods(xlibMethods);
DLLGlueXObject *xobj = new DLLGlueXObject(type);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void DLLGlueXObj::close(ObjectType type) {
DLLGlueXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void DLLGlueXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("DLLGlueXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUB(DLLGlueXObj::m_name, "")
XOBJSTUB(DLLGlueXObj::m_call, 0)
XOBJSTUB(DLLGlueXObj::m_status, 0)
XOBJSTUB(DLLGlueXObj::m_error, "")
XOBJSTUB(DLLGlueXObj::m_lastError, "")
XOBJSTUB(DLLGlueXObj::m_windowHandle, 0)
XOBJSTUB(DLLGlueXObj::m_comment, "")
XOBJSTUBNR(DLLGlueXObj::m_debug)
}

View File

@@ -0,0 +1,54 @@
/* 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_DLLGLUE_H
#define DIRECTOR_LINGO_XLIBS_DLLGLUE_H
namespace Director {
class DLLGlueXObject : public Object<DLLGlueXObject> {
public:
DLLGlueXObject(ObjectType objType);
};
namespace DLLGlueXObj {
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_name(int nargs);
void m_call(int nargs);
void m_status(int nargs);
void m_error(int nargs);
void m_lastError(int nargs);
void m_windowHandle(int nargs);
void m_comment(int nargs);
void m_debug(int nargs);
} // End of namespace DLLGlueXObj
} // 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/d/dpwavi.h"
/**************************************************
*
* USED IN:
* jman-win
* hellcab-win
*
**************************************************/
/*
-- AVI External Factory. 02oct92 JT
--DPWAVI
X +mStartup -- First time init
X +mQuit -- Major bye bye
XI mNew qtPacket -- create a window
X mDispose -- close and dispose window
XII mVerb msg, qtPacker -- do something
*/
namespace Director {
const char *const DPWAVIXObj::xlibName = "DPWAVI";
const XlibFileDesc DPWAVIXObj::fileNames[] = {
{ "DPWAVI", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "startup", DPWAVIXObj::m_startup, 0, 0, 300 },
{ "quit", DPWAVIXObj::m_quit, 0, 0, 300 },
{ "new", DPWAVIXObj::m_new, 1, 1, 300 },
{ "dispose", DPWAVIXObj::m_dispose, 0, 0, 300 },
{ "verb", DPWAVIXObj::m_verb, 2, 2, 300 },
{ nullptr, nullptr, 0, 0, 0 }
};
static const BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
DPWAVIXObject::DPWAVIXObject(ObjectType ObjectType) :Object<DPWAVIXObject>("DPWAVI") {
_objType = ObjectType;
}
void DPWAVIXObj::open(ObjectType type, const Common::Path &path) {
DPWAVIXObject::initMethods(xlibMethods);
DPWAVIXObject *xobj = new DPWAVIXObject(type);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void DPWAVIXObj::close(ObjectType type) {
DPWAVIXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void DPWAVIXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("DPWAVIXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(DPWAVIXObj::m_startup)
XOBJSTUBNR(DPWAVIXObj::m_quit)
XOBJSTUBNR(DPWAVIXObj::m_dispose)
XOBJSTUBNR(DPWAVIXObj::m_verb)
}

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_DPWAVI_H
#define DIRECTOR_LINGO_XLIBS_DPWAVI_H
namespace Director {
class DPWAVIXObject : public Object<DPWAVIXObject> {
public:
DPWAVIXObject(ObjectType objType);
};
namespace DPWAVIXObj {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_startup(int nargs);
void m_quit(int nargs);
void m_new(int nargs);
void m_dispose(int nargs);
void m_verb(int nargs);
} // End of namespace DPWAVIXObj
} // 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/d/dpwqtw.h"
/**************************************************
*
* USED IN:
* jman-win
* hellcab-win
*
**************************************************/
/*
-- QuickTime for Windows Player External Factory. 02oct92 JT
--DPWQTW
X +mStartup -- First time init
X +mQuit -- Major bye bye
XI mNew qtPacket -- create a window
X mDispose -- close and dispose window
XII mVerb msg, qtPacker -- do something
*/
namespace Director {
const char *const DPWQTWXObj::xlibName = "DPWQTW";
const XlibFileDesc DPWQTWXObj::fileNames[] = {
{ "DPWQTW", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "startup", DPWQTWXObj::m_startup, 0, 0, 300 },
{ "quit", DPWQTWXObj::m_quit, 0, 0, 300 },
{ "new", DPWQTWXObj::m_new, 1, 1, 300 },
{ "dispose", DPWQTWXObj::m_dispose, 0, 0, 300 },
{ "verb", DPWQTWXObj::m_verb, 2, 2, 300 },
{ nullptr, nullptr, 0, 0, 0 }
};
static const BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
DPWQTWXObject::DPWQTWXObject(ObjectType ObjectType) :Object<DPWQTWXObject>("DPWQTW") {
_objType = ObjectType;
}
void DPWQTWXObj::open(ObjectType type, const Common::Path &path) {
DPWQTWXObject::initMethods(xlibMethods);
DPWQTWXObject *xobj = new DPWQTWXObject(type);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void DPWQTWXObj::close(ObjectType type) {
DPWQTWXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void DPWQTWXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("DPWQTWXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(DPWQTWXObj::m_startup)
XOBJSTUBNR(DPWQTWXObj::m_quit)
XOBJSTUBNR(DPWQTWXObj::m_dispose)
XOBJSTUBNR(DPWQTWXObj::m_verb)
}

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_DPWQTW_H
#define DIRECTOR_LINGO_XLIBS_DPWQTW_H
namespace Director {
class DPWQTWXObject : public Object<DPWQTWXObject> {
public:
DPWQTWXObject(ObjectType objType);
};
namespace DPWQTWXObj {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_startup(int nargs);
void m_quit(int nargs);
void m_new(int nargs);
void m_dispose(int nargs);
void m_verb(int nargs);
} // End of namespace DPWQTWXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,160 @@
/* 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:
* מיץ פטל (Mitz Petel)
*
*************************************/
/* -- Draw XObject version 1.0 beta
* Draw
* -- (c) 1995 - Daniele Russo
* -- New York University - Center for Digital Multimedia
* I mNew --Creates a new instance of the XObject.
* --
* I mDispose --Disposes of an XObject instance.
* --
* IIIII mLine --Draws a line.
* --
* IIIII mLineBrush --Draws a line using a pen.
* --
* IIIIII mLineBrushTrans --Draws a line using a transparent, multicolored pen.
* --
* IIIIIII mLineBrushCol --Draws a line using a transparent pen.
* --
* III mFilterBMP --Gets a picture containing all the pixels in an
* -- image excluding those which are of a particular color.
* -- The image to filter must be on the clipboard (as a BITMAP).
* --
* III mFilterDIB --As above, but the image must be a DIB.
* --
* III mFilterBMP128 --Gets a picture containing all the pixels in an
* -- image whose color is within the lower/upper
* -- 128. The image to filter must be on the clipboard
* -- (as a BITMAP).
* --
* III mFilterDIB128 --As above, but the image must be a DIB.
* --
* III mFilterBMPMakeGhostImage
* -- Gets a picture which has all the pixels that don't
* -- have the background color changed to a given color,
* -- specified by the caller. The image to filter must be
* -- on the clipboard (as a BITMAP).
* --
* III mFilterDIBMakeGhostImage
* -- As above, but the image must be a DIB.
* --
* I mEmptyClipboard --Empties the clipboard. This method MUST be called
* -- after using the result of mFilterBMP and mFilterBMP128.
* --
* IIII mFill --Fills an area starting at a specified pixel
* -- and defined by all the adjacent pixels with
* -- the same color.
* --
* III mGetColor --Gets the color of a pixel on the stage. The
* -- result is the index of the color in Director's
* -- palette.
* --
* IIIIII mDrawRect -- Draws a rectangle of a specified color.
* --
* IIIIII mDrawFrame -- Draws a frame using a dotted pen.
*/
#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/d/draw.h"
namespace Director {
const char *const DrawXObj::xlibName = "Draw";
const XlibFileDesc DrawXObj::fileNames[] = {
{ "DRAW", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "New", DrawXObj::m_new, 0, 0, 400 }, // D4
{ "Dispose", DrawXObj::m_dispose, 0, 0, 400 }, // D4
{ "Line", DrawXObj::m_line, 4, 4, 400 }, // D4
{ "LineBrush", DrawXObj::m_lineBrush, 4, 4, 400 }, // D4
{ "LineBrushTrans", DrawXObj::m_lineBrushTrans, 5, 5, 400 }, // D4
{ "LineBrushCol", DrawXObj::m_lineBrushCol, 6, 6, 400 }, // D4
{ "FilterBMP", DrawXObj::m_filterBMP, 2, 2, 400 }, // D4
{ "FilterDIB", DrawXObj::m_filterDIB, 2, 2, 400 }, // D4
{ "FilterBMP128", DrawXObj::m_filterBMP128, 2, 2, 400 }, // D4
{ "FilterDIB128", DrawXObj::m_filterDIB128, 2, 2, 400 }, // D4
{ "FilterBMPMakeGhostImage", DrawXObj::m_filterBMPMakeGhostImage, 2, 2, 400 }, // D4
{ "FilterDIBMakeGhostImage", DrawXObj::m_filterDIBMakeGhostImage, 2, 2, 400 }, // D4
{ "EmptyClipboard", DrawXObj::m_emptyClipboard, 0, 0, 400 }, // D4
{ "Fill", DrawXObj::m_fill, 3, 3, 400 }, // D4
{ "GetColor", DrawXObj::m_getColor, 2, 2, 400 }, // D4
{ "DrawRect", DrawXObj::m_drawRect, 5, 5, 400 }, // D4
{ "DrawFrame", DrawXObj::m_drawFrame, 5, 5, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void DrawXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
DrawXObject::initMethods(xlibMethods);
DrawXObject *xobj = new DrawXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void DrawXObj::close(ObjectType type) {
if (type == kXObj) {
DrawXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
DrawXObject::DrawXObject(ObjectType ObjectType) :Object<DrawXObject>("Draw") {
_objType = ObjectType;
}
void DrawXObj::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUB(DrawXObj::m_dispose, 0)
XOBJSTUB(DrawXObj::m_line, 0)
XOBJSTUB(DrawXObj::m_lineBrush, 0)
XOBJSTUB(DrawXObj::m_lineBrushTrans, 0)
XOBJSTUB(DrawXObj::m_lineBrushCol, 0)
XOBJSTUB(DrawXObj::m_filterBMP, 0)
XOBJSTUB(DrawXObj::m_filterDIB, 0)
XOBJSTUB(DrawXObj::m_filterBMP128, 0)
XOBJSTUB(DrawXObj::m_filterDIB128, 0)
XOBJSTUB(DrawXObj::m_filterBMPMakeGhostImage, 0)
XOBJSTUB(DrawXObj::m_filterDIBMakeGhostImage, 0)
XOBJSTUB(DrawXObj::m_emptyClipboard, 0)
XOBJSTUB(DrawXObj::m_fill, 0)
XOBJSTUB(DrawXObj::m_getColor, 0)
XOBJSTUB(DrawXObj::m_drawRect, 0)
XOBJSTUB(DrawXObj::m_drawFrame, 0)
} // End of namespace Director

View File

@@ -0,0 +1,62 @@
/* 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_DRAWXOBJ_H
#define DIRECTOR_LINGO_XLIBS_DRAWXOBJ_H
namespace Director {
class DrawXObject : public Object<DrawXObject> {
public:
DrawXObject(ObjectType objType);
};
namespace DrawXObj {
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_line(int nargs);
void m_lineBrush(int nargs);
void m_lineBrushTrans(int nargs);
void m_lineBrushCol(int nargs);
void m_filterBMP(int nargs);
void m_filterDIB(int nargs);
void m_filterBMP128(int nargs);
void m_filterDIB128(int nargs);
void m_filterBMPMakeGhostImage(int nargs);
void m_filterDIBMakeGhostImage(int nargs);
void m_emptyClipboard(int nargs);
void m_fill(int nargs);
void m_getColor(int nargs);
void m_drawRect(int nargs);
void m_drawFrame(int nargs);
} // End of namespace DrawXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,261 @@
/* 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:
* Secrets of the Pyramids (Win)
* Mindscape's Wonder Land (Win)
* Grackon's Curse (Win)
* Return to Jurassic (Win)
*
*************************************/
/*
* -- Ednox External Factory. 22Nov93 PTM
* ednox
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance
* S mName --Returns the XObject name (Widget)
* I mStatus --Returns an integer status code
* SI mError, code --Returns an error string
* S mLastError --Returns last error string
* SSI playSoundX --Play an external sound, return status string
* S clearSoundX --Stop an external sound, return status string
* S checkSoundX --check an external sound,see if it is still playing
* SS drawBkgndX,hBkgnd --draw background image, from resource bitmap
* SS SaveX, hStrIn --Save string into a file(file name will be prompted
* SSSI GetPathX,hSection,hStrIn,mMacMode, Retrieve the installed path name from the win.ini and return
* S RestoreX --Restore string from a file(file name will be prompted
* SS SetDriveX,hStrIn --Set the current path name
* SSS IsCDX,hDrive,hStrIn --Check for the correct CD
* S EnableTaskSwitch --enable task switch
* S DisableTaskSwitch --Disable task switch
* SSS getDocumentName,hdir,hext --Get strings of file in specific directory
* SSS getDocumentFile,hDir,hFile --Get string from a file
* SSSS saveDocumentFile,hDir,hFile,hStrIn --save string into a file
* SSS deleteDocumentFile,hDir,hFile -- delete a file from the directory
*/
#include "common/savefile.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/e/ednox.h"
namespace Director {
const char *const Ednox::xlibName = "Ednox";
const XlibFileDesc Ednox::fileNames[] = {
{ "Ednox", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "mNew", Ednox::m_new, 0, 0, 300 }, // d3
{ "mDispose", Ednox::m_dispose, 0, 0, 300 }, // d3
{ "mName", Ednox::m_name, 0, 0, 300 }, // d3
{ "mStatus", Ednox::m_status, 0, 0, 300 }, // d3
{ "mError", Ednox::m_error, 1, 1, 300 }, // d3
{ "mLastError", Ednox::m_lasterror, 0, 0, 300 }, // d3
{ "playSoundX", Ednox::m_playsoundx, 2, 2, 300 }, // d3
{ "clearSoundX", Ednox::m_clearsoundx, 0, 0, 300 }, // d3
{ "checkSoundX", Ednox::m_checksoundx, 0, 0, 300 }, // d3
{ "drawBkgndX", Ednox::m_drawbkgndx, 1, 1, 300 }, // d3
{ "SaveX", Ednox::m_savex, 1, 1, 300 }, // d3
{ "GetPathX", Ednox::m_getpathx, 3, 3, 300 }, // d3
{ "RestoreX", Ednox::m_restorex, 0, 0, 300 }, // d3
{ "SetDriveX", Ednox::m_setdrivex, 1, 1, 300 }, // d3
{ "IsCDX", Ednox::m_iscdx, 2, 2, 300 }, // d3
{ "EnableTaskSwitch", Ednox::m_enabletaskswitch, 0, 0, 300 }, // d3
{ "DisableTaskSwitch", Ednox::m_disabletaskswitch, 0, 0, 300 }, // d3
{ "getDocumentName", Ednox::m_getdocumentname, 2, 2, 300 }, // d3
{ "getDocumentFile", Ednox::m_getdocumentfile, 2, 2, 300 }, // d3
{ "saveDocumentFile", Ednox::m_savedocumentfile, 3, 3, 300 }, // d3
{ "deleteDocumentFile", Ednox::m_deletedocumentfile, 2, 2, 300 }, // d3
{ nullptr, nullptr, 0, 0, 0 }
};
void Ednox::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
EdnoxObject::initMethods(xlibMethods);
EdnoxObject *xobj = new EdnoxObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void Ednox::close(ObjectType type) {
if (type == kXObj) {
EdnoxObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
EdnoxObject::EdnoxObject(ObjectType ObjectType) :Object<EdnoxObject>("Ednox") {
_objType = ObjectType;
}
void Ednox::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(Ednox::m_dispose)
void Ednox::m_getpathx(int nargs) {
/* int mMacMode = */ g_lingo->pop().asInt();
Common::U32String hStrIn = g_lingo->pop().asString();
/* Common::U32String hSection = */ g_lingo->pop().asString();
hStrIn.toLowercase();
if (hStrIn == "cdpath"){
g_lingo->push(Datum("d:\\"));
} else {
g_lingo->push(Datum(""));
}
}
void Ednox::m_iscdx(int nargs) {
/* Common::U32String hStrIn = */ g_lingo->pop().asString();
Common::U32String hDrive = g_lingo->pop().asString();
// g_lingo->printSTUBWithArglist("Ednox::m_iscdx", nargs);
if (hDrive == "d:\\"){
g_lingo->push(Datum("0"));
} else {
g_lingo->push(Datum("-1"));
}
}
void Ednox::m_setdrivex(int nargs) {
// Common::U32String hStrIn = g_lingo->pop().asString();
g_lingo->printSTUBWithArglist("Ednox::m_setdrivex", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(Datum("1"));
}
XOBJSTUB(Ednox::m_checksoundx, "")
XOBJSTUB(Ednox::m_clearsoundx, "")
void Ednox::m_deletedocumentfile(int nargs) {
// Common::U32String hFile = g_lingo->pop().asString();
// Common::U32String hDir = g_lingo->pop().asString();
g_lingo->printSTUBWithArglist("Ednox::m_deletedocumentfile", nargs);
g_lingo->dropStack(nargs);
}
XOBJSTUB(Ednox::m_enabletaskswitch, "")
XOBJSTUB(Ednox::m_disabletaskswitch, "")
void Ednox::m_drawbkgndx(int nargs) {
// Common::U32String hBkgnd = g_lingo->pop().asString();
g_lingo->printSTUBWithArglist("Ednox::m_drawbkgndx", nargs);
}
void Ednox::m_getdocumentname(int nargs) {
Common::SaveFileManager *saves = g_system->getSavefileManager();
Common::String prefix = savePrefix();
g_lingo->printSTUBWithArglist("Ednox::m_getdocumentname", nargs);
ARGNUMCHECK(2);
Common::String hExt = g_lingo->pop().asString();
Common::String hDir = g_lingo->pop().asString();
Common::String result;
Common::StringArray existing = saves->listSavefiles(Common::String::format("%s*", prefix.c_str()));
bool first = true;
for (auto &it : existing) {
if (first)
first = false;
else
result += ",";
result += it.substr(prefix.size());
}
g_lingo->push(result);
}
void Ednox::m_getdocumentfile(int nargs) {
Common::SaveFileManager *saves = g_system->getSavefileManager();
Common::String prefix = savePrefix();
g_lingo->printSTUBWithArglist("Ednox::m_getdocumentfile", nargs);
ARGNUMCHECK(2);
Common::String hFile = g_lingo->pop().asString();
Common::String hDir = g_lingo->pop().asString();
Common::String filename = prefix + hFile;
// ignore the directory, we just care about the filename
if (!saves->exists(filename)) {
warning("Ednox::m_getdocumentfile: No file exists for %s", filename.c_str());
g_lingo->push(Datum());
return;
}
Common::SeekableReadStream *stream = saves->openForLoading(filename);
if (!stream) {
warning("Ednox::m_getdocumentfile: Unable to open file %s", filename.c_str());
g_lingo->push(Datum());
return;
}
Common::String result = stream->readString();
delete stream;
g_lingo->push(Datum(result));
}
void Ednox::m_savedocumentfile(int nargs) {
Common::SaveFileManager *saves = g_system->getSavefileManager();
g_lingo->printSTUBWithArglist("Ednox::m_savedocumentfile", nargs);
ARGNUMCHECK(3);
Common::String hStrIn = g_lingo->pop().asString();
Common::String hFile = g_lingo->pop().asString();
Common::String hDir = g_lingo->pop().asString();
Common::String filename = savePrefix() + hFile;
Common::SeekableWriteStream *stream = saves->openForSaving(filename, false);
if (!stream) {
warning("Ednox::m_savedocumentfile: Unable to open file %s", filename.c_str());
g_lingo->push(Datum());
return;
}
stream->writeString(hStrIn);
delete stream;
g_lingo->push(Common::String(""));
}
void Ednox::m_error(int nargs) {
// int code = g_lingo->pop().asInt();
g_lingo->printSTUBWithArglist("Ednox::m_error", nargs);
g_lingo->dropStack(nargs);
}
XOBJSTUB(Ednox::m_lasterror, "")
void Ednox::m_name(int nargs) {
g_lingo->push(Datum("ednox"));
}
XOBJSTUB(Ednox::m_status, 0)
XOBJSTUB(Ednox::m_playsoundx, "")
XOBJSTUB(Ednox::m_restorex, "")
void Ednox::m_savex(int nargs) {
// Common::U32String hStrIn = g_lingo->pop().asString();
g_lingo->printSTUBWithArglist("Ednox::m_savex", nargs);
g_lingo->dropStack(nargs);
}
} // End of namespace Director

View File

@@ -0,0 +1,66 @@
/* 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_EDNOX_H
#define DIRECTOR_LINGO_XLIBS_EDNOX_H
namespace Director {
class EdnoxObject : public Object<EdnoxObject> {
public:
EdnoxObject(ObjectType objType);
};
namespace Ednox {
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_playsoundx(int nargs);
void m_clearsoundx(int nargs);
void m_checksoundx(int nargs);
void m_drawbkgndx(int nargs);
void m_savex(int nargs);
void m_getpathx(int nargs);
void m_restorex(int nargs);
void m_setdrivex(int nargs);
void m_iscdx(int nargs);
void m_enabletaskswitch(int nargs);
void m_disabletaskswitch(int nargs);
void m_getdocumentname(int nargs);
void m_getdocumentfile(int nargs);
void m_savedocumentfile(int nargs);
void m_deletedocumentfile(int nargs);
} // End of namespace Ednox
} // End of namespace Director
#endif

View File

@@ -0,0 +1,107 @@
/* 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:
* Meet Mediaband
*
*************************************/
/*
* -- EventQ XObject. 7/12/94 greg yachuk
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance.
* X mBufferEvents --Begins buffering messages.
* X mFlushEvents --Ends buffering. Flushes all queued messages.
* X mPostEvents --Ends buffering. Posts all queued messages.
* I mBufferStatus --1 => Buffering in effect. 0 => No buffering.
* SSI mGetNextEvent --Gets the next event of a certain type.
* -- -- param1: mouseDown or keyDown.
* -- -- param2: 1 => remove found message.
* -- -- 0 => leave found message in queue.
*/
#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/e/eventq.h"
namespace Director {
const char *const EventQXObj::xlibNames[] = {
"EventQ",
nullptr
};
const XlibFileDesc EventQXObj::fileNames[] = {
{ "EventQ", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", EventQXObj::m_new, 0, 0, 400 }, // D4
{ "Dispose", EventQXObj::m_dispose, 0, 0, 400 }, // D4
{ "BufferEvents", EventQXObj::m_bufferEvents, 0, 0, 400 }, // D4
{ "FlushEvents", EventQXObj::m_flushEvents, 0, 0, 400 }, // D4
{ "PostEvents", EventQXObj::m_postEvents, 0, 0, 400 }, // D4
{ "BufferStatus", EventQXObj::m_bufferStatus, 0, 0, 400 }, // D4
{ "GetNextEvent", EventQXObj::m_getNextEvent, 2, 2, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void EventQXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
EventQXObject::initMethods(xlibMethods);
EventQXObject *xobj = new EventQXObject(kXObj);
for (uint i = 0; xlibNames[i]; i++) {
g_lingo->exposeXObject(xlibNames[i], xobj);
}
}
}
void EventQXObj::close(ObjectType type) {
if (type == kXObj) {
EventQXObject::cleanupMethods();
for (uint i = 0; xlibNames[i]; i++) {
g_lingo->_globalvars[xlibNames[i]] = Datum();
}
}
}
EventQXObject::EventQXObject(ObjectType ObjectType) : Object<EventQXObject>("EventQ") {
_objType = ObjectType;
}
void EventQXObj::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUB(EventQXObj::m_dispose, 0)
XOBJSTUB(EventQXObj::m_bufferEvents, 0)
XOBJSTUB(EventQXObj::m_flushEvents, 0)
XOBJSTUB(EventQXObj::m_postEvents, 0)
XOBJSTUB(EventQXObj::m_bufferStatus, 0)
XOBJSTUB(EventQXObj::m_getNextEvent, 0)
} // End of namespace Director

View File

@@ -0,0 +1,51 @@
/* 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_EVENTQ_H
#define DIRECTOR_LINGO_XLIBS_EVENTQ_H
namespace Director {
class EventQXObject : public Object<EventQXObject> {
public:
EventQXObject(ObjectType objType);
};
namespace EventQXObj {
extern const char *const xlibNames[];
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_bufferEvents(int nargs);
void m_flushEvents(int nargs);
void m_postEvents(int nargs);
void m_bufferStatus(int nargs);
void m_getNextEvent(int nargs);
} // End of namespace EventQXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,60 @@
/* 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/f/fadegammadownxcmd.h"
/**************************************************
*
* USED IN:
* puppetmotel
*
**************************************************/
namespace Director {
const char *const FadeGammaDownXCMD::xlibName = "FadeGammaDown";
const XlibFileDesc FadeGammaDownXCMD::fileNames[] = {
{ "FadeGammaDown", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "FadeGammaDown", FadeGammaDownXCMD::m_FadeGammaDown, -1, 0, 400, CBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void FadeGammaDownXCMD::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void FadeGammaDownXCMD::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
XOBJSTUB(FadeGammaDownXCMD::m_FadeGammaDown, 0)
}

View File

@@ -0,0 +1,41 @@
/* 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_FADEGAMMADOWNXCMD_H
#define DIRECTOR_LINGO_XLIBS_FADEGAMMADOWNXCMD_H
namespace Director {
namespace FadeGammaDownXCMD {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_FadeGammaDown(int nargs);
} // End of namespace FadeGammaDownXCMD
} // End of namespace Director
#endif

View File

@@ -0,0 +1,60 @@
/* 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/f/fadegammaupxcmd.h"
/**************************************************
*
* USED IN:
* puppetmotel
*
**************************************************/
namespace Director {
const char *const FadeGammaUpXCMD::xlibName = "FadeGammaUp";
const XlibFileDesc FadeGammaUpXCMD::fileNames[] = {
{ "FadeGammaUp", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "FadeGammaUp", FadeGammaUpXCMD::m_FadeGammaUp, -1, 0, 400, CBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void FadeGammaUpXCMD::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void FadeGammaUpXCMD::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
XOBJSTUB(FadeGammaUpXCMD::m_FadeGammaUp, 0)
}

View File

@@ -0,0 +1,41 @@
/* 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_FADEGAMMAUPXCMD_H
#define DIRECTOR_LINGO_XLIBS_FADEGAMMAUPXCMD_H
namespace Director {
namespace FadeGammaUpXCMD {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_FadeGammaUp(int nargs);
} // End of namespace FadeGammaUpXCMD
} // End of namespace Director
#endif

View File

@@ -0,0 +1,60 @@
/* 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/f/fadegammaxcmd.h"
/**************************************************
*
* USED IN:
* puppetmotel
*
**************************************************/
namespace Director {
const char *const FadeGammaXCMD::xlibName = "FadeGamma";
const XlibFileDesc FadeGammaXCMD::fileNames[] = {
{ "FadeGamma", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "FadeGamma", FadeGammaXCMD::m_FadeGamma, -1, 0, 400, CBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void FadeGammaXCMD::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void FadeGammaXCMD::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
XOBJSTUB(FadeGammaXCMD::m_FadeGamma, 0)
}

View File

@@ -0,0 +1,41 @@
/* 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_FADEGAMMAXCMD_H
#define DIRECTOR_LINGO_XLIBS_FADEGAMMAXCMD_H
namespace Director {
namespace FadeGammaXCMD {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_FadeGamma(int nargs);
} // End of namespace FadeGammaXCMD
} // End of namespace Director
#endif

View File

@@ -0,0 +1,115 @@
/* 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:
* Dracula's Secret
*
*************************************/
/*
* -- FEDracul External Factory.
* FEDracul
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance
* S mName --Returns the XObject name (FEIMask)
* IP mCreateInventory -- hPictOfBackground
* IPII mAddToInventory -- hPictOfItem,row,column
* P mGetInventory -- retrieve hPictOfInventory
* I mDestroyInventory --
* IIPI mSetCharData -- letter,hpicLetter,letterWidth
* I mIsWindows95
* I mDisableScreenSaver
* II mEnableScreenSaver
* I mProgramStartup
* II mProgramShutdown
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/f/fedracul.h"
namespace Director {
const char *const FEDraculXObj::xlibName = "FEDracul";
const XlibFileDesc FEDraculXObj::fileNames[] = {
{ "FEDracul", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", FEDraculXObj::m_new, 0, 0, 400 }, // D4
{ "AddToInventory", FEDraculXObj::m_AddToInventory, 3, 3, 400 }, // D4
{ "CreateInventory", FEDraculXObj::m_CreateInventory, 1, 1, 400 }, // D4
{ "DestroyInventory", FEDraculXObj::m_DestroyInventory, 0, 0, 400 }, // D4
{ "GetInventory", FEDraculXObj::m_GetInventory, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void FEDraculXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
FEDraculXObject::initMethods(xlibMethods);
FEDraculXObject *xobj = new FEDraculXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void FEDraculXObj::close(ObjectType type) {
if (type == kXObj) {
FEDraculXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
FEDraculXObject::FEDraculXObject(ObjectType ObjectType) : Object<FEDraculXObject>("FEDracul") {
_objType = ObjectType;
}
void FEDraculXObj::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
void FEDraculXObj::m_AddToInventory(int nargs) {
g_lingo->printSTUBWithArglist("FEDraculXObj::AddToInventory", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
void FEDraculXObj::m_CreateInventory(int nargs) {
g_lingo->printSTUBWithArglist("FEDraculXObj::CreateInventory", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
void FEDraculXObj::m_DestroyInventory(int nargs) {
g_lingo->printSTUBWithArglist("FEDraculXObj:mDestroyInventory", nargs);
g_lingo->push(g_lingo->_state->me);
}
void FEDraculXObj::m_GetInventory(int nargs) {
g_lingo->printSTUBWithArglist("FEDraculXObj::GetInventory", nargs);
g_lingo->push(g_lingo->_state->me);
}
} // End of namespace Director

View File

@@ -0,0 +1,51 @@
/* 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_FEDRACUL_H
#define DIRECTOR_LINGO_XLIBS_FEDRACUL_H
namespace Director {
class FEDraculXObject : public Object<FEDraculXObject> {
public:
FEDraculXObject(ObjectType objType);
};
namespace FEDraculXObj {
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_AddToInventory(int nargs);
void m_CreateInventory(int nargs);
void m_DestroyInventory(int nargs);
void m_GetInventory(int nargs);
} // End of namespace FEDraculXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,88 @@
/* 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:
* Dracula's Secret
*
*************************************/
/*
* -- FEIMasks External Factory.
* FEIMasks
* IPIIII mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance
* S mName --Returns the XObject name (FEIMask)
* III mMaskID -- h,v
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/f/feimasks.h"
namespace Director {
const char *const FEIMasksXObj::xlibName = "FEIMasks";
const XlibFileDesc FEIMasksXObj::fileNames[] = {
{ "FEIMasks", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", FEIMasksXObj::m_new, 0, 0, 400 }, // D4
{ "MaskID", FEIMasksXObj::m_MaskID, 2, 2, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void FEIMasksXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
FEIMasksXObject::initMethods(xlibMethods);
FEIMasksXObject *xobj = new FEIMasksXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void FEIMasksXObj::close(ObjectType type) {
if (type == kXObj) {
FEIMasksXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
FEIMasksXObject::FEIMasksXObject(ObjectType ObjectType) : Object<FEIMasksXObject>("FEIMasks") {
_objType = ObjectType;
}
void FEIMasksXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("FEIMasksXObj::new", nargs);
g_lingo->push(g_lingo->_state->me);
}
void FEIMasksXObj::m_MaskID(int nargs) {
g_lingo->printSTUBWithArglist("FEIMasksXObj::MaskID", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(Datum());
}
} // End of namespace Director

View File

@@ -0,0 +1,48 @@
/* 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_FEIMASKS_H
#define DIRECTOR_LINGO_XLIBS_FEIMASKS_H
namespace Director {
class FEIMasksXObject : public Object<FEIMasksXObject> {
public:
FEIMasksXObject(ObjectType objType);
};
namespace FEIMasksXObj {
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_MaskID(int nargs);
} // End of namespace IntroMaskXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,101 @@
/* 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:
* Dracula's Secret
*
*************************************/
/*
* -- FEIPrefs External Factory.
* FEIPrefs
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance
* S mName --Returns the XObject name (FEIPref)
* ISS mPrefAppName -- GroupName,AppName
* ISSS mPrefWriteString -- Section,Entry,String
* ISSI mPrefWriteInteger -- Section,Entry,Integer
* ISSI mPrefReadInteger -- Section,Entry,Default
* SSSS mPrefReadString -- Section,Entry,Default
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/f/feiprefs.h"
namespace Director {
const char *const FEIPrefsXObj::xlibName = "FEIPrefs";
const XlibFileDesc FEIPrefsXObj::fileNames[] = {
{ "feiprefs", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", FEIPrefsXObj::m_new, 0, 0, 400 }, // D4
{ "PrefAppName", FEIPrefsXObj::m_prefAppName, 2, 2, 400 }, // D4
{ "PrefReadString", FEIPrefsXObj::m_prefReadString, 3, 3, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void FEIPrefsXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
FEIPrefsXObject::initMethods(xlibMethods);
FEIPrefsXObject *xobj = new FEIPrefsXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void FEIPrefsXObj::close(ObjectType type) {
if (type == kXObj) {
FEIPrefsXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
FEIPrefsXObject::FEIPrefsXObject(ObjectType ObjectType) : Object<FEIPrefsXObject>("FEIPrefs") {
_objType = ObjectType;
}
void FEIPrefsXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("FEIPrefsXObj::new", nargs);
g_lingo->push(g_lingo->_state->me);
}
void FEIPrefsXObj::m_prefAppName(int nargs) {
g_lingo->printSTUBWithArglist("FEIPrefsXObj::m_prefAppName", nargs);
g_lingo->dropStack(nargs);
}
void FEIPrefsXObj::m_prefReadString(int nargs) {
g_lingo->printSTUBWithArglist("FEIPrefsXObj::m_prefReadString", nargs);
g_lingo->pop(); // TODO
auto key = g_lingo->pop().asString();
auto defaultValue = g_lingo->pop();
g_lingo->push(defaultValue); // TODO: Just return the default for now.
}
} // 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_FEIPREFS_H
#define DIRECTOR_LINGO_XLIBS_FEIPREFS_H
namespace Director {
class FEIPrefsXObject : public Object<FEIPrefsXObject> {
public:
FEIPrefsXObject(ObjectType objType);
};
namespace FEIPrefsXObj {
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_prefAppName(int nargs);
void m_prefReadString(int nargs);
} // End of namespace IntroMaskXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,85 @@
/* 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:
* Yearn2Learn: The Flintstones Coloring Book
*
*************************************/
/*
* © 1989,1990 Apple Computer, Inc., v.1.1, by Anup Murarka
* FileExists(pathname «, “noDialog”:errGlobal»)
*/
#include "common/file.h"
#include "common/savefile.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/f/fileexists.h"
namespace Director {
const char *const FileExists::xlibName = "FileExists";
const XlibFileDesc FileExists::fileNames[] = {
{ "FileExists", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "FileExists", FileExists::m_fileexists, 1, 1, 300, HBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void FileExists::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void FileExists::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
void FileExists::m_fileexists(int nargs) {
// This is mostly copied from FileIO::m_new
Common::SaveFileManager *saves = g_system->getSavefileManager();
Common::String path = g_lingo->pop().asString();
Common::String origpath = path;
if (!path.hasSuffixIgnoreCase(".txt")) {
path += ".txt";
}
Common::String filename = lastPathComponent(path, g_director->_dirSeparator);
if (!(saves->exists(filename))) {
Common::File file;
Common::Path location = findPath(origpath);
if (location.empty() || !file.open(location)) {
g_lingo->push(Datum(false));
return;
}
g_lingo->push(Datum(true));
}
}
} // End of namespace Director

View File

@@ -0,0 +1,41 @@
/* 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_FILEEXISTS_H
#define DIRECTOR_LINGO_XLIBS_FILEEXISTS_H
namespace Director {
namespace FileExists {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_fileexists(int nargs);
} // End of namespace FileExists
} // End of namespace Director
#endif

View File

@@ -0,0 +1,752 @@
/* 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:
* Standard Director Xtra
* Karma: Curse of the 12 Caves
*
*************************************/
/*
* -- XObject version
*
* --FileIO, Tool, 1.5.0 , 31mar92
* --© 1989-1992 MacroMind, Inc.
* --by John Thompson and Al McNeil
* ---------------------------------------------------------------------
* ---------------------------------------------------------------------
* --=METHODS=--
* --
* ISS mNew, mode, fileNameOrType --Creates a new instance of the XObject.
* -- Mode can be :
* -- "read" - Read "fileName"
* -- "?read" - Select and Read "fileType"
* -- "write" - Write "fileName"
* -- "?write" - Select and Write "fileName"
* -- "append" - Append "fileName"
* -- "?append" - Select and Append "fileName"
* -- FileType for ?read can be :
* -- "TEXT" - standard file type
* -- "trak" - cd track type
* -- etc... - Any four character combination.
* --
* X mDispose --Disposes of XObject instance.
* S mName --Returns the name of the XObject.
* /IXX mWrite, countPtr, bufferPtr --Writes out a set of chars. Returns error code.
* II mWriteChar, charNum --Writes a single character. Returns error code.
* IS mWriteString, string --Writes out a string of chars. Returns error code.
* /IXX mRead, countPtr, bufferPtr --Reads into buffer. Returns error code.
* I mReadChar --Returns a single character.
* S mReadWord --Returns the next word of an input file.
* S mReadLine --Returns the next line of an input file.
* S mReadFile --Returns the remainder of the file.
* --
* SSS mReadToken, breakString, skipString
* -- --breakstring designates character (or token) that signals to stop reading.
* -- --skipstring designates what characters (or tokens) not to read.
* I mGetPosition --Returns the file position.
* II mSetPosition, newPos --Sets the file position. Returns error code.
* I mGetLength --Returns the number of chars in the file.
* ISS mSetFinderInfo, typeString, creatorString --Sets the finder info. Returns error code.
* S mGetFinderInfo --Gets the finder info.
* S mFileName --Returns the name of the file.
* S mNativeFileName --Returns the name of the file.
* I mDelete --Delete the file and dispose of me.
* I mStatus --Returns result code of the last file io activity
* --
* SI +mError, errorCode --Returns error message string.
* -- Possible error codes:
* -- -33 :: File directory full
* -- -34 :: Volume full
* -- -35 :: Volume not found
* -- -36 :: I/O Error
* -- -37 :: Bad file name
* -- -38 :: File not open
* -- -42 :: Too many files open
* -- -43 :: File not found
* -- -56 :: No such drive
* -- -65 :: No disk in drive
* -- -120 :: Directory not found
* V mReadPICT
* II +mSetOverrideDrive, driveLetter --Set override drive letter ('A' - 'Z') to use when loading linked castmembers. Use 0x00 to clear override.
*
* -- Xtra version
-- xtra fileio -- CH May96
new object me -- create a new child instance
-- FILEIO --
fileName object me -- return fileName string of the open file
status object me -- return the error code of the last method called
error object me, int error -- return the error string of the error
setFilterMask me, string mask -- set the filter mask for dialogs
openFile object me, string fileName, int mode -- opens named file. valid modes: 0=r/w 1=r 2=w
closeFile object me -- close the file
displayOpen object me -- displays an open dialog and returns the selected fileName to lingo
displaySave object me, string title, string defaultFileName -- displays save dialog and returns selected fileName to lingo
createFile object me, string fileName -- creates a new file called fileName
setPosition object me, int position -- set the file position
getPosition object me -- get the file position
getLength object me -- get the length of the open file
writeChar object me, string theChar -- write a single character (by ASCII code) to the file
writeString object me, string theString -- write a null-terminated string to the file
readChar object me -- read the next character of the file and return it as an ASCII code value
readLine object me -- read the next line of the file (including the next RETURN) and return as a string
readFile object me -- read from current position to EOF and return as a string
readWord object me -- read the next word of the file and return it as a string
readToken object me, string skip, string break -- read the next token and return it as a string
getFinderInfo object me -- get the finder info for the open file (Mac Only)
setFinderInfo object me, string attributes -- set the finder info for the open file (Mac Only)
delete object me -- deletes the open file
+ version xtraRef -- display fileIO version and build information in the message window
* getOSDirectory -- returns the full path to the Mac System Folder or Windows Directory
*/
#include "common/file.h"
#include "common/macresman.h"
#include "common/memstream.h"
#include "common/savefile.h"
#include "image/pict.h"
#include "director/director.h"
#include "director/picture.h"
#include "director/types.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/f/fileio.h"
namespace Director {
const char *const FileIO::xlibName = "FileIO";
const XlibFileDesc FileIO::fileNames[] = {
{ "FileIO", nullptr },
{ "shFILEIO", nullptr }, // TD loads this up using openXLib("@:shFILEIO.DLL")
{ "FILE", nullptr },
{ "FILEIO16", nullptr },
{ "FileIOXtraFat", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
// XObject
{ "delete", FileIO::m_delete, 0, 0, 200 }, // D2
{ "error", FileIO::m_error, 1, 1, 200 }, // D2
{ "fileName", FileIO::m_fileName, 0, 0, 200 }, // D2
{ "getFinderInfo", FileIO::m_getFinderInfo, 0, 0, 200 }, // D2
{ "getLength", FileIO::m_getLength, 0, 0, 200 }, // D2
{ "getPosition", FileIO::m_getPosition, 0, 0, 200 }, // D2
{ "new", FileIO::m_new, 0, 2, 200 }, // D2
{ "readChar", FileIO::m_readChar, 0, 0, 200 }, // D2
{ "readFile", FileIO::m_readFile, 0, 0, 200 }, // D2
{ "readLine", FileIO::m_readLine, 0, 0, 200 }, // D2
{ "readToken", FileIO::m_readToken, 2, 2, 200 }, // D2
{ "readPict", FileIO::m_readPict, 0, 0, 300 }, // D3
{ "readWord", FileIO::m_readWord, 0, 0, 200 }, // D2
{ "setFinderInfo", FileIO::m_setFinderInfo, 2, 2, 200 }, // D2
{ "setPosition", FileIO::m_setPosition, 1, 1, 200 }, // D2
{ "status", FileIO::m_status, 0, 0, 200 }, // D2
{ "writeChar", FileIO::m_writeChar, 1, 1, 200 }, // D2
{ "writeString", FileIO::m_writeString, 1, 1, 200 }, // D2
// Windows only?
{ "setOverrideDrive", FileIO::m_setOverrideDrive, 1, 1, 300 }, // D3
// Xtra
{ "closeFile", FileIO::m_closeFile, 0, 0, 500 }, // D5
{ "createFile", FileIO::m_createFile, 1, 1, 500 }, // D5
{ "displayOpen", FileIO::m_displayOpen, 0, 0, 500 }, // D5
{ "displaySave", FileIO::m_displaySave, 2, 2, 500 }, // D5
{ "openFile", FileIO::m_openFile, 2, 2, 500 }, // D5
{ "setFilterMask", FileIO::m_setFilterMask, 1, 1, 500 }, // D5
{ nullptr, nullptr, 0, 0, 0 }
};
static const BuiltinProto xlibBuiltins[] = {
{ "getOSDirectory", FileIO::m_getOSDirectory, 0, 0, 500, HBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void FileIO::open(ObjectType type, const Common::Path &path) {
FileObject::initMethods(xlibMethods);
FileObject *xobj = new FileObject(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 FileIO::close(ObjectType type) {
FileObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
// Initialization/disposal
FileObject::FileObject(ObjectType objType) : Object<FileObject>("FileIO") {
_objType = objType;
_filename = nullptr;
_inStream = nullptr;
_outFile = nullptr;
_outStream = nullptr;
_lastError = kErrorNone;
}
FileObject::FileObject(const FileObject &obj) : Object<FileObject>(obj) {
_objType = obj.getObjType();
_filename = nullptr;
_inStream = nullptr;
_outFile = nullptr;
_outStream = nullptr;
_lastError = kErrorNone;
}
FileObject::~FileObject() {
clear();
}
bool FileObject::hasProp(const Common::String &propName) {
return (propName == "name");
}
Datum FileObject::getProp(const Common::String &propName) {
if (propName == "name")
return Datum(FileIO::xlibName);
warning("FileIO::getProp: unknown property '%s'", propName.c_str());
return Datum();
}
FileIOError FileObject::open(const Common::String &origpath, const Common::String &mode) {
Common::SaveFileManager *saves = g_system->getSavefileManager();
Common::String path = origpath;
Common::String option = mode;
char dirSeparator = g_director->_dirSeparator;
Common::String prefix = savePrefix();
if (option.hasPrefix("?")) {
option = option.substr(1);
path = getFileNameFromModal(option.equalsIgnoreCase("write"), origpath, Common::String(), "txt");
if (path.empty()) {
return kErrorFileNotFound;
}
dirSeparator = '/';
} else if (!path.hasSuffixIgnoreCase(".txt")) {
path += ".txt";
}
// We pretend that drive E:\ is a read-only CD-ROM
// It helps with CD checks in many games
if (option.equalsIgnoreCase("write") || option.equalsIgnoreCase("append")) {
if (origpath.hasPrefixIgnoreCase("E:\\"))
return kErrorIO;
}
// In general, we assume that there are no drives beyond disk E:
if (origpath.size() >= 2 && origpath[1] == ':' && (toupper(origpath[0]) > 'E')) {
return kErrorIO;
}
// Enforce target to the created files so they do not mix up
Common::String filenameOrig = lastPathComponent(path, dirSeparator);
Common::String filename = filenameOrig;
if (!filename.hasPrefixIgnoreCase(prefix))
filename = prefix + filenameOrig;
if (option.equalsIgnoreCase("read")) {
_inStream = saves->openForLoading(filename);
if (!_inStream) {
// Maybe we're trying to read one of the game files
Common::Path location = findPath(origpath);
Common::SeekableReadStream *file = Common::MacResManager::openFileOrDataFork(location);
if (!file) {
return saveFileError();
}
_inStream = file;
}
} else if (option.equalsIgnoreCase("write")) {
// OutSaveFile is not seekable so create a separate seekable stream
// which will be written to the _outFile upon disposal
_outFile = saves->openForSaving(filename, false);
_outStream = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES);
if (!_outFile) {
return saveFileError();
}
} else if (option.equalsIgnoreCase("append")) {
Common::SeekableReadStream *inFile = saves->openForLoading(filename);
if (!inFile) {
Common::Path location = findPath(origpath);
Common::SeekableReadStream *file = Common::MacResManager::openFileOrDataFork(location);
if (!file) {
return saveFileError();
}
inFile = file;
}
_outStream = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES);
byte b = inFile->readByte();
while (!inFile->eos() && !inFile->err()) {
_outStream->writeByte(b);
b = inFile->readByte();
}
delete inFile;
_outFile = saves->openForSaving(filename, false);
if (!_outFile) {
return saveFileError();
}
} else {
error("Unsupported FileIO option: '%s'", option.c_str());
}
_filename = new Common::String(filename);
return kErrorNone;
}
void FileObject::clear() {
if (_filename) {
delete _filename;
_filename = nullptr;
}
if (_inStream) {
delete _inStream;
_inStream = nullptr;
}
if (_outFile) {
_outFile->write(_outStream->getData(), _outStream->size());
_outFile->finalize();
delete _outFile;
delete _outStream;
_outFile = nullptr;
_outStream = nullptr;
}
}
void FileObject::dispose() {
_disposed = true;
clear();
}
FileIOError FileObject::saveFileError() {
Common::SaveFileManager *saves = g_system->getSavefileManager();
if (saves->getError().getCode()) {
warning("SaveFileManager error %d: %s", saves->getError().getCode(), saves->getErrorDesc().c_str());
return kErrorIO;
} else {
return kErrorFileNotFound;
}
}
void FileIO::m_new(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
Datum result = g_lingo->_state->me;
if (nargs == 2) {
if (me->getObjType() != kXObj) {
warning("FileIO::m_new: called with XObject API however was expecting object type %d", me->getObjType());
}
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
Common::String option = d1.asString();
Common::String path = d2.asString();
FileIOError err = me->open(path, option);
// if there's an error, return an errorcode int instead of an object
if (err != kErrorNone) {
me->_lastError = err;
warning("FileIO::m_new: couldn't open file at path %s, error %d", path.c_str(), err);
g_lingo->push(Datum(err));
return;
}
} else if (nargs == 0) {
if (me->getObjType() != kXtraObj) {
warning("FileIO::m_new: called with Xtra API however was expecting object type %d", me->getObjType());
}
} else {
warning("FileIO::m_new: expected 0 or 2 args, assuming 0");
g_lingo->dropStack(nargs);
}
g_lingo->push(result);
}
void FileIO::m_openFile(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
Datum d1 = g_lingo->pop();
Datum d2 = g_lingo->pop();
int mode = d1.asInt();
Common::String option;
switch (mode) {
case 1:
option = "read";
break;
case 2:
option = "write";
break;
case 0:
default:
warning("FIXME: Mode %d not supported, falling back to read", mode);
option = "read";
break;
}
Common::String path = d2.asString();
me->_lastError = me->open(path, option);
}
void FileIO::m_closeFile(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
me->clear();
}
// FIXME: split out filename-to-savegame logic from open() so we can implement createFile
XOBJSTUB(FileIO::m_createFile, 0)
void FileIO::m_displayOpen(int nargs) {
g_lingo->push(getFileNameFromModal(false, Common::String(), Common::String(), "txt"));
}
void FileIO::m_displaySave(int nargs) {
Datum defaultFileName = g_lingo->pop();
Datum title = g_lingo->pop();
g_lingo->push(getFileNameFromModal(true, Common::String(), title.asString(), "txt"));
}
XOBJSTUB(FileIO::m_setFilterMask, 0)
// Read
void FileIO::m_readChar(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
if (!me->_inStream || me->_inStream->eos() || me->_inStream->err()) {
g_lingo->push(Datum(kErrorEOF));
return;
}
int ch = me->_inStream->readByte();
if (me->_inStream->eos() || me->_inStream->err()) {
ch = kErrorEOF;
}
g_lingo->push(Datum(ch));
}
void FileIO::m_readLine(int nargs) {
// file(mReadLine) is equivalent to file(mReadToken, "", RETURN)
// See D4 Using Lingo p. 323
g_lingo->push(Datum(""));
g_lingo->push(Datum("\r"));
FileIO::m_readToken(2);
}
void FileIO::m_readWord(int nargs) {
// file(mReadWord) is equivalent to file(mReadToken, " ", " " & RETURN)
// See D4 Using Lingo p. 323
g_lingo->push(Datum(" "));
g_lingo->push(Datum(" \r"));
FileIO::m_readToken(2);
}
void FileIO::m_readPict(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
Datum result;
if (!me->_inStream || me->_inStream->err()) {
g_lingo->push(result);
return;
}
me->_inStream->seek(0, SEEK_SET);
Image::PICTDecoder decoder;
if (decoder.loadStream(*me->_inStream)) {
result.type = PICTUREREF;
result.u.picture = new PictureReference;
result.u.picture->_picture = new Picture(decoder);
}
g_lingo->push(result);
return;
}
bool FileIO::charInMatchString(char ch, const Common::String &matchString) {
return matchString.contains(ch);
}
void FileIO::m_readToken(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
Common::String skipString = d1.asString();
Common::String breakString = d2.asString();
if (!me->_inStream || me->_inStream->eos() || me->_inStream->err()) {
g_lingo->push(Datum(""));
return;
}
Common::String tok = "";
char ch;
do {
ch = me->_inStream->readByte();
if (me->_inStream->eos() || me->_inStream->err()) {
g_lingo->push(Datum(tok));
return;
}
} while (charInMatchString(ch, skipString));
while (!charInMatchString(ch, breakString)) {
tok += ch;
ch = me->_inStream->readByte();
if (me->_inStream->eos() || me->_inStream->err()) {
g_lingo->push(Datum(tok));
return;
}
}
// Include the break character when the skipString is empty
if (skipString.size() == 0) {
tok += ch;
} else {
me->_inStream->seek(-1, SEEK_CUR);
}
g_lingo->push(Datum(tok));
}
void FileIO::m_readFile(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
if (!me->_inStream || me->_inStream->eos() || me->_inStream->err()) {
g_lingo->push(Datum(""));
return;
}
Common::String res;
char ch = me->_inStream->readByte();
while (!me->_inStream->eos() && !me->_inStream->err()) {
res += ch;
ch = me->_inStream->readByte();
}
g_lingo->push(res);
}
// Write
void FileIO::m_writeChar(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
Datum d = g_lingo->pop();
if (!me->_outStream) {
g_lingo->push(Datum(kErrorReadOnly));
return;
}
me->_outStream->writeByte(d.asInt());
g_lingo->push(Datum(kErrorNone));
}
void FileIO::m_writeString(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
Datum d = g_lingo->pop();
if (!me->_outStream) {
g_lingo->push(Datum(kErrorReadOnly));
return;
}
Common::U32String unicodeString = Common::U32String(d.asString(), Common::kUtf8);
Common::String encodedString = unicodeString.encode(g_director->getPlatformEncoding());
me->_outStream->writeString(encodedString);
g_lingo->push(Datum(kErrorNone));
}
// Getters/Setters
XOBJSTUB(FileIO::m_getFinderInfo, "")
XOBJSTUB(FileIO::m_setFinderInfo, 0)
void FileIO::m_getPosition(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
if (me->_inStream) {
g_lingo->push(Datum((int)me->_inStream->pos()));
} else if (me->_outStream) {
g_lingo->push(Datum((int)me->_outStream->pos()));
} else {
warning("FileIO: No file open");
g_lingo->push(Datum(kErrorFileNotOpen));
}
}
void FileIO::m_setPosition(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
Datum d = g_lingo->pop();
int pos = d.asInt();
if (me->_inStream) {
if (pos <= me->_inStream->size()) {
me->_inStream->seek(pos, SEEK_SET);
g_lingo->push(Datum(kErrorNone));
} else {
me->_inStream->seek(me->_inStream->size(), SEEK_SET);
g_lingo->push(Datum(kErrorInvalidPos));
}
} else if (me->_outStream) {
if (pos <= me->_outStream->size()) {
me->_outStream->seek(pos, SEEK_SET);
g_lingo->push(Datum(kErrorNone));
} else {
me->_outStream->seek(me->_outStream->size(), SEEK_SET);
g_lingo->push(Datum(kErrorInvalidPos));
}
} else {
warning("FileIO: No file open");
g_lingo->push(Datum(kErrorFileNotOpen));
}
}
void FileIO::m_getLength(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
if (me->_inStream) {
g_lingo->push(Datum((int)me->_inStream->size()));
} else if (me->_outStream) {
g_lingo->push(Datum((int)me->_outStream->size()));
} else {
warning("FileIO: No file open");
g_lingo->push(Datum(kErrorFileNotOpen));
}
}
void FileIO::m_fileName(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
if (me->_filename) {
Common::String prefix = savePrefix();
Common::String res = *me->_filename;
if (res.hasPrefix(prefix)) {
res = Common::String(&me->_filename->c_str()[prefix.size()]);
}
g_lingo->push(Datum(res));
} else {
warning("FileIO: No file open");
g_lingo->push(Datum(kErrorFileNotOpen));
}
}
void FileIO::m_error(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
Datum d = g_lingo->pop();
Datum result("");
switch (d.asInt()) {
case kErrorNone:
if (me->getObjType() == kXtraObj) {
result = Datum("OK");
}
break;
case kErrorMemAlloc:
result = Datum("Memory allocation failure");
break;
case kErrorDirectoryFull:
result = Datum("File directory full");
break;
case kErrorVolumeFull:
result = Datum("Volume full");
break;
case kErrorVolumeNotFound:
result = Datum("Volume not found");
break;
case kErrorIO:
result = Datum("I/O Error");
break;
case kErrorBadFileName:
result = Datum("Bad file name");
break;
case kErrorFileNotOpen:
result = Datum("File not open");
break;
case kErrorTooManyFilesOpen:
result = Datum("Too many files open");
break;
case kErrorFileNotFound:
result = Datum("File not found");
break;
case kErrorNoSuchDrive:
result = Datum("No such drive");
break;
case kErrorNoDiskInDrive:
result = Datum("No disk in drive");
break;
case kErrorDirectoryNotFound:
result = Datum("Directory not found");
break;
default:
result = Datum("Unknown error");
break;
}
g_lingo->push(result);
}
void FileIO::m_status(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
g_lingo->push(Datum(me->_lastError));
}
// Other
void FileIO::m_delete(int nargs) {
FileObject *me = static_cast<FileObject *>(g_lingo->_state->me.u.obj);
if (me->_filename) {
Common::String filename = *me->_filename;
// Xtra version does not dispose handle on file delete
if (me->getObjType() == kXObj) {
me->dispose();
}
if (g_system->getSavefileManager()->removeSavefile(filename)) {
g_lingo->push(Datum(kErrorNone));
} else {
g_lingo->push(Datum(kErrorIO));
}
} else {
warning("FileIO: No file open");
g_lingo->push(Datum(kErrorFileNotOpen));
}
}
// Non-standard extensions
XOBJSTUBNR(FileIO::m_setOverrideDrive)
XOBJSTUB(FileIO::m_getOSDirectory, "")
} // End of namespace Director

View File

@@ -0,0 +1,118 @@
/* 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_FILEIO_H
#define DIRECTOR_LINGO_XLIBS_FILEIO_H
namespace Common {
class SeekableReadStream;
typedef SeekableReadStream InSaveFile;
class OutSaveFile;
class MemoryWriteStreamDynamic;
class String;
}
namespace Director {
enum FileIOError {
kErrorNone = 0,
kErrorMemAlloc = 1,
kErrorEOF = -1,
kErrorDirectoryFull = -33,
kErrorVolumeFull = -34,
kErrorVolumeNotFound = -35,
kErrorIO = -36,
kErrorBadFileName = -37,
kErrorFileNotOpen = -38,
kErrorInvalidPos = -39, // undocumented
kErrorTooManyFilesOpen = -42,
kErrorFileNotFound = -43,
kErrorNoSuchDrive = -56,
kErrorReadOnly = -61, // undocumented
kErrorNoDiskInDrive = -65,
kErrorDirectoryNotFound = -120
};
class FileObject : public Object<FileObject> {
public:
Common::String *_filename;
Common::SeekableReadStream *_inStream;
Common::OutSaveFile *_outFile;
Common::MemoryWriteStreamDynamic *_outStream;
FileIOError _lastError;
public:
FileObject(ObjectType objType);
FileObject(const FileObject &obj);
~FileObject() override;
bool hasProp(const Common::String &propName) override;
Datum getProp(const Common::String &propName) override;
FileIOError open(const Common::String &origpath, const Common::String &mode);
void clear();
FileIOError saveFileError();
void dispose() override;
};
namespace FileIO {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
bool charInMatchString(char ch, const Common::String &matchString);
void m_delete(int nargs);
void m_dispose(int nargs);
void m_error(int nargs);
void m_fileName(int nargs);
void m_getFinderInfo(int nargs);
void m_getLength(int nargs);
void m_getPosition(int nargs);
void m_new(int nargs);
void m_readChar(int nargs);
void m_readFile(int nargs);
void m_readLine(int nargs);
void m_readPict(int nargs);
void m_readToken(int nargs);
void m_readWord(int nargs);
void m_setFinderInfo(int nargs);
void m_setPosition(int nargs);
void m_status(int nargs);
void m_writeChar(int nargs);
void m_writeString(int nards);
void m_setOverrideDrive(int nargs);
void m_closeFile(int nargs);
void m_createFile(int nargs);
void m_displayOpen(int nargs);
void m_displaySave(int nargs);
void m_openFile(int nargs);
void m_setFilterMask(int nargs);
void m_getOSDirectory(int nargs);
} // End of namespace FileIO
} // End of namespace Director
#endif

View File

@@ -0,0 +1,60 @@
/* 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/f/findereventsxcmd.h"
/**************************************************
*
* USED IN:
* puppetmotel
*
**************************************************/
namespace Director {
const char *const FinderEventsXCMD::xlibName = "FinderEvents";
const XlibFileDesc FinderEventsXCMD::fileNames[] = {
{ "FinderEvents", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "FinderEvents", FinderEventsXCMD::m_FinderEvents, -1, 0, 400, CBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void FinderEventsXCMD::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void FinderEventsXCMD::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
XOBJSTUB(FinderEventsXCMD::m_FinderEvents, 0)
}

View File

@@ -0,0 +1,41 @@
/* 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_FINDEREVENTSXCMD_H
#define DIRECTOR_LINGO_XLIBS_FINDEREVENTSXCMD_H
namespace Director {
namespace FinderEventsXCMD {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_FinderEvents(int nargs);
} // End of namespace FinderEventsXCMD
} // End of namespace Director
#endif

View File

@@ -0,0 +1,117 @@
/* 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:
* Yearn2Learn: The Flintstones Coloring Book
*
*************************************/
/*
* FindFolder 1.1
*
* by Frédéric RINALDI
*
*
* DESCRIPTION
* ------------
* FindFolder returns the full pathname of the active System folder or any of its reserved folders (System 7.0).
*
*
* SYNTAX
* -------
* FindFolder([<folder descriptor>[,<create it>]])
*
* PARAMETERS
* ------------
* <folder descriptor> is a string describing the folder. It must be one of these values (only first char is checked) :
* A[pple menu]
* C[ontrol Panel]
* D[esktop]
* E[xtensions]
* F[onts] (System 7.1 only)
* P[references]
* M[onitor printing]
* N[etwork trash]
* T[rash]
* I[tems startup]
* S[ystem]
* Y : TemporarY items
*
* Default value is "S".
*
* <create it> is a boolean telling if the XFCN must create the folder if not found (only with System 7.0). Default is FALSE.
*
* Both parameters are optional. Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
*
* USING
* -----
* The XFCN returns the full pathname of the requested folder, ending with colon.
* Under System 6.0, only current System folder can be returned.
*
* ERRORS
* -------
* If an error occurs, the XFCN can return :
* "Error : Empty parameter"
* "Error : Second param must be boolean"
* "Error : Folder not found"
* "Error : Found file instead of folder"
*
* HISTORY
* -------
* 1.1 : 04/21/92
* • Added "font" param for System 7.1
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/f/findfolder.h"
namespace Director {
const char *const FindFolder::xlibName = "FindFolder";
const XlibFileDesc FindFolder::fileNames[] = {
{ "FindFolder", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "FindFolder", FindFolder::m_findfolder, 0, 2, 300, HBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void FindFolder::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void FindFolder::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
void FindFolder::m_findfolder(int nargs) {
g_lingo->dropStack(nargs);
g_lingo->push(Datum(""));
}
} // End of namespace Director

View File

@@ -0,0 +1,41 @@
/* 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_FINDFOLDER_H
#define DIRECTOR_LINGO_XLIBS_FINDFOLDER_H
namespace Director {
namespace FindFolder {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_findfolder(int nargs);
} // End of namespace FindFolder
} // End of namespace Director
#endif

View File

@@ -0,0 +1,91 @@
/* 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
*
*************************************/
/*
* Findsys
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance
* S mDo --Return the System directory path as a string
* -- Returns pathname OR:
* -- <empty string> couldn't allocate memory
* -- string beginning with the word 'Error:<description>'
* -- The Windows directory is where you should write Preferences files etc.
* -- Mark_Carolan@aapda.com.au Compuserve 100242,1154
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/f/findsys.h"
namespace Director {
// The name is different from the obj filename.
const char *const FindSys::xlibName = "FindSys";
const XlibFileDesc FindSys::fileNames[] = {
{ "FindSys", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", FindSys::m_new, 0, 0, 400 }, // D4
{ "do", FindSys::m_do, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void FindSys::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
FindSysXObject::initMethods(xlibMethods);
FindSysXObject *xobj = new FindSysXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void FindSys::close(ObjectType type) {
if (type == kXObj) {
FindSysXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
FindSysXObject::FindSysXObject(ObjectType ObjectType) : Object<FindSysXObject>("FindSys") {
_objType = ObjectType;
}
void FindSys::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
void FindSys::m_do(int nargs) {
g_lingo->push(Common::String("C:\\WINDOWS\\"));
}
} // End of namespace Director

View File

@@ -0,0 +1,47 @@
/* 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_FINDSYS_H
#define DIRECTOR_LINGO_XLIBS_FINDSYS_H
namespace Director {
class FindSysXObject : public Object<FindSysXObject> {
public:
FindSysXObject(ObjectType objType);
};
namespace FindSys {
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_do(int nargs);
} // End of namespace FindSys
} // End of namespace Director
#endif

View File

@@ -0,0 +1,88 @@
/* 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:
* tivolafall1998
* tivolaspring1999
* tivolasummer2000
*
*************************************/
/*
-- FindWin. Returns path to Windows directory. Mark_Carolan@aapda.com.au
--FindWin
I mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
S mDo --Return the System directory path as a string
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/f/findwin.h"
namespace Director {
// The name is different from the obj filename.
const char *const FindWin::xlibName = "FindWin";
const XlibFileDesc FindWin::fileNames[] = {
{ "FindWin", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", FindWin::m_new, 0, 0, 400 }, // D4
{ "do", FindWin::m_do, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void FindWin::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
FindWinXObject::initMethods(xlibMethods);
FindWinXObject *xobj = new FindWinXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void FindWin::close(ObjectType type) {
if (type == kXObj) {
FindWinXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
FindWinXObject::FindWinXObject(ObjectType ObjectType) : Object<FindWinXObject>("FindWin") {
_objType = ObjectType;
}
void FindWin::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
void FindWin::m_do(int nargs) {
g_lingo->push(Common::String("C:\\WINDOWS\\"));
}
} // End of namespace Director

View File

@@ -0,0 +1,47 @@
/* 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_FINDWIN_H
#define DIRECTOR_LINGO_XLIBS_FINDWIN_H
namespace Director {
class FindWinXObject : public Object<FindWinXObject> {
public:
FindWinXObject(ObjectType objType);
};
namespace FindWin {
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_do(int nargs);
} // End of namespace FindWin
} // End of namespace Director
#endif

View File

@@ -0,0 +1,136 @@
/* 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/>.
*
*/
/* FlushXObj is a Mac only XObject to call the underlying FlushEvents function
* from the Macintosh Toolbox. Its purpose is to flush, i.e. remove, events
* that happened while loading code.
*
* Implemented as a no-op, there's no need to flush events because:
* - ScummVM handles them and
* - computers were slower and queued events when the program was loading.
*
* More information about the Toolbox and the flush events can be found here:
* https://en.wikipedia.org/wiki/Macintosh_Toolbox
* https://developer.apple.com/legacy/library/documentation/mac/pdf/MacintoshToolboxEssentials.pdf
*
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/f/flushxobj.h"
/*************************************
*
* USED IN:
* majestic-mac
*
*************************************/
/*
* 8-- FlushEvents: an XObject to call toolbox FlushEvents().-- By Scott Kelley , sakelley@ucsd.edu, 6/2/93?-- Copyright
* 1993 The Regents of the University of California;-- Freely distributable. No warranties. Ask before selling!
* --5-- mNew creates a new instance of the Flush XObject.@-- Note that the object contains internal variables which allow>-- a unique masking operation to be built for each object, or:-- mFlushEvents can pass masks to FlushEvents() directly.
* I mNew
* --?-- mFlushEvents is identical to the toolbox call FlushEvents()%XII mFlushEvents, eventMask, stopMask
* --?-- mClearMask clears the object's internal masks. Note that if<-- you never call this, the object starts with a default of9-- flushing everything (i.e. FlushEvent(everyEvent,0) )
* X mClearMask
* --<-- mAddToMask adds the specified event mask to the object's8-- internal masks (i.e. OR's it with the existing mask)!XII mAddToMask eventMask,stopMask
* --6-- mFlush calls FlushEvents() with the internal masks
* X mFlush
* --"-- mDispose gets rid of an object2X mDispose -- dispose of an instance of u * s
*/
namespace Director {
const char *const FlushXObj::xlibNames[] = {
"FlushXObj",
"Johnny",
nullptr,
};
const XlibFileDesc FlushXObj::fileNames[] = {
{ "FlushEvents", nullptr },
{ "FlushXObj", nullptr },
{ "Johnny", nullptr },
{ "Johnny.XObj", nullptr },
{ "Toilet", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", FlushXObj::m_new, 0, 0, 300 }, // D3
{ "AddToMask", FlushXObj::m_addToMask, 2, 2, 400 }, // D4
{ "ClearMask", FlushXObj::m_clearMask, 0, 0, 400 }, // D4
{ "Flush", FlushXObj::m_flush, 0, 0, 300 }, // D3
{ "FlushEvents", FlushXObj::m_flushEvents, 2, 2, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void FlushXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
FlushXObject::initMethods(xlibMethods);
FlushXObject *xobj = new FlushXObject(kXObj);
for (uint i = 0; xlibNames[i]; i++) {
g_lingo->exposeXObject(xlibNames[i], xobj);
}
}
}
void FlushXObj::close(ObjectType type) {
if (type == kXObj) {
FlushXObject::cleanupMethods();
for (uint i = 0; xlibNames[i]; i++) {
g_lingo->_globalvars[xlibNames[i]] = Datum();
}
}
}
FlushXObject::FlushXObject(ObjectType ObjectType) :Object<FlushXObject>("FlushXObj") {
_objType = ObjectType;
}
void FlushXObj::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
void FlushXObj::m_clearMask(int nargs) {
debug(5, "FlushXobj::m_clearMask: no-op");
}
void FlushXObj::m_addToMask(int nargs) {
g_lingo->pop();
g_lingo->pop();
debug(5, "FlushXobj::m_addToMask: no-op");
}
void FlushXObj::m_flush(int nargs) {
debug(5, "FlushXobj::m_flush: no-op");
}
void FlushXObj::m_flushEvents(int nargs) {
g_lingo->pop();
g_lingo->pop();
debug(5, "FlushXobj::m_flush: no-op");
}
} // End of namespace Director

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_FLUSHXOBJ_H
#define DIRECTOR_LINGO_XLIBS_FLUSHXOBJ_H
namespace Director {
class FlushXObject : public Object<FlushXObject> {
public:
FlushXObject(ObjectType objType);
};
namespace FlushXObj {
extern const char *const xlibNames[];
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_clearMask(int nargs);
void m_addToMask(int nargs);
void m_flush(int nargs);
void m_flushEvents(int nargs);
} // End of namespace FlushXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,115 @@
/* 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:
* Spaceship Warlock (Mac)
*
*************************************/
/*
* Version 2.0.3 Copyright © 1988-90 Farallon Computing, Inc.
*/
#include "director/director.h"
#include "director/sound.h"
#include "director/window.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/f/fplayxobj.h"
#include "audio/audiostream.h"
namespace Director {
const char *const FPlayXObj::xlibName = "FPlay";
const XlibFileDesc FPlayXObj::fileNames[] = {
{ "FPlayXObj", nullptr },
{ "FPlay", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "FPlay", FPlayXObj::b_fplay, -1,0, 200, CBLTIN }, // XCMD
{ "CopySnd", FPlayXObj::b_copysnd, -1,0, 200, CBLTIN }, // XCMD
{ "EraseSnd", FPlayXObj::b_erasesnd, -1,0, 200, CBLTIN }, // XCMD
{ "PasteSnd", FPlayXObj::b_pastesnd, -1,0, 200, CBLTIN }, // XCMD
{ "RenameSnd", FPlayXObj::b_renamesnd, -1,0, 200, CBLTIN }, // XCMD
{ "DuplicateSnd", FPlayXObj::b_duplicatesnd, -1,0, 200, CBLTIN }, // XCMD
{ "SndInfo", FPlayXObj::b_sndinfo, -1,0, 200, FBLTIN }, // XFCN
{ "SndList", FPlayXObj::b_sndlist, -1,0, 200, FBLTIN }, // XFCN
{ "Volume", FPlayXObj::b_volume, -1,0, 200, FBLTIN }, // XFCN
{ "FileName", FPlayXObj::b_filename, -1,0, 200, FBLTIN }, // XFCN
{ "InputLevel", FPlayXObj::b_inputlevel, -1,0, 200, FBLTIN }, // XFCN
{ "FSound", FPlayXObj::b_fsound, 0,0, 200, FBLTIN }, // XFCN
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void FPlayXObj::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void FPlayXObj::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
void FPlayXObj::b_fplay(int nargs) {
if (nargs == 0) {
warning("FPlayXObj::b_fplay: requires at least one argument");
return;
}
Common::Array<Common::String> arr(nargs);
for (int i = nargs - 1; i >= 0; i--) {
arr[i] = g_lingo->pop().asString();
}
DirectorSound *sound = g_director->getCurrentWindow()->getSoundManager();
sound->playFPlaySound(arr);
}
XOBJSTUBV(FPlayXObj::b_copysnd)
XOBJSTUBV(FPlayXObj::b_erasesnd)
XOBJSTUBV(FPlayXObj::b_pastesnd)
XOBJSTUBV(FPlayXObj::b_renamesnd)
XOBJSTUBV(FPlayXObj::b_duplicatesnd)
XOBJSTUBV(FPlayXObj::b_sndinfo)
XOBJSTUBV(FPlayXObj::b_sndlist)
XOBJSTUBV(FPlayXObj::b_volume)
XOBJSTUBV(FPlayXObj::b_filename)
XOBJSTUBV(FPlayXObj::b_inputlevel)
void FPlayXObj::b_fsound(int nargs) {
if (nargs != 0) {
warning("FPlayXObj::b_fsound: unhandled arguments");
g_lingo->dropStack(nargs);
}
DirectorSound *sound = g_director->getCurrentWindow()->getSoundManager();
if (sound->isChannelActive(1)) {
g_lingo->push(Datum(sound->getCurrentSound()));
} else {
g_lingo->push(Datum("done"));
}
}
} // End of namespace Director

View File

@@ -0,0 +1,52 @@
/* 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_FPLAYXOBJ_H
#define DIRECTOR_LINGO_XLIBS_FPLAYXOBJ_H
namespace Director {
namespace FPlayXObj {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void b_fplay(int nargs);
void b_copysnd(int nargs);
void b_erasesnd(int nargs);
void b_pastesnd(int nargs);
void b_renamesnd(int nargs);
void b_duplicatesnd(int nargs);
void b_sndinfo(int nargs);
void b_sndlist(int nargs);
void b_volume(int nargs);
void b_filename(int nargs);
void b_inputlevel(int nargs);
void b_fsound(int nargs);
} // End of namespace FPlayXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,101 @@
/* 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/f/fsutil.h"
/**************************************************
*
* USED IN:
* Amusement Planet Phantasmagoria
* Ursa Minor Blue
*
**************************************************/
/*
-- FSUtil XObj v0.1d ©1995 Halfmoon Systems Co. Ltd.
I mNew
X mDispose
S mGetSystemFolder
IS mMakeFolder, <FolderPath>
*/
namespace Director {
const char *const FSUtilXObj::xlibName = "FSUtil";
const XlibFileDesc FSUtilXObj::fileNames[] = {
{ "FSUtil", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", FSUtilXObj::m_new, 0, 0, 400 },
{ "dispose", FSUtilXObj::m_dispose, 0, 0, 400 },
{ "getSystemFolder", FSUtilXObj::m_getSystemFolder, 0, 0, 400 },
{ "makeFolder", FSUtilXObj::m_makeFolder, 1, 1, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
static const BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
FSUtilXObject::FSUtilXObject(ObjectType ObjectType) :Object<FSUtilXObject>("FSUtil") {
_objType = ObjectType;
}
void FSUtilXObj::open(ObjectType type, const Common::Path &path) {
FSUtilXObject::initMethods(xlibMethods);
FSUtilXObject *xobj = new FSUtilXObject(type);
if (type == kXtraObj)
g_lingo->_openXtras.push_back(xlibName);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void FSUtilXObj::close(ObjectType type) {
FSUtilXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void FSUtilXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("FSUtilXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(FSUtilXObj::m_dispose)
// This stub is fine: a system folder of "" roots the files it creates in
// ScummVM's save directory.
XOBJSTUB(FSUtilXObj::m_getSystemFolder, "")
// This stub is also fine; the only folders it creates are within the
// save directory, and since ScummVM encodes the path inside the filename
// instead of actually creating directories, we don't have to do anything.
XOBJSTUB(FSUtilXObj::m_makeFolder, 0)
}

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_FSUTIL_H
#define DIRECTOR_LINGO_XLIBS_FSUTIL_H
namespace Director {
class FSUtilXObject : public Object<FSUtilXObject> {
public:
FSUtilXObject(ObjectType objType);
};
namespace FSUtilXObj {
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_getSystemFolder(int nargs);
void m_makeFolder(int nargs);
} // End of namespace FSUtilXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,106 @@
/* 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/g/genutils.h"
/**************************************************
*
* USED IN:
* Isis
*
**************************************************/
/*
-- GenUtils External Factory. 16Feb93 PTM
--GenUtils
I mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
S mName --Returns the XObject name (GenUtils)
I mStatus --Returns an integer status code
S mGetWindowsFolder --Retrieves the location of the windows folder
I mFlushEvents --Clears the event queue.
III mMoveCursor --Moves the cursor to x,y
III mClickCursor --Moves the cursor to x,y and clicks it.
*/
namespace Director {
const char *const GenUtilsXObj::xlibName = "GenUtils";
const XlibFileDesc GenUtilsXObj::fileNames[] = {
{ "GENUTILS", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", GenUtilsXObj::m_new, 0, 0, 400 },
{ "dispose", GenUtilsXObj::m_dispose, 0, 0, 400 },
{ "name", GenUtilsXObj::m_name, 0, 0, 400 },
{ "status", GenUtilsXObj::m_status, 0, 0, 400 },
{ "getWindowsFolder", GenUtilsXObj::m_getWindowsFolder, 0, 0, 400 },
{ "flushEvents", GenUtilsXObj::m_flushEvents, 0, 0, 400 },
{ "moveCursor", GenUtilsXObj::m_moveCursor, 2, 2, 400 },
{ "clickCursor", GenUtilsXObj::m_clickCursor, 2, 2, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
static const BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
GenUtilsXObject::GenUtilsXObject(ObjectType ObjectType) :Object<GenUtilsXObject>("GenUtils") {
_objType = ObjectType;
}
void GenUtilsXObj::open(ObjectType type, const Common::Path &path) {
GenUtilsXObject::initMethods(xlibMethods);
GenUtilsXObject *xobj = new GenUtilsXObject(type);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void GenUtilsXObj::close(ObjectType type) {
GenUtilsXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void GenUtilsXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("GenUtilsXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(GenUtilsXObj::m_dispose)
XOBJSTUB(GenUtilsXObj::m_name, "")
XOBJSTUB(GenUtilsXObj::m_status, 0)
XOBJSTUB(GenUtilsXObj::m_getWindowsFolder, "")
XOBJSTUB(GenUtilsXObj::m_flushEvents, 0)
XOBJSTUB(GenUtilsXObj::m_moveCursor, 0)
XOBJSTUB(GenUtilsXObj::m_clickCursor, 0)
}

View File

@@ -0,0 +1,53 @@
/* 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_GENUTILS_H
#define DIRECTOR_LINGO_XLIBS_GENUTILS_H
namespace Director {
class GenUtilsXObject : public Object<GenUtilsXObject> {
public:
GenUtilsXObject(ObjectType objType);
};
namespace GenUtilsXObj {
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_getWindowsFolder(int nargs);
void m_flushEvents(int nargs);
void m_moveCursor(int nargs);
void m_clickCursor(int nargs);
} // End of namespace GenUtilsXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,60 @@
/* 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/g/getscreenrectsxfcn.h"
/**************************************************
*
* USED IN:
* the7colors
*
**************************************************/
namespace Director {
const char *const GetScreenRectsXFCN::xlibName = "GetScreenRects";
const XlibFileDesc GetScreenRectsXFCN::fileNames[] = {
{ "GetScreenRects", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "GetScreenRects", GetScreenRectsXFCN::m_GetScreenRects, -1, 0, 300, HBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void GetScreenRectsXFCN::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void GetScreenRectsXFCN::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
XOBJSTUB(GetScreenRectsXFCN::m_GetScreenRects, 0)
}

View File

@@ -0,0 +1,41 @@
/* 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_GETSCREENRECTSXFCN_H
#define DIRECTOR_LINGO_XLIBS_GETSCREENRECTSXFCN_H
namespace Director {
namespace GetScreenRectsXFCN {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_GetScreenRects(int nargs);
} // End of namespace GetScreenRectsXFCN
} // End of namespace Director
#endif

View File

@@ -0,0 +1,60 @@
/* 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/g/getscreensizexfcn.h"
/**************************************************
*
* USED IN:
* the7colors
*
**************************************************/
namespace Director {
const char *const GetScreenSizeXFCN::xlibName = "GetScreenSize";
const XlibFileDesc GetScreenSizeXFCN::fileNames[] = {
{ "GetScreenSize", nullptr },
{ nullptr, nullptr },
};
static const BuiltinProto builtins[] = {
{ "GetScreenSize", GetScreenSizeXFCN::m_GetScreenSize, -1, 0, 300, HBLTIN },
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
void GetScreenSizeXFCN::open(ObjectType type, const Common::Path &path) {
g_lingo->initBuiltIns(builtins);
}
void GetScreenSizeXFCN::close(ObjectType type) {
g_lingo->cleanupBuiltIns(builtins);
}
XOBJSTUB(GetScreenSizeXFCN::m_GetScreenSize, 0)
}

View File

@@ -0,0 +1,41 @@
/* 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_GETSCREENSIZEXFCN_H
#define DIRECTOR_LINGO_XLIBS_GETSCREENSIZEXFCN_H
namespace Director {
namespace GetScreenSizeXFCN {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_GetScreenSize(int nargs);
} // End of namespace GetScreenSizeXFCN
} // End of namespace Director
#endif

View File

@@ -0,0 +1,107 @@
/* 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/g/getsoundinlevel.h"
/**************************************************
*
* USED IN:
* Microphone Fiend
*
**************************************************/
/*
-- GetSoundInLevel, v1.4 C G.M.Smith 1994/5/6
I mNew
I mGetLevel --> I -- Get the sound input current level
I mGetLeftLevel --> I -- Get the left sound input current level
I mGetRightLevel --> I -- Get the right sound input current level
I mGetChannelCount --> I -- Get the number of sound channels
X mDispose
--
-- mNew return error values
-- -227 Sound input busy
-- -108 Out of memory, increase partition in info dialog
-- -10 No stereo input
-- -20 Cannot access data - odd hardware?
*/
namespace Director {
const char *GetSoundInLevelXObj::xlibName = "GetSoundInLevel";
const XlibFileDesc GetSoundInLevelXObj::fileNames[] = {
{ "GetSoundInLevel", nullptr },
{ nullptr, nullptr },
};
static MethodProto xlibMethods[] = {
{ "new", GetSoundInLevelXObj::m_new, 0, 0, 400 },
{ "getLevel", GetSoundInLevelXObj::m_getLevel, 0, 0, 400 },
{ "getLeftLevel", GetSoundInLevelXObj::m_getLeftLevel, 0, 0, 400 },
{ "getRightLevel", GetSoundInLevelXObj::m_getRightLevel, 0, 0, 400 },
{ "getChannelCount", GetSoundInLevelXObj::m_getChannelCount, 0, 0, 400 },
{ "dispose", GetSoundInLevelXObj::m_dispose, 0, 0, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
static BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
GetSoundInLevelXObject::GetSoundInLevelXObject(ObjectType ObjectType) :Object<GetSoundInLevelXObject>("GetSoundInLevel") {
_objType = ObjectType;
}
void GetSoundInLevelXObj::open(ObjectType type, const Common::Path &path) {
GetSoundInLevelXObject::initMethods(xlibMethods);
GetSoundInLevelXObject *xobj = new GetSoundInLevelXObject(type);
if (type == kXtraObj)
g_lingo->_openXtras.push_back(xlibName);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void GetSoundInLevelXObj::close(ObjectType type) {
GetSoundInLevelXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void GetSoundInLevelXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("GetSoundInLevelXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUB(GetSoundInLevelXObj::m_getLevel, 100)
XOBJSTUB(GetSoundInLevelXObj::m_getLeftLevel, 100)
XOBJSTUB(GetSoundInLevelXObj::m_getRightLevel, 100)
XOBJSTUB(GetSoundInLevelXObj::m_getChannelCount, 1)
XOBJSTUBNR(GetSoundInLevelXObj::m_dispose)
}

View File

@@ -0,0 +1,51 @@
/* 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_GETSOUNDINLEVEL_H
#define DIRECTOR_LINGO_XLIBS_GETSOUNDINLEVEL_H
namespace Director {
class GetSoundInLevelXObject : public Object<GetSoundInLevelXObject> {
public:
GetSoundInLevelXObject(ObjectType objType);
};
namespace GetSoundInLevelXObj {
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_getLevel(int nargs);
void m_getLeftLevel(int nargs);
void m_getRightLevel(int nargs);
void m_getChannelCount(int nargs);
void m_dispose(int nargs);
} // End of namespace GetSoundInLevelXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,104 @@
/* 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:
* Gahan Wilson's Ultimate Haunted House
*
*************************************/
/*
* Product Identification Number
* Gahan Wilson's Ultimate Haunted House
* Copyright 1994 Byron Preiss Multimedia Company, Inc.
* 'Copyright 1994, Byron Preiss Multimedia
* -- copyright 1994 by Byron Priess Multimedia, authored by MayoSmith
* gpid
* I mNew --Read Docs to avoid Hard Drive failure
* X mDispose --Disposes of XObject instance
* S mName --Returns the XObject name (Widget)
* I mStatus --Returns an integer status code
* SI mError, code --Returns an error string
* S mLastError --Returns last error string
* I mGetPid --Retrieves PID
*
*/
#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/g/gpid.h"
namespace Director {
const char *const GpidXObj::xlibName = "gpid";
const XlibFileDesc GpidXObj::fileNames[] = {
{ "GPID", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", GpidXObj::m_new, 0, 0, 400 }, // D4
{ "dispose", GpidXObj::m_dispose, 0, 0, 400 }, // D4
{ "name", GpidXObj::m_name, 0, 0, 400 }, // D4
{ "status", GpidXObj::m_status, 0, 0, 400 }, // D4
{ "error", GpidXObj::m_error, 1, 1, 400 }, // D4
{ "lastError", GpidXObj::m_lastError, 0, 0, 400 }, // D4
{ "getPid", GpidXObj::m_getPid, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void GpidXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
ProductIdXObject::initMethods(xlibMethods);
ProductIdXObject *xobj = new ProductIdXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void GpidXObj::close(ObjectType type) {
if (type == kXObj) {
ProductIdXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
ProductIdXObject::ProductIdXObject(ObjectType ObjectType) :Object<ProductIdXObject>("gpid") {
_objType = ObjectType;
}
void GpidXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("gpid::new", nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(GpidXObj::m_dispose)
XOBJSTUB(GpidXObj::m_name, "")
XOBJSTUB(GpidXObj::m_status, 0)
XOBJSTUB(GpidXObj::m_error, "")
XOBJSTUB(GpidXObj::m_lastError, "")
XOBJSTUB(GpidXObj::m_getPid, 0)
} // End of namespace Director

View File

@@ -0,0 +1,53 @@
/* 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_GPID_H
#define DIRECTOR_LINGO_XLIBS_GPID_H
namespace Director {
class ProductIdXObject : public Object<ProductIdXObject> {
public:
ProductIdXObject(ObjectType objType);
};
namespace GpidXObj {
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_getPid(int nargs);
} // End of namespace GpidXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,302 @@
/* 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/file.h"
#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/h/henry.h"
/**************************************************
*
* USED IN:
* Mummy: Tomb of the Pharaoh
* Frankenstein: Through the Eyes of the Monster
*
**************************************************/
/*
-- From Mummy:
-- Henry XObject. Mar 21, 95 JPY
--Henry
ISS mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
S mName
SIIS mUserHitMouse --
XSSS mStartNewPosition --
XSS mStartNewPositionSubView --
S mCommittNewPosition --
S mDoLeftTurn --
S mDoRightTurn --
SII mCheckCursor --
SII mGetRollOverActions --
S mGetEntryActions --
S mPeekEntryActions --
S mGetExitActions --
S mSetSavedPosition
IS mGetStateVariable --
XSI mSetStateVariable --
SS mGetStringVariable --
XSS mSetStringVariable --
XSI mStartTimer --
XS mAbortTimer --
S mCheckTimers --
SS mGetTimerStatus
SS mPickUpItem
XS mDropItem --
XS mDumpItem
SS mReturnItem
SS mIngestItem
SSS mPutItemInContainer
SSSSS mPutItemAtLocation
S mGetCurrentPosition
S mGetPlayerProperties
SSS mSaveGame --
SS mLoadGame --
XI mShowCursor --
X mReleaseCursor --
S mGetRoomList --
SI mGetItemList --
S mGetCurrentItem --
S mGetCurrentContainer --
S mGetCurrentInteraction --
SS mGetItemLocation --
SS mGetContainerContents --
X mPauseGame --
X mResumeGame --
-- From Frankenstein
-- Henry XObject. Mar 21, 95 JPY
--Henry
ISS mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
S mName
SIII mUserHitMouse --
XSSS mStartNewPosition --
XSS mStartNewPositionSubView --
S mCommittNewPosition --
S mDoLeftTurn --
S mDoRightTurn --
SII mCheckCursor --
SII mGetRollOverActions --
S mGetCurrentPosition --
S mGetRoomList --
S mGetVariableList --
SI mGetItemList --
S mGetEntryActions --
S mPeekEntryActions --
S mGetExitActions --
SS mGetTimerActionsForTimer --
SS mGetTimerStatus
SSS mSaveGameState --
SS mLoadGameState --
IS mGetStateVariable --
XSI mSetStateVariable --
SS mGetStringVariable --
XSS mSetStringVariable --
XSI mStartTimer --
XS mAbortTimer --
S mCheckTimers --
XS mDropItem --
XS mDumpItem
XS mPutItemInHand --
XS mPutItemInEnvironment --
XS mPutItemInBag --
SS mGetItemLocation --
XI mShowCursor --
X mReleaseCursor --
*/
namespace Director {
const char *const HenryXObj::xlibName = "Henry";
const XlibFileDesc HenryXObj::fileNames[] = {
{ "HENRY", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", HenryXObj::m_new, 2, 2, 400 },
{ "dispose", HenryXObj::m_dispose, 0, 0, 400 },
{ "name", HenryXObj::m_name, 0, 0, 400 },
{ "userHitMouse", HenryXObj::m_userHitMouse, 3, 3, 400 },
{ "startNewPosition", HenryXObj::m_startNewPosition, 3, 3, 400 },
{ "startNewPositionSubView", HenryXObj::m_startNewPositionSubView, 2, 2, 400 },
{ "committNewPosition", HenryXObj::m_committNewPosition, 0, 0, 400 },
{ "doLeftTurn", HenryXObj::m_doLeftTurn, 0, 0, 400 },
{ "doRightTurn", HenryXObj::m_doRightTurn, 0, 0, 400 },
{ "checkCursor", HenryXObj::m_checkCursor, 2, 2, 400 },
{ "getRollOverActions", HenryXObj::m_getRollOverActions, 2, 2, 400 },
{ "getEntryActions", HenryXObj::m_getEntryActions, 0, 0, 400 },
{ "peekEntryActions", HenryXObj::m_peekEntryActions, 0, 0, 400 },
{ "getExitActions", HenryXObj::m_getExitActions, 0, 0, 400 },
{ "getStateVariable", HenryXObj::m_getStateVariable, 1, 1, 400 },
{ "setStateVariable", HenryXObj::m_setStateVariable, 2, 2, 400 },
{ "getStringVariable", HenryXObj::m_getStringVariable, 1, 1, 400 },
{ "setStringVariable", HenryXObj::m_setStringVariable, 2, 2, 400 },
{ "startTimer", HenryXObj::m_startTimer, 2, 2, 400 },
{ "abortTimer", HenryXObj::m_abortTimer, 1, 1, 400 },
{ "checkTimers", HenryXObj::m_checkTimers, 0, 0, 400 },
{ "getTimerStatus", HenryXObj::m_getTimerStatus, 1, 1, 400 },
{ "dropItem", HenryXObj::m_dropItem, 1, 1, 400 },
{ "dumpItem", HenryXObj::m_dumpItem, 1, 1, 400 },
{ "getCurrentPosition", HenryXObj::m_getCurrentPosition, 0, 0, 400 },
{ "showCursor", HenryXObj::m_showCursor, 1, 1, 400 },
{ "releaseCursor", HenryXObj::m_releaseCursor, 0, 0, 400 },
{ "getRoomList", HenryXObj::m_getRoomList, 0, 0, 400 },
{ "getItemList", HenryXObj::m_getItemList, 1, 1, 400 },
{ "getItemLocation", HenryXObj::m_getItemLocation, 1, 1, 400 },
// Functions for Mummy
{ "setSavedPosition", HenryXObj::m_setSavedPosition, 0, 0, 400 },
{ "pickUpItem", HenryXObj::m_pickUpItem, 1, 1, 400 },
{ "returnItem", HenryXObj::m_returnItem, 1, 1, 400 },
{ "ingestItem", HenryXObj::m_ingestItem, 1, 1, 400 },
{ "putItemInContainer", HenryXObj::m_putItemInContainer, 2, 2, 400 },
{ "putItemAtLocation", HenryXObj::m_putItemAtLocation, 4, 4, 400 },
{ "getPlayerProperties", HenryXObj::m_getPlayerProperties, 0, 0, 400 },
{ "saveGame", HenryXObj::m_saveGame, 2, 2, 400 },
{ "loadGame", HenryXObj::m_loadGame, 1, 1, 400 },
{ "getCurrentItem", HenryXObj::m_getCurrentItem, 0, 0, 400 },
{ "getCurrentContainer", HenryXObj::m_getCurrentContainer, 0, 0, 400 },
{ "getCurrentInteraction", HenryXObj::m_getCurrentInteraction, 0, 0, 400 },
{ "getContainerContents", HenryXObj::m_getContainerContents, 1, 1, 400 },
{ "pauseGame", HenryXObj::m_pauseGame, 0, 0, 400 },
{ "resumeGame", HenryXObj::m_resumeGame, 0, 0, 400 },
// Functions for Frankenstein
{ "putItemInHand", HenryXObj::m_putItemInHand, 1, 1, 400 },
{ "putItemInEnvironment", HenryXObj::m_putItemInEnvironment, 1, 1, 400 },
{ "putItemInBag", HenryXObj::m_putItemInBag, 1, 1, 400 },
{ "getVariableList", HenryXObj::m_getVariableList, 0, 0, 400 },
{ "getTimerActionsForTimer", HenryXObj::m_getTimerActionsForTimer, 1, 1, 400 },
{ "saveGameState", HenryXObj::m_saveGameState, 2, 2, 400 },
{ "loadGameState", HenryXObj::m_loadGameState, 1, 1, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
static const BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
bool CheckKey(Common::File &file) {
return file.readUint32BE() == 4;
}
void GameState_Read() {
Common::File gameStateFile;
if (!CheckKey(gameStateFile)) {
// invalid file
gameStateFile.close();
} else {
}
}
HenryXObject::HenryXObject(ObjectType ObjectType) :Object<HenryXObject>("Henry") {
_objType = ObjectType;
}
void HenryXObj::open(ObjectType type, const Common::Path &path) {
HenryXObject::initMethods(xlibMethods);
HenryXObject *xobj = new HenryXObject(type);
if (type == kXtraObj)
g_lingo->_openXtras.push_back(xlibName);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void HenryXObj::close(ObjectType type) {
HenryXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void HenryXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("HenryXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(HenryXObj::m_dispose)
XOBJSTUB(HenryXObj::m_name, "")
XOBJSTUB(HenryXObj::m_userHitMouse, "")
XOBJSTUBNR(HenryXObj::m_startNewPosition)
XOBJSTUBNR(HenryXObj::m_startNewPositionSubView)
XOBJSTUB(HenryXObj::m_committNewPosition, "")
XOBJSTUB(HenryXObj::m_doLeftTurn, "")
XOBJSTUB(HenryXObj::m_doRightTurn, "")
XOBJSTUB(HenryXObj::m_checkCursor, "")
XOBJSTUB(HenryXObj::m_getRollOverActions, "")
XOBJSTUB(HenryXObj::m_getEntryActions, "")
XOBJSTUB(HenryXObj::m_peekEntryActions, "")
XOBJSTUB(HenryXObj::m_getExitActions, "")
XOBJSTUB(HenryXObj::m_getStateVariable, 0)
XOBJSTUBNR(HenryXObj::m_setStateVariable)
XOBJSTUB(HenryXObj::m_getStringVariable, "")
XOBJSTUBNR(HenryXObj::m_setStringVariable)
XOBJSTUBNR(HenryXObj::m_startTimer)
XOBJSTUBNR(HenryXObj::m_abortTimer)
XOBJSTUB(HenryXObj::m_checkTimers, "")
XOBJSTUB(HenryXObj::m_getTimerStatus, "")
XOBJSTUBNR(HenryXObj::m_dropItem)
XOBJSTUBNR(HenryXObj::m_dumpItem)
XOBJSTUB(HenryXObj::m_getCurrentPosition, "")
XOBJSTUBNR(HenryXObj::m_showCursor)
XOBJSTUBNR(HenryXObj::m_releaseCursor)
XOBJSTUB(HenryXObj::m_getRoomList, "")
XOBJSTUB(HenryXObj::m_getItemList, "")
XOBJSTUB(HenryXObj::m_getItemLocation, "")
XOBJSTUB(HenryXObj::m_setSavedPosition, "")
XOBJSTUB(HenryXObj::m_pickUpItem, "")
XOBJSTUB(HenryXObj::m_returnItem, "")
XOBJSTUB(HenryXObj::m_ingestItem, "")
XOBJSTUB(HenryXObj::m_putItemInContainer, "")
XOBJSTUB(HenryXObj::m_putItemAtLocation, "")
XOBJSTUB(HenryXObj::m_getPlayerProperties, "")
XOBJSTUB(HenryXObj::m_saveGame, "")
XOBJSTUB(HenryXObj::m_loadGame, "")
XOBJSTUB(HenryXObj::m_getCurrentItem, "")
XOBJSTUB(HenryXObj::m_getCurrentContainer, "")
XOBJSTUB(HenryXObj::m_getCurrentInteraction, "")
XOBJSTUB(HenryXObj::m_getContainerContents, "")
XOBJSTUBNR(HenryXObj::m_pauseGame)
XOBJSTUBNR(HenryXObj::m_resumeGame)
XOBJSTUBNR(HenryXObj::m_putItemInHand)
XOBJSTUBNR(HenryXObj::m_putItemInEnvironment)
XOBJSTUBNR(HenryXObj::m_putItemInBag)
XOBJSTUB(HenryXObj::m_getVariableList, "")
XOBJSTUB(HenryXObj::m_getTimerActionsForTimer, "")
XOBJSTUB(HenryXObj::m_saveGameState, "")
XOBJSTUB(HenryXObj::m_loadGameState, "")
}

View File

@@ -0,0 +1,100 @@
/* 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_HENRY_H
#define DIRECTOR_LINGO_XLIBS_HENRY_H
namespace Director {
class HenryXObject : public Object<HenryXObject> {
public:
HenryXObject(ObjectType objType);
};
namespace HenryXObj {
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_userHitMouse(int nargs);
void m_startNewPosition(int nargs);
void m_startNewPositionSubView(int nargs);
void m_committNewPosition(int nargs);
void m_doLeftTurn(int nargs);
void m_doRightTurn(int nargs);
void m_checkCursor(int nargs);
void m_getRollOverActions(int nargs);
void m_getEntryActions(int nargs);
void m_peekEntryActions(int nargs);
void m_getExitActions(int nargs);
void m_getStateVariable(int nargs);
void m_setStateVariable(int nargs);
void m_getStringVariable(int nargs);
void m_setStringVariable(int nargs);
void m_startTimer(int nargs);
void m_abortTimer(int nargs);
void m_checkTimers(int nargs);
void m_getTimerStatus(int nargs);
void m_dropItem(int nargs);
void m_dumpItem(int nargs);
void m_getCurrentPosition(int nargs);
void m_showCursor(int nargs);
void m_releaseCursor(int nargs);
void m_getRoomList(int nargs);
void m_getItemList(int nargs);
void m_getItemLocation(int nargs);
void m_setSavedPosition(int nargs);
void m_pickUpItem(int nargs);
void m_returnItem(int nargs);
void m_ingestItem(int nargs);
void m_putItemInContainer(int nargs);
void m_putItemAtLocation(int nargs);
void m_getPlayerProperties(int nargs);
void m_saveGame(int nargs);
void m_loadGame(int nargs);
void m_getCurrentItem(int nargs);
void m_getCurrentContainer(int nargs);
void m_getCurrentInteraction(int nargs);
void m_getContainerContents(int nargs);
void m_pauseGame(int nargs);
void m_resumeGame(int nargs);
void m_putItemInHand(int nargs);
void m_putItemInEnvironment(int nargs);
void m_putItemInBag(int nargs);
void m_getVariableList(int nargs);
void m_getTimerActionsForTimer(int nargs);
void m_saveGameState(int nargs);
void m_loadGameState(int nargs);
} // End of namespace HenryXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,102 @@
/* 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:
* Night Light (Mac)
*
*************************************/
/*
-- HitMap XObject
ISIII mNew, path, xOffset, yOffset, scale -- path, xOffset, yOffset, scale
X mDispose
III mWhere, x, y -- Return GWorld Index
-- Hitmap Scale Factor 27.JUL.94
hitmap
S mName --Returns the XObject name (hitmap)
S mGetSys --Returns Windows System Directory Path(hitmap)
ISIII mNew, hitBitMapfile, hitmaposx, hitmaposy, factor --Creates new instance of XObject
III mWhere, xpos, ypos --coordinate position
X mDispose --Dispose of memory allocation
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/h/hitmap.h"
namespace Director {
const char *const HitMap::xlibName = "HitMap";
const XlibFileDesc HitMap::fileNames[] = {
{ "HitMap", nullptr },
{ "maskXobj", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "New", HitMap::m_new, 4, 4, 400 }, // D4
{ "Where", HitMap::m_where, 2, 2, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void HitMap::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
HitMapObject::initMethods(xlibMethods);
HitMapObject *xobj = new HitMapObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void HitMap::close(ObjectType type) {
if (type == kXObj) {
HitMapObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
HitMapObject::HitMapObject(ObjectType ObjectType) :Object<HitMapObject>("HitMap") {
_objType = ObjectType;
}
void HitMap::m_new(int nargs) {
// Common::String hitBitMapfile = g_lingo->pop().asString();
// int hitmaposx = g_lingo->pop().asInt();
// int hitmaposy = g_lingo->pop().asInt();
// int factor = g_lingo->pop().asInt();
g_lingo->printSTUBWithArglist("HitMap::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
void HitMap::m_where(int nargs) {
// int xpos = g_lingo->pop().asInt();
// int ypos = g_lingo->pop().asInt();
g_lingo->printSTUBWithArglist("HitMap::m_where", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(Datum(0));
}
} // End of namespace Director

View File

@@ -0,0 +1,47 @@
/* 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_HITMAP_H
#define DIRECTOR_LINGO_XLIBS_HITMAP_H
namespace Director {
class HitMapObject : public Object<HitMapObject> {
public:
HitMapObject(ObjectType objType);
};
namespace HitMap {
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_where(int nargs);
} // End of namespace HitMap
} // 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/>.
*
*/
#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/i/inixobj.h"
/**************************************************
*
* USED IN:
* Karma: Curse of the 12 Caves
*
**************************************************/
/*
-- Ini File External Factory. 9feb93 JT
--Ini
I mNew -- Creates a new instance of the XObject
SSSSS mReadString fileName, SecName, EntryName, DefaultStr -- Read .INI
ISSSS mWriteString fileName, SecName, EntryName, String -- Write .INI
I mDispose -- Disposes of XObject instance.
*/
namespace Director {
const char *const IniXObj::xlibName = "Ini";
const XlibFileDesc IniXObj::fileNames[] = {
{ "INI", "karma" }, // "Karma: Curse of the 12 Caves" conflicts with JWXIni in "www" gameid
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{"new", IniXObj::m_new, 0, 0, 400},
{"readString", IniXObj::m_readString, 4, 4, 400},
{"writeString", IniXObj::m_writeString, 4, 4, 400},
{nullptr, nullptr, 0, 0, 0}
};
static const BuiltinProto xlibBuiltins[] = {
{nullptr, nullptr, 0, 0, 0, VOIDSYM}
};
IniXObject::IniXObject(const ObjectType objType) : Object<IniXObject>("Ini") {
_objType = objType;
}
void IniXObj::open(const ObjectType type, const Common::Path &path) {
IniXObject::initMethods(xlibMethods);
IniXObject *xobj = new IniXObject(type);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void IniXObj::close(ObjectType type) {
IniXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void IniXObj::m_new(const int nargs) {
g_lingo->printSTUBWithArglist("IniXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUB(IniXObj::m_readString, "")
XOBJSTUB(IniXObj::m_writeString, 0)
}

View File

@@ -0,0 +1,52 @@
/* 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_INI_H
#define DIRECTOR_LINGO_XLIBS_INI_H
#include "common/path.h"
#include "director/types.h"
#include "director/lingo/lingo-object.h"
namespace Director {
class IniXObject : public Object<IniXObject> {
public:
IniXObject(ObjectType objType);
};
namespace IniXObj {
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_readString(int nargs);
void m_writeString(int nargs);
} // End of namespace IniXObj
} // End of namespace Director
#endif

View File

@@ -0,0 +1,170 @@
/* 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/i/instobj.h"
/**************************************************
*
* USED IN:
* Virtual Nightclub
*
**************************************************/
/*
-- InstObj Installer XObject. Andy Wilson, Tape Gallery Multimedia, 20th March 1996
--InstObj
I mNew --Creates a new instance of the XObject
X mDispose --Disposes of XObject instance
S mName --Returns the XObject name (InstObj)
I mStatus --Returns an integer status code
SI mError, code --Returns an error string
S mLastError --Returns last error string
S mGetWinDir --Returns the Windows directory
S mGetSysDir --Returns the System directory
S mGetWinVer --Returns the Windows version
S mGetProcInfo --Returns the processor type
SI mGetDriveType, Drive --Make a new directory (A=0, B=1, etc.)
II mGetFreeSpace, Drive --Returns the free space in Kb (A=0, B=1, etc.)
IS mMakeDir, DirName --Make a new directory
IS mDirExists, DirName --Checks that a directory exists
ISS mCopyFile, Source,Dest --Copy a file
IS mDeleteFile, File --Delete a file
IS mFileExists, File --Returns 0 if the file exists
IS mAddPMGroup, Group --Add a program manager group
ISSSSI mAddPMItem, Group,CmndLine,ItemName,IconPath,IconIndex --Add a program manager item
SSSSS mReadProfile, File,Section,Item,Default --Read an INI profile string
ISSSS mWriteProfile, File,Section,Item,NewVal --Write an INI profile string
*/
namespace Director {
const char *const InstObjXObj::xlibName = "InstObj";
const XlibFileDesc InstObjXObj::fileNames[] = {
{ "INSTOBJ", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", InstObjXObj::m_new, 0, 0, 400 },
{ "dispose", InstObjXObj::m_dispose, 0, 0, 400 },
{ "name", InstObjXObj::m_name, 0, 0, 400 },
{ "status", InstObjXObj::m_status, 0, 0, 400 },
{ "error", InstObjXObj::m_error, 1, 1, 400 },
{ "lastError", InstObjXObj::m_lastError, 0, 0, 400 },
{ "getWinDir", InstObjXObj::m_getWinDir, 0, 0, 400 },
{ "getSysDir", InstObjXObj::m_getSysDir, 0, 0, 400 },
{ "getWinVer", InstObjXObj::m_getWinVer, 0, 0, 400 },
{ "getProcInfo", InstObjXObj::m_getProcInfo, 0, 0, 400 },
{ "getDriveType", InstObjXObj::m_getDriveType, 1, 1, 400 },
{ "getFreeSpace", InstObjXObj::m_getFreeSpace, 1, 1, 400 },
{ "makeDir", InstObjXObj::m_makeDir, 1, 1, 400 },
{ "dirExists", InstObjXObj::m_dirExists, 1, 1, 400 },
{ "copyFile", InstObjXObj::m_copyFile, 2, 2, 400 },
{ "deleteFile", InstObjXObj::m_deleteFile, 1, 1, 400 },
{ "fileExists", InstObjXObj::m_fileExists, 1, 1, 400 },
{ "addPMGroup", InstObjXObj::m_addPMGroup, 1, 1, 400 },
{ "addPMItem", InstObjXObj::m_addPMItem, 5, 5, 400 },
{ "readProfile", InstObjXObj::m_readProfile, 4, 4, 400 },
{ "writeProfile", InstObjXObj::m_writeProfile, 4, 4, 400 },
{ nullptr, nullptr, 0, 0, 0 }
};
static const BuiltinProto xlibBuiltins[] = {
{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
};
InstObjXObject::InstObjXObject(ObjectType ObjectType) :Object<InstObjXObject>("InstObj") {
_objType = ObjectType;
}
void InstObjXObj::open(ObjectType type, const Common::Path &path) {
InstObjXObject::initMethods(xlibMethods);
InstObjXObject *xobj = new InstObjXObject(type);
g_lingo->exposeXObject(xlibName, xobj);
g_lingo->initBuiltIns(xlibBuiltins);
}
void InstObjXObj::close(ObjectType type) {
InstObjXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
void InstObjXObj::m_new(int nargs) {
g_lingo->printSTUBWithArglist("InstObjXObj::m_new", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(g_lingo->_state->me);
}
void InstObjXObj::m_getDriveType(int nargs) {
g_lingo->printSTUBWithArglist("InstObjXObj::m_getDriveType", nargs);
Datum result("Undetermined Drive Type");
if (nargs != 1) {
warning("InstObjXObj: expected 1 argument");
g_lingo->dropStack(nargs);
} else {
Datum id = g_lingo->pop();
switch (id.asInt()) {
case 1: // fall-through
case 2:
result = Datum("Floppy Drive");
break;
case 3:
result = Datum("Hard Disk");
break;
case 4:
result = Datum("CD Drive");
break;
default:
break;
}
}
g_lingo->push(result);
}
XOBJSTUBNR(InstObjXObj::m_dispose)
XOBJSTUB(InstObjXObj::m_name, "")
XOBJSTUB(InstObjXObj::m_status, 0)
XOBJSTUB(InstObjXObj::m_error, "")
XOBJSTUB(InstObjXObj::m_lastError, "")
XOBJSTUB(InstObjXObj::m_getWinDir, "")
XOBJSTUB(InstObjXObj::m_getSysDir, "")
XOBJSTUB(InstObjXObj::m_getWinVer, "")
XOBJSTUB(InstObjXObj::m_getProcInfo, "")
XOBJSTUB(InstObjXObj::m_getFreeSpace, 0)
XOBJSTUB(InstObjXObj::m_makeDir, 0)
XOBJSTUB(InstObjXObj::m_dirExists, 0)
XOBJSTUB(InstObjXObj::m_copyFile, 0)
XOBJSTUB(InstObjXObj::m_deleteFile, 0)
XOBJSTUB(InstObjXObj::m_fileExists, 0)
XOBJSTUB(InstObjXObj::m_addPMGroup, 0)
XOBJSTUB(InstObjXObj::m_addPMItem, 0)
XOBJSTUB(InstObjXObj::m_readProfile, "")
XOBJSTUB(InstObjXObj::m_writeProfile, 0)
}

View File

@@ -0,0 +1,66 @@
/* 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_INSTOBJ_H
#define DIRECTOR_LINGO_XLIBS_INSTOBJ_H
namespace Director {
class InstObjXObject : public Object<InstObjXObject> {
public:
InstObjXObject(ObjectType objType);
};
namespace InstObjXObj {
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_getWinDir(int nargs);
void m_getSysDir(int nargs);
void m_getWinVer(int nargs);
void m_getProcInfo(int nargs);
void m_getDriveType(int nargs);
void m_getFreeSpace(int nargs);
void m_makeDir(int nargs);
void m_dirExists(int nargs);
void m_copyFile(int nargs);
void m_deleteFile(int nargs);
void m_fileExists(int nargs);
void m_addPMGroup(int nargs);
void m_addPMItem(int nargs);
void m_readProfile(int nargs);
void m_writeProfile(int nargs);
} // End of namespace InstObjXObj
} // End of namespace Director
#endif

Some files were not shown because too many files have changed in this diff Show More