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 
35 namespace Wintermute {
36 
37 // Implemented in their respective .cpp-files
38 BaseScriptable *makeSXSteamAPI(BaseGame *inGame, ScStack *stack);
39 BaseScriptable *makeSXWMEGalaxyAPI(BaseGame *inGame, ScStack *stack);
40 BaseScriptable *makeSX3fStatistics(BaseGame *inGame, ScStack *stack);
41 BaseScriptable *makeSXCommandLineHelper(BaseGame *inGame, ScStack *stack);
42 BaseScriptable *makeSXSample(BaseGame *inGame, ScStack *stack);
43 BaseScriptable *makeSXVlink(BaseGame *inGame, ScStack *stack);
44 BaseScriptable *makeSXBlackAndWhite(BaseGame *inGame, ScStack *stack);
45 BaseScriptable *makeSXShadowManager(BaseGame *inGame, ScStack *stack);
46 BaseScriptable *makeSXDisplacement(BaseGame *inGame, ScStack *stack);
47 
48 bool EmulatePluginCall(BaseGame *inGame, ScStack *stack, ScStack *thisStack, char *name) {
49  ScValue *thisObj;
50 
52  // SteamAPI (from wme_steam.dll)
54  if (strcmp(name, "SteamAPI") == 0) {
55  thisObj = thisStack->getTop();
56 
57  thisObj->setNative(makeSXSteamAPI(inGame, stack));
58 
59  stack->pushNULL();
60  return STATUS_OK;
61  }
62 
64  // WMEGalaxyAPI (from GOG version of julia.exe)
66  else if (strcmp(name, "WMEGalaxyAPI") == 0) {
67  thisObj = thisStack->getTop();
68 
69  thisObj->setNative(makeSXWMEGalaxyAPI(inGame, stack));
70 
71  stack->pushNULL();
72  return STATUS_OK;
73  }
74 
76  // Statistics (from wme_3fstatistics.dll)
78  else if (strcmp(name, "Statistics") == 0) {
79  thisObj = thisStack->getTop();
80 
81  thisObj->setNative(makeSX3fStatistics(inGame, stack));
82 
83  stack->pushNULL();
84  return STATUS_OK;
85  }
86 
88  // Commandline helper (from wme_commandlinehelper.dll)
90  else if (strcmp(name, "CommandLineHelper") == 0) {
91  thisObj = thisStack->getTop();
92 
93  thisObj->setNative(makeSXCommandLineHelper(inGame, stack));
94 
95  stack->pushNULL();
96  return STATUS_OK;
97  }
98 
100  // Window mode changer (from wme_windowmode.dll of "lostbride" game)
102  else if (strcmp(name, "Sample") == 0) {
103  thisObj = thisStack->getTop();
104 
105  thisObj->setNative(makeSXSample(inGame, stack));
106 
107  stack->pushNULL();
108  return STATUS_OK;
109  }
110 
112  // Displacement plugin (from wme_displacement.dll for "Beyond the Threshold" game)
114  else if (strcmp(name, "Displacement") == 0) {
115  thisObj = thisStack->getTop();
116 
117  thisObj->setNative(makeSXDisplacement(inGame, stack));
118 
119  stack->pushNULL();
120  return STATUS_OK;
121  }
122 
124  // BinkVideo player (from wme_vlink.dll of "Sunrise" game)
126  else if (strcmp(name, "BinkVideo") == 0) {
127  thisObj = thisStack->getTop();
128 
129  thisObj->setNative(makeSXVlink(inGame, stack));
130 
131  stack->pushNULL();
132  return STATUS_OK;
133  }
134 
135 #ifdef ENABLE_WME3D
136  // BlackAndWhite (from wme_blackandwhite.dll of "Stroke of Fate" duology games)
139  else if (strcmp(name, "BlackAndWhite") == 0) {
140  thisObj = thisStack->getTop();
141 
142  thisObj->setNative(makeSXBlackAndWhite(inGame, stack));
143 
144  stack->pushNULL();
145  return STATUS_OK;
146  }
147 
149  // ShadowManager (from wme_shadows.dll of "Stroke of Fate" duology games)
151  else if (strcmp(name, "ShadowManager") == 0) {
152  thisObj = thisStack->getTop();
153 
154  thisObj->setNative(makeSXShadowManager(inGame, stack));
155 
156  stack->pushNULL();
157  return STATUS_OK;
158  }
159 #endif
160 
161  return STATUS_FAILED;
162 }
163 
164 } // End of namespace Wintermute
165 
166 #endif
Definition: achievements_tables.h:27