Skip to content

Commit

Permalink
DIRECTOR: LINGO: Added BlitPict XObject stub
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Feb 6, 2023
1 parent 7e6c896 commit 57a9a80
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engines/director/lingo/lingo-object.cpp
Expand Up @@ -41,6 +41,7 @@
#include "director/lingo/xlibs/askuser.h"
#include "director/lingo/xlibs/barakeobj.h"
#include "director/lingo/xlibs/batqt.h"
#include "director/lingo/xlibs/blitpict.h"
#include "director/lingo/xlibs/cdromxobj.h"
#include "director/lingo/xlibs/darkenscreen.h"
#include "director/lingo/xlibs/developerStack.h"
Expand Down Expand Up @@ -152,6 +153,7 @@ static struct XLibProto {
{ AskUser::fileNames, AskUser::open, AskUser::close, kXObj, 400 }, // D4
{ BarakeObj::fileNames, BarakeObj::open, BarakeObj::close, kXObj, 400 }, // D4
{ BatQT::fileNames, BatQT::open, BatQT::close, kXObj, 400 }, // D4
{ BlitPict::fileNames, BlitPict::open, BlitPict::close, kXObj, 400 }, // D4
{ CDROMXObj::fileNames, CDROMXObj::open, CDROMXObj::close, kXObj, 200 }, // D2
{ DarkenScreen::fileNames, DarkenScreen::open, DarkenScreen::close, kXObj, 300 }, // D3
{ DeveloperStack::fileNames, DeveloperStack::open, DeveloperStack::close, kXObj, 300 }, // D3
Expand Down
83 changes: 83 additions & 0 deletions engines/director/lingo/xlibs/blitpict.cpp
@@ -0,0 +1,83 @@
/* 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/>.
*
*/

/**
* -- 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
*
* USED IN: teamxtreme2-win
*/

#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/xlibs/blitpict.h"


namespace Director {

// The name is different from the obj filename.
const char *BlitPict::xlibName = "BlitPict";
const char *BlitPict::fileNames[] = {
"BlitPict",
nullptr
};

static MethodProto xlibMethods[] = {
{ "new", BlitPict::m_new, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};

void BlitPict::open(int type) {
if (type == kXObj) {
BlitPictXObject::initMethods(xlibMethods);
BlitPictXObject *xobj = new BlitPictXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}

void BlitPict::close(int type) {
if (type == kXObj) {
BlitPictXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}


BlitPictXObject::BlitPictXObject(ObjectType ObjectType) : Object<BlitPictXObject>("BlitPict") {
_objType = ObjectType;
}

void BlitPict::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}

} // End of namespace Director
46 changes: 46 additions & 0 deletions engines/director/lingo/xlibs/blitpict.h
@@ -0,0 +1,46 @@
/* 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 BlitPict {

extern const char *xlibName;
extern const char *fileNames[];

void open(int type);
void close(int type);

void m_new(int nargs);

} // End of namespace BlitPict

} // End of namespace Director

#endif
1 change: 1 addition & 0 deletions engines/director/module.mk
Expand Up @@ -44,6 +44,7 @@ MODULE_OBJS = \
lingo/xlibs/askuser.o \
lingo/xlibs/barakeobj.o \
lingo/xlibs/batqt.o \
lingo/xlibs/blitpict.o \
lingo/xlibs/cdromxobj.o \
lingo/xlibs/darkenscreen.o \
lingo/xlibs/developerStack.o \
Expand Down

0 comments on commit 57a9a80

Please sign in to comment.