[Scummvm-cvs-logs] SF.net SVN: scummvm: [32105] scummvm/trunk/engines/made

john_doe at users.sourceforge.net john_doe at users.sourceforge.net
Wed May 14 13:19:31 CEST 2008


Revision: 32105
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32105&view=rev
Author:   john_doe
Date:     2008-05-14 04:19:31 -0700 (Wed, 14 May 2008)

Log Message:
-----------
Merged the three ScriptFunctionsXXX classes into ScriptFunctions

Modified Paths:
--------------
    scummvm/trunk/engines/made/script.cpp
    scummvm/trunk/engines/made/scriptfuncs.h

Added Paths:
-----------
    scummvm/trunk/engines/made/scriptfuncs.cpp

Modified: scummvm/trunk/engines/made/script.cpp
===================================================================
--- scummvm/trunk/engines/made/script.cpp	2008-05-14 09:54:15 UTC (rev 32104)
+++ scummvm/trunk/engines/made/script.cpp	2008-05-14 11:19:31 UTC (rev 32105)
@@ -172,15 +172,7 @@
 	_commands = commandProcs;
 	_commandsMax = ARRAYSIZE(commandProcs) + 1;
 
-	if (_vm->getGameID() == GID_RTZ)
-		_functions = new ScriptFunctionsRtz(_vm);
-	else if (_vm->getGameID() == GID_LGOP2)
-		_functions = new ScriptFunctionsLgop2(_vm);
-	else if (_vm->getGameID() == GID_MANHOLE)
-		_functions = new ScriptFunctionsMhne(_vm);
-	else
-		error("Unsupported GameID");
-		
+	_functions = new ScriptFunctions(_vm);
 	_functions->setupExternalsTable();
 	
 #undef COMMAND

Added: scummvm/trunk/engines/made/scriptfuncs.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs.cpp	                        (rev 0)
+++ scummvm/trunk/engines/made/scriptfuncs.cpp	2008-05-14 11:19:31 UTC (rev 32105)
@@ -0,0 +1,945 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/endian.h"
+#include "common/util.h"
+#include "common/events.h"
+
+#include "graphics/cursorman.h"
+
+#include "made/made.h"
+#include "made/resource.h"
+#include "made/database.h"
+#include "made/screen.h"
+#include "made/script.h"
+#include "made/pmvplayer.h"
+#include "made/scriptfuncs.h"
+#include "made/music.h"
+
+namespace Made {
+
+typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctions> ExternalScriptFunc;
+#define External(x) \
+	_externalFuncs.push_back(new ExternalScriptFunc(this, &ScriptFunctions::x));  \
+	_externalFuncNames.push_back(#x);
+void ScriptFunctions::setupExternalsTable() {
+
+	External(sfSystemCall);
+	External(sfInitGraf);
+	External(sfRestoreGraf);
+	External(sfDrawPicture);
+	External(sfClearScreen);
+	External(sfShowPage);
+	External(sfPollEvent);
+	External(sfGetMouseX);
+	External(sfGetMouseY);
+	External(sfGetKey);
+	External(sfSetVisualEffect);
+	External(sfPlaySound);
+	External(sfPlayMusic);
+	External(sfStopMusic);
+	External(sfIsMusicPlaying);
+	External(sfSetTextPos);
+	External(sfFlashScreen);
+	External(sfPlayNote);
+	External(sfStopNote);
+	External(sfPlayTele);
+	External(sfStopTele);
+	External(sfHideMouseCursor);
+	External(sfShowMouseCursor);
+	External(sfGetMusicBeat);
+	External(sfSetScreenLock);
+	External(sfAddSprite);
+	External(sfFreeAnim);
+	External(sfDrawSprite);
+	External(sfEraseSprites);
+	External(sfUpdateSprites);
+	External(sfGetTimer);
+	External(sfSetTimer);
+	External(sfResetTimer);
+	External(sfAllocTimer);
+	External(sfFreeTimer);
+	External(sfSetPaletteLock);
+	External(sfSetFont);
+	External(sfDrawText);
+	External(sfHomeText);
+	External(sfSetTextRect);
+	External(sfSetTextXY);
+	External(sfSetFontDropShadow);
+	External(sfSetFontColor);
+	External(sfSetFontOutline);
+	External(sfLoadMouseCursor);
+	External(sfSetSpriteGround);
+	External(sfLoadResText);
+	
+	if (_vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_LGOP2) {
+		External(sfAddScreenMask);
+		External(sfSetSpriteMask);
+	} else if (_vm->getGameID() == GID_RTZ) {
+		External(sfSetClipArea);
+		External(sfSetSpriteClip);
+	}
+
+	External(sfSoundPlaying);
+	External(sfStopSound);
+	External(sfPlayVoice);
+
+	if (_vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_RTZ) {
+		External(sfPlayCd);
+		External(sfStopCd);
+		External(sfGetCdStatus);
+		External(sfGetCdTime);
+		External(sfPlayCdSegment);
+	}
+	
+	if (_vm->getGameID() == GID_RTZ) {
+		External(sfPrintf);
+		External(sfClearMono);
+		External(sfGetSoundEnergy);
+		External(sfClearText);
+		External(sfAnimText);
+		External(sfGetTextWidth);
+		External(sfPlayMovie);
+		External(sfLoadSound);
+		External(sfLoadMusic);
+		External(sfLoadPicture);
+		External(sfSetMusicVolume);
+		External(sfRestartEvents);
+		External(sfPlaceSprite);
+		External(sfPlaceText);
+		External(sfDeleteChannel);
+		External(sfGetChannelType);
+		External(sfSetChannelState);
+		External(sfSetChannelLocation);
+		External(sfSetChannelContent);
+		External(sfSetExcludeArea);
+		External(sfSetSpriteExclude);
+		External(sfGetChannelState);
+		External(sfPlaceAnim);
+		External(sfSetAnimFrame);
+		External(sfGetAnimFrame);
+		External(sfGetAnimFrameCount);
+		External(sfGetPictureWidth);
+		External(sfGetPictureHeight);
+		External(sfSetSoundRate);
+		External(sfDrawAnimPic);
+		External(sfLoadAnim);
+		External(sfReadText);
+		External(sfReadMenu);
+		External(sfDrawMenu);
+		External(sfGetMenuCount);
+		External(sfSaveGame);
+		External(sfLoadGame);
+		External(sfGetGameDescription);
+		External(sfShakeScreen);
+		External(sfPlaceMenu);
+		External(sfSetSoundVolume);
+		External(sfGetSynthType);
+		External(sfIsSlowSystem);
+	}
+
+}
+#undef External
+
+int16 ScriptFunctions::sfSystemCall(int16 argc, int16 *argv) {
+	// This opcode is empty.
+	return 0;
+}
+
+int16 ScriptFunctions::sfInitGraf(int16 argc, int16 *argv) {
+	// This opcode is empty.
+	return 0;
+}
+
+int16 ScriptFunctions::sfRestoreGraf(int16 argc, int16 *argv) {
+	// This opcode is empty.
+	return 0;
+}
+
+int16 ScriptFunctions::sfDrawPicture(int16 argc, int16 *argv) {
+	return _vm->_screen->drawPic(argv[4], argv[3], argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctions::sfClearScreen(int16 argc, int16 *argv) {
+ 	_vm->_screen->clearScreen();
+	return 0;
+}
+
+int16 ScriptFunctions::sfShowPage(int16 argc, int16 *argv) {
+	_vm->_mixer->stopHandle(_audioStreamHandle);
+	_vm->_screen->show();
+	return 0;
+}
+
+int16 ScriptFunctions::sfPollEvent(int16 argc, int16 *argv) {
+
+	Common::Event event;
+	Common::EventManager *eventMan = g_system->getEventManager();
+
+	int16 eventNum = 0;
+
+	if (eventMan->pollEvent(event)) {
+		switch (event.type) {
+
+		case Common::EVENT_MOUSEMOVE:
+			_vm->_eventMouseX = event.mouse.x;
+			_vm->_eventMouseY = event.mouse.y;
+			break;
+			
+		case Common::EVENT_LBUTTONDOWN:
+			eventNum = 1;
+			break;
+
+		/*
+		case Common::EVENT_LBUTTONUP:
+			eventNum = 2; // TODO: Is this correct?
+			break;
+		*/
+
+		case Common::EVENT_RBUTTONDOWN:
+			eventNum = 3;
+			break;
+
+		/*
+		case Common::EVENT_RBUTTONUP:
+			eventNum = 4; // TODO: Is this correct?
+			break;
+		*/
+
+		case Common::EVENT_KEYDOWN:
+			_vm->_eventKey = event.kbd.ascii;
+			// For unknown reasons, the game accepts ASCII code
+			// 9 as backspace
+			if (_vm->_eventKey == Common::KEYCODE_BACKSPACE)
+				_vm->_eventKey = 9;
+			eventNum = 5;
+			break;
+
+		case Common::EVENT_QUIT:
+			_vm->_quit = true;
+			break;
+
+		default:
+			break;
+
+		}
+	}
+
+	_vm->_system->updateScreen();
+
+	return eventNum;
+}
+
+int16 ScriptFunctions::sfGetMouseX(int16 argc, int16 *argv) {
+	return _vm->_eventMouseX;
+}
+
+int16 ScriptFunctions::sfGetMouseY(int16 argc, int16 *argv) {
+	return _vm->_eventMouseY;
+}
+
+int16 ScriptFunctions::sfGetKey(int16 argc, int16 *argv) {
+	return _vm->_eventKey;
+}
+
+int16 ScriptFunctions::sfSetVisualEffect(int16 argc, int16 *argv) {
+	_vm->_screen->setVisualEffectNum(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfPlaySound(int16 argc, int16 *argv) {
+	int soundNum = argv[0];
+	bool loop = false;
+
+	if (argc > 1) {
+		soundNum = argv[1];
+		loop = (argv[0] == 1);
+	}
+
+	if (soundNum > 0) {
+		if (!_vm->_mixer->isSoundHandleActive(_audioStreamHandle)) {
+			_vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle, 
+										 _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, loop));
+		}
+	}
+
+	return 0;
+}
+
+int16 ScriptFunctions::sfPlayMusic(int16 argc, int16 *argv) {
+	// TODO: Music in LGOP2 and Manhole isn't supported yet
+	if (_vm->getGameID() == GID_RTZ) {
+		int16 musicNum = argv[0];
+		if (musicNum > 0) {
+			_musicRes = _vm->_res->getXmidi(musicNum);
+			if (_musicRes)
+				_vm->_music->playXMIDI(_musicRes);
+		}
+	}
+	return 0;
+}
+
+int16 ScriptFunctions::sfStopMusic(int16 argc, int16 *argv) {
+	if (_vm->_music->isPlaying() && _musicRes) {
+		_vm->_music->stop();
+		_vm->_res->freeResource(_musicRes);
+		_musicRes = NULL;
+	}
+	return 0;
+}
+
+int16 ScriptFunctions::sfIsMusicPlaying(int16 argc, int16 *argv) {
+	if (_vm->_music->isPlaying())
+		return 1;
+	else
+		return 0;
+}
+
+int16 ScriptFunctions::sfSetTextPos(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfSetTextPos");
+	// This seems to be some kind of low-level opcode.
+	// The original engine calls int 10h to set the VGA cursor position.
+	return 0;
+}
+
+int16 ScriptFunctions::sfFlashScreen(int16 argc, int16 *argv) {
+	_vm->_screen->flash(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfPlayNote(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfPlayNote");
+	return 0;
+}
+
+int16 ScriptFunctions::sfStopNote(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfStopNote");
+	return 0;
+}
+
+int16 ScriptFunctions::sfPlayTele(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfPlayTele");
+	return 0;
+}
+
+int16 ScriptFunctions::sfStopTele(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfStopTele");
+	return 0;
+}
+
+int16 ScriptFunctions::sfHideMouseCursor(int16 argc, int16 *argv) {
+	_vm->_system->showMouse(false);
+	return 0;
+}
+
+int16 ScriptFunctions::sfShowMouseCursor(int16 argc, int16 *argv) {
+	_vm->_system->showMouse(true);
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetMusicBeat(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfGetMusicBeat");
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetScreenLock(int16 argc, int16 *argv) {
+	_vm->_screen->setScreenLock(argv[0] != 0);
+	return 0;
+}
+
+int16 ScriptFunctions::sfAddSprite(int16 argc, int16 *argv) {
+	if (_vm->getGameID() == GID_RTZ) {
+		warning("Unimplemented opcode: sfAddSprite");
+		return 0;
+	} if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+		return argv[2];
+	} else {
+		return 0;
+	}
+}
+
+int16 ScriptFunctions::sfFreeAnim(int16 argc, int16 *argv) {
+	_vm->_screen->clearChannels();
+	return 0;
+}
+
+int16 ScriptFunctions::sfDrawSprite(int16 argc, int16 *argv) {
+	if (_vm->getGameID() == GID_RTZ) {
+		return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+	} if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+		int16 channel = _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+		_vm->_screen->setChannelUseMask(channel);
+		return 0;
+	} else {
+		return 0;
+	}
+}
+
+int16 ScriptFunctions::sfEraseSprites(int16 argc, int16 *argv) {
+	_vm->_screen->clearChannels();
+	return 0;
+}
+
+int16 ScriptFunctions::sfUpdateSprites(int16 argc, int16 *argv) {
+	_vm->_screen->updateSprites();
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetTimer(int16 argc, int16 *argv) {
+	return _vm->getTimer(argv[0]);
+}
+
+int16 ScriptFunctions::sfSetTimer(int16 argc, int16 *argv) {
+	_vm->setTimer(argv[1], argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfResetTimer(int16 argc, int16 *argv) {
+	_vm->resetTimer(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfAllocTimer(int16 argc, int16 *argv) {
+	return _vm->allocTimer();
+}
+
+int16 ScriptFunctions::sfFreeTimer(int16 argc, int16 *argv) {
+	_vm->freeTimer(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetPaletteLock(int16 argc, int16 *argv) {
+	_vm->_screen->setPaletteLock(argv[0] != 0);
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetFont(int16 argc, int16 *argv) {
+	_vm->_screen->setFont(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfDrawText(int16 argc, int16 *argv) {
+
+	const char *text = NULL;
+
+	if (_vm->getGameID() == GID_RTZ) {
+		Object *obj = _vm->_dat->getObject(argv[argc - 1]);
+		text = obj->getString();
+	} if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+		text = _vm->_dat->getString(argv[argc - 1]);
+	}
+
+	if (text) {
+		char finalText[1024];
+		switch (argc) {
+		case 1:
+			snprintf(finalText, 1024, "%s", text);
+			break;
+		case 2:
+			snprintf(finalText, 1024, text, argv[0]);
+			break;
+		case 3:
+			snprintf(finalText, 1024, text, argv[1], argv[0]);
+			break;
+		case 4:
+			snprintf(finalText, 1024, text, argv[2], argv[1], argv[0]);
+			break;
+		case 5:
+			snprintf(finalText, 1024, text, argv[3], argv[2], argv[1], argv[0]);
+			break;
+		default:
+			finalText[0] = '\0';
+			break;
+		}
+		_vm->_screen->printText(finalText);
+	}
+
+	return 0;
+}
+
+int16 ScriptFunctions::sfHomeText(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfHomeText");
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetTextRect(int16 argc, int16 *argv) {
+	int16 x1 = CLIP<int16>(argv[4], 1, 318);
+	int16 y1 = CLIP<int16>(argv[3], 1, 198);
+	int16 x2 = CLIP<int16>(argv[2], 1, 318);
+	int16 y2 = CLIP<int16>(argv[1], 1, 198);
+	//int16 textValue = argv[0];
+	// TODO: textValue
+	_vm->_screen->setTextRect(Common::Rect(x1, y1, x2, y2));
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetTextXY(int16 argc, int16 *argv) {
+	int16 x = CLIP<int16>(argv[1], 1, 318);
+	int16 y = CLIP<int16>(argv[0], 1, 198);
+	_vm->_screen->setTextXY(x, y);
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetFontDropShadow(int16 argc, int16 *argv) {
+	// if the drop shadow color is -1, then text drop shadow is disabled
+	// when font drop shadow is enabled, outline is disabled
+	_vm->_screen->setDropShadowColor(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetFontColor(int16 argc, int16 *argv) {
+	_vm->_screen->setTextColor(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetFontOutline(int16 argc, int16 *argv) {
+	// if the outline color is -1, then text outline is disabled
+	// when font outline is enabled, drop shadow is disabled
+	_vm->_screen->setOutlineColor(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfLoadMouseCursor(int16 argc, int16 *argv) {
+	PictureResource *flex = _vm->_res->getPicture(argv[2]);
+	if (flex) {
+		Graphics::Surface *surf = flex->getPicture();
+		CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
+		CursorMan.showMouse(true);
+		_vm->_res->freeResource(flex);
+	}
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetSpriteGround(int16 argc, int16 *argv) {
+	_vm->_screen->setGround(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfLoadResText(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfLoadResText");
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetClipArea(int16 argc, int16 *argv) {
+	_vm->_screen->setClipArea(argv[3], argv[2], argv[1], argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetSpriteClip(int16 argc, int16 *argv) {
+	_vm->_screen->setClip(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfAddScreenMask(int16 argc, int16 *argv) {
+	_vm->_screen->drawMask(argv[2], argv[1], argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetSpriteMask(int16 argc, int16 *argv) {
+	_vm->_screen->setMask(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfSoundPlaying(int16 argc, int16 *argv) {
+	if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle))
+		return 1;
+	else
+		return 0;
+}
+
+int16 ScriptFunctions::sfStopSound(int16 argc, int16 *argv) {
+	_vm->_mixer->stopHandle(_audioStreamHandle);
+	return 0;
+}
+
+int16 ScriptFunctions::sfPlayVoice(int16 argc, int16 *argv) {
+	if (argv[0] > 0) {
+		_vm->_mixer->stopHandle(_audioStreamHandle);
+		_vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
+			_vm->_res->getSound(argv[0])->getAudioStream(_vm->_soundRate, false));
+	}
+	return 0;
+}
+
+int16 ScriptFunctions::sfPlayCd(int16 argc, int16 *argv) {
+	// This one is called loads of times, so it has been commented out to reduce spam
+	//warning("Unimplemented opcode: sfPlayCd");
+	return 0;
+}
+
+int16 ScriptFunctions::sfStopCd(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfStopCd");
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetCdStatus(int16 argc, int16 *argv) {
+	// This one is called loads of times, so it has been commented out to reduce spam
+	//warning("Unimplemented opcode: sfGetCdStatus");
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetCdTime(int16 argc, int16 *argv) {
+	// This one is called loads of times, so it has been commented out to reduce spam
+	//warning("Unimplemented opcode: sfGetCdTime");
+	return 0;
+}
+
+int16 ScriptFunctions::sfPlayCdSegment(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfPlayCdSegment");
+	return 0;
+}
+
+int16 ScriptFunctions::sfPrintf(int16 argc, int16 *argv) {
+	Object *obj = _vm->_dat->getObject(argv[argc - 1]);
+	const char *text = obj->getString();
+	debug(4, "--> text = %s", text);
+	return 0;
+}
+
+int16 ScriptFunctions::sfClearMono(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfClearMono");
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetSoundEnergy(int16 argc, int16 *argv) {
+	// This is called while in-game voices are played
+	// Not sure what it's used for
+	// -> It's used to animate mouths when NPCs are talking
+	// FIXME: This is a workaround for the "sound energy" problem
+	// At least the characters move their lips when talking now
+	return _vm->_rnd->getRandomNumber(5);
+}
+
+int16 ScriptFunctions::sfClearText(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfClearText");
+	return 1;
+}
+
+int16 ScriptFunctions::sfAnimText(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfAnimText");
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetTextWidth(int16 argc, int16 *argv) {
+	int16 width = 0;
+	if (argv[1] > 0) {
+		Object *obj = _vm->_dat->getObject(argv[1]);
+		const char *text = obj->getString();
+		width = _vm->_screen->getTextWidth(argv[0], text);
+	}
+	return width;
+}
+
+int16 ScriptFunctions::sfPlayMovie(int16 argc, int16 *argv) {
+	const char *movieName = _vm->_dat->getObject(argv[1])->getString();
+	_vm->_system->showMouse(false);
+	_vm->_pmvPlayer->play(movieName);
+	_vm->_system->showMouse(true);
+	return 0;
+}
+
+int16 ScriptFunctions::sfLoadSound(int16 argc, int16 *argv) {
+	SoundResource *sound = _vm->_res->getSound(argv[0]);
+	if (sound) {
+		_vm->_res->freeResource(sound);
+		return 1;
+	}
+	return 0;
+}
+
+int16 ScriptFunctions::sfLoadMusic(int16 argc, int16 *argv) {
+	GenericResource *xmidi = _vm->_res->getXmidi(argv[0]);
+	if (xmidi) {
+		_vm->_res->freeResource(xmidi);
+		return 1;
+	}
+	return 0;
+}
+
+int16 ScriptFunctions::sfLoadPicture(int16 argc, int16 *argv) {
+	PictureResource *flex = _vm->_res->getPicture(argv[0]);
+	if (flex) {
+		_vm->_res->freeResource(flex);
+		return 1;
+	}
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetMusicVolume(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfSetMusicVolume");
+	return 0;
+}
+
+int16 ScriptFunctions::sfRestartEvents(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfRestartEvents");
+	return 0;
+}
+
+int16 ScriptFunctions::sfPlaceSprite(int16 argc, int16 *argv) {
+	return _vm->_screen->placeSprite(argv[3], argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctions::sfPlaceText(int16 argc, int16 *argv) {
+	return _vm->_screen->placeText(argv[6], argv[5], argv[4], argv[3], argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctions::sfDeleteChannel(int16 argc, int16 *argv) {
+	_vm->_screen->deleteChannel(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetChannelType(int16 argc, int16 *argv) {
+	return _vm->_screen->getChannelType(argv[0]);
+}
+
+int16 ScriptFunctions::sfSetChannelState(int16 argc, int16 *argv) {
+	_vm->_screen->setChannelState(argv[1], argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetChannelLocation(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfSetChannelLocation");
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetChannelContent(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfSetChannelContent");
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetExcludeArea(int16 argc, int16 *argv) {
+	_vm->_screen->setExcludeArea(argv[3], argv[2], argv[1], argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetSpriteExclude(int16 argc, int16 *argv) {
+	_vm->_screen->setExclude(argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetChannelState(int16 argc, int16 *argv) {
+	return _vm->_screen->getChannelState(argv[0]);
+}
+
+int16 ScriptFunctions::sfPlaceAnim(int16 argc, int16 *argv) {
+	return _vm->_screen->placeAnim(argv[4], argv[3], argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctions::sfSetAnimFrame(int16 argc, int16 *argv) {
+	_vm->_screen->setAnimFrame(argv[1], argv[0]);
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetAnimFrame(int16 argc, int16 *argv) {
+	return _vm->_screen->getAnimFrame(argv[0]);
+}
+
+int16 ScriptFunctions::sfGetAnimFrameCount(int16 argc, int16 *argv) {
+	int16 frameCount = 0;
+	AnimationResource *anim = _vm->_res->getAnimation(argv[0]);
+	if (anim) {
+		frameCount = anim->getCount();
+		_vm->_res->freeResource(anim);
+	}
+	return frameCount;
+}
+
+int16 ScriptFunctions::sfGetPictureWidth(int16 argc, int16 *argv) {
+	int16 width = 0;
+	PictureResource *flex = _vm->_res->getPicture(argv[0]);
+	if (flex) {
+		width = flex->getPicture()->w;
+		_vm->_res->freeResource(flex);
+	}
+	return width;
+}
+
+int16 ScriptFunctions::sfGetPictureHeight(int16 argc, int16 *argv) {
+	int16 height = 0;
+	PictureResource *flex = _vm->_res->getPicture(argv[0]);
+	if (flex) {
+		height = flex->getPicture()->h;
+		_vm->_res->freeResource(flex);
+	}
+	return height;
+}
+
+int16 ScriptFunctions::sfSetSoundRate(int16 argc, int16 *argv) {
+	_vm->_soundRate = argv[0];
+	return 1;
+}
+
+int16 ScriptFunctions::sfDrawAnimPic(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfDrawAnimPic");
+	return 0;
+}
+
+int16 ScriptFunctions::sfLoadAnim(int16 argc, int16 *argv) {
+	AnimationResource *anim = _vm->_res->getAnimation(argv[0]);
+	if (anim) {
+		_vm->_res->freeResource(anim);
+		return 1;
+	}
+	return 0;
+}
+
+int16 ScriptFunctions::sfReadText(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfReadText");
+	return 0;
+}
+
+int16 ScriptFunctions::sfReadMenu(int16 argc, int16 *argv) {
+	int16 objectIndex = argv[2];
+	int16 menuIndex = argv[1];
+	int16 textIndex = argv[0];
+	int16 length = 0;
+	MenuResource *menu = _vm->_res->getMenu(menuIndex);
+	if (menu) {
+		const char *text = menu->getString(textIndex);
+		debug(4, "objectIndex = %04X; text = %s\n", objectIndex, text);
+		Object *obj = _vm->_dat->getObject(objectIndex);
+		obj->setString(text);
+		_vm->_res->freeResource(menu);
+		if (text)
+			length = strlen(text);
+	}
+	return length;
+}
+
+int16 ScriptFunctions::sfDrawMenu(int16 argc, int16 *argv) {
+	int16 menuIndex = argv[1];
+	int16 textIndex = argv[0];
+	MenuResource *menu = _vm->_res->getMenu(menuIndex);
+	if (menu) {
+		const char *text = menu->getString(textIndex);
+		if (text)
+			_vm->_screen->printText(text);
+		_vm->_res->freeResource(menu);
+	}
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetMenuCount(int16 argc, int16 *argv) {
+	int16 menuIndex = argv[0];
+	int16 count = 0;
+	MenuResource *menu = _vm->_res->getMenu(menuIndex);
+	if (menu) {
+		count = menu->getCount();
+		_vm->_res->freeResource(menu);
+	}
+	return count;
+}
+
+int16 ScriptFunctions::sfSaveGame(int16 argc, int16 *argv) {
+	
+	int16 saveNum = argv[2];
+	int16 descObjectIndex = argv[1];
+	int16 version = argv[0];
+	
+	if (saveNum > 999)
+		return 6;
+
+	Object *obj = _vm->_dat->getObject(descObjectIndex);
+	const char *description = obj->getString();
+
+	Common::String filename = _vm->getSavegameFilename(saveNum);
+
+	return _vm->_dat->savegame(filename.c_str(), description, version);
+	
+}
+
+int16 ScriptFunctions::sfLoadGame(int16 argc, int16 *argv) {
+
+	int16 saveNum = argv[1];
+	int16 version = argv[0];
+
+	if (saveNum > 999)
+		return 1;
+
+	Common::String filename = _vm->getSavegameFilename(saveNum);
+
+	return _vm->_dat->loadgame(filename.c_str(), version);
+	
+}
+
+int16 ScriptFunctions::sfGetGameDescription(int16 argc, int16 *argv) {
+	
+	int16 descObjectIndex = argv[2];
+	int16 saveNum = argv[1];
+	/*int16 version = argv[0];*/
+	Common::String description;
+
+	if (saveNum > 999)
+		return 1;
+
+	Common::String filename = _vm->getSavegameFilename(saveNum);
+
+	Object *obj = _vm->_dat->getObject(descObjectIndex);
+
+	if (_vm->_dat->getSavegameDescription(filename.c_str(), description)) {
+		obj->setString(description.c_str());
+		return 0;
+	} else {
+		obj->setString("");
+		return 1;
+	}
+
+}
+
+int16 ScriptFunctions::sfShakeScreen(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfShakeScreen");
+	return 0;
+}
+
+int16 ScriptFunctions::sfPlaceMenu(int16 argc, int16 *argv) {
+	warning("Unimplemented opcode: sfPlaceMenu");
+	return 0;
+}
+
+int16 ScriptFunctions::sfSetSoundVolume(int16 argc, int16 *argv) {
+	_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, argv[0] * 25);
+	_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, argv[0] * 25);
+	return 0;
+}
+
+int16 ScriptFunctions::sfGetSynthType(int16 argc, int16 *argv) {
+	// 0 = Default
+	// 1 = PCSPKR
+	// 2 = SBFM/ADLIB
+	// 3 = ADLIBG
+	// 4 = MT32MPU
+	warning("Unimplemented opcode: sfGetSynthType");
+	return 0;
+}
+
+int16 ScriptFunctions::sfIsSlowSystem(int16 argc, int16 *argv) {
+	//warning("Unimplemented opcode: sfIsSlowSystem");
+	// NOTE: In the original engine this value is set via a command-line parameter
+	// I don't think it's needed here
+	// One could maybe think about returning 1 here on actually slower systems.
+	return 0;
+}
+
+} // End of namespace Made


Property changes on: scummvm/trunk/engines/made/scriptfuncs.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Modified: scummvm/trunk/engines/made/scriptfuncs.h
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs.h	2008-05-14 09:54:15 UTC (rev 32104)
+++ scummvm/trunk/engines/made/scriptfuncs.h	2008-05-14 11:19:31 UTC (rev 32105)
@@ -47,14 +47,12 @@
 			delete _externalFuncs[i];
 	}
 	int16 callFunction(uint16 index, int16 argc, int16 *argv)  {
-		if (index >= _externalFuncs.size()) {
-			// TODO: ERROR!
-			return 0;
-		}
+		if (index >= _externalFuncs.size())
+			error("ScriptFunctions::callFunction() Invalid function index %d", index);
 		debug(4, "%s", _externalFuncNames[index]);
 		return (*_externalFuncs[index])(argc, argv);
 	}
-	virtual void setupExternalsTable() = 0;
+	void setupExternalsTable();
 protected:
 	MadeEngine *_vm;
 	Audio::SoundHandle _audioStreamHandle;
@@ -62,242 +60,113 @@
 
 	Common::Array<const ExternalFunc*> _externalFuncs;
 	Common::Array<const char *> _externalFuncNames;
-	GenericResource *_xmidiRes;
-};
+	GenericResource *_musicRes;
+	
+	int16 sfSystemCall(int16 argc, int16 *argv);
+	int16 sfInitGraf(int16 argc, int16 *argv);
+	int16 sfRestoreGraf(int16 argc, int16 *argv);
+	int16 sfDrawPicture(int16 argc, int16 *argv);
+	int16 sfClearScreen(int16 argc, int16 *argv);
+	int16 sfShowPage(int16 argc, int16 *argv);
+	int16 sfPollEvent(int16 argc, int16 *argv);
+	int16 sfGetMouseX(int16 argc, int16 *argv);
+	int16 sfGetMouseY(int16 argc, int16 *argv);
+	int16 sfGetKey(int16 argc, int16 *argv);
+	int16 sfSetVisualEffect(int16 argc, int16 *argv);
+	int16 sfPlaySound(int16 argc, int16 *argv);
+	int16 sfPlayMusic(int16 argc, int16 *argv);
+	int16 sfStopMusic(int16 argc, int16 *argv);
+	int16 sfIsMusicPlaying(int16 argc, int16 *argv);
+	int16 sfSetTextPos(int16 argc, int16 *argv);
+	int16 sfFlashScreen(int16 argc, int16 *argv);
+	int16 sfPlayNote(int16 argc, int16 *argv);
+	int16 sfStopNote(int16 argc, int16 *argv);
+	int16 sfPlayTele(int16 argc, int16 *argv);
+	int16 sfStopTele(int16 argc, int16 *argv);
+	int16 sfHideMouseCursor(int16 argc, int16 *argv);
+	int16 sfShowMouseCursor(int16 argc, int16 *argv);
+	int16 sfGetMusicBeat(int16 argc, int16 *argv);
+	int16 sfSetScreenLock(int16 argc, int16 *argv);
+	int16 sfAddSprite(int16 argc, int16 *argv);
+	int16 sfFreeAnim(int16 argc, int16 *argv);
+	int16 sfDrawSprite(int16 argc, int16 *argv);
+	int16 sfEraseSprites(int16 argc, int16 *argv);
+	int16 sfUpdateSprites(int16 argc, int16 *argv);
+	int16 sfGetTimer(int16 argc, int16 *argv);
+	int16 sfSetTimer(int16 argc, int16 *argv);
+	int16 sfResetTimer(int16 argc, int16 *argv);
+	int16 sfAllocTimer(int16 argc, int16 *argv);
+	int16 sfFreeTimer(int16 argc, int16 *argv);
+	int16 sfSetPaletteLock(int16 argc, int16 *argv);
+	int16 sfSetFont(int16 argc, int16 *argv);
+	int16 sfDrawText(int16 argc, int16 *argv);
+	int16 sfHomeText(int16 argc, int16 *argv);
+	int16 sfSetTextRect(int16 argc, int16 *argv);
+	int16 sfSetTextXY(int16 argc, int16 *argv);
+	int16 sfSetFontDropShadow(int16 argc, int16 *argv);
+	int16 sfSetFontColor(int16 argc, int16 *argv);
+	int16 sfSetFontOutline(int16 argc, int16 *argv);
+	int16 sfLoadMouseCursor(int16 argc, int16 *argv);
+	int16 sfSetSpriteGround(int16 argc, int16 *argv);
+	int16 sfLoadResText(int16 argc, int16 *argv);
+	int16 sfSetClipArea(int16 argc, int16 *argv);
+	int16 sfSetSpriteClip(int16 argc, int16 *argv);
+	int16 sfAddScreenMask(int16 argc, int16 *argv);
+	int16 sfSetSpriteMask(int16 argc, int16 *argv);
+	int16 sfSoundPlaying(int16 argc, int16 *argv);
+	int16 sfStopSound(int16 argc, int16 *argv);
+	int16 sfPlayVoice(int16 argc, int16 *argv);
+	int16 sfPlayCd(int16 argc, int16 *argv);
+	int16 sfStopCd(int16 argc, int16 *argv);
+	int16 sfGetCdStatus(int16 argc, int16 *argv);
+	int16 sfGetCdTime(int16 argc, int16 *argv);
+	int16 sfPlayCdSegment(int16 argc, int16 *argv);
+	int16 sfPrintf(int16 argc, int16 *argv);
+	int16 sfClearMono(int16 argc, int16 *argv);
+	int16 sfGetSoundEnergy(int16 argc, int16 *argv);
+	int16 sfClearText(int16 argc, int16 *argv);
+	int16 sfAnimText(int16 argc, int16 *argv);
+	int16 sfGetTextWidth(int16 argc, int16 *argv);
+	int16 sfPlayMovie(int16 argc, int16 *argv);
+	int16 sfLoadSound(int16 argc, int16 *argv);
+	int16 sfLoadMusic(int16 argc, int16 *argv);
+	int16 sfLoadPicture(int16 argc, int16 *argv);
+	int16 sfSetMusicVolume(int16 argc, int16 *argv);
+	int16 sfRestartEvents(int16 argc, int16 *argv);
+	int16 sfPlaceSprite(int16 argc, int16 *argv);
+	int16 sfPlaceText(int16 argc, int16 *argv);
+	int16 sfDeleteChannel(int16 argc, int16 *argv);
+	int16 sfGetChannelType(int16 argc, int16 *argv);
+	int16 sfSetChannelState(int16 argc, int16 *argv);
+	int16 sfSetChannelLocation(int16 argc, int16 *argv);
+	int16 sfSetChannelContent(int16 argc, int16 *argv);
+	int16 sfSetExcludeArea(int16 argc, int16 *argv);
+	int16 sfSetSpriteExclude(int16 argc, int16 *argv);
+	int16 sfGetChannelState(int16 argc, int16 *argv);
+	int16 sfPlaceAnim(int16 argc, int16 *argv);
+	int16 sfSetAnimFrame(int16 argc, int16 *argv);
+	int16 sfGetAnimFrame(int16 argc, int16 *argv);
+	int16 sfGetAnimFrameCount(int16 argc, int16 *argv);
+	int16 sfGetPictureWidth(int16 argc, int16 *argv);
+	int16 sfGetPictureHeight(int16 argc, int16 *argv);
+	int16 sfSetSoundRate(int16 argc, int16 *argv);
+	int16 sfDrawAnimPic(int16 argc, int16 *argv);
+	int16 sfLoadAnim(int16 argc, int16 *argv);
+	int16 sfReadText(int16 argc, int16 *argv);
+	int16 sfReadMenu(int16 argc, int16 *argv);
+	int16 sfDrawMenu(int16 argc, int16 *argv);
+	int16 sfGetMenuCount(int16 argc, int16 *argv);
+	int16 sfSaveGame(int16 argc, int16 *argv);
+	int16 sfLoadGame(int16 argc, int16 *argv);
+	int16 sfGetGameDescription(int16 argc, int16 *argv);
+	int16 sfShakeScreen(int16 argc, int16 *argv);
+	int16 sfPlaceMenu(int16 argc, int16 *argv);
+	int16 sfSetSoundVolume(int16 argc, int16 *argv);
+	int16 sfGetSynthType(int16 argc, int16 *argv);
+	int16 sfIsSlowSystem(int16 argc, int16 *argv);
 
-class ScriptFunctionsLgop2 : public ScriptFunctions {
-public:
-	ScriptFunctionsLgop2(MadeEngine *vm) : ScriptFunctions(vm) {}
-	void setupExternalsTable();
-protected:
-
-	int16 o1_SYSTEM(int16 argc, int16 *argv);
-	int16 o1_INITGRAF(int16 argc, int16 *argv);
-	int16 o1_RESTOREGRAF(int16 argc, int16 *argv);
-	int16 o1_DRAWPIC(int16 argc, int16 *argv);
-	int16 o1_CLS(int16 argc, int16 *argv);
-	int16 o1_SHOWPAGE(int16 argc, int16 *argv);
-	int16 o1_EVENT(int16 argc, int16 *argv);
-	int16 o1_EVENTX(int16 argc, int16 *argv);
-	int16 o1_EVENTY(int16 argc, int16 *argv);
-	int16 o1_EVENTKEY(int16 argc, int16 *argv);
-	int16 o1_VISUALFX(int16 argc, int16 *argv);
-	int16 o1_PLAYSND(int16 argc, int16 *argv);
-	int16 o1_PLAYMUS(int16 argc, int16 *argv);
-	int16 o1_STOPMUS(int16 argc, int16 *argv);
-	int16 o1_ISMUS(int16 argc, int16 *argv);
-	int16 o1_TEXTPOS(int16 argc, int16 *argv);
-	int16 o1_FLASH(int16 argc, int16 *argv);
-	int16 o1_PLAYNOTE(int16 argc, int16 *argv);
-	int16 o1_STOPNOTE(int16 argc, int16 *argv);
-	int16 o1_PLAYTELE(int16 argc, int16 *argv);
-	int16 o1_STOPTELE(int16 argc, int16 *argv);
-	int16 o1_HIDECURS(int16 argc, int16 *argv);
-	int16 o1_SHOWCURS(int16 argc, int16 *argv);
-	int16 o1_MUSICBEAT(int16 argc, int16 *argv);
-	int16 o1_SCREENLOCK(int16 argc, int16 *argv);
-	int16 o1_ADDSPRITE(int16 argc, int16 *argv);
-	int16 o1_FREEANIM(int16 argc, int16 *argv);
-	int16 o1_DRAWSPRITE(int16 argc, int16 *argv);
-	int16 o1_ERASESPRITES(int16 argc, int16 *argv);
-	int16 o1_UPDATESPRITES(int16 argc, int16 *argv);
-	int16 o1_GETTIMER(int16 argc, int16 *argv);
-	int16 o1_SETTIMER(int16 argc, int16 *argv);
-	int16 o1_RESETTIMER(int16 argc, int16 *argv);
-	int16 o1_ALLOCTIMER(int16 argc, int16 *argv);
-	int16 o1_FREETIMER(int16 argc, int16 *argv);
-	int16 o1_PALETTELOCK(int16 argc, int16 *argv);
-	int16 o1_FONT(int16 argc, int16 *argv);
-	int16 o1_DRAWTEXT(int16 argc, int16 *argv);
-	int16 o1_HOMETEXT(int16 argc, int16 *argv);
-	int16 o1_TEXTRECT(int16 argc, int16 *argv);
-	int16 o1_TEXTXY(int16 argc, int16 *argv);
-	int16 o1_DROPSHADOW(int16 argc, int16 *argv);
-	int16 o1_TEXTCOLOR(int16 argc, int16 *argv);
-	int16 o1_OUTLINE(int16 argc, int16 *argv);
-	int16 o1_LOADCURSOR(int16 argc, int16 *argv);
-	int16 o1_SETGROUND(int16 argc, int16 *argv);
-	int16 o1_RESTEXT(int16 argc, int16 *argv);
-	int16 o1_ADDMASK(int16 argc, int16 *argv);
-	int16 o1_SETMASK(int16 argc, int16 *argv);
-	int16 o1_ISSND(int16 argc, int16 *argv);
-	int16 o1_STOPSND(int16 argc, int16 *argv);
-	int16 o1_PLAYVOICE(int16 argc, int16 *argv);
 };
 
-class ScriptFunctionsRtz : public ScriptFunctions {
-public:
-	ScriptFunctionsRtz(MadeEngine *vm) : ScriptFunctions(vm) {}
-	void setupExternalsTable();
-protected:
-
-	int16 o1_SYSTEM(int16 argc, int16 *argv);
-	int16 o1_INITGRAF(int16 argc, int16 *argv);
-	int16 o1_RESTOREGRAF(int16 argc, int16 *argv);
-	int16 o1_DRAWPIC(int16 argc, int16 *argv);
-	int16 o1_CLS(int16 argc, int16 *argv);
-	int16 o1_SHOWPAGE(int16 argc, int16 *argv);
-	int16 o1_EVENT(int16 argc, int16 *argv);
-	int16 o1_EVENTX(int16 argc, int16 *argv);
-	int16 o1_EVENTY(int16 argc, int16 *argv);
-	int16 o1_EVENTKEY(int16 argc, int16 *argv);
-	int16 o1_VISUALFX(int16 argc, int16 *argv);
-	int16 o1_PLAYSND(int16 argc, int16 *argv);
-	int16 o1_PLAYMUS(int16 argc, int16 *argv);
-	int16 o1_STOPMUS(int16 argc, int16 *argv);
-	int16 o1_ISMUS(int16 argc, int16 *argv);
-	int16 o1_TEXTPOS(int16 argc, int16 *argv);
-	int16 o1_FLASH(int16 argc, int16 *argv);
-	int16 o1_PLAYNOTE(int16 argc, int16 *argv);
-	int16 o1_STOPNOTE(int16 argc, int16 *argv);
-	int16 o1_PLAYTELE(int16 argc, int16 *argv);
-	int16 o1_STOPTELE(int16 argc, int16 *argv);
-	int16 o1_HIDECURS(int16 argc, int16 *argv);
-	int16 o1_SHOWCURS(int16 argc, int16 *argv);
-	int16 o1_MUSICBEAT(int16 argc, int16 *argv);
-	int16 o1_SCREENLOCK(int16 argc, int16 *argv);
-	int16 o1_ADDSPRITE(int16 argc, int16 *argv);
-	int16 o1_FREEANIM(int16 argc, int16 *argv);
-	int16 o1_DRAWSPRITE(int16 argc, int16 *argv);
-	int16 o1_ERASESPRITES(int16 argc, int16 *argv);
-	int16 o1_UPDATESPRITES(int16 argc, int16 *argv);
-	int16 o1_GETTIMER(int16 argc, int16 *argv);
-	int16 o1_SETTIMER(int16 argc, int16 *argv);
-	int16 o1_RESETTIMER(int16 argc, int16 *argv);
-	int16 o1_ALLOCTIMER(int16 argc, int16 *argv);
-	int16 o1_FREETIMER(int16 argc, int16 *argv);
-	int16 o1_PALETTELOCK(int16 argc, int16 *argv);
-	int16 o1_FONT(int16 argc, int16 *argv);
-	int16 o1_DRAWTEXT(int16 argc, int16 *argv);
-	int16 o1_HOMETEXT(int16 argc, int16 *argv);
-	int16 o1_TEXTRECT(int16 argc, int16 *argv);
-	int16 o1_TEXTXY(int16 argc, int16 *argv);
-	int16 o1_DROPSHADOW(int16 argc, int16 *argv);
-	int16 o1_TEXTCOLOR(int16 argc, int16 *argv);
-	int16 o1_OUTLINE(int16 argc, int16 *argv);
-	int16 o1_LOADCURSOR(int16 argc, int16 *argv);
-	int16 o1_SETGROUND(int16 argc, int16 *argv);
-	int16 o1_RESTEXT(int16 argc, int16 *argv);
-	int16 o1_CLIPAREA(int16 argc, int16 *argv);
-	int16 o1_SETCLIP(int16 argc, int16 *argv);
-	int16 o1_ISSND(int16 argc, int16 *argv);
-	int16 o1_STOPSND(int16 argc, int16 *argv);
-	int16 o1_PLAYVOICE(int16 argc, int16 *argv);
-	int16 o1_CDPLAY(int16 argc, int16 *argv);
-	int16 o1_STOPCD(int16 argc, int16 *argv);
-	int16 o1_CDSTATUS(int16 argc, int16 *argv);
-	int16 o1_CDTIME(int16 argc, int16 *argv);
-	int16 o1_CDPLAYSEG(int16 argc, int16 *argv);
-	int16 o1_PRINTF(int16 argc, int16 *argv);
-	int16 o1_MONOCLS(int16 argc, int16 *argv);
-	int16 o1_SNDENERGY(int16 argc, int16 *argv);
-	int16 o1_CLEARTEXT(int16 argc, int16 *argv);
-	int16 o1_ANIMTEXT(int16 argc, int16 *argv);
-	int16 o1_TEXTWIDTH(int16 argc, int16 *argv);
-	int16 o1_PLAYMOVIE(int16 argc, int16 *argv);
-	int16 o1_LOADSND(int16 argc, int16 *argv);
-	int16 o1_LOADMUS(int16 argc, int16 *argv);
-	int16 o1_LOADPIC(int16 argc, int16 *argv);
-	int16 o1_MUSICVOL(int16 argc, int16 *argv);
-	int16 o1_RESTARTEVENTS(int16 argc, int16 *argv);
-	int16 o1_PLACESPRITE(int16 argc, int16 *argv);
-	int16 o1_PLACETEXT(int16 argc, int16 *argv);
-	int16 o1_DELETECHANNEL(int16 argc, int16 *argv);
-	int16 o1_CHANNELTYPE(int16 argc, int16 *argv);
-	int16 o1_SETSTATE(int16 argc, int16 *argv);
-	int16 o1_SETLOCATION(int16 argc, int16 *argv);
-	int16 o1_SETCONTENT(int16 argc, int16 *argv);
-	int16 o1_EXCLUDEAREA(int16 argc, int16 *argv);
-	int16 o1_SETEXCLUDE(int16 argc, int16 *argv);
-	int16 o1_GETSTATE(int16 argc, int16 *argv);
-	int16 o1_PLACEANIM(int16 argc, int16 *argv);
-	int16 o1_SETFRAME(int16 argc, int16 *argv);
-	int16 o1_GETFRAME(int16 argc, int16 *argv);
-	int16 o1_GETFRAMECOUNT(int16 argc, int16 *argv);
-	int16 o1_PICWIDTH(int16 argc, int16 *argv);
-	int16 o1_PICHEIGHT(int16 argc, int16 *argv);
-	int16 o1_SOUNDRATE(int16 argc, int16 *argv);
-	int16 o1_DRAWANIMPIC(int16 argc, int16 *argv);
-	int16 o1_LOADANIM(int16 argc, int16 *argv);
-	int16 o1_READTEXT(int16 argc, int16 *argv);
-	int16 o1_READMENU(int16 argc, int16 *argv);
-	int16 o1_DRAWMENU(int16 argc, int16 *argv);
-	int16 o1_MENUCOUNT(int16 argc, int16 *argv);
-	int16 o1_SAVEGAME(int16 argc, int16 *argv);
-	int16 o1_LOADGAME(int16 argc, int16 *argv);
-	int16 o1_GAMENAME(int16 argc, int16 *argv);
-	int16 o1_SHAKESCREEN(int16 argc, int16 *argv);
-	int16 o1_PLACEMENU(int16 argc, int16 *argv);
-	int16 o1_SETVOLUME(int16 argc, int16 *argv);
-	int16 o1_WHATSYNTH(int16 argc, int16 *argv);
-	int16 o1_SLOWSYSTEM(int16 argc, int16 *argv);
-};
-
-class ScriptFunctionsMhne : public ScriptFunctions {
-public:
-	ScriptFunctionsMhne(MadeEngine *vm) : ScriptFunctions(vm) {}
-	void setupExternalsTable();
-protected:
-
-	int16 o1_SYSTEM(int16 argc, int16 *argv);
-	int16 o1_INITGRAF(int16 argc, int16 *argv);
-	int16 o1_RESTOREGRAF(int16 argc, int16 *argv);
-	int16 o1_DRAWPIC(int16 argc, int16 *argv);
-	int16 o1_CLS(int16 argc, int16 *argv);
-	int16 o1_SHOWPAGE(int16 argc, int16 *argv);
-	int16 o1_EVENT(int16 argc, int16 *argv);
-	int16 o1_EVENTX(int16 argc, int16 *argv);
-	int16 o1_EVENTY(int16 argc, int16 *argv);
-	int16 o1_EVENTKEY(int16 argc, int16 *argv);
-	int16 o1_VISUALFX(int16 argc, int16 *argv);
-	int16 o1_PLAYSND(int16 argc, int16 *argv);
-	int16 o1_PLAYMUS(int16 argc, int16 *argv);
-	int16 o1_STOPMUS(int16 argc, int16 *argv);
-	int16 o1_ISMUS(int16 argc, int16 *argv);
-	int16 o1_TEXTPOS(int16 argc, int16 *argv);
-	int16 o1_FLASH(int16 argc, int16 *argv);
-	int16 o1_PLAYNOTE(int16 argc, int16 *argv);
-	int16 o1_STOPNOTE(int16 argc, int16 *argv);
-	int16 o1_PLAYTELE(int16 argc, int16 *argv);
-	int16 o1_STOPTELE(int16 argc, int16 *argv);
-	int16 o1_HIDECURS(int16 argc, int16 *argv);
-	int16 o1_SHOWCURS(int16 argc, int16 *argv);
-	int16 o1_MUSICBEAT(int16 argc, int16 *argv);
-	int16 o1_SCREENLOCK(int16 argc, int16 *argv);
-	int16 o1_ADDSPRITE(int16 argc, int16 *argv);
-	int16 o1_FREEANIM(int16 argc, int16 *argv);
-	int16 o1_DRAWSPRITE(int16 argc, int16 *argv);
-	int16 o1_ERASESPRITES(int16 argc, int16 *argv);
-	int16 o1_UPDATESPRITES(int16 argc, int16 *argv);
-	int16 o1_GETTIMER(int16 argc, int16 *argv);
-	int16 o1_SETTIMER(int16 argc, int16 *argv);
-	int16 o1_RESETTIMER(int16 argc, int16 *argv);
-	int16 o1_ALLOCTIMER(int16 argc, int16 *argv);
-	int16 o1_FREETIMER(int16 argc, int16 *argv);
-	int16 o1_PALETTELOCK(int16 argc, int16 *argv);
-	int16 o1_FONT(int16 argc, int16 *argv);
-	int16 o1_DRAWTEXT(int16 argc, int16 *argv);
-	int16 o1_HOMETEXT(int16 argc, int16 *argv);
-	int16 o1_TEXTRECT(int16 argc, int16 *argv);
-	int16 o1_TEXTXY(int16 argc, int16 *argv);
-	int16 o1_DROPSHADOW(int16 argc, int16 *argv);
-	int16 o1_TEXTCOLOR(int16 argc, int16 *argv);
-	int16 o1_OUTLINE(int16 argc, int16 *argv);
-	int16 o1_LOADCURSOR(int16 argc, int16 *argv);
-	int16 o1_SETGROUND(int16 argc, int16 *argv);
-	int16 o1_RESTEXT(int16 argc, int16 *argv);
-	int16 o1_ADDMASK(int16 argc, int16 *argv);
-	int16 o1_SETMASK(int16 argc, int16 *argv);
-	int16 o1_ISSND(int16 argc, int16 *argv);
-	int16 o1_STOPSND(int16 argc, int16 *argv);
-	int16 o1_PLAYVOICE(int16 argc, int16 *argv);
-	int16 o1_CDPLAY(int16 argc, int16 *argv);
-	int16 o1_STOPCD(int16 argc, int16 *argv);
-	int16 o1_CDSTATUS(int16 argc, int16 *argv);
-	int16 o1_CDTIME(int16 argc, int16 *argv);
-	int16 o1_CDPLAYSEG(int16 argc, int16 *argv);
-};
-
 } // End of namespace Made
 
 #endif /* MADE_H */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list