mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Replaced a ton of ConsoleMethods with the DefineConsoleMethod Macro.
This commit is contained in:
parent
378a933894
commit
acb192e2a5
133 changed files with 1716 additions and 2087 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include "platform/platform.h"
|
||||
#include "console/compiler.h"
|
||||
#include "console/consoleInternal.h"
|
||||
#include "console/engineAPI.h"
|
||||
#include "core/util/tDictionary.h"
|
||||
#include "core/strings/stringFunctions.h"
|
||||
#include "app/mainLoop.h"
|
||||
|
|
@ -458,20 +459,16 @@ extern "C" {
|
|||
// By default, it is marked as secure by the web plugins and then can be called from
|
||||
// Javascript on the web page to ensure that function calls across the language
|
||||
// boundry are working with arguments and return values
|
||||
ConsoleFunction(testJavaScriptBridge, const char *, 4, 4, "testBridge(arg1, arg2, arg3)")
|
||||
DefineConsoleFunction( testJavaScriptBridge, const char *, (const char* arg1, const char* arg2, const char* arg3), , "testBridge(arg1, arg2, arg3)")
|
||||
{
|
||||
S32 failed = 0;
|
||||
if(argc != 4)
|
||||
failed = 1;
|
||||
else
|
||||
{
|
||||
if (dStrcmp(argv[1],"one"))
|
||||
if (dStrcmp(arg1,"one"))
|
||||
failed = 2;
|
||||
if (dStrcmp(argv[2],"two"))
|
||||
if (dStrcmp(arg2,"two"))
|
||||
failed = 2;
|
||||
if (dStrcmp(argv[3],"three"))
|
||||
if (dStrcmp(arg3,"three"))
|
||||
failed = 2;
|
||||
}
|
||||
|
||||
|
||||
//attempt to call from TorqueScript -> JavaScript
|
||||
const char* jret = Con::evaluate("JS::bridgeCallback(\"one\",\"two\",\"three\");");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue