Browse Source

moved all console bindings not related to guis and only updated in vs2012 project!

Charlie Patterson 12 years ago
parent
commit
934b309843
54 changed files with 243 additions and 1308 deletions
  1. 22 2
      engine/compilers/VisualStudio 2012/Torque 2D.vcxproj
  2. 66 6
      engine/compilers/VisualStudio 2012/Torque 2D.vcxproj.filters
  3. 2 58
      engine/source/2d/core/Utility.cc
  4. BIN
      engine/source/2d/core/Utility_ScriptBinding.h
  5. 2 28
      engine/source/console/consoleExprEvalState.cc
  6. BIN
      engine/source/console/consoleExprEvalState_ScriptBinding.h
  7. 3 85
      engine/source/console/consoleFunctions.cc
  8. 1 38
      engine/source/console/consoleObject.cc
  9. BIN
      engine/source/console/inputManagement_ScriptBinding.h
  10. BIN
      engine/source/console/metaScripting_ScriptBinding.cc
  11. BIN
      engine/source/console/taggedStrings_ScriptBinding.h
  12. 0 46
      engine/source/graphics/PNGImage.cpp
  13. 0 70
      engine/source/graphics/TextureManager_ScriptBinding_o.h
  14. 3 191
      engine/source/graphics/dgl.cc
  15. BIN
      engine/source/graphics/dglMac_ScriptBinding.h
  16. BIN
      engine/source/graphics/dgl_ScriptBinding.h
  17. 0 104
      engine/source/io/resource/resourceManager_ScriptBinding_o.h
  18. 10 1
      engine/source/memory/frameAllocator_ScriptBinding.cc
  19. 0 139
      engine/source/network/RemoteCommandEvent_ScriptBinding_o.h
  20. 3 9
      engine/source/network/connectionProtocol.cc
  21. 10 21
      engine/source/network/connectionProtocol_ScriptBinding.h
  22. 2 12
      engine/source/network/netInterface.cc
  23. BIN
      engine/source/network/netInterface_ScriptBinding.h
  24. 2 11
      engine/source/network/netStringTable.cc
  25. BIN
      engine/source/network/netStringTable_ScriptBinding.h
  26. 2 17
      engine/source/network/telnetConsole.cc
  27. BIN
      engine/source/network/telnetConsole_ScriptBinding.h
  28. 2 40
      engine/source/platform/CursorManager.cc
  29. BIN
      engine/source/platform/CursorManager_ScriptBinding.h
  30. 2 20
      engine/source/platform/nativeDialogs/msgBox.cpp
  31. BIN
      engine/source/platform/nativeDialogs/msgBox_ScriptBinding.h
  32. BIN
      engine/source/platform/platformNetwork_ScriptBinding.cc
  33. 2 8
      engine/source/platformWin32/cardProfile.cpp
  34. BIN
      engine/source/platformWin32/cardProfile_ScriptBinding.h
  35. 2 9
      engine/source/platformWin32/winConsole.cc
  36. BIN
      engine/source/platformWin32/winConsole_ScriptBinding.h
  37. 4 54
      engine/source/platformWin32/winExec.cc
  38. BIN
      engine/source/platformWin32/winExec_ScriptBinding.h
  39. 1 136
      engine/source/platformWin32/winGLSpecial.cc
  40. BIN
      engine/source/platformWin32/winGLSpecial_ScriptBinding.h
  41. 1 24
      engine/source/platformWin32/winInput.cc
  42. BIN
      engine/source/platformWin32/winInput_ScriptBinding.h
  43. 1 45
      engine/source/platformWin32/winMath.cc
  44. BIN
      engine/source/platformWin32/winMath_ScriptBinding.h
  45. 6 54
      engine/source/platformWin32/winOGLVideo.cc
  46. BIN
      engine/source/platformWin32/winOGLVideo_ScriptBinding.h
  47. 2 15
      engine/source/sim/simDatablock.cc
  48. BIN
      engine/source/sim/simDatablock_ScriptBinding.h
  49. 1 28
      engine/source/string/stringBuffer.cc
  50. 18 0
      engine/source/string/stringBuffer.h
  51. BIN
      engine/source/string/stringBuffer_ScriptBinding.h
  52. 1 37
      engine/source/testing/unitTesting.cc
  53. 70 0
      engine/source/testing/unitTesting_ScriptBinding.h
  54. 2 0
      tools/documentation/config/torqueScriptReference.cfg

+ 22 - 2
engine/compilers/VisualStudio 2012/Torque 2D.vcxproj

@@ -437,7 +437,7 @@
     <ClCompile Include="..\..\source\math\math_ScriptBinding.cc" />
     <ClCompile Include="..\..\source\math\rectClipper.cpp" />
     <ClCompile Include="..\..\source\memory\dataChunker.cc" />
-    <ClCompile Include="..\..\source\memory\frameAllocator.cc" />
+    <ClCompile Include="..\..\source\memory\frameAllocator_ScriptBinding.cc" />
     <ClCompile Include="..\..\source\messaging\dispatcher.cc" />
     <ClCompile Include="..\..\source\messaging\eventManager.cc" />
     <ClCompile Include="..\..\source\messaging\message.cc" />
@@ -528,7 +528,7 @@
     <ClCompile Include="..\..\source\platform\platformFileIO.cc" />
     <ClCompile Include="..\..\source\platform\platformFont.cc" />
     <ClCompile Include="..\..\source\platform\platformMemory.cc" />
-    <ClCompile Include="..\..\source\platform\platformNetwork.cc" />
+    <ClCompile Include="..\..\source\platform\platformNetwork_ScriptBinding.cc" />
     <ClCompile Include="..\..\source\platform\platformString.cc" />
     <ClCompile Include="..\..\source\platform\platformVideo.cc" />
     <ClCompile Include="..\..\source\platform\menus\popupMenu.cc" />
@@ -656,6 +656,7 @@
     <ClInclude Include="..\..\source\2d\core\SpriteBatchQuery.h" />
     <ClInclude Include="..\..\source\2d\core\SpriteBatchQueryResult.h" />
     <ClInclude Include="..\..\source\2d\core\Utility.h" />
+    <ClInclude Include="..\..\source\2d\core\Utility_ScriptBinding.h" />
     <ClInclude Include="..\..\source\2d\core\Vector2.h" />
     <ClInclude Include="..\..\source\2d\core\Vector2_ScriptBinding.h" />
     <ClInclude Include="..\..\source\2d\experimental\composites\WaveComposite.h" />
@@ -799,13 +800,16 @@
     <ClInclude Include="..\..\source\console\consoleDictionary.h" />
     <ClInclude Include="..\..\source\console\consoleDoc_ScriptBinding.h" />
     <ClInclude Include="..\..\source\console\consoleExprEvalState.h" />
+    <ClInclude Include="..\..\source\console\consoleExprEvalState_ScriptBinding.h" />
     <ClInclude Include="..\..\source\console\consoleInternal.h" />
     <ClInclude Include="..\..\source\console\consoleLogger_ScriptBinding.h" />
     <ClInclude Include="..\..\source\console\consoleNamespace.h" />
     <ClInclude Include="..\..\source\console\consoleNamespace_ScriptBinding.h" />
     <ClInclude Include="..\..\source\console\ConsoleTypeValidators.h" />
     <ClInclude Include="..\..\source\console\expando_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\console\inputManagement_ScriptBinding.h" />
     <ClInclude Include="..\..\source\console\output_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\console\taggedStrings_ScriptBinding.h" />
     <ClInclude Include="..\..\source\debug\profiler.h" />
     <ClInclude Include="..\..\source\debug\profiler_ScriptBinding.h" />
     <ClInclude Include="..\..\source\debug\remote\RemoteDebugger1.h" />
@@ -827,6 +831,8 @@
     <ClInclude Include="..\..\source\graphics\color.h" />
     <ClInclude Include="..\..\source\graphics\color_ScriptBinding.h" />
     <ClInclude Include="..\..\source\graphics\dgl.h" />
+    <ClInclude Include="..\..\source\graphics\dglMac_Scriptbinding.h" />
+    <ClInclude Include="..\..\source\graphics\dgl_ScriptBinding.h" />
     <ClInclude Include="..\..\source\graphics\DynamicTexture.h" />
     <ClInclude Include="..\..\source\graphics\gBitmap.h" />
     <ClInclude Include="..\..\source\graphics\gFont.h" />
@@ -927,15 +933,18 @@
     <ClInclude Include="..\..\source\module\moduleMergeDefinition.h" />
     <ClInclude Include="..\..\source\module\tamlModuleIdUpdateVisitor.h" />
     <ClInclude Include="..\..\source\network\connectionProtocol.h" />
+    <ClInclude Include="..\..\source\network\connectionProtocol_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\connectionStringTable.h" />
     <ClInclude Include="..\..\source\network\httpObject.h" />
     <ClInclude Include="..\..\source\network\httpObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\netConnection.h" />
     <ClInclude Include="..\..\source\network\netConnection_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\netInterface.h" />
+    <ClInclude Include="..\..\source\network\netInterface_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\netObject.h" />
     <ClInclude Include="..\..\source\network\netObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\netStringTable.h" />
+    <ClInclude Include="..\..\source\network\netStringTable_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\networkProcessList.h" />
     <ClInclude Include="..\..\source\network\RemoteCommandEvent.h" />
     <ClInclude Include="..\..\source\network\RemoteCommandEvent_ScriptBinding.h" />
@@ -944,6 +953,7 @@
     <ClInclude Include="..\..\source\network\tcpObject.h" />
     <ClInclude Include="..\..\source\network\tcpObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\telnetConsole.h" />
+    <ClInclude Include="..\..\source\network\telnetConsole_ScriptBinding.h" />
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\allocators.h" />
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\document.h" />
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\encodedstream.h" />
@@ -1021,13 +1031,21 @@
     <ClInclude Include="..\..\source\math\mSphere.h" />
     <ClInclude Include="..\..\source\math\mSplinePatch.h" />
     <ClInclude Include="..\..\source\persistence\SimXMLDocument.h" />
+    <ClInclude Include="..\..\source\platformWin32\cardProfile_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\platformWin32\winConsole_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\platformWin32\winExec_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\platformWin32\winGLSpecial_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\platformWin32\winInput_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\platformWin32\winOGLVideo_ScriptBinding.h" />
     <ClInclude Include="..\..\source\platformWin32\winWindow.h" />
+    <ClInclude Include="..\..\source\platform\CursorManager_ScriptBinding.h" />
     <ClInclude Include="..\..\source\platform\event.h" />
     <ClInclude Include="..\..\source\platform\GLCoreFunc.h" />
     <ClInclude Include="..\..\source\platform\GLExtFunc.h" />
     <ClInclude Include="..\..\source\platform\GLUFunc.h" />
     <ClInclude Include="..\..\source\platform\menus\popupMenu_ScriptBinding.h" />
     <ClInclude Include="..\..\source\platform\nativeDialogs\fileDialog_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\platform\nativeDialogs\msgBox_ScriptBinding.h" />
     <ClInclude Include="..\..\source\platform\platform.h" />
     <ClInclude Include="..\..\source\platform\platformAL.h" />
     <ClInclude Include="..\..\source\platform\platformAssert.h" />
@@ -1096,6 +1114,7 @@
     <ClInclude Include="..\..\source\sim\simConsoleThreadExecEvent.h" />
     <ClInclude Include="..\..\source\sim\simDatablock.h" />
     <ClInclude Include="..\..\source\sim\simDatablockGroup.h" />
+    <ClInclude Include="..\..\source\sim\simDatablock_ScriptBinding.h" />
     <ClInclude Include="..\..\source\sim\simDictionary.h" />
     <ClInclude Include="..\..\source\sim\simEvent.h" />
     <ClInclude Include="..\..\source\sim\simFieldDictionary.h" />
@@ -1143,6 +1162,7 @@
     <ClInclude Include="..\..\source\gui\editor\guiMenuBar.h" />
     <ClInclude Include="..\..\source\gui\editor\guiSeparatorCtrl.h" />
     <ClInclude Include="..\..\source\testing\unitTesting.h" />
+    <ClInclude Include="..\..\source\testing\unitTesting_ScriptBinding.h" />
     <ClInclude Include="..\..\source\torqueConfig.h" />
   </ItemGroup>
   <ItemGroup>

+ 66 - 6
engine/compilers/VisualStudio 2012/Torque 2D.vcxproj.filters

@@ -945,9 +945,6 @@
     <ClCompile Include="..\..\source\memory\dataChunker.cc">
       <Filter>memory</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\memory\frameAllocator.cc">
-      <Filter>memory</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\algorithm\crc.cc">
       <Filter>algorithm</Filter>
     </ClCompile>
@@ -1206,9 +1203,6 @@
     <ClCompile Include="..\..\source\platform\platformFont.cc">
       <Filter>platform</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\platform\platformNetwork.cc">
-      <Filter>platform</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\network\networkProcessList.cc">
       <Filter>network</Filter>
     </ClCompile>
@@ -1335,6 +1329,12 @@
     <ClCompile Include="..\..\source\math\math_ScriptBinding.cc">
       <Filter>math</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\source\platform\platformNetwork_ScriptBinding.cc">
+      <Filter>platform</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\memory\frameAllocator_ScriptBinding.cc">
+      <Filter>memory</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\source\audio\audio.h">
@@ -2904,6 +2904,66 @@
       <Filter>graphics</Filter>
     </ClInclude>
     <ClInclude Include="..\..\source\torqueConfig.h" />
+    <ClInclude Include="..\..\source\platformWin32\cardProfile_ScriptBinding.h">
+      <Filter>platformWin32</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\network\connectionProtocol_ScriptBinding.h">
+      <Filter>network</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\console\consoleExprEvalState_ScriptBinding.h">
+      <Filter>console</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\console\taggedStrings_ScriptBinding.h">
+      <Filter>console</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\console\inputManagement_ScriptBinding.h">
+      <Filter>console</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platform\CursorManager_ScriptBinding.h">
+      <Filter>platform</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\graphics\dgl_ScriptBinding.h">
+      <Filter>graphics</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\graphics\dglMac_Scriptbinding.h">
+      <Filter>graphics</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platformWin32\winOGLVideo_ScriptBinding.h">
+      <Filter>platformWin32</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platformWin32\winInput_ScriptBinding.h">
+      <Filter>platformWin32</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\2d\core\Utility_ScriptBinding.h">
+      <Filter>2d\core</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platformWin32\winExec_ScriptBinding.h">
+      <Filter>platformWin32</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platformWin32\winGLSpecial_ScriptBinding.h">
+      <Filter>platformWin32</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platformWin32\winConsole_ScriptBinding.h">
+      <Filter>platformWin32</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\network\netInterface_ScriptBinding.h">
+      <Filter>network</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\network\netStringTable_ScriptBinding.h">
+      <Filter>network</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\network\telnetConsole_ScriptBinding.h">
+      <Filter>network</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\testing\unitTesting_ScriptBinding.h">
+      <Filter>testing</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platform\nativeDialogs\msgBox_ScriptBinding.h">
+      <Filter>platform\nativeDialogs</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\sim\simDatablock_ScriptBinding.h">
+      <Filter>sim</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\..\source\math\mMath_ASM.asm">

+ 2 - 58
engine/source/2d/core/Utility.cc

@@ -28,6 +28,8 @@
 #include "2d/sceneobject/SceneObject.h"
 #include "2d/core/Utility.h"
 
+#include "Utility_ScriptBinding.h"
+
 //-----------------------------------------------------------------------------
 
 ConsoleType( b2AABB, Typeb2AABB, sizeof(b2AABB), "" )
@@ -76,64 +78,6 @@ ConsoleSetType( Typeb2AABB )
 namespace Utility
 {
 
-//-----------------------------------------------------------------------------
-// Return a string containing the common elements of two space-separated strings of elements.
-//-----------------------------------------------------------------------------
-ConsoleFunction( t2dGetCommonElements, const char*, 3, 3, "(set1, set2) - Returns the common elements in two sets.")
-{
-    if (argc != 3)
-    {
-        Con::warnf("t2dGetCommonElements - Invalid number of parameters!");
-        return NULL;
-    }
-
-    // Grab the element count of the first set.
-    const U32 elementCount1 = Utility::mGetStringElementCount(argv[1]);
-
-    // Make sure we get at least one number.
-    if (elementCount1 < 1)
-    {
-        return NULL;
-    }
-
-    // Grab the element count of the second set.
-    const U32 elementCount2 = Utility::mGetStringElementCount(argv[2]);
-
-    // Make sure we get at least one number.
-    if (elementCount2 < 1)
-    {
-        return NULL;
-    }
-
-    char* buffer = Con::getReturnBuffer(dStrlen(argv[1]) + 1);
-    buffer[0] = '\0';
-    bool first = true;
-    
-    // Individual elements assumed to be 1024 or less in length
-    char element[1024];
-
-    // Check for common elements
-    for (U32 i = 0; i < elementCount1; i++)
-    {
-        dStrcpy(element,  Utility::mGetStringElement(argv[1], i, true));
-        
-        for (U32 j = 0; j < elementCount2; j++)
-        {
-            if (!dStrcmp(element, Utility::mGetStringElement(argv[2], j, true)))
-            {
-                if (!first)
-                    dStrcat(buffer, " ");
-                else
-                    first = false;
-
-                dStrcat(buffer, element);
-            }
-        }
-    }
-
-    return buffer;
-}
-
 //-----------------------------------------------------------------------------
 
 const char* mGetFirstNonWhitespace( const char* inString )

BIN
engine/source/2d/core/Utility_ScriptBinding.h


+ 2 - 28
engine/source/console/consoleExprEvalState.cc

@@ -34,6 +34,8 @@
 #include "io/fileStream.h"
 #include "console/compiler.h"
 
+#include "consoleExprEvalState_ScriptBinding.h"
+
 extern ExprEvalState gEvalState;
 
 void ExprEvalState::pushFrame(StringTableEntry frameName, Namespace *ns)
@@ -71,31 +73,3 @@ ExprEvalState::~ExprEvalState()
    while(stack.size())
       popFrame();
 }
-
-ConsoleFunction(backtrace, void, 1, 1, "() Use the backtrace function to print the current callstack to the console. This is used to trace functions called from withing functions and can help discover what functions were called (and not yet exited) before the current point in your scripts.\n"
-                                                                "@return No return value")
-{
-   U32 totalSize = 1;
-
-   for(U32 i = 0; i < (U32)gEvalState.stack.size(); i++)
-   {
-      totalSize += dStrlen(gEvalState.stack[i]->scopeName) + 3;
-      if(gEvalState.stack[i]->scopeNamespace && gEvalState.stack[i]->scopeNamespace->mName)
-         totalSize += dStrlen(gEvalState.stack[i]->scopeNamespace->mName) + 2;
-   }
-
-   char *buf = Con::getReturnBuffer(totalSize);
-   buf[0] = 0;
-   for(U32 i = 0; i < (U32)gEvalState.stack.size(); i++)
-   {
-      dStrcat(buf, "->");
-      if(gEvalState.stack[i]->scopeNamespace && gEvalState.stack[i]->scopeNamespace->mName)
-      {
-         dStrcat(buf, gEvalState.stack[i]->scopeNamespace->mName);
-         dStrcat(buf, "::");
-      }
-      dStrcat(buf, gEvalState.stack[i]->scopeName);
-   }
-   Con::printf("BackTrace: %s", buf);
-
-}

BIN
engine/source/console/consoleExprEvalState_ScriptBinding.h


+ 3 - 85
engine/source/console/consoleFunctions.cc

@@ -30,94 +30,13 @@
 #include <arpa/inet.h>
 #endif
 
+#include "taggedStrings_ScriptBinding.h"
+#include "inputManagement_ScriptBinding.h"
+
 #ifdef TORQUE_ALLOW_JOURNALING
    static U32 journalDepth = 1;
 #endif
 
-//----------------------------------------------------------------
-
-#include "string/stringUnit.h"
-
-ConsoleFunctionGroupBegin( TaggedStrings, "Functions dealing with tagging/detagging strings.");
-
-ConsoleFunction(detag, const char *, 2, 2, "( tagID ) Use the detag function to convert a tag to a string. This can only be used in the proper context, i.e. to parse values passed to a client command or to a server command. See 'Remote Procedure Call Samples' below.\n"
-                                                                "@param tagID A numeric tag ID corresponding to a previously tagged string.\n"
-                                                                "@return Returns the string associated with the tag ID.\n"
-                                                                "@sa commandToClient, commandToServer")
-{
-   TORQUE_UNUSED( argc );
-   if(argv[1][0] == StringTagPrefixByte)
-   {
-      const char *word = dStrchr(argv[1], ' ');
-      if(word == NULL)
-         return "";
-      char *ret = Con::getReturnBuffer(dStrlen(word + 1) + 1);
-      dStrcpy(ret, word + 1);
-      return ret;
-   }
-   else
-      return argv[1];
-}
-
-ConsoleFunction(getTag, const char *, 2, 2, "( taggedString ) Use the getTag function to retrieve the tag ID associated with a previously tagged string.\n"
-                                                                "@param taggedString A previously tagged string.\n"
-                                                                "@return Returns the tag ID of the string. If the string was not previously tagged, it gets tagged and the new tag ID is returned")
-{
-   TORQUE_UNUSED( argc );
-   if(argv[1][0] == StringTagPrefixByte)
-   {
-      const char * space = dStrchr(argv[1], ' ');
-
-      U32 len;
-      if(space)
-         len = space - argv[1];
-      else
-         len = dStrlen(argv[1]) + 1;
-
-      char * ret = Con::getReturnBuffer(len);
-      dStrncpy(ret, argv[1] + 1, len - 1);
-      ret[len - 1] = 0;
-
-      return(ret);
-   }
-   else
-      return(argv[1]);
-}
-
-ConsoleFunctionGroupEnd( TaggedStrings );
-
-//----------------------------------------------------------------
-
-ConsoleFunctionGroupBegin( InputManagement, "Functions that let you deal with input from scripts" );
-
-ConsoleFunction( deactivateDirectInput, void, 1, 1, "() Use the deactivateDirectInput function to de-activate polling of direct input devices (keyboard, mouse, joystick, et cetera).\n"
-                                                                "@return No return value.\n"
-                                                                "@sa activateDirectInput")
-{
-   TORQUE_UNUSED( argc );
-   TORQUE_UNUSED( argv );
-   if ( Input::isActive() )
-      Input::deactivate();
-}
-
-//--------------------------------------------------------------------------
-ConsoleFunction( activateDirectInput, void, 1, 1, "() Use the activateDirectInput function to activate polling of direct input devices (keyboard, mouse, joystick, et cetera).\n"
-                                                                "@return No return value.\n"
-                                                                "@sa deactivateDirectInput")
-{
-   TORQUE_UNUSED( argc );
-   TORQUE_UNUSED( argv );
-   if ( !Input::isActive() )
-      Input::activate();
-}
-
-ConsoleFunctionGroupEnd( InputManagement );
-
-ConsoleFunction(openFolder, void, 2, 2, "(folder) Opens a folder of the platform")
-{
-    Platform::openFolder(argv[1]);
-}
-
 //Luma:	Console function to tell if this is a TORQUE_OS_IOS build
 ConsoleFunction(isiPhoneBuild, bool, 1, 1, "Returns true if this is a iPhone build, false otherwise")
 {
@@ -127,4 +46,3 @@ ConsoleFunction(isiPhoneBuild, bool, 1, 1, "Returns true if this is a iPhone bui
    return false;
 #endif	//TORQUE_OS_IOS
 }
-

+ 1 - 38
engine/source/console/consoleObject.cc

@@ -158,7 +158,7 @@ ConsoleObject* AbstractClassRep::create(const U32 groupId, const U32 typeId, con
 
 //--------------------------------------
 
-static S32 QSORT_CALLBACK ACRCompare(const void *aptr, const void *bptr)
+S32 QSORT_CALLBACK ACRCompare(const void *aptr, const void *bptr)
 {
    const AbstractClassRep *a = *((const AbstractClassRep **) aptr);
    const AbstractClassRep *b = *((const AbstractClassRep **) bptr);
@@ -581,40 +581,3 @@ AbstractClassRep* ConsoleObject::getClassRep() const
 {
    return NULL;
 }
-
-ConsoleFunction( enumerateConsoleClasses, const char*, 1, 2, "enumerateConsoleClasses(<\"base class\">);")
-{
-   AbstractClassRep *base = NULL;    
-   if(argc > 1)
-   {
-      base = AbstractClassRep::findClassRep(argv[1]);
-      if(!base)
-         return "";
-   }
-   
-   Vector<AbstractClassRep*> classes;
-   U32 bufSize = 0;
-   for(AbstractClassRep *rep = AbstractClassRep::getClassList(); rep; rep = rep->getNextClass())
-   {
-      if( !base || rep->isClass(base))
-      {
-         classes.push_back(rep);
-         bufSize += dStrlen(rep->getClassName()) + 1;
-      }
-   }
-   
-   if(!classes.size())
-      return "";
-
-   dQsort(classes.address(), classes.size(), sizeof(AbstractClassRep*), ACRCompare);
-
-   char* ret = Con::getReturnBuffer(bufSize);
-   dStrcpy( ret, classes[0]->getClassName());
-   for( U32 i=0; i< (U32)classes.size(); i++)
-   {
-      dStrcat( ret, "\t" );
-      dStrcat( ret, classes[i]->getClassName() );
-   }
-   
-   return ret;
-}

BIN
engine/source/console/inputManagement_ScriptBinding.h


BIN
engine/source/console/metaScripting_ScriptBinding.cc


BIN
engine/source/console/taggedStrings_ScriptBinding.h


+ 0 - 46
engine/source/graphics/PNGImage.cpp

@@ -475,49 +475,3 @@ bool PNGImage::CleanMemoryUsage()
 
     return true;
 }
-
-ConsoleFunction(CaptureScreenArea, bool, 7, 7, "(posX, posY, width, height, fileName, fileType) Capture a specific area of the screen")
-{
-    GLint positionX = dAtoi(argv[1]);
-    GLint positionY = dAtoi(argv[2]);
-    U32 width = dAtoi(argv[3]);
-    U32 height = dAtoi(argv[4]);
-    
-    FileStream fStream;
-    if(!fStream.open(argv[5], FileStream::Write))
-    { 
-        Con::printf("Failed to open file '%s'.", argv[5]);
-        return false;
-    }
-
-    // Read gl pixels here
-    glReadBuffer(GL_FRONT);
-   
-    Point2I extent;
-    extent.x = width;
-    extent.y = height;
-
-    U8 * pixels = new U8[extent.x * extent.y * 4];
-    glReadPixels(positionX, positionY, extent.x, extent.y, GL_RGB, GL_UNSIGNED_BYTE, pixels);
-
-    GBitmap * bitmap = new GBitmap;
-    bitmap->allocateBitmap(U32(extent.x), U32(extent.y));
-   
-    // flip the rows
-    for(U32 y = 0; y < (U32)extent.y; y++)
-        dMemcpy(bitmap->getAddress(0, extent.y - y - 1), pixels + y * extent.x * 3, U32(extent.x * 3));
-
-    if ( dStrcmp( argv[6], "JPEG" ) == 0 )
-        bitmap->writeJPEG(fStream);
-    else if( dStrcmp( argv[6], "PNG" ) == 0)
-        bitmap->writePNG(fStream);
-    else
-        bitmap->writePNG(fStream);
-
-    fStream.close();
-
-    delete [] pixels;
-    delete bitmap;
-
-    return true;
-}

+ 0 - 70
engine/source/graphics/TextureManager_ScriptBinding_o.h

@@ -1,70 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2013 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-/*! @defgroup TextureManagerFunctions Texture Manager
-	@ingroup TorqueScriptFunctions
-	@{
-*/
-
-ConsoleFunction(setOpenGLTextureCompressionHint, void, 2, 2, " ( hint ) Use the setOpenGLTextureCompressionHint function to select the OpenGL texture compression method.\n"
-    "@param hint \"GL_DONT_CARE\", \"GL_FASTEST\", or \"GL_NICEST\". (Please refer to an OpenGL text for information on what these mean).\n"
-    "@return No return value")
-{
-    GLenum newHint        = GL_DONT_CARE;
-    const char* newString = "GL_DONT_CARE";
-
-    if (!dStricmp(argv[1], "GL_FASTEST"))
-    {
-        newHint = GL_FASTEST;
-        newString = "GL_FASTEST";
-    }
-    else if (!dStricmp(argv[1], "GL_NICEST"))
-    {
-        newHint = GL_NICEST;
-        newString = "GL_NICEST";
-    }
-
-    TextureManager::mTextureCompressionHint = newHint;
-
-#if !defined(TORQUE_OS_IOS)
-    if (dglDoesSupportTextureCompression())
-        glHint(GL_TEXTURE_COMPRESSION_HINT_ARB, TextureManager::mTextureCompressionHint);
-#endif
-}
-
-//--------------------------------------------------------------------------------------------------------------------
-
-ConsoleFunction( flushTextureCache, void, 1, 1, "() Use the flushTextureCache function to flush the texture cache.\n"
-                                                "@return No return value.\n")
-{
-    TextureManager::flush();
-}
-
-//--------------------------------------------------------------------------------------------------------------------
-
-ConsoleFunction( dumpTextureManagerMetrics, void, 1, 1, "() Dump the texture manager metrics." )
-{
-    return TextureManager::dumpMetrics();
-}
-
-
-/*! @} */ // group TextureManagerFunctions

+ 3 - 191
engine/source/graphics/dgl.cc

@@ -33,6 +33,9 @@
 #include "debug/profiler.h"
 #include "string/unicode.h"
 
+#include "dglMac_Scriptbinding.h"
+#include "dgl_ScriptBinding.h"
+
 namespace {
 
 ColorI sg_bitmapModulation(255, 255, 255, 255);
@@ -1442,197 +1445,6 @@ bool dglCheckState(const S32 mvDepth, const S32 pDepth,
             (v.extent.y == vp[3])));
 }
 
-
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //
-// Advanced hardware functionality.
-
-// now owns the global stuff for FSAA, rather than sceneGraph.
-
-// define the globals first.  don't bracket them, as it doesn't hurt to have
-// them defined always...
-
-S32 gFSAASamples = 1; ///< 1==no FSAA.
-
-#if defined(TORQUE_OS_OSX)
-// new FSAA simple-method handling
-
-ConsoleFunctionGroupBegin( MacFSAA, "Mac-specific FSAA control functions.");
-
-//------------------------------------------------------------------------------
-ConsoleFunction( setFSAA, void, 2, 2, "setFSAA(int);")
-{
-   gFSAASamples = dAtoi(argv[1]);
-   if (gFSAASamples<1)
-      gFSAASamples = 1;
-   else if (gFSAASamples>gGLState.maxFSAASamples)
-      gFSAASamples = gGLState.maxFSAASamples;
-   dglSetFSAASamples(gFSAASamples);
-}
-
-//------------------------------------------------------------------------------
-ConsoleFunction( increaseFSAA, void, 1, 1, "increaseFSAA()" )
-{
-   if (gFSAASamples<gGLState.maxFSAASamples)
-   {
-      gFSAASamples<<=1;
-      dglSetFSAASamples(gFSAASamples);
-   }
-}
-
-//------------------------------------------------------------------------------
-ConsoleFunction( decreaseFSAA, void, 1, 1, "decreaseFSAA()" )
-{
-   if (gFSAASamples>1)
-   {
-      gFSAASamples>>=1;
-      dglSetFSAASamples(gFSAASamples);
-   }
-}
-
-ConsoleFunctionGroupEnd( MacFSAA );
-
-#endif
-
-//------------------------------------------------------------------------------
-ConsoleFunction(png2jpg, S32, 2, 3, "( pngFilename [ , quality ] ) Use the png2jpg function to save a PNG file specified by pngFilename as a similarly named JPEG file with the optionally specified quality.\n"
-                                                                "@param pngFilename The path and file name of the PNG file to convert.\n"
-                                                                "@param quality An optional quality between 0 and 100. The default quality is 90.\n"
-                                                                "@return Returns -1 if the file could not be opened, 0 on other failures, and 1 if the conversion worked")
-{
-   extern U32 gJpegQuality;
-   const char * rgbname = NULL;
-   const char * alphaname = NULL;
-   const char * bmpname = argv[1];
-   if(argc == 3)
-      gJpegQuality = dAtoi(argv[2]);
-   else
-      gJpegQuality = 90;
-
-   Con::printf("Converting file: %s", argv[1]);
-
-   if (!rgbname)
-   {
-      char * buf = new char[dStrlen(bmpname)+32];
-      dStrcpy(buf,bmpname);
-      char * pos = dStrstr((const char*)buf,".png");
-      if (!pos)
-         pos = buf + dStrlen(buf);
-      dStrcpy(pos,".jpg");
-      rgbname = buf;
-   }
-   if (!alphaname)
-   {
-      char * buf = new char[dStrlen(bmpname)+32];
-      dStrcpy(buf,bmpname);
-      char * pos = dStrstr((const char*)buf,".png");
-      if (!pos)
-         pos = buf + dStrlen(buf);
-      dStrcpy(pos,".alpha.jpg");
-      alphaname = buf;
-   }
-   GBitmap bmp;
-   FileStream fs;
-   if (fs.open(bmpname, FileStream::Read) == false) {
-      Con::printf("Error: unable to open file: %s for reading\n", bmpname);
-      return -1;
-   }
-   if (bmp.readPNG(fs) == false) {
-      Con::printf("Error: unable to read %s as a .PNG\n", bmpname);
-      return -1;
-   }
-   fs.close();
-
-   if (bmp.getFormat() != GBitmap::RGB &&
-       bmp.getFormat() != GBitmap::RGBA) {
-      Con::printf("Error: %s is not a 24 or 32-bit .PNG\n", bmpname);
-      return false;
-   }
-
-   GBitmap * outRGB = NULL;
-   GBitmap * outAlpha = NULL;
-   GBitmap workRGB, workAlpha;
-   if (bmp.getFormat() == GBitmap::RGB)
-      outRGB = &bmp;
-   else
-   {
-      S32 w = bmp.getWidth();
-      S32 h = bmp.getHeight();
-      workRGB.allocateBitmap(w,h,false,GBitmap::RGB);
-      workAlpha.allocateBitmap(w,h,false,GBitmap::Alpha);
-
-      U8 * rgbBits = workRGB.getWritableBits();
-      U8 * alphaBits = workAlpha.getWritableBits();
-      U8 * bmpBits = bmp.getWritableBits();
-      for (S32 i=0; i<w; i++)
-      {
-         for (S32 j=0; j<h; j++)
-         {
-            rgbBits[i*3 + j*3*w + 0] = bmpBits[i*4 + j*4*w + 0];
-            rgbBits[i*3 + j*3*w + 1] = bmpBits[i*4 + j*4*w + 1];
-            rgbBits[i*3 + j*3*w + 2] = bmpBits[i*4 + j*4*w + 2];
-            alphaBits[i + j*w]       = bmpBits[i*4 + j*4*w + 3];
-         }
-      }
-      Con::printf("texture: width=%i, height=%i\n",w,h);
-      outRGB = &workRGB;
-      outAlpha = &workAlpha;
-   }
-
-   if (outRGB)
-   {
-      FileStream fws;
-      if (fws.open(rgbname, FileStream::Write) == false)
-      {
-         Con::printf("Error: unable to open file: %s for writing\n", rgbname);
-         return -1;
-      }
-
-      if (dStrstr(rgbname,".png"))
-      {
-         if (outRGB->writePNG(fws) == false)
-         {
-            fws.close();
-            Con::printf("Error: couldn't write RGB as a png\n");
-            return -1;
-         }
-      }
-      else if (outRGB->writeJPEG(fws) == false)
-      {
-         Con::printf("Error: couldn't write RGB as a jpg\n");
-         return -1;
-      }
-      fws.close();
-   }
-   if (outAlpha)
-   {
-      gJpegQuality = 60;
-      FileStream fws;
-      if (fws.open(alphaname, FileStream::Write) == false)
-      {
-         Con::printf("Error: unable to open file: %s for writing\n", alphaname);
-         return -1;
-      }
-
-      if (dStrstr(alphaname,".png"))
-      {
-         if (outAlpha->writePNG(fws) == false)
-         {
-            fws.close();
-            Con::printf("Error: couldn't write alpha as a png\n");
-            return -1;
-         }
-      }
-      else if (outAlpha->writeJPEG(fws) == false)
-      {
-         Con::printf("Error: couldn't write alpha as a jpg\n");
-         return -1;
-      }
-      fws.close();
-   }
-
-   return(0);
-}
-
 #ifdef TORQUE_OS_IOS
 GLfloat gVertexFloats[8];
 GLfloat gTextureVerts[8];

BIN
engine/source/graphics/dglMac_ScriptBinding.h


BIN
engine/source/graphics/dgl_ScriptBinding.h


+ 0 - 104
engine/source/io/resource/resourceManager_ScriptBinding_o.h

@@ -1,104 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2013 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-ConsoleFunctionGroupBegin( Net, "Functions for use with the network; tagged strings and remote commands.");
-
-/*! @defgroup NetworkFunctions Network
-	@ingroup TorqueScriptFunctions
-	@{
-*/
-
-
-
-#ifdef TORQUE_DEBUG
-
-ConsoleFunction(dumpResources, void, 2, 2, "(onlyLoaded?) Use the dumpLoadedResources function to dump a listing of the currently in-use resources to the console. This will include such things as sound files, font files, etc.\n"
-                                                                "For this to work, the engine must have been compiled with TORQUE_DEBUG defined.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa purgeResources")
-{
-    const bool onlyLoaded = argc == 2 ? dAtob(argv[1]) : true;
-    ResourceManager->dumpResources(onlyLoaded);
-}
-
-#endif
-
-ConsoleFunction(addResPath, void, 2, 3, "(path, [ignoreZips=false]) Add a path to the resource manager")
-{
-   if( argc > 2 )
-      ResourceManager->addPath(argv[1], dAtob(argv[2]));
-   else
-      ResourceManager->addPath(argv[1]);
-}
-
-
-ConsoleFunction(removeResPath, void, 2, 2, "(pathExpression) Remove a path from the resource manager. Path is an expression as in findFirstFile()")
-{
-   ResourceManager->removePath(argv[1]);
-}
-
-// Mod paths aren't used in tools applications.  
-// See : addResPath/removeResPath console functions
-ConsoleFunction( setModPaths, void, 2, 2, "( path ) Use the setModPaths function to set the current mod path to the value specified in path.\n"
-                                                                "@param path A string containing a semi-colon (;) separated list of game and mod paths.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa getModPaths")
-{
-   char buf[512];
-   dStrncpy(buf, argv[1], sizeof(buf) - 1);
-   buf[511] = '\0';
-
-   Vector<char *> paths;
-   char* temp = dStrtok( buf, ";" );
-   while ( temp )
-   {
-      if ( temp[0] )
-         paths.push_back(temp);
-      
-      temp = dStrtok( NULL, ";" );
-   }
-
-   ResourceManager->setModPaths( paths.size(), (const char**) paths.address() );
-}
-
-ConsoleFunction( getModPaths, const char*, 1, 1, "() Use the getModPaths function to get the current mod path information.\n"
-                                                                "@return Returns a string equivalent to the complete current mod path, that is all pads that are visible to the file manager.\n"
-                                                                "@sa setModPaths")
-{
-   return( ResourceManager->getModPaths() );
-}
-
-ConsoleFunction( purgeResources, void, 1, 1, "() Use the purgeResources function to purge all game resources.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa clearTextureHolds, dumpResourceStats, dumpTextureStats, flushTextureCache")
-{
-   ResourceManager->purge();
-}
-
-ConsoleFunction(isUsingVFS, bool, 1, 1, "()\n"
-                "@return Returns true if using Virtual File System")
-{
-   return ResourceManager->isUsingVFS();
-}
-
-
-/*! @} */ // group NetworkFunctions

+ 10 - 1
engine/source/memory/frameAllocator.cc → engine/source/memory/frameAllocator_ScriptBinding.cc

@@ -29,9 +29,18 @@ U32   FrameAllocator::smHighWaterMark = 0;
 
 #if defined(TORQUE_DEBUG)
 
-ConsoleFunction(getMaxFrameAllocation, S32, 1,1, "getMaxFrameAllocation();")
+/*! @defgroup MemoryFrameAllocation Memory Frames
+	@ingroup TorqueScriptFunctions
+	@{
+*/
+
+/*!
+*/
+ConsoleFunctionWithDocs(getMaxFrameAllocation, S32, 1,1, ())
 {
    return sgMaxFrameAllocation;
 }
 
+/*! @} */ // end group MemoryFrameAllocation
+
 #endif

+ 0 - 139
engine/source/network/RemoteCommandEvent_ScriptBinding_o.h

@@ -1,139 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2013 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-/*! @defgroup TelnetDebuggerFunctions Telnet Debugger
-	@ingroup TorqueScriptFunctions
-	@{
-*/
-
-ConsoleFunctionGroupBegin( Net, "Functions for use with the network; tagged strings and remote commands.");
-
-ConsoleFunction( commandToServer, void, 2, RemoteCommandEvent::MaxRemoteCommandArgs + 1, "( func [ , arg1, ... , argn ] ) Use the commandToServer function to issue a remote procedure call the server.\n"
-                                                                "All arguments may be in tagged or non-tagged format. See 'Remote Procedure Call Samples' below\n"
-                                                                "@param func The suffix of the remote procedure name to be executed on the client.\n"
-                                                                "@param arg1 ... argn - Optional arguments to be passed to the remote procedure.\n"
-                                                                "@return No return value.")
-{
-   NetConnection *conn = NetConnection::getConnectionToServer();
-   if(!conn)
-      return;
-   sendRemoteCommand(conn, argc - 1, argv + 1);
-}
-
-ConsoleFunction( commandToClient, void, 3, RemoteCommandEvent::MaxRemoteCommandArgs + 2, "( client, func [ , arg1, ... , argn ] ) Use the commandToClient function to issue a remote procedure call on a client.\n"
-                                                                "All arguments (excluding client) may be in tagged or non-tagged format. See 'Remote Procedure Call Samples' below\n"
-                                                                "@param client The numeric ID of a client gameConnection.\n"
-                                                                "@param func The suffix of the remote procedure name to be executed on the client.\n"
-                                                                "@param arg1 ... argn - Optional arguments to be passed to the remote procedure.\n"
-                                                                "@return No return value.")
-{
-   NetConnection *conn;
-   if(!Sim::findObject(argv[1], conn))
-      return;
-   sendRemoteCommand(conn, argc - 2, argv + 2);
-}
-
-ConsoleFunction(removeTaggedString, void, 2, 2, "( tag ) Use the removeTaggedSTring function to remove a previously tagged string from the NetStringTable.\n"
-                                                                "@param tag A number tag ID.\n"
-                                                                "@return No return value")
-{
-   gNetStringTable->removeString(dAtoi(argv[1]+1), true);
-}
-
-ConsoleFunction( addTaggedString, const char*, 2, 2, "( string ) Use the addTaggedString function to tag a new string and add it to the NetStringTable.\n"
-                                                                "@param string The string to tagged and placed in the NetStringTable. Tagging ignores case, so tagging the same string (excluding case differences) will be ignored as a duplicated tag.\n"
-                                                                "@return Returns a string (containing a numeric value) equivalent to the string ID for the newly tagged string")
-{
-   NetStringHandle s(argv[1]);
-   gNetStringTable->incStringRefScript(s.getIndex());
-
-   char *ret = Con::getReturnBuffer(10);
-   ret[0] = StringTagPrefixByte;
-   dSprintf(ret + 1, 9, "%d", s.getIndex());
-   return ret;
-}
-
-ConsoleFunction( getTaggedString, const char*, 2, 2, "( tag ) Use the getTaggedString function to convert a tag to a string. This is not the same a detag() which can only be used within the context of a function that receives a tag. This function can be used any time and anywhere to convert a tag to a string.\n"
-                                                                "@param tag A numeric tag ID.\n"
-                                                                "@return Returns the string corresponding to the tag ID")
-{
-   const char *indexPtr = argv[1];
-   if (*indexPtr == StringTagPrefixByte)
-      indexPtr++;
-   return gNetStringTable->lookupString(dAtoi(indexPtr));
-}
-
-ConsoleFunction( buildTaggedString, const char*, 2, 11, "( format , <arg1, ...arg9> ) Use the buildTaggedString function to build a tagged string using the specified format.\n"
-                                                                "@param enable A boolean value. If set to true, network packet logging is enabled, otherwise it is disabled.\n"
-                                                                "@return No return value")
-{
-   const char *indexPtr = argv[1];
-   if (*indexPtr == StringTagPrefixByte)
-      indexPtr++;
-   const char *fmtString = gNetStringTable->lookupString(dAtoi(indexPtr));
-   char *strBuffer = Con::getReturnBuffer(512);
-   const char *fmtStrPtr = fmtString;
-   char *strBufPtr = strBuffer;
-   S32 strMaxLength = 511;
-   if (!fmtString)
-      goto done;
-
-   //build the string
-   while (*fmtStrPtr)
-   {
-      //look for an argument tag
-      if (*fmtStrPtr == '%')
-      {
-         if (fmtStrPtr[1] >= '1' && fmtStrPtr[1] <= '9')
-         {
-            S32 argIndex = S32(fmtStrPtr[1] - '0') + 1;
-            if (argIndex >= argc)
-               goto done;
-            const char *argStr = argv[argIndex];
-            if (!argStr)
-               goto done;
-            S32 strLength = dStrlen(argStr);
-            if (strLength > strMaxLength)
-               goto done;
-            dStrcpy(strBufPtr, argStr);
-            strBufPtr += strLength;
-            strMaxLength -= strLength;
-            fmtStrPtr += 2;
-            continue;
-         }
-      }
-
-      //if we don't continue, just copy the character
-      if (strMaxLength <= 0)
-         goto done;
-      *strBufPtr++ = *fmtStrPtr++;
-      strMaxLength--;
-   }
-
-done:
-   *strBufPtr = '\0';
-   return strBuffer;
-}
-
-ConsoleFunctionGroupEnd( Net );
-
-/*! @} */ // group TelnetDebuggerFunctions

+ 3 - 9
engine/source/network/connectionProtocol.cc

@@ -25,7 +25,9 @@
 #include "io/bitStream.h"
 #include "console/consoleTypes.h"
 
-bool gLogToConsole = false;
+#include "connectionProtocol_ScriptBinding.h"
+
+static bool gLogToConsole = false;
 
 S32 gNetBitsReceived = 0;
 
@@ -44,14 +46,6 @@ static const char *packetTypeNames[] =
    "AckPacket",
 };
 
-//-----------------------------------------------------------------
-//-----------------------------------------------------------------
-//-----------------------------------------------------------------
-ConsoleFunction(DNetSetLogging, void, 2, 2, "(bool enabled)")
-{
-   gLogToConsole = dAtob(argv[1]);
-}
-
 ConnectionProtocol::ConnectionProtocol()
 {
    mLastSeqRecvd = 0;

+ 10 - 21
engine/source/platform/platformNetwork.cc → engine/source/network/connectionProtocol_ScriptBinding.h

@@ -20,29 +20,18 @@
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 
-#ifndef _CONSOLE_H_
-#include "console/console.h"
-#endif
+extern bool gLogToConsole;
 
-#ifndef _PLATFORM_NETWORK_H_
-#include "platformNetwork.h"
-#endif
+/*! @defgroup NetLogging Network Logging
+	@ingroup TorqueScriptFunctions
+	@{
+*/
 
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( setNetPort, bool, 2, 2, "(int port)"
-                "Set the network port for the game to use.\n"
-                "@param The requested port as an integer\n"
-                "@return Returns true on success, false on fail")
+/*!
+*/
+ConsoleFunctionWithDocs(DNetSetLogging, void, 2, 2, (bool enabled))
 {
-    return Net::openPort(dAtoi(argv[1]));
+   gLogToConsole = dAtob(argv[1]);
 }
 
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( closeNetPort, void, 1, 1, "()"
-   "@brief Closes the current network port\n\n"
-   "@ingroup Networking")
-{
-   Net::closePort();
-}
+/*! @} */ // group NetLogging

+ 2 - 12
engine/source/network/netInterface.cc

@@ -28,6 +28,8 @@
 #include "math/mRandom.h"
 #include "game/gameInterface.h"
 
+#include "netInterface_ScriptBinding.h"
+
 NetInterface *GNet = NULL;
 
 NetInterface::NetInterface()
@@ -627,15 +629,3 @@ void NetInterface::computeNetMD5(const NetAddress *address, U32 connectSequence,
     digest[2]+=c;
     digest[3]+=d;
 }
-
-ConsoleFunctionGroupBegin(NetInterface, "Global control functions for the netInterfaces.");
-
-ConsoleFunction(allowConnections,void,2,2,"( enable ) Use the allowConnections to enable (or disable) remote connections to the local game server.\n"
-                                                                "@param enable A boolean value enabling, or disabling connections to the local server.\n"
-                                                                "@return No return value")
-{
-   GNet->setAllowsConnections(dAtob(argv[1]));
-}
-
-ConsoleFunctionGroupEnd(NetInterface);
-

BIN
engine/source/network/netInterface_ScriptBinding.h


+ 2 - 11
engine/source/network/netStringTable.cc

@@ -26,6 +26,8 @@
 #include "network/netStringTable.h"
 #include "string/stringTable.h"
 
+#include "netStringTable_ScriptBinding.h"
+
 NetStringTable *gNetStringTable = NULL;
 
 NetStringTable::NetStringTable()
@@ -264,15 +266,4 @@ void NetStringTable::dumpToConsole()
          0x11 );
 }
 
-ConsoleFunctionGroupBegin(NetStringTable, "Debug functions for the NetStringTable.");
-
-ConsoleFunction( dumpNetStringTable, void, 1, 1, "() Use the dumpNetStringTable function to dump a list of all the currently registered NetStringTable entries, including the times each has been referenced, the total entry count, and the current 'highest' reference string.\n"
-                                                                "For this to work, the engine must have been compiled with TORQUE_DEBUG defined\n"
-                                                                "@return No return value.")
-{
-   gNetStringTable->dumpToConsole();
-}
-
-ConsoleFunctionGroupEnd(NetStringTable);
-
 #endif // DEBUG

BIN
engine/source/network/netStringTable_ScriptBinding.h


+ 2 - 17
engine/source/network/telnetConsole.cc

@@ -25,6 +25,8 @@
 #include "network/telnetConsole.h"
 #include "game/gameInterface.h"
 
+#include "telnetConsole_ScriptBinding.h"
+
 TelnetConsole *TelConsole = NULL;
 
 void TelnetConsole::create()
@@ -38,23 +40,6 @@ void TelnetConsole::destroy()
    TelConsole = NULL;
 }
 
-ConsoleFunction( telnetSetParameters, void, 4, 5, "(int port, string consolePass, string listenPass)"
-                "Initialize and open the telnet console.\n\n"
-                "@param port        Port to listen on for console connections (0 will shut down listening).\n"
-                "@param consolePass Password for read/write access to console.\n"
-                "@param listenPass  Password for read access to console.\n"
-                "@param remoteEcho  [optional] Enable echoing back to the client, off by default.\n"
-        "@return No return value")
-{
-   if (TelConsole)
-   {
-      bool remoteEcho = false;
-      if( argc == 5 )
-         remoteEcho = dAtob( argv[4] );
-       TelConsole->setTelnetParameters(dAtoi(argv[1]), argv[2], argv[3], remoteEcho);
-   }
-}
-
 static void telnetCallback(ConsoleLogEntry::Level level, const char *consoleLine)
 {
    if (TelConsole)

BIN
engine/source/network/telnetConsole_ScriptBinding.h


+ 2 - 40
engine/source/platform/CursorManager.cc

@@ -25,6 +25,8 @@
 #include "platform/event.h"
 #include "console/console.h"
 
+#include "CursorManager_ScriptBinding.h"
+
 //------------------------------------------------------------------------------
 //*** DAW: Cursor Manager Methods
 CursorManager* Input::getCursorManager()
@@ -81,43 +83,3 @@ static EnumTable::Enums curManagerShapesEnums[] =
 };
       
 static EnumTable gCurManagerShapesTable(8, &curManagerShapesEnums[0]); 
-
-//*** Console function to set the current cursor shape given the cursor shape
-//*** name as defined in the enum above.
-ConsoleFunction( inputPushCursor, void, 2, 2, "(cursorShapeName) Set's the current cursor to one specified"
-                "@param cursorShapeName Name corresponding to enumerated shape value: \"Arrow\", \"Wait\", \"Plus\", \"ResizeVert\", \"ResizeHorz\", "
-                "\"ResizeAll\", \"ibeam\", \"ResizeNESW\", \"ResizeNWSE\"\n"
-                "@return No Return Value")
-{
-   S32 val = 0;
-
-   //*** Find the cursor shape
-   if(argc == 2)
-   {
-      for (S32 i = 0; i < gCurManagerShapesTable.size; i++)
-      {
-         if (! dStricmp(argv[1], gCurManagerShapesTable.table[i].label))
-         {
-            val = gCurManagerShapesTable.table[i].index;
-            break;
-         }
-      }
-   }
-
-   //*** Now set it
-   CursorManager* cm = Input::getCursorManager();
-   if(cm)
-   {
-      cm->pushCursor(val);
-   }
-}
-//*** Function to pop the current cursor shape
-ConsoleFunction( inputPopCursor, void, 1, 1, "() Pops the current cursor shape from manager stack\n"
-                "@return No Return Value.")
-{
-   CursorManager* cm = Input::getCursorManager();
-   if(cm)
-   {
-      cm->popCursor();
-   }
-}

BIN
engine/source/platform/CursorManager_ScriptBinding.h


+ 2 - 20
engine/source/platform/nativeDialogs/msgBox.cpp

@@ -25,6 +25,8 @@
 
 #include "platform/nativeDialogs/msgBox.h"
 
+#include "msgBox_ScriptBinding.h"
+
 // these are the return values for message box dialog buttons
 void initMessageBoxVars()
 {
@@ -67,23 +69,3 @@ static S32 getIDFromName(EnumTable::Enums *table, const char *name, S32 def = -1
    AssertWarn(false,"getIDFromName(): didn't find that name" );
    return def;
 }
-
-//////////////////////////////////////////////////////////////////////////
-
-ConsoleFunction(messageBox, S32, 3, 5, "(title, message[, buttons[, icon]]) Pops up a message box\n"
-				"@param title The message box's title to display\n"
-				"@param message The message to display in the box\n"
-				"@param buttons The buttons to include on box (default MBOkCancel)\n"
-				"@param icon The displayed icon (default MIInformation)\n"
-				"@return Returns the ID of the box")
-{
-   S32 btns = MBOkCancel;
-   S32 icns = MIInformation;
-   
-   if(argc > 3)
-      btns = getIDFromName(sgButtonEnums, argv[3], btns);
-   if(argc > 4)
-      icns = getIDFromName(sgIconEnums, argv[4], icns);
-
-   return Platform::messageBox(argv[1], argv[2], (MBButtons)btns, (MBIcons)icns);
-}

BIN
engine/source/platform/nativeDialogs/msgBox_ScriptBinding.h


BIN
engine/source/platform/platformNetwork_ScriptBinding.cc


+ 2 - 8
engine/source/platformWin32/cardProfile.cpp

@@ -23,6 +23,8 @@
 #include "console/console.h"
 #include "platformWin32/platformWin32.h"
 
+#include "cardProfile_ScriptBinding.h"
+
 void initDisplayDeviceInfo()
 {
    Con::printf( "Reading Display Device information..." );
@@ -71,11 +73,3 @@ void initDisplayDeviceInfo()
    Con::setVariable( "$PCI_VEN", ven );
    Con::setVariable( "$PCI_DEV", dev );
 }
-
-ConsoleFunction( initDisplayDeviceInfo, void, 1, 1, "() Prints display device info to console and sets them to console variables:\n"
-                "\tVendor->$PCI_VEN\n"
-                "\tDevice_ID->$PCI_DEV\n"
-                "@return No Return Value")
-{
-   initDisplayDeviceInfo();
-}

BIN
engine/source/platformWin32/cardProfile_ScriptBinding.h


+ 2 - 9
engine/source/platformWin32/winConsole.cc

@@ -26,16 +26,9 @@
 #include "game/gameInterface.h"
 #include "string/unicode.h"
 
-WinConsole *WindowsConsole = NULL;
+#include "winConsole_ScriptBinding.h"
 
-ConsoleFunction(enableWinConsole, void, 2, 2, "( enable ) Use the enableWinConsole function to tell TGB to create an external console window, either as a separate DOS window or as a new window under OSX/Linux/*NIX.\n"
-                                                                "Subsequent calls to this function do nothing. Only one external console is allowed\n"
-                                                                "@param enable A boolean. If this value is set to true, a new console window will be created.\n"
-                                                                "@return No return value.")
-{
-   argc;
-   WindowsConsole->enable(dAtob(argv[1]));
-}
+WinConsole *WindowsConsole = NULL;
 
 void WinConsole::create()
 {

BIN
engine/source/platformWin32/winConsole_ScriptBinding.h


+ 4 - 54
engine/source/platformWin32/winExec.cc

@@ -44,6 +44,10 @@ public:
    virtual void run(void *arg = 0);
 };
 
+//----------------------------------------------------
+
+#include "winExec_ScriptBinding.h"
+
 //////////////////////////////////////////////////////////////////////////
 // Event for cleanup
 //////////////////////////////////////////////////////////////////////////
@@ -108,60 +112,6 @@ void ExecuteThread::run(void *arg /* = 0 */)
    Sim::postEvent(Sim::getRootGroup(), new ExecuteCleanupEvent(this, wait == WAIT_OBJECT_0), -1);
 }
 
-//////////////////////////////////////////////////////////////////////////
-// Console Functions
-//////////////////////////////////////////////////////////////////////////
-
-ConsoleFunction(shellExecute, bool, 2, 4, "(executable, [args], [directory]) Executes a process"
-                "@param executable The program to execute\n"
-                "@param args Arguments to pass to the executable\n"
-                "@param directory The directory in which the program is located\n"
-                "@return Returns true on success, false otherwise")
-{
-   ExecuteThread *et = new ExecuteThread(argv[1], argc > 2 ? argv[2] : NULL, argc > 3 ? argv[3] : NULL);
-   if(! et->isAlive())
-   {
-      delete et;
-      return false;
-   }
-
-   return true;
-}
-
-ConsoleFunction(shellExecuteBlocking, int, 2, 6, "(executable, [args], [directory])"
-                "@param executable The program to execute\n"
-                "@param args Arguments to pass to the executable\n"
-                "@param directory The directory in which the program is located\n"
-                "@return Returns true on success, false otherwise")
-{
-    const char* executable = argv[1];
-    const char* args = argc > 2 ? argv[2] : NULL;
-    const char* directory = argc > 3 ? argv[3] : NULL;
-
-    SHELLEXECUTEINFOA shl;
-    dMemset(&shl, 0, sizeof(shl));
-
-    shl.cbSize = sizeof(shl);
-    shl.fMask = SEE_MASK_NOCLOSEPROCESS;
-   
-    char exeBuf[1024];
-    Platform::makeFullPathName(executable, exeBuf, sizeof(exeBuf));
-   
-    shl.lpVerb = "open";
-    shl.lpFile = exeBuf;
-    shl.lpParameters = args;
-    shl.lpDirectory = directory;
-
-    shl.nShow = SW_HIDE;
-
-    ShellExecuteExA(&shl);
-
-    if ( shl.hProcess == NULL )
-        return false;
-
-    return ( WaitForSingleObject( shl.hProcess, INFINITE) == WAIT_OBJECT_0 );
-}
-
 void Platform::openFolder(const char* path )
 {
    char filePath[1024];

BIN
engine/source/platformWin32/winExec_ScriptBinding.h


+ 1 - 136
engine/source/platformWin32/winGLSpecial.cc

@@ -2712,139 +2712,4 @@ static void APIENTRY perfDrawElements(GLenum mode, GLsizei count, GLenum type, c
    dllglDrawElements( mode, count, type, indices );
 }
 
-
-
-#if defined (TORQUE_DEBUG) || defined(INTERNAL_RELEASE)
-ConsoleFunction(GLEnableLogging, void, 2, 2, "( enable ) Use the GLEnableLogging function to enable/disable the gathering of OpenGL metrics.\n"
-                                                                "For this to work, the engine must have been compiled with either TORQUE_DEBUG or INTERNAL_RELEASE defined. Always be sure to do a disable after an enable to flush the last log data to the log file.\n"
-                                                                "@param enable A boolean value. If set to true, the engine will gather various OpenGL metrics and dump them to a file named gl_log.txt. If set to false, logging is stopped, the last writes to the log are flushed, and the file is closed.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa GLEnableMetrics, metrics")
-{
-   argc;
-   bool enable = dAtob(argv[1]);
-
-   if(loggingEnabled == enable)
-      return;
-
-   if(enable && (outlineEnabled || perfEnabled))
-      return;
-
-   loggingEnabled = enable;
-
-   if ( enable )
-   {
-      if ( !winState.log_fp )
-      {
-         struct tm *newtime;
-         time_t aclock;
-
-         time( &aclock );
-         newtime = localtime( &aclock );
-
-         asctime( newtime );
-
-         winState.log_fp = fopen( "gl_log.txt", "wt" );
-
-         fprintf( winState.log_fp, "%s\n", asctime( newtime ) );
-         fflush(winState.log_fp);
-      }
-
-#define GL_FUNCTION(fn_type, fn_name, fn_args, fn_body) fn_name = log##fn_name;
-#include "platform/GLCoreFunc.h"
-#include "platform/GLExtFunc.h"
-#include "platform/GLUFunc.h"
-#undef GL_FUNCTION
-   }
-   else
-   {
-      if ( winState.log_fp )
-      {
-         fprintf( winState.log_fp, "*** CLOSING LOG ***\n" );
-         fflush(winState.log_fp);
-         fclose( winState.log_fp );
-         winState.log_fp = NULL;
-      }
-
-#define GL_FUNCTION(fn_type, fn_name, fn_args, fn_body) fn_name = dll##fn_name;
-#include "platform/GLCoreFunc.h"
-#include "platform/GLExtFunc.h"
-#include "platform/GLUFunc.h"
-#undef GL_FUNCTION
-   }
-}
-
-#endif
-
-ConsoleFunction(GLEnableOutline, void, 2, 2, "GLEnableOutline(bool); Enables outlines with OpenGL\n"
-                "@param enable Boolean value representing whether or not outlines should be enabled.\n"
-                "@return No Return Value.")
-{
-   argc;
-   bool enable = dAtob(argv[1]);
-   if(outlineEnabled == enable)
-      return;
-
-   if(enable && (loggingEnabled || perfEnabled))
-      return;
-
-   outlineEnabled = enable;
-
-   if ( enable )
-   {
-      glDrawElements = outlineDrawElements;
-      glDrawArrays = outlineDrawArrays;
-      dwglSwapBuffers = outlineSwapBuffers;
-   }
-   else
-   {
-      glDrawElements = dllglDrawElements;
-      glDrawArrays = dllglDrawArrays;
-      dwglSwapBuffers = dlldwglSwapBuffers;
-   }
-}
-
-ConsoleFunction(GLEnableMetrics, void, 2, 2, "( enable ) Use the GLEnableMetrics function to enable or disable logging of OpenGL texture and video metrics.\n"
-                                                                "For this to work, the engine must have been compiled with either TORQUE_DEBUG or INTERNAL_RELEASE defined. Use the metrics function to get at this information. Also, once this feature is enabled, the following globals will be available for inspection/examination: <OpenGL::triCount0 – Terrain triangles, OpenGL::triCount1– DIF triangles, OpenGL::triCount2 – DTS triangles, OpenGL::triCount3 – Uncategorized triangles, OpenGL::primCount0 - Terrain primitives, OpenGL::primCount1 – DIF primitives, OpenGL::primCount2 – DTS primitives, OpenGL::primCount3 – Uncategorized primitives>\n"
-                                                                "@param enable A boolean value. When this is set to true, texture and video (triangles and primitives) logging is enabled and dumped as part of calls to certain metrics.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa GLEnableLogging, metrics")
-{
-   argc;
-   static bool varsAdded = false;
-
-   if(!varsAdded)
-   {
-      Con::addVariable("OpenGL::triCount0", TypeS32, &gGLState.triCount[0]);
-      Con::addVariable("OpenGL::triCount1", TypeS32, &gGLState.triCount[1]);
-      Con::addVariable("OpenGL::triCount2", TypeS32, &gGLState.triCount[2]);
-      Con::addVariable("OpenGL::triCount3", TypeS32, &gGLState.triCount[3]);
-
-      Con::addVariable("OpenGL::primCount0", TypeS32, &gGLState.primCount[0]);
-      Con::addVariable("OpenGL::primCount1", TypeS32, &gGLState.primCount[1]);
-      Con::addVariable("OpenGL::primCount2", TypeS32, &gGLState.primCount[2]);
-      Con::addVariable("OpenGL::primCount3", TypeS32, &gGLState.primCount[3]);
-      varsAdded = true;
-   }
-
-   bool enable = dAtob(argv[1]);
-   if(perfEnabled == enable)
-      return;
-
-   if(enable && (loggingEnabled || outlineEnabled))
-      return;
-
-   perfEnabled = enable;
-
-   if ( enable )
-   {
-      glDrawElements = perfDrawElements;
-      glDrawArrays = perfDrawArrays;
-   }
-   else
-   {
-      glDrawElements = dllglDrawElements;
-      glDrawArrays = dllglDrawArrays;
-   }
-}
-
+#include "winGLSpecial_ScriptBinding.h"

BIN
engine/source/platformWin32/winGLSpecial_ScriptBinding.h


+ 1 - 24
engine/source/platformWin32/winInput.cc

@@ -28,6 +28,7 @@
 #include "console/console.h"
 
 #include "platform/platformInput_ScriptBinding.h"
+#include "winInput_ScriptBinding.h"
 
 // Static class variables:
 InputManager*  Input::smManager;
@@ -125,30 +126,6 @@ void Input::init()
 
 }
 
-//------------------------------------------------------------------------------
-ConsoleFunction( isJoystickDetected, bool, 1, 1, "() Use the isJoystickDetected function to determine if one or more joysticks are connected to the system.\n"
-																"This doesn't tell us how many joysticks there are, just that there are joysticks. It is our job to find out how many and to attach them.\n"
-																"@return Returns true if one or more joysticks are attached and detected, false otherwise.\n"
-																"@sa disableJoystick, enableJoystick, getJoystickAxes")
-{
-   argc; argv;
-   return( DInputDevice::joystickDetected() );
-}
-
-//------------------------------------------------------------------------------
-ConsoleFunction( getJoystickAxes, const char*, 2, 2, "( instance ) Use the getJoystickAxes function to get the current axes position (x and y ) of any intance of a joystick.\n"
-																"@param instance A non-negative number value selecting a specific joystick instance attached to this computer.\n"
-																"@return Returns a string containing the \"x y\" position of the joystick.\n"
-																"@sa disableJoystick, enableJoystick, isJoystickDetected")
-{
-   argc;
-   DInputManager* mgr = dynamic_cast<DInputManager*>( Input::getManager() );
-   if ( mgr )
-      return( mgr->getJoystickAxesString( dAtoi( argv[1] ) ) );
-
-   return( "" );
-}
-
 //------------------------------------------------------------------------------
 static void fillAsciiTable()
 {

BIN
engine/source/platformWin32/winInput_ScriptBinding.h


+ 1 - 45
engine/source/platformWin32/winMath.cc

@@ -24,6 +24,7 @@
 #include "console/console.h"
 #include "math/mMath.h"
 
+#include "winMath_ScriptBinding.h"
 
 extern void mInstallLibrary_C();
 extern void mInstallLibrary_ASM();
@@ -34,51 +35,6 @@ extern void mInstall_Library_SSE();
 
 
 //--------------------------------------
-ConsoleFunction( mathInit, void, 1, 10, "( extension ) Use the MathInit function to install a specified math extensions, or to detect and enable all extensions.\n"
-                                                                "Generally speaking, the best extension choice is to used detect. This will automatically detected and enable all extensions supported by the current processor. It will also print out a list of the extension that were enabled to the console\n"
-                                                                "@param extension Can be any of these:\ndetect – Detect all supported extensions and enable.\nC - Enable standard C extensions.\nFPU - Enable floating-point-unit extensions.\nMMX - Enable Intel MMX extensions.\n3DNOW - Enable AMD 3DNOW extensions.\nSSE - Enable Intel SSE extensions.\n"
-                                                                "@return No return value.")
-
-
-{
-   U32 properties = CPU_PROP_C;  // C entensions are always used
-
-   if (argc == 1)
-   {
-         Math::init(0);
-         return;
-   }
-   for (argc--, argv++; argc; argc--, argv++)
-   {
-      if (dStricmp(*argv, "DETECT") == 0) {
-         Math::init(0);
-         return;
-      }
-      if (dStricmp(*argv, "C") == 0) {
-         properties |= CPU_PROP_C;
-         continue;
-      }
-      if (dStricmp(*argv, "FPU") == 0) {
-         properties |= CPU_PROP_FPU;
-         continue;
-      }
-      if (dStricmp(*argv, "MMX") == 0) {
-         properties |= CPU_PROP_MMX;
-         continue;
-      }
-      if (dStricmp(*argv, "3DNOW") == 0) {
-         properties |= CPU_PROP_3DNOW;
-         continue;
-      }
-      if (dStricmp(*argv, "SSE") == 0) {
-         properties |= CPU_PROP_SSE;
-         continue;
-      }
-      Con::printf("Error: MathInit(): ignoring unknown math extension '%s'", *argv);
-   }
-   Math::init(properties);
-}
-
 
 
 //------------------------------------------------------------------------------

BIN
engine/source/platformWin32/winMath_ScriptBinding.h


+ 6 - 54
engine/source/platformWin32/winOGLVideo.cc

@@ -66,6 +66,12 @@ struct OSCardProfile
 static Vector<CardProfile> sCardProfiles(__FILE__, __LINE__);
 static Vector<OSCardProfile> sOSCardProfiles(__FILE__, __LINE__);
 
+//------------------------------------------------------------------------------
+
+#include "winOGLVideo_ScriptBinding.h"
+
+//------------------------------------------------------------------------------
+
 struct ProcessorProfile
 {
     U16 clock;  // clock range max
@@ -96,60 +102,6 @@ static SettingProfile sSettingProfiles[] =
 };
 
 //------------------------------------------------------------------------------
-ConsoleFunction( addCardProfile, void, 16, 16, "(string vendor, string renderer,"
-                "bool safeMode, bool lockArray, bool subImage, bool fogTexture,"
-                "bool noEnvColor, bool clipHigh, bool deleteContext, bool texCompress"
-                "bool interiorLock, bool skipFirstFog, bool only16,"
-                "bool noArraysAlpha, string proFile)"
-                ""
-                "Register a card profile with the card profile manager.\n\n"
-                "Most of the parameters are fairly self-explanatory and very internal"
-                " to the rendering code; however there are a few of note:\n"
-                "@param vendor   The vendor string the card claims.\n"
-                "@param renderer The renderer string the card claims.\n"
-                "@param proFile  Name of the file where further configuration information is kept."
-                )
-{
-   CardProfile profile;
-
-   profile.vendor = dStrdup(argv[1]);
-   profile.renderer = dStrdup(argv[2]);
-
-   profile.safeMode = dAtob(argv[3]);
-   profile.lockArray = dAtob(argv[4]);
-   profile.subImage = dAtob(argv[5]);
-   profile.fogTexture = dAtob(argv[6]);
-   profile.noEnvColor = dAtob(argv[7]);
-   profile.clipHigh = dAtob(argv[8]);
-    profile.deleteContext = dAtob(argv[9]);
-    profile.texCompress = dAtob(argv[10]);
-    profile.interiorLock = dAtob(argv[11]);
-    profile.skipFirstFog = dAtob(argv[12]);
-    profile.only16 = dAtob(argv[13]);
-    profile.noArraysAlpha = dAtob(argv[14]);
-
-    if (strcmp(argv[15],""))
-        profile.proFile = dStrdup(argv[15]);
-    else
-        profile.proFile = NULL;
-
-   sCardProfiles.push_back(profile);
-}
-
-ConsoleFunction( addOSCardProfile, void, 6,6, "(string vendor, string renderer, bool allowOpenGL,"
-                "Register with the profile manager what rendering mode is preferred with the "
-                "specified card.")
-{
-   OSCardProfile profile;
-
-   profile.vendor = dStrdup(argv[1]);
-   profile.renderer = dStrdup(argv[2]);
-
-   profile.allowOpenGL = dAtob(argv[3]);
-    profile.preferOpenGL = dAtob(argv[5]);
-
-   sOSCardProfiles.push_back(profile);
-}
 
 static void clearCardProfiles()
 {

BIN
engine/source/platformWin32/winOGLVideo_ScriptBinding.h


+ 2 - 15
engine/source/sim/simDatablock.cc

@@ -25,6 +25,8 @@
 #include "sim/scriptObject.h"
 #include "sim/simDatablock.h"
 
+#include "simDatablock_ScriptBinding.h"
+
 //-----------------------------------------------------------------------------
 
 IMPLEMENT_CO_DATABLOCK_V1(SimDataBlock);
@@ -94,18 +96,3 @@ bool SimDataBlock::preload(bool, char[256])
 {
    return true;
 }
-
-ConsoleFunction(deleteDataBlocks, void, 1, 1, "() Use the deleteDataBlocks function to cause a server to delete all datablocks that have thus far been loaded and defined.\n"
-                                                                "This is usually done in preparation of downloading a new set of datablocks, such as occurs on a mission change, but it's also good post-mission cleanup\n"
-                                                                "@return No return value.")
-{
-   // delete from last to first:
-   SimGroup *grp = Sim::getDataBlockGroup();
-   for(S32 i = grp->size() - 1; i >= 0; i--)
-   {
-      SimObject *obj = (*grp)[i];
-      obj->deleteObject();
-   }
-   SimDataBlock::sNextObjectId = DataBlockObjectIdFirst;
-   SimDataBlock::sNextModifiedKey = 0;
-}

BIN
engine/source/sim/simDatablock_ScriptBinding.h


+ 1 - 28
engine/source/string/stringBuffer.cc

@@ -25,34 +25,7 @@
 #include "string/unicode.h"
 #include "math/mMath.h"
 
-
-#if defined(TORQUE_DEBUG)
-   class StringBufferManager
-   {
-      public:
-         static StringBufferManager& getManager();
-         Vector<StringBuffer*> strings;
-         U64 request8;
-         U64 request16;
-         
-         void add(StringBuffer* s);
-         void remove(StringBuffer* s);
-         void updateStats();
-         void dumpStats();
-         void dumpAllStrings();
-   };
-
-   ConsoleFunction(sbmDumpStats, void, 1, 1, "")
-   {
-      StringBufferManager::getManager().dumpStats();
-   }
-
-   ConsoleFunction(sbmDumpStrings, void, 1, 1, "")
-   {
-      StringBufferManager::getManager().dumpAllStrings();
-   }
-#endif // TORQUE_DEBUG
-
+#include "stringBuffer_ScriptBinding.h"
 
 #if defined(TORQUE_DEBUG)
 #define SBMAddThisStringBuffer() \

+ 18 - 0
engine/source/string/stringBuffer.h

@@ -141,4 +141,22 @@ private:
    
 };
 
+#if defined(TORQUE_DEBUG)
+   class StringBufferManager
+   {
+      public:
+         static StringBufferManager& getManager();
+         Vector<StringBuffer*> strings;
+         U64 request8;
+         U64 request16;
+         
+         void add(StringBuffer* s);
+         void remove(StringBuffer* s);
+         void updateStats();
+         void dumpStats();
+         void dumpAllStrings();
+   };
+
+#endif // TORQUE_DEBUG
+
 #endif

BIN
engine/source/string/stringBuffer_ScriptBinding.h


+ 1 - 37
engine/source/testing/unitTesting.cc

@@ -80,42 +80,6 @@ class TorqueUnitTestListener : public ::testing::EmptyTestEventListener
     }
 };
 
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( runAllUnitTests, S32, 1, 1, "() - Runs all the registered unit tests." )
-{
-    // Set-up some empty arguments.
-    S32 testArgc = 0;
-    char** testArgv = NULL;
-
-    // Initialize Google Test.
-    testing::InitGoogleTest( &testArgc, testArgv );
-
-    // Fetch the unit test instance.
-    testing::UnitTest& unitTest = *testing::UnitTest::GetInstance();
-
-    // Fetch the unit test event listeners.
-    testing::TestEventListeners& listeners = unitTest.listeners();
-
-    // Release the default listener.
-    delete listeners.Release( listeners.default_result_printer() );
-
-    // Add the Torque unit test listener.
-    listeners.Append( new TorqueUnitTestListener );
-
-    Con::printBlankLine();
-    Con::printSeparator();
-    Con::printf( "Unit Tests Starting..." );
-    Con::printBlankLine();
-
-    const S32 result RUN_ALL_TESTS();
-
-    Con::printBlankLine();
-    Con::printf( "... Unit Tests Ended." );
-    Con::printSeparator();
-    Con::printBlankLine();
-
-    return result;
-}
+#include "unitTesting_ScriptBinding.h"
 
 #endif // TORQUE_SHIPPING

+ 70 - 0
engine/source/testing/unitTesting_ScriptBinding.h

@@ -0,0 +1,70 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+#ifndef TORQUE_SHIPPING
+
+/*! @defgroup UnitTesting Unit Testing
+	@ingroup TorqueScriptFunctions
+	@{
+*/
+
+/*! Runs all the registered unit tests.
+*/
+ConsoleFunctionWithDocs( runAllUnitTests, S32, 1, 1, () )
+{
+    // Set-up some empty arguments.
+    S32 testArgc = 0;
+    char** testArgv = NULL;
+
+    // Initialize Google Test.
+    testing::InitGoogleTest( &testArgc, testArgv );
+
+    // Fetch the unit test instance.
+    testing::UnitTest& unitTest = *testing::UnitTest::GetInstance();
+
+    // Fetch the unit test event listeners.
+    testing::TestEventListeners& listeners = unitTest.listeners();
+
+    // Release the default listener.
+    delete listeners.Release( listeners.default_result_printer() );
+
+    // Add the Torque unit test listener.
+    listeners.Append( new TorqueUnitTestListener );
+
+    Con::printBlankLine();
+    Con::printSeparator();
+    Con::printf( "Unit Tests Starting..." );
+    Con::printBlankLine();
+
+    const S32 result RUN_ALL_TESTS();
+
+    Con::printBlankLine();
+    Con::printf( "... Unit Tests Ended." );
+    Con::printSeparator();
+    Con::printBlankLine();
+
+    return result;
+}
+
+/*! @} */ // end group UnitTesting
+
+#endif // TORQUE_SHIPPING

+ 2 - 0
tools/documentation/config/torqueScriptReference.cfg

@@ -1625,6 +1625,8 @@ INCLUDE_FILE_PATTERNS  =
 # Convert abstract types like ConsoleString into TorqueScript types
 
 PREDEFINED             = TORQUE_DEBUG
+# one doc should have all platform-specific script calls
+PREDEFINED            += TORQUE_OS_OSX
 PREDEFINED            += ConsoleString=String
 PREDEFINED            += ConsoleInt=Integer
 PREDEFINED            += ConsoleFloat=Float