ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 
47 bool EmulatePluginCall(BaseGame *inGame, ScStack *stack, ScStack *thisStack, char *name) {
48  ScValue *thisObj;
49 
51  // SteamAPI (from wme_steam.dll)
53  if (strcmp(name, "SteamAPI") == 0) {
54  thisObj = thisStack->getTop();
55 
56  thisObj->setNative(makeSXSteamAPI(inGame, stack));
57 
58  stack->pushNULL();
59  return STATUS_OK;
60  }
61 
63  // WMEGalaxyAPI (from GOG version of julia.exe)
65  else if (strcmp(name, "WMEGalaxyAPI") == 0) {
66  thisObj = thisStack->getTop();
67 
68  thisObj->setNative(makeSXWMEGalaxyAPI(inGame, stack));
69 
70  stack->pushNULL();
71  return STATUS_OK;
72  }
73 
75  // Statistics (from wme_3fstatistics.dll)
77  else if (strcmp(name, "Statistics") == 0) {
78  thisObj = thisStack->getTop();
79 
80  thisObj->setNative(makeSX3fStatistics(inGame, stack));
81 
82  stack->pushNULL();
83  return STATUS_OK;
84  }
85 
87  // Commandline helper (from wme_commandlinehelper.dll)
89  else if (strcmp(name, "CommandLineHelper") == 0) {
90  thisObj = thisStack->getTop();
91 
92  thisObj->setNative(makeSXCommandLineHelper(inGame, stack));
93 
94  stack->pushNULL();
95  return STATUS_OK;
96  }
97 
99  // Window mode changer (from wme_windowmode.dll of "lostbride" game)
101  else if (strcmp(name, "Sample") == 0) {
102  thisObj = thisStack->getTop();
103 
104  thisObj->setNative(makeSXSample(inGame, stack));
105 
106  stack->pushNULL();
107  return STATUS_OK;
108  }
109 
111  // BinkVideo player (from wme_vlink.dll of "Sunrise" game)
113  else if (strcmp(name, "BinkVideo") == 0) {
114  thisObj = thisStack->getTop();
115 
116  thisObj->setNative(makeSXVlink(inGame, stack));
117 
118  stack->pushNULL();
119  return STATUS_OK;
120  }
121 
122 #ifdef ENABLE_WME3D
123  // BlackAndWhite (from wme_blackandwhite.dll of "Stroke of Fate" duology games)
126  else if (strcmp(name, "BlackAndWhite") == 0) {
127  thisObj = thisStack->getTop();
128 
129  thisObj->setNative(makeSXBlackAndWhite(inGame, stack));
130 
131  stack->pushNULL();
132  return STATUS_OK;
133  }
134 
136  // ShadowManager (from wme_shadows.dll of "Stroke of Fate" duology games)
138  else if (strcmp(name, "ShadowManager") == 0) {
139  thisObj = thisStack->getTop();
140 
141  thisObj->setNative(makeSXShadowManager(inGame, stack));
142 
143  stack->pushNULL();
144  return STATUS_OK;
145  }
146 #endif
147 
148  return STATUS_FAILED;
149 }
150 
151 } // End of namespace Wintermute
152 
153 #endif
Definition: achievements_tables.h:27