ScummVM API documentation
plugins.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22/*
23 * This file is based on WME Lite.
24 * http://dead-code.org/redir.php?target=wmelite
25 * Copyright (c) 2011 Jan Nedoma
26 */
27
28#include "engines/wintermute/base/base_scriptable.h"
29#include "engines/wintermute/base/scriptables/script_value.h"
30#include "engines/wintermute/base/scriptables/script_stack.h"
31
32#ifndef WINTERMUTE_PLUGINS_H
33#define WINTERMUTE_PLUGINS_H
34
35namespace Wintermute {
36
37// Implemented in their respective .cpp-files
38BaseScriptable *makeSXSteamAPI(BaseGame *inGame, ScStack *stack);
39BaseScriptable *makeSXWMEGalaxyAPI(BaseGame *inGame, ScStack *stack);
40BaseScriptable *makeSX3fStatistics(BaseGame *inGame, ScStack *stack);
41BaseScriptable *makeSXCommandLineHelper(BaseGame *inGame, ScStack *stack);
42BaseScriptable *makeSXSample(BaseGame *inGame, ScStack *stack);
43BaseScriptable *makeSXVlink(BaseGame *inGame, ScStack *stack);
44BaseScriptable *makeSXBlackAndWhite(BaseGame *inGame, ScStack *stack);
45BaseScriptable *makeSXShadowManager(BaseGame *inGame, ScStack *stack);
46BaseScriptable *makeSXDisplacement(BaseGame *inGame, ScStack *stack);
47BaseScriptable *makeSXProtection(BaseGame *inGame, ScStack *stack);
48
49bool EmulatePluginCall(BaseGame *inGame, ScStack *stack, ScStack *thisStack, char *name) {
50 ScValue *thisObj;
51
53 // SteamAPI (from wme_steam.dll)
55 if (strcmp(name, "SteamAPI") == 0) {
56 thisObj = thisStack->getTop();
57
58 thisObj->setNative(makeSXSteamAPI(inGame, stack));
59
60 stack->pushNULL();
61 return STATUS_OK;
62 }
63
65 // WMEGalaxyAPI (from GOG version of julia.exe)
67 else if (strcmp(name, "WMEGalaxyAPI") == 0) {
68 thisObj = thisStack->getTop();
69
70 thisObj->setNative(makeSXWMEGalaxyAPI(inGame, stack));
71
72 stack->pushNULL();
73 return STATUS_OK;
74 }
75
77 // Statistics (from wme_3fstatistics.dll)
79 else if (strcmp(name, "Statistics") == 0) {
80 thisObj = thisStack->getTop();
81
82 thisObj->setNative(makeSX3fStatistics(inGame, stack));
83
84 stack->pushNULL();
85 return STATUS_OK;
86 }
87
89 // Commandline helper (from wme_commandlinehelper.dll)
91 else if (strcmp(name, "CommandLineHelper") == 0) {
92 thisObj = thisStack->getTop();
93
94 thisObj->setNative(makeSXCommandLineHelper(inGame, stack));
95
96 stack->pushNULL();
97 return STATUS_OK;
98 }
99
101 // Window mode changer (from wme_windowmode.dll of "lostbride" game)
103 else if (strcmp(name, "Sample") == 0) {
104 thisObj = thisStack->getTop();
105
106 thisObj->setNative(makeSXSample(inGame, stack));
107
108 stack->pushNULL();
109 return STATUS_OK;
110 }
111
113 // Displacement plugin (from wme_displacement.dll for "Beyond the Threshold" game)
115 else if (strcmp(name, "Displacement") == 0) {
116 thisObj = thisStack->getTop();
117
118 thisObj->setNative(makeSXDisplacement(inGame, stack));
119
120 stack->pushNULL();
121 return STATUS_OK;
122 }
123
125 // Protection class for "Susan Rose: Mysterious Child" game)
127 else if (strcmp(name, "Protection") == 0) {
128 thisObj = thisStack->getTop();
129
130 thisObj->setNative(makeSXProtection(inGame, stack));
131
132 stack->pushNULL();
133 return STATUS_OK;
134 }
135
136#ifdef ENABLE_WME3D
138 // BinkVideo player (from wme_vlink.dll of "Sunrise" game)
140 else if (strcmp(name, "BinkVideo") == 0) {
141 thisObj = thisStack->getTop();
142
143 thisObj->setNative(makeSXVlink(inGame, stack));
144
145 stack->pushNULL();
146 return STATUS_OK;
147 }
148
150 // BlackAndWhite (from wme_blackandwhite.dll of "Stroke of Fate" duology games)
152 else if (strcmp(name, "BlackAndWhite") == 0) {
153 thisObj = thisStack->getTop();
154
155 thisObj->setNative(makeSXBlackAndWhite(inGame, stack));
156
157 stack->pushNULL();
158 return STATUS_OK;
159 }
160
162 // ShadowManager (from wme_shadows.dll of "Stroke of Fate" duology games)
164 else if (strcmp(name, "ShadowManager") == 0) {
165 thisObj = thisStack->getTop();
166
167 thisObj->setNative(makeSXShadowManager(inGame, stack));
168
169 stack->pushNULL();
170 return STATUS_OK;
171 }
172#endif
173
174 return STATUS_FAILED;
175}
176
177} // End of namespace Wintermute
178
179#endif