2
0
Эх сурвалжийг харах

converting a ton of ConsoleFunction's to ConsoleFunctionWithDocs. This often involves separating console functions into their own *_ScriptBinding.h file. This is probably half of them moved and 75% tested.

Still only VS2012 is updated.  VS2010 and XCode need to be added but probably easiest after conversion.
Charlie Patterson 12 жил өмнө
parent
commit
9308e1e3ed
73 өөрчлөгдсөн 101 нэмэгдсэн , 4369 устгасан
  1. 10 3
      engine/compilers/VisualStudio 2012/Torque 2D.vcxproj
  2. 30 9
      engine/compilers/VisualStudio 2012/Torque 2D.vcxproj.filters
  3. BIN
      engine/source/2d/assets/AnimationAsset_ScriptBinding.h
  4. BIN
      engine/source/2d/assets/ImageAsset_ScriptBinding.h
  5. BIN
      engine/source/2d/assets/ParticleAssetEmitter_ScriptBinding.h
  6. BIN
      engine/source/2d/assets/ParticleAsset_ScriptBinding.h
  7. BIN
      engine/source/2d/controllers/AmbientForceController_ScriptBinding.h
  8. BIN
      engine/source/2d/controllers/BuoyancyController_ScriptBinding.h
  9. BIN
      engine/source/2d/controllers/PointForceController_ScriptBinding.h
  10. BIN
      engine/source/2d/controllers/core/PickingSceneController_ScriptBinding.h
  11. BIN
      engine/source/2d/core/RenderProxy_ScriptBinding.h
  12. BIN
      engine/source/2d/core/SpriteBase_ScriptBinding.h
  13. 3 0
      engine/source/2d/experimental/composites/WaveComposite_ScriptBinding.h
  14. BIN
      engine/source/2d/gui/SceneWindow_ScriptBinding.h
  15. BIN
      engine/source/2d/gui/guiImageButtonCtrl_ScriptBindings.h
  16. BIN
      engine/source/2d/gui/guiSpriteCtrl_ScriptBindings.h
  17. BIN
      engine/source/2d/scene/Scene_ScriptBinding.h
  18. BIN
      engine/source/2d/sceneobject/CompositeSprite_ScriptBinding.h
  19. BIN
      engine/source/2d/sceneobject/ImageFont_ScriptBinding.h
  20. BIN
      engine/source/2d/sceneobject/ParticlePlayer_ScriptBinding.h
  21. BIN
      engine/source/2d/sceneobject/SceneObjectSet_ScriptBinding.h
  22. BIN
      engine/source/2d/sceneobject/SceneObject_ScriptBinding.h
  23. BIN
      engine/source/2d/sceneobject/Scroller_ScriptBinding.h
  24. BIN
      engine/source/2d/sceneobject/ShapeVector_ScriptBinding.h
  25. BIN
      engine/source/2d/sceneobject/Sprite_ScriptBinding.h
  26. BIN
      engine/source/assets/assetBase_ScriptBinding.h
  27. BIN
      engine/source/assets/assetManager_ScriptBinding.h
  28. BIN
      engine/source/assets/assetTagsManifest_ScriptBinding.h
  29. 0 745
      engine/source/audio/audioFunctions.cc
  30. BIN
      engine/source/audio/audio_ScriptBinding.cc
  31. BIN
      engine/source/collection/nameTags_ScriptBinding.h
  32. BIN
      engine/source/component/behaviors/behaviorComponent_ScriptBinding.h
  33. BIN
      engine/source/component/behaviors/behaviorInstance_ScriptBinding.h
  34. BIN
      engine/source/component/behaviors/behaviorTemplate_ScriptBinding.h
  35. 14 117
      engine/source/console/console.cc
  36. 4 0
      engine/source/console/console.h
  37. 0 1485
      engine/source/console/consoleFunctions.cc
  38. BIN
      engine/source/console/expando_ScriptBinding.h
  39. BIN
      engine/source/console/metaScripting_ScriptBinding.cc
  40. BIN
      engine/source/console/output_ScriptBinding.h
  41. 1 0
      engine/source/console/scriptBinding.dox
  42. BIN
      engine/source/debug/remote/RemoteDebugger1_ScriptBinding.h
  43. BIN
      engine/source/debug/remote/RemoteDebuggerBase_ScriptBinding.h
  44. BIN
      engine/source/debug/remote/RemoteDebuggerBridge_ScriptBinding.h
  45. BIN
      engine/source/game/gameInterface_ScriptBinding.h
  46. 12 55
      engine/source/game/version.cc
  47. 6 0
      engine/source/game/version.h
  48. BIN
      engine/source/game/version_ScriptBinding.h
  49. 2 79
      engine/source/graphics/color.cc
  50. BIN
      engine/source/graphics/color_ScriptBinding.h
  51. 2 372
      engine/source/gui/guiCanvas.cc
  52. BIN
      engine/source/gui/guiCanvas_ScriptBinding.h
  53. 2 228
      engine/source/gui/guiControl.cc
  54. BIN
      engine/source/gui/guiControl_ScriptBinding.h
  55. 3 153
      engine/source/input/actionMap.cc
  56. BIN
      engine/source/input/actionMap_ScriptBinding.h
  57. 0 592
      engine/source/io/fileSystemFunctions.cpp
  58. BIN
      engine/source/io/fileSystem_ScriptBinding.cc
  59. 0 308
      engine/source/math/mConsoleFunctions.cc
  60. BIN
      engine/source/math/math_ScriptBinding.cc
  61. BIN
      engine/source/module/moduleDefinition_ScriptBinding.h
  62. BIN
      engine/source/module/moduleManager_ScriptBinding.h
  63. BIN
      engine/source/persistence/taml/taml_ScriptBinding.h
  64. BIN
      engine/source/platform/nativeDialogs/fileDialog_ScriptBinding.h
  65. BIN
      engine/source/platform/platformInput_ScriptBinding.h
  66. 6 1
      engine/source/platform/platformString.cc
  67. BIN
      engine/source/platform/platformString_ScriptBinding.h
  68. 2 220
      engine/source/platform/platformVideo.cc
  69. BIN
      engine/source/platform/platformVideo_ScriptBinding.h
  70. BIN
      engine/source/platform/platform_ScriptBinding.h
  71. 2 0
      engine/source/string/stringUnit.cpp
  72. BIN
      engine/source/string/stringUnit_ScriptBinding.h
  73. 2 2
      tools/documentation/config/torqueScriptReference.cfg

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

@@ -293,6 +293,7 @@
     <ClCompile Include="..\..\source\assets\declaredAssets.cc" />
     <ClCompile Include="..\..\source\assets\referencedAssets.cc" />
     <ClCompile Include="..\..\source\audio\AudioAsset.cc" />
+    <ClCompile Include="..\..\source\audio\audio_ScriptBinding.cc" />
     <ClCompile Include="..\..\source\box2d\Collision\b2BroadPhase.cpp" />
     <ClCompile Include="..\..\source\box2d\Collision\b2CollideCircle.cpp" />
     <ClCompile Include="..\..\source\box2d\Collision\b2CollideEdge.cpp" />
@@ -349,6 +350,7 @@
     <ClCompile Include="..\..\source\console\consoleExprEvalState.cc" />
     <ClCompile Include="..\..\source\console\consoleNamespace.cc" />
     <ClCompile Include="..\..\source\console\ConsoleTypeValidators.cc" />
+    <ClCompile Include="..\..\source\console\metaScripting_ScriptBinding.cc" />
     <ClCompile Include="..\..\source\debug\profiler.cc" />
     <ClCompile Include="..\..\source\debug\remote\RemoteDebugger1.cc" />
     <ClCompile Include="..\..\source\debug\remote\RemoteDebuggerBase.cc" />
@@ -413,7 +415,7 @@
     <ClCompile Include="..\..\source\io\fileObject.cc" />
     <ClCompile Include="..\..\source\io\fileStream.cc" />
     <ClCompile Include="..\..\source\io\fileStreamObject.cc" />
-    <ClCompile Include="..\..\source\io\fileSystemFunctions.cpp" />
+    <ClCompile Include="..\..\source\io\fileSystem_ScriptBinding.cc" />
     <ClCompile Include="..\..\source\io\filterStream.cc" />
     <ClCompile Include="..\..\source\io\memStream.cc" />
     <ClCompile Include="..\..\source\io\nStream.cc" />
@@ -432,6 +434,7 @@
     <ClCompile Include="..\..\source\io\zip\zipObject.cc" />
     <ClCompile Include="..\..\source\io\zip\zipSubStream.cc" />
     <ClCompile Include="..\..\source\io\zip\zipTempStream.cc" />
+    <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" />
@@ -477,7 +480,6 @@
     <ClCompile Include="..\..\source\audio\audio.cc" />
     <ClCompile Include="..\..\source\audio\audioBuffer.cc" />
     <ClCompile Include="..\..\source\audio\audioDataBlock.cc" />
-    <ClCompile Include="..\..\source\audio\audioFunctions.cc" />
     <ClCompile Include="..\..\source\audio\audioStreamSourceFactory.cc" />
     <ClCompile Include="..\..\source\audio\wavStreamSource.cc" />
     <ClCompile Include="..\..\source\component\dynamicConsoleMethodComponent.cpp" />
@@ -504,7 +506,6 @@
     <ClCompile Include="..\..\source\math\mathTypes.cc" />
     <ClCompile Include="..\..\source\math\mathUtils.cc" />
     <ClCompile Include="..\..\source\math\mBox.cc" />
-    <ClCompile Include="..\..\source\math\mConsoleFunctions.cc" />
     <ClCompile Include="..\..\source\math\mMath_C.cc" />
     <ClCompile Include="..\..\source\math\mMathAltivec.cc" />
     <ClCompile Include="..\..\source\math\mMathAMD.cc" />
@@ -797,6 +798,7 @@
     <ClInclude Include="..\..\source\console\consoleInternal.h" />
     <ClInclude Include="..\..\source\console\consoleNamespace.h" />
     <ClInclude Include="..\..\source\console\ConsoleTypeValidators.h" />
+    <ClInclude Include="..\..\source\console\output_ScriptBinding.h" />
     <ClInclude Include="..\..\source\debug\profiler.h" />
     <ClInclude Include="..\..\source\debug\remote\RemoteDebugger1.h" />
     <ClInclude Include="..\..\source\debug\remote\RemoteDebugger1_ScriptBinding.h" />
@@ -829,6 +831,7 @@
     <ClInclude Include="..\..\source\gui\guiBitmapCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiBubbleTextCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiCanvas.h" />
+    <ClInclude Include="..\..\source\gui\guiCanvas_ScriptBinding.h" />
     <ClInclude Include="..\..\source\gui\guiColorPicker.h" />
     <ClInclude Include="..\..\source\gui\guiConsole.h" />
     <ClInclude Include="..\..\source\gui\guiConsoleEditCtrl.h" />
@@ -857,6 +860,7 @@
     <ClInclude Include="..\..\source\gui\language\lang.h" />
     <ClInclude Include="..\..\source\gui\messageVector.h" />
     <ClInclude Include="..\..\source\input\actionMap.h" />
+    <ClInclude Include="..\..\source\input\actionMap_ScriptBinding.h" />
     <ClInclude Include="..\..\source\io\bitStream.h" />
     <ClInclude Include="..\..\source\io\bufferStream.h" />
     <ClInclude Include="..\..\source\io\fileio.h" />
@@ -1004,10 +1008,12 @@
     <ClInclude Include="..\..\source\platform\platformNetwork.h" />
     <ClInclude Include="..\..\source\platform\platformSemaphore.h" />
     <ClInclude Include="..\..\source\platform\platformString.h" />
+    <ClInclude Include="..\..\source\platform\platformString_ScriptBinding.h" />
     <ClInclude Include="..\..\source\platform\platformTimeManager.h" />
     <ClInclude Include="..\..\source\platform\platformTLS.h" />
     <ClInclude Include="..\..\source\platform\platformVFS.h" />
     <ClInclude Include="..\..\source\platform\platformVideo.h" />
+    <ClInclude Include="..\..\source\platform\platformVideo_ScriptBinding.h" />
     <ClInclude Include="..\..\source\platform\platform_ScriptBinding.h" />
     <ClInclude Include="..\..\source\platform\Tickable.h" />
     <ClInclude Include="..\..\source\platform\types.codewarrior.h" />
@@ -1065,6 +1071,7 @@
     <ClInclude Include="..\..\source\string\stringStack.h" />
     <ClInclude Include="..\..\source\string\stringTable.h" />
     <ClInclude Include="..\..\source\string\stringUnit.h" />
+    <ClInclude Include="..\..\source\string\stringUnit_ScriptBinding.h" />
     <ClInclude Include="..\..\source\string\unicode.h" />
     <ClInclude Include="..\..\source\gui\buttons\guiBitmapButtonCtrl.h" />
     <ClInclude Include="..\..\source\gui\buttons\guiButtonBaseCtrl.h" />

+ 30 - 9
engine/compilers/VisualStudio 2012/Torque 2D.vcxproj.filters

@@ -204,9 +204,6 @@
     <ClCompile Include="..\..\source\audio\audioDataBlock.cc">
       <Filter>audio</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\audio\audioFunctions.cc">
-      <Filter>audio</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\audio\audioStreamSourceFactory.cc">
       <Filter>audio</Filter>
     </ClCompile>
@@ -285,9 +282,6 @@
     <ClCompile Include="..\..\source\math\mBox.cc">
       <Filter>math</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\math\mConsoleFunctions.cc">
-      <Filter>math</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\math\mMath_C.cc">
       <Filter>math</Filter>
     </ClCompile>
@@ -1014,9 +1008,6 @@
     <ClCompile Include="..\..\source\network\tcpObject.cc">
       <Filter>network</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\io\fileSystemFunctions.cpp">
-      <Filter>io</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\string\stringBuffer.cc">
       <Filter>string</Filter>
     </ClCompile>
@@ -1332,6 +1323,18 @@
     <ClCompile Include="..\..\source\gui\containers\guiGridCtrl.cc">
       <Filter>gui\containers</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\source\console\metaScripting_ScriptBinding.cc">
+      <Filter>console</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\audio\audio_ScriptBinding.cc">
+      <Filter>audio</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\io\fileSystem_ScriptBinding.cc">
+      <Filter>io</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\math\math_ScriptBinding.cc">
+      <Filter>math</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\source\audio\audio.h">
@@ -2760,6 +2763,24 @@
     <ClInclude Include="..\..\source\sim\simBase_ScriptBinding.h">
       <Filter>sim</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\source\input\actionMap_ScriptBinding.h">
+      <Filter>input</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\gui\guiCanvas_ScriptBinding.h">
+      <Filter>gui</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platform\platformString_ScriptBinding.h">
+      <Filter>platform</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\string\stringUnit_ScriptBinding.h">
+      <Filter>string</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\console\output_ScriptBinding.h">
+      <Filter>console</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platform\platformVideo_ScriptBinding.h">
+      <Filter>platform</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\..\source\math\mMath_ASM.asm">

BIN
engine/source/2d/assets/AnimationAsset_ScriptBinding.h


BIN
engine/source/2d/assets/ImageAsset_ScriptBinding.h


BIN
engine/source/2d/assets/ParticleAssetEmitter_ScriptBinding.h


BIN
engine/source/2d/assets/ParticleAsset_ScriptBinding.h


BIN
engine/source/2d/controllers/AmbientForceController_ScriptBinding.h


BIN
engine/source/2d/controllers/BuoyancyController_ScriptBinding.h


BIN
engine/source/2d/controllers/PointForceController_ScriptBinding.h


BIN
engine/source/2d/controllers/core/PickingSceneController_ScriptBinding.h


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


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


+ 3 - 0
engine/source/2d/experimental/composites/WaveComposite_ScriptBinding.h

@@ -20,3 +20,6 @@
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 
+ConsoleMethodGroupBeginWithDocs(WaveComposite, SceneObject)
+
+ConsoleMethodGroupEndWithDocs(WaveComposite)

BIN
engine/source/2d/gui/SceneWindow_ScriptBinding.h


BIN
engine/source/2d/gui/guiImageButtonCtrl_ScriptBindings.h


BIN
engine/source/2d/gui/guiSpriteCtrl_ScriptBindings.h


BIN
engine/source/2d/scene/Scene_ScriptBinding.h


BIN
engine/source/2d/sceneobject/CompositeSprite_ScriptBinding.h


BIN
engine/source/2d/sceneobject/ImageFont_ScriptBinding.h


BIN
engine/source/2d/sceneobject/ParticlePlayer_ScriptBinding.h


BIN
engine/source/2d/sceneobject/SceneObjectSet_ScriptBinding.h


BIN
engine/source/2d/sceneobject/SceneObject_ScriptBinding.h


BIN
engine/source/2d/sceneobject/Scroller_ScriptBinding.h


BIN
engine/source/2d/sceneobject/ShapeVector_ScriptBinding.h


BIN
engine/source/2d/sceneobject/Sprite_ScriptBinding.h


BIN
engine/source/assets/assetBase_ScriptBinding.h


BIN
engine/source/assets/assetManager_ScriptBinding.h


BIN
engine/source/assets/assetTagsManifest_ScriptBinding.h


+ 0 - 745
engine/source/audio/audioFunctions.cc

@@ -1,745 +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.
-//-----------------------------------------------------------------------------
-
-#ifndef _ASSET_MANAGER_H_
-#include "assets/assetManager.h"
-#endif
-
-#include "platform/platform.h"
-
-#ifndef _PLATFORMAUDIO_H_
-#include "platform/platformAudio.h"
-#endif
-
-#ifndef _SIMBASE_H_
-#include "sim/simBase.h"
-#endif
-
-#ifndef _AUDIODATABLOCK_H_
-#include "audio/audioDataBlock.h"
-#endif
-
-#ifndef _AUDIO_ASSET_H_
-#include "audio/audioAsset.h"
-#endif
-
-#ifdef TORQUE_OS_IOS
-#include "platformiOS/iOSStreamSource.h"
-#endif
-
-
-extern ALuint alxGetWaveLen(ALuint buffer);
-
-extern F32 mAudioChannelVolumes[Audio::AudioVolumeChannels];
-
-//--------------------------------------------------------------------------
-// Expose all al get/set methods...
-//--------------------------------------------------------------------------
-enum AL_GetSetBits{
-   Source      =  BIT(0),
-   Listener    =  BIT(1),
-   Context     =  BIT(2),
-   Environment =  BIT(3),
-   Get         =  BIT(4),
-   Set         =  BIT(5),
-   Int         =  BIT(6),
-   Float       =  BIT(7),
-   Float3      =  BIT(8),
-   Float6      =  BIT(9)
-};
-
-static ALenum getEnum(const char * name, U32 flags)
-{
-   AssertFatal(name, "Audio getEnum: bad param");
-
-   static struct {
-      const char *   mName;
-      ALenum   mAlenum;
-      U32      mFlags;
-   } table[] = {
-      //-----------------------------------------------------------------------------------------------------------------
-      // "name"                           ENUM                             Flags
-      //-----------------------------------------------------------------------------------------------------------------
-      { "AL_GAIN",                        AL_GAIN,                         (Source|Listener|Get|Set|Float) },
-      { "AL_GAIN_LINEAR",                 AL_GAIN_LINEAR,                  (Source|Listener|Get|Set|Float) },
-      { "AL_PITCH",                       AL_PITCH,                        (Source|Get|Set|Float) },
-      { "AL_REFERENCE_DISTANCE",          AL_REFERENCE_DISTANCE,           (Source|Get|Set|Float) },
-      { "AL_MAX_DISTANCE",                AL_MAX_DISTANCE,                 (Source|Get|Set|Float) },
-      { "AL_CONE_OUTER_GAIN",             AL_CONE_OUTER_GAIN,              (Source|Get|Set|Float) },
-      { "AL_POSITION",                    AL_POSITION,                     (Source|Listener|Get|Set|Float3) },
-      { "AL_DIRECTION",                   AL_DIRECTION,                    (Source|Get|Set|Float3) },
-      { "AL_VELOCITY",                    AL_VELOCITY,                     (Source|Listener|Get|Set|Float3) },
-      { "AL_ORIENTATION",                 AL_ORIENTATION,                  (Listener|Set|Float6) },
-      { "AL_CONE_INNER_ANGLE",            AL_CONE_INNER_ANGLE,             (Source|Get|Set|Int) },
-      { "AL_CONE_OUTER_ANGLE",            AL_CONE_OUTER_ANGLE,             (Source|Get|Set|Int) },
-      { "AL_LOOPING",                     AL_LOOPING,                      (Source|Get|Set|Int) },
-      //{ "AL_STREAMING",                   AL_STREAMING,                    (Source|Get|Set|Int) },
-      //{ "AL_BUFFER",                      AL_BUFFER,                       (Source|Get|Set|Int) },
-
-      { "AL_VENDOR",                      AL_VENDOR,                       (Context|Get) },
-      { "AL_VERSION",                     AL_VERSION,                      (Context|Get) },
-      { "AL_RENDERER",                    AL_RENDERER,                     (Context|Get) },
-      { "AL_EXTENSIONS",                  AL_EXTENSIONS,                   (Context|Get) },
-
-      /*
-      // environment
-      { "AL_ENV_ROOM_IASIG",                       AL_ENV_ROOM_IASIG,                        (Environment|Get|Set|Int) },
-      { "AL_ENV_ROOM_HIGH_FREQUENCY_IASIG",        AL_ENV_ROOM_HIGH_FREQUENCY_IASIG,         (Environment|Get|Set|Int) },
-      { "AL_ENV_REFLECTIONS_IASIG",                AL_ENV_REFLECTIONS_IASIG,                 (Environment|Get|Set|Int) },
-      { "AL_ENV_REVERB_IASIG",                     AL_ENV_REVERB_IASIG,                      (Environment|Get|Set|Int) },
-      { "AL_ENV_ROOM_ROLLOFF_FACTOR_IASIG",        AL_ENV_ROOM_ROLLOFF_FACTOR_IASIG,         (Environment|Get|Set|Float) },
-      { "AL_ENV_DECAY_TIME_IASIG",                 AL_ENV_DECAY_TIME_IASIG,                  (Environment|Get|Set|Float) },
-      { "AL_ENV_DECAY_HIGH_FREQUENCY_RATIO_IASIG", AL_ENV_DECAY_HIGH_FREQUENCY_RATIO_IASIG,  (Environment|Get|Set|Float) },
-      { "AL_ENV_REFLECTIONS_DELAY_IASIG",          AL_ENV_REFLECTIONS_DELAY_IASIG,           (Environment|Get|Set|Float) },
-      { "AL_ENV_REVERB_DELAY_IASIG",               AL_ENV_REVERB_DELAY_IASIG,                (Environment|Get|Set|Float) },
-      { "AL_ENV_DIFFUSION_IASIG",                  AL_ENV_DIFFUSION_IASIG,                   (Environment|Get|Set|Float) },
-      { "AL_ENV_DENSITY_IASIG",                    AL_ENV_DENSITY_IASIG,                     (Environment|Get|Set|Float) },
-      { "AL_ENV_HIGH_FREQUENCY_REFERENCE_IASIG",   AL_ENV_HIGH_FREQUENCY_REFERENCE_IASIG,    (Environment|Get|Set|Float) },
-
-      { "AL_ENV_ROOM_VOLUME_EXT",                  AL_ENV_ROOM_VOLUME_EXT,                   (Environment|Get|Set|Int) },
-      { "AL_ENV_FLAGS_EXT",                        AL_ENV_FLAGS_EXT,                         (Environment|Get|Set|Int) },
-      { "AL_ENV_EFFECT_VOLUME_EXT",                AL_ENV_EFFECT_VOLUME_EXT,                 (Environment|Get|Set|Float) },
-      { "AL_ENV_DAMPING_EXT",                      AL_ENV_DAMPING_EXT,                       (Environment|Get|Set|Float) },
-      { "AL_ENV_ENVIRONMENT_SIZE_EXT",             AL_ENV_ENVIRONMENT_SIZE_EXT,              (Environment|Get|Set|Float) },
-
-      // sample environment
-      { "AL_ENV_SAMPLE_DIRECT_EXT",                AL_ENV_SAMPLE_DIRECT_EXT,                 (Source|Get|Set|Int) },
-      { "AL_ENV_SAMPLE_DIRECT_HF_EXT",             AL_ENV_SAMPLE_DIRECT_HF_EXT,              (Source|Get|Set|Int) },
-      { "AL_ENV_SAMPLE_ROOM_EXT",                  AL_ENV_SAMPLE_ROOM_EXT,                   (Source|Get|Set|Int) },
-      { "AL_ENV_SAMPLE_ROOM_HF_EXT",               AL_ENV_SAMPLE_ROOM_HF_EXT,                (Source|Get|Set|Int) },
-      { "AL_ENV_SAMPLE_OUTSIDE_VOLUME_HF_EXT",     AL_ENV_SAMPLE_OUTSIDE_VOLUME_HF_EXT,      (Source|Get|Set|Int) },
-      { "AL_ENV_SAMPLE_FLAGS_EXT",                 AL_ENV_SAMPLE_FLAGS_EXT,                  (Source|Get|Set|Int) },
-
-      { "AL_ENV_SAMPLE_REVERB_MIX_EXT",            AL_ENV_SAMPLE_REVERB_MIX_EXT,             (Source|Get|Set|Float) },
-      { "AL_ENV_SAMPLE_OBSTRUCTION_EXT",           AL_ENV_SAMPLE_OBSTRUCTION_EXT,            (Source|Get|Set|Float) },
-      { "AL_ENV_SAMPLE_OBSTRUCTION_LF_RATIO_EXT",  AL_ENV_SAMPLE_OBSTRUCTION_LF_RATIO_EXT,   (Source|Get|Set|Float) },
-      { "AL_ENV_SAMPLE_OCCLUSION_EXT",             AL_ENV_SAMPLE_OCCLUSION_EXT,              (Source|Get|Set|Float) },
-      { "AL_ENV_SAMPLE_OCCLUSION_LF_RATIO_EXT",    AL_ENV_SAMPLE_OCCLUSION_LF_RATIO_EXT,     (Source|Get|Set|Float) },
-      { "AL_ENV_SAMPLE_OCCLUSION_ROOM_RATIO_EXT",  AL_ENV_SAMPLE_OCCLUSION_ROOM_RATIO_EXT,   (Source|Get|Set|Float) },
-      { "AL_ENV_SAMPLE_ROOM_ROLLOFF_EXT",          AL_ENV_SAMPLE_ROOM_ROLLOFF_EXT,           (Source|Get|Set|Float) },
-      { "AL_ENV_SAMPLE_AIR_ABSORPTION_EXT",        AL_ENV_SAMPLE_AIR_ABSORPTION_EXT,         (Source|Get|Set|Float) },
-   */
-   };
-   for(U32 i = 0; i < (sizeof(table) / sizeof(table[0])); i++)
-   {
-      if((table[i].mFlags & flags) != flags)
-         continue;
-
-      if(dStricmp(table[i].mName, name) == 0)
-         return(table[i].mAlenum);
-   }
-
-   return(AL_INVALID);
-}
-
-
-//-----------------------------------------------
-ConsoleFunctionGroupBegin(Audio, "Functions dealing with the OpenAL audio layer.\n\n"
-                          "@see www.OpenAL.org for what these functions do. Variances from posted"
-                          "     behaviour is described below.");
-
-ConsoleFunction(OpenALInitDriver, bool, 1, 1, "() Use the OpenALInitDriver function to initialize the OpenAL driver.\n"
-                                                                "This must be done before all other OpenAL operations.\n"
-                                                                "@return Returns true on successful initialization, false otherwise.\n"
-                                                                "@sa OpenALShutdownDriver")
-{
-   if (Audio::OpenALInit())
-   {
-      static bool registered = false;
-      if (!registered) {
-         ResourceManager->registerExtension(".wav", AudioBuffer::construct);
-      }
-      registered = true;
-      return true;
-   }
-   return false;
-}
-
-//-----------------------------------------------
-ConsoleFunction(OpenALShutdownDriver, void, 1, 1, "() Use the OpenALShutdownDriver function to stop/shut down the OpenAL driver.\n"
-                                                                "After this is called, you must restart the driver with OpenALInitDriver to execute any new sound operations.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa OpenALInitDriver")
-{
-   Audio::OpenALShutdown();
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(OpenALRegisterExtensions, void, 1, 1, "OpenALRegisterExtensions()"
-                "@note Currently does nothing (possibly deprecated)")
-{
-}
-
-//-----------------------------------------------
-ConsoleFunction(alGetString, const char *, 2, 2, "( ALEnum ) Use the alGetString function to get the string equivalent to the specified OpenAL enumerated value.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@return Returns a string corresponding to the passed ALEnum")
-{
-   ALenum e = getEnum(argv[1], (Context|Get));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "alGetString: invalid enum name '%s'", argv[1]);
-      return "";
-   }
-
-   return (const char*)alGetString(e);
-}
-
-
-//--------------------------------------------------------------------------
-// Soundfile
-//--------------------------------------------------------------------------
-ConsoleFunction(alxGetAudioLength, S32, 2, 2,   "( audio-assetId ) Use the alxGetAudioLength function to get the play-length of a specified resource sound file in milliseconds.\n"
-                                            "@param audio-assetId  The asset Id that specifies the audio file to check.\n"
-                                            "@return Returns play-length of the audio file specified by audio-assetId in milliseconds.\n"
-                                            "@sa alxGetStreamDuration, alxGetStreamPosition")
-{
-    // Fetch asset Id.
-    const char* pAssetId = argv[1];
-
-    // Acquire audio asset.
-    AudioAsset* pAudioAsset = AssetDatabase.acquireAsset<AudioAsset>( pAssetId );
-
-    // Did we get the audio asset?
-    if ( pAudioAsset == NULL )
-    {
-        // No, so warn.
-        Con::warnf( "alxGetAudioLength() - Could not find audio asset '%s'.", pAssetId );
-        return 0;
-    }
-
-    Resource<AudioBuffer> buffer = AudioBuffer::find( pAudioAsset->getAudioFile() );
-
-    if ( !buffer.isNull() )
-    {
-        ALuint alBuffer = buffer->getALBuffer();
-        return alxGetWaveLen( alBuffer );
-    }
-
-    // Warn.
-    Con::warnf( "alxGetAudioLength() - Could not find audio file '%s' for asset '%s'.", pAudioAsset->getAudioFile(), pAssetId );
-
-    return 0;
-}
-
-//--------------------------------------------------------------------------
-// Source
-//--------------------------------------------------------------------------
-ConsoleFunction(alxCreateSource, S32, 2, 2, "(audio-assetId) - Create a source from the specified asset Id.\n"
-                                            "@param audio-assetId The asset Id to create the source from.\n"
-                                            "@return The handle of the created source or 0 on error." )
-{
-    // Fetch asset Id.
-    const char* pAssetId = argv[1];
-
-    // Acquire audio asset.
-    AudioAsset* pAudioAsset = AssetDatabase.acquireAsset<AudioAsset>( pAssetId );
-
-    // Did we get the audio asset?
-    if ( pAudioAsset == NULL )
-    {
-        // No, so warn.
-        Con::warnf( "alxCreateSource() - Could not find audio asset '%s'.", pAssetId );
-        return NULL_AUDIOHANDLE;
-    }
-
-    // Fetch audio handle.
-    AUDIOHANDLE handle = alxCreateSource( pAudioAsset );
-
-    // Release asset.
-    AssetDatabase.releaseAsset( pAssetId );
-
-    return handle;
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alxSourcef, void, 4, 4, "( handle , ALEnum , value ) Use the alxSource* function to set a source parameter(s) as specified by the OpenAL enumerated type ALEnum.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@param value An ALEnum type specific value corresponding to the new value for this enumerated parameters.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa alxGetSource*, al*Listener*")
-{
-   ALenum e = getEnum(argv[2], (Source|Set|Float));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "cAudio_alxSourcef: invalid enum name '%s'", argv[2]);
-      return;
-   }
-
-   alxSourcef(dAtoi(argv[1]), e, dAtof(argv[3]));
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alxSource3f, void, 3, 6, "( handle , ALEnum , x , y , z ) Use the alxSource* function to set a source parameter(s) as specified by the OpenAL enumerated type ALEnum.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@param x,y,z XYZ floating-point coordinates.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa alxGetSource*, al*Listener*")
-{
-   ALenum e = getEnum(argv[2], (Source|Set|Float3));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "cAudio_alxSource3f: invalid enum name '%s'", argv[2]);
-      return;
-   }
-
-   if((argc != 4 && argc != 6))
-   {
-      Con::errorf(ConsoleLogEntry::General, "cAudio_alxSource3f: wrong number of args");
-      return;
-   }
-
-   Point3F pos;
-   if(argc == 4)
-      dSscanf(argv[3], "%g %g %g", &pos.x, &pos.y, &pos.z);
-   else
-   {
-      pos.x = dAtof(argv[3]);
-      pos.y = dAtof(argv[4]);
-      pos.z = dAtof(argv[5]);
-   }
-
-   alxSource3f(dAtoi(argv[1]), e, pos.x, pos.y, pos.z);
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alxSourcei, void, 4, 4, "( handle , ALEnum , value ) Use the alxSource* function to set a source parameter(s) as specified by the OpenAL enumerated type ALEnum.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@param value An ALEnum type specific value corresponding to the new value for this enumerated parameters.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa alxGetSource*, al*Listener*")
-{
-   ALenum e = getEnum(argv[2], (Source|Set|Int));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "cAudio_alxSourcei: invalid enum name '%s'", argv[2]);
-      return;
-   }
-
-   alxSourcei(dAtoi(argv[1]), e, dAtoi(argv[3]));
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alxGetSourcef, F32, 3, 3, "( handle , ALEnum ) Use the alxGetSource* function to get the current value of a source parameter, as specified by ALEnum.\n"
-                                                                "Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of alxGetSource*.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@return Returns current value of parameter specified by ALEnum for source identified by handle.\n"
-                                                                "@sa alxSource*, al*GetListener*")
-{
-   ALenum e = getEnum(argv[2], (Source|Get|Float));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "cAudio_alxGetSourcef: invalid enum name '%s'", argv[2]);
-      return(0.f);
-   }
-
-   F32 value;
-   alxGetSourcef(dAtoi(argv[1]), e, &value);
-   return(value);
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alxGetSource3f, const char *, 3, 3, "( handle , ALEnum ) Use the alxGetSource* function to get the current value of a source parameter, as specified by ALEnum.\n"
-                                                                "Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of alxGetSource*.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name.\n"
-                                                                "@return Returns current value of parameter specified by ALEnum for source identified by handle.\n"
-                                                                "@sa alxSource*, al*GetListener*")
-{
-   ALenum e = getEnum(argv[2], (Source|Get|Float));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "cAudio_alxGetSource3f: invalid enum name '%s'", argv[2]);
-      return("0 0 0");
-   }
-
-   F32 value1, value2, value3;
-   alxGetSource3f(dAtoi(argv[1]), e, &value1, &value2, &value3);
-
-   char * ret = Con::getReturnBuffer(64);
-   dSprintf(ret, 64, "%7.3f %7.3 %7.3", value1, value2, value3);
-   return(ret);
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alxGetSourcei, S32, 3, 3, "( handle , ALEnum ) Use the alxGetSource* function to get the current value of a source parameter, as specified by ALEnum.\n"
-                                                                "Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of alxGetSource*.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@return Returns current value of parameter specified by ALEnum for source identified by handle.\n"
-                                                                "@sa alxSource*, al*GetListener*")
-{
-   ALenum e = getEnum(argv[2], (Source|Get|Int));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "cAudio_alxGetSourcei: invalid enum name '%s'", argv[2]);
-      return(0);
-   }
-
-   S32 value;
-   alxGetSourcei(dAtoi(argv[1]), e, &value);
-   return(value);
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alxPlay, S32, 2, 2, "(audio-assetId) - Play the audio asset Id.\n"
-                                    "@param audio-assetId The asset Id to play.\n"
-                                    "@return The handle to the playing audio asset Id or 0 on error." )
-{
-    // Fetch asset Id.
-    const char* pAssetId = argv[1];
-
-    // Acquire audio asset.
-    AudioAsset* pAudioAsset = AssetDatabase.acquireAsset<AudioAsset>( pAssetId );
-
-    // Did we get the audio asset?
-    if ( pAudioAsset == NULL )
-    {
-        // No, so warn.
-        Con::warnf( "alxPlay() - Could not find audio asset '%s'.", pAssetId );
-        return NULL_AUDIOHANDLE;
-    }
-
-    // Fetch audio handle.
-    AUDIOHANDLE handle = alxPlay( pAudioAsset );
-
-    // Release asset.
-    AssetDatabase.releaseAsset( pAssetId );
-
-    return handle;
-}
-
-ConsoleFunction(alxPause, bool, 2, 2, "( handle ) Use the alxPause function to pause a currently playing sound as specified by handle.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa alxIsPlaying, alxPlay, alxStopAll")
-{
-   AUDIOHANDLE handle = dAtoi(argv[1]);
-   if(handle == NULL_AUDIOHANDLE)
-      return false;
-   return alxPause( handle );
-}
-
-ConsoleFunction(alxUnpause, void, 2, 2, "( handle ) Use the alxUnpause function to resume playing a currently paused sound as specified by handle.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa alxIsPlaying, alxPlay, alxStopAll")
-{
-   AUDIOHANDLE handle = dAtoi(argv[1]);
-   if(handle == NULL_AUDIOHANDLE)
-      return;
-   alxUnPause( handle );
-}
-
-//-----------------------------------------------
-ConsoleFunction(alxStop, void, 2, 2, "( handle ) Use the alxStop function to stop a currently playing sound as specified by handle.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa alxIsPlaying, alxPlay, alxStopAll")
-{
-   AUDIOHANDLE handle = dAtoi(argv[1]);
-   if(handle == NULL_AUDIOHANDLE)
-      return;
-   alxStop(handle);
-}
-
-//-----------------------------------------------
-ConsoleFunction(alxStopAll, void, 1, 1, "() Use the alxStopAll function to stop all currently playing sounds associated with registered handles.\n"
-                                                                "@return No return.\n"
-                                                                "@sa alxIsPlaying, alxPlay, alxStop")
-{
-   alxStopAll();
-}
-
-//-----------------------------------------------
-ConsoleFunction(alxIsPlaying, bool, 2, 5, "( handle ) Use the alxIsPlaying function to determine if the sound associated with a previously set-up sound handle is playing or not.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@return Returns 1 if specified handle is being played, 0 otherwise.\n"
-                                                                "@sa alxPlay, alxStop, alxStopAll")
-{
-   AUDIOHANDLE handle = dAtoi(argv[1]);
-   if(handle == NULL_AUDIOHANDLE)
-      return false;
-   return alxIsPlaying(handle);
-}
-
-
-//--------------------------------------------------------------------------
-// Listener
-//--------------------------------------------------------------------------
-ConsoleFunction(alxListenerf, void, 3, 3, "( AlEnum , value ) Use the al*Listener* function to set a listener parameter(s) as specified by the OpenAL enumerated type ALEnum.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@param value An ALEnum type specific value corresponding to the new value for this enumerated parameters.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa al*GetListener*, alxSource*")
-{
-   ALenum e = getEnum(argv[1], (Listener|Set|Float));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "alxListenerf: invalid enum name '%s'", argv[1]);
-      return;
-   }
-
-   alxListenerf(e, dAtof(argv[2]));
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alListener3f, void, 3, 5, "( ALEnum , x , y , z) Use the al*Listener* function to set a listener parameter(s) as specified by the OpenAL enumerated type ALEnum.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@param x,y,z XYZ floating-point coordinates.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa al*GetListener*, alxSource*")
-{
-   ALenum e = getEnum(argv[1], (Listener|Set|Float3));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "alListener3f: invalid enum name '%s'", argv[1]);
-      return;
-   }
-
-   if(argc != 3 && argc != 5)
-   {
-      Con::errorf(ConsoleLogEntry::General, "alListener3f: wrong number of arguments");
-      return;
-   }
-
-   Point3F pos;
-   if(argc == 3)
-      dSscanf(argv[2], "%g %g %g", &pos.x, &pos.y, &pos.z);
-   else
-   {
-      pos.x = dAtof(argv[2]);
-      pos.y = dAtof(argv[3]);
-      pos.z = dAtof(argv[4]);
-   }
-
-   alListener3f(e, pos.x, pos.y, pos.z);
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alxGetListenerf, F32, 2, 2, "( ALEnum ) Use the al*GetListener* function to get the current value of a listener parameter, as specified by ALEnum.\n"
-                                                                "Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of al*GetListener*.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@return Returns a float (alxGetListenerf), a vector of three floats (alGetListener3f), or an integer value respectively (alGetListeneri).\n"
-                                                                "@sa alxGetSource*")
-{
-   ALenum e = getEnum(argv[1], (Source|Get|Float));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "alxGetListenerf: invalid enum name '%s'", argv[1]);
-      return(0.f);
-   }
-
-   F32 value;
-   alxGetListenerf(e, &value);
-   return(value);
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alGetListener3f, const char *, 2, 2, "( ALEnum ) Use the al*GetListener* function to get the current value of a listener parameter, as specified by ALEnum.\n"
-                                                                "Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of al*GetListener*.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@return Returns a float (alxGetListenerf), a vector of three floats (alGetListener3f), or an integer value respectively (alGetListeneri).\n"
-                                                                "@sa alxGetSource*")
-{
-   ALenum e = getEnum(argv[2], (Source|Get|Float));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "alGetListener3f: invalid enum name '%s'", argv[1]);
-      return("0 0 0");
-   }
-
-   F32 value1, value2, value3;
-   alGetListener3f(e, &value1, &value2, &value3);
-
-   char * ret = Con::getReturnBuffer(64);
-   dSprintf(ret, 64, "%7.3f %7.3 %7.3", value1, value2, value3);
-   return(ret);
-}
-
-
-//-----------------------------------------------
-ConsoleFunction(alGetListeneri, S32, 2, 2, "( ALEnum ) Use the al*GetListener* function to get the current value of a listener parameter, as specified by ALEnum.\n"
-                                                                "Depending on the ALEnum you need to acquire, be sure to use the correct version (i.e. correct return type) of al*GetListener*.\n"
-                                                                "@param ALEnum A string containing an OpenAL enumerated type name. See (above) table of ALEnum values for legal values.\n"
-                                                                "@return Returns a float (alxGetListenerf), a vector of three floats (alGetListener3f), or an integer value respectively (alGetListeneri).\n"
-                                                                "@sa alxGetSource*")
-{
-   ALenum e = getEnum(argv[1], (Source|Get|Int));
-   if(e == AL_INVALID)
-   {
-      Con::errorf(ConsoleLogEntry::General, "alGetListeneri: invalid enum name '%s'", argv[1]);
-      return(0);
-   }
-
-   S32 value;
-   alGetListeneri(e, &value);
-   return(value);
-}
-
-
-//--------------------------------------------------------------------------
-// Channel Volumes
-//--------------------------------------------------------------------------
-ConsoleFunction(alxGetChannelVolume, F32, 2, 2, "( channelID ) Use the alxGetChannelVolume function to get the volume setting for a specified channel.\n"
-                                                                "@param channelID An integer value, equal to or greater than 0, corresponding to a valid audio channel.\n"
-                                                                "@return Returns volume [ 0.0, 1.0 ] for channel specified by channelID.\n"
-                                                                "@sa alxSetChannelVolume")
-{
-   U32 channel = dAtoi(argv[1]);
-   if(channel >= Audio::AudioVolumeChannels)
-   {
-      Con::errorf(ConsoleLogEntry::General, "alxGetChannelVolume: invalid channel '%d'", dAtoi(argv[1]));
-      return(0.f);
-   }
-
-   return(mAudioChannelVolumes[channel]);
-}
-
-//-----------------------------------------------
-ConsoleFunction(alxSetChannelVolume, bool, 3, 3, "( channelD , volume ) Use the alxSetChannelVolume function to set a volume [ 0.0, 1.0 ] for the channel specified by channelID.\n"
-                                                                "@param channelID An integer value, equal to or greater than 0, corresponding to a valid audio channel.\n"
-                                                                "@param volume A value between 0.0 and 1.0 specifying the new volume for the specified channel.\n"
-                                                                "@return Returns true on success and false on failure.\n"
-                                                                "@sa alxGetChannelVolume")
-{
-   U32 channel = dAtoi(argv[1]);
-   F32 volume = mClampF(dAtof(argv[2]), 0.f, 1.f);
-
-   if(channel >= Audio::AudioVolumeChannels)
-   {
-      Con::errorf(ConsoleLogEntry::General, "alxSetChannelVolume: channel '%d' out of range [0, %d]", channel, Audio::AudioVolumeChannels);
-      return false;
-   }
-
-   mAudioChannelVolumes[channel] = volume;
-   alxUpdateTypeGain(channel);
-   return true;
-}
-
-//-----------------------------------------------
-ConsoleFunction(alxGetStreamPosition, F32, 2, 2, "( handle ) Use the alxGetStreamPosition function to get the current play position for a playing sound. Note, this value is a percentage equivalent to the percent of the sound that as already played.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@return Returns -1 for invalid handle, and 0.0 to 1.0 for valid handle indicating what percentage of the sound file has been played.\n"
-                                                                "@sa alxGetStreamDuration")
-{
-   AUDIOHANDLE handle = dAtoi(argv[1]);
-
-   if(handle == NULL_AUDIOHANDLE)
-      return -1;
-
-   return alxGetStreamPosition( handle );
-}
-
-//-----------------------------------------------
-ConsoleFunction(alxGetStreamDuration, F32, 2, 2, "( handle ) Use the alxGetStreamDuration function to determine the length of a previously set up sound in seconds.\n"
-                                                                "@param handle The ID (a non-negative integer) corresponding to a previously set up sound source.\n"
-                                                                "@return Returns -1 for invalid handle, and 0.0 to N.M for valid handle indicating length of scheduled sound in seconds.\n"
-                                                                "@sa alxGetStreamPosition")
-{
-   AUDIOHANDLE handle = dAtoi(argv[1]);
-
-   if(handle == NULL_AUDIOHANDLE)
-      return -1;
-
-   return alxGetStreamDuration( handle );
-}
-
-#ifdef TORQUE_OS_IOS
-ConsoleFunction(startiOSAudioStream, S32, 2, 2,  "(audio-assetId) - Play the audio asset Id.\n"
-                                                    "@param audio-assetId The asset Id to play.  This *must* be an MP3 to work correctly.\n"
-                                                    "@return The playing stream Id." )
-{
-    // Fetch asset Id.
-    const char* pAssetId = argv[1];
-
-    // Acquire audio asset.
-    AudioAsset* pAudioAsset = AssetDatabase.acquireAsset<AudioAsset>( pAssetId );
-
-    // Did we get the audio asset?
-    if ( pAudioAsset == NULL )
-    {
-        // No, so warn.
-        Con::warnf( "startiOSAudioStream() - Could not find audio asset '%s'.", pAssetId );
-        return 0;
-    }
-
-    // Fetch the audio filename,
-    char fileName[1024];
-    Con::expandPath( fileName, sizeof(fileName), pAudioAsset->getAudioFile() );
-    iOSStreamSource* pStream = new iOSStreamSource( fileName );
-    pStream->start( pAudioAsset->getLooping() );
-
-    // Release asset.
-    AssetDatabase.releaseAsset( pAssetId );
-
-    return pStream->getId();
-}
-
-//-----------------------------------------------
-ConsoleFunction(stopiOSAudioStream, void, 2, 2, "( streamId ) - Stops playing the audio stream Id." )
-{
-    SimObjectId streamId = dAtoi( argv[1] );
-    iOSStreamSource* pStream = Sim::findObject<iOSStreamSource>( streamId );
-
-    if( pStream != NULL )
-    {
-        if( pStream->isPlaying() )
-        {
-            pStream->stop();
-        }
-        pStream->deleteObject();
-    }
-}
-
-ConsoleFunction(setiOSAudioStreamVolume, void, 3, 3, "setiPhoneAudioVolume( Stream ID, float volume )" )
-{
-    SimObjectId streamId = dAtoi( argv[1] );
-    iOSStreamSource* pStream = Sim::findObject<iOSStreamSource>( streamId );
-    
-    F32 volume = dAtof( argv[2] );
-    
-    if( pStream ) {
-        if( pStream->isPlaying() ) {
-            pStream->setVolume(volume);
-        }
-    }
-}
-#endif
-
-
-ConsoleFunctionGroupEnd(Audio);

BIN
engine/source/audio/audio_ScriptBinding.cc


BIN
engine/source/collection/nameTags_ScriptBinding.h


BIN
engine/source/component/behaviors/behaviorComponent_ScriptBinding.h


BIN
engine/source/component/behaviors/behaviorInstance_ScriptBinding.h


BIN
engine/source/component/behaviors/behaviorTemplate_ScriptBinding.h


+ 14 - 117
engine/source/console/console.cc

@@ -19,6 +19,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
+
 #include "platform/platform.h"
 #include "platform/platformTLS.h"
 #include "platform/threads/thread.h"
@@ -38,6 +39,9 @@
 #include "memory/safeDelete.h"
 #include <stdarg.h>
 
+#include "output_ScriptBinding.h"
+#include "expando_ScriptBinding.h"
+
 #ifndef _HASHTABLE_H
 #include "collection/hashTable.h"
 #endif
@@ -221,34 +225,6 @@ StringTableEntry gCurrentFile;
 StringTableEntry gCurrentRoot;
 /// @}
 
-ConsoleFunctionGroupBegin( Clipboard, "Miscellaneous functions to control the clipboard and clear the console.");
-
-ConsoleFunction( cls, void, 1, 1, "() Use the cls function to clear the console output.\n"
-                                                                "@return No return value")
-{
-   if(consoleLogLocked)
-      return;
-   consoleLogChunker.freeBlocks();
-   consoleLog.setSize(0);
-};
-
-ConsoleFunction( getClipboard, const char*, 1, 1, "() Use the getClipboard function to get the contents of the GUI clipboard.\n"
-                                                                "@return Returns a string equal to the current contents of the copy the clipboard, or a NULL strain if the copy clipboard is empty.\n"
-                                                                "@sa setClipboard")
-{
-    return Platform::getClipboard();
-};
-
-ConsoleFunction( setClipboard, bool, 2, 2, "( string ) Use the setClipboard function to Set value on clipboard to string.\n"
-                                                                "@param string The new value to place in the GUI clipboard.\n"
-                                                                "@return Returns true if successful, false otherwise.\n"
-                                                                "@sa getClipoard")
-{
-    return Platform::setClipboard(argv[1]);
-};
-
-ConsoleFunctionGroupEnd( Clipboard );
-
 void init()
 {
    AssertFatal(active == false, "Con::init should only be called once.");
@@ -511,6 +487,16 @@ static void log(const char *string)
 
 //------------------------------------------------------------------------------
 
+void cls( void )
+{
+   if(consoleLogLocked)
+      return;
+   consoleLogChunker.freeBlocks();
+   consoleLog.setSize(0);
+};
+
+//------------------------------------------------------------------------------
+
 #if defined( _MSC_VER )  
 #include <windows.h>  
 
@@ -1713,93 +1699,4 @@ bool stripRepeatSlashes( char* pDstPath, const char* pSrcPath, S32 dstSize )
     return false;
 }
 
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(expandPath, const char*, 2, 2, "(string path) - Expands an expando or relative path into a full path.")
-{
-    char* ret = Con::getReturnBuffer( 1024 );
-    expandPath(ret, 1024, argv[1]);
-    return ret;
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(collapsePath, const char*, 2, 2, "(string path) - Collapses a path into either an expando path or a relative path.")
-{
-    char* ret = Con::getReturnBuffer( 1024 );
-    Con::collapsePath(ret, 1024, argv[1]);
-    return ret;
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(addPathExpando, void, 3, 3, "(string expando, string path) - Adds the expando to the path.  If it already exists then it is replaced.")
-{
-    addPathExpando(argv[1], argv[2]);
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(removePathExpando, void, 2, 2, "(string expando) - Removes the specified path expando.")
-{
-    removePathExpando(argv[1]);
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(isPathExpando, bool, 2, 2, "(string expando) - Checks whether the specified path expando is current set or not.")
-{
-    return isPathExpando(argv[1]);
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(getPathExpandoCount, S32, 1, 1, "() - Gets the expando path count.")
-{
-    return getPathExpandoCount();
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(getPathExpandoKey, const char*, 2, 2, "(int expandoIndex) - Gets the path expando key (the expando name) at the specified index.")
-{
-    // Fetch expando index.
-    const S32 expandoIndex = dAtoi(argv[1]);
-
-    // Is the expando index in range?
-    if ( expandoIndex < 0 || expandoIndex >= (S32)getPathExpandoCount() )
-    {
-        // No, so warn.
-        Con::warnf("getPathExpandoKey() - Expando index of '%d' is out of bounds.  Current expando count is '%d'.",
-            expandoIndex,
-            getPathExpandoCount() );
-        return StringTable->EmptyString;
-    }
-
-    // Fetch path expando key.
-    return getPathExpandoKey( expandoIndex );
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(getPathExpandoValue, const char*, 2, 2, "(int expandoIndex) - Gets the path expando value (the expando path) at the specified index.")
-{
-    // Fetch expando index.
-    const S32 expandoIndex = dAtoi(argv[1]);
-
-    // Is the expando index in range?
-    if ( expandoIndex < 0 || expandoIndex >= (S32)getPathExpandoCount() )
-    {
-        // No, so warn.
-        Con::warnf("getPathExpandoValue() - Expando index of '%d' is out of bounds.  Current expando count is '%d'.",
-            expandoIndex,
-            getPathExpandoCount() );
-        return StringTable->EmptyString;
-    }
-
-    // Fetch path expando value.
-    return getPathExpandoValue( expandoIndex );
-}
-
-
 } // end of Console namespace

+ 4 - 0
engine/source/console/console.h

@@ -513,6 +513,9 @@ namespace Con
    /// @see Con::errorf()
    void errorf(ConsoleLogEntry::Type type, const char *_format, ...);
 
+   /// clear the console log
+   void cls( void );
+
    /// Prints a separator to the console.
    inline void printSeparator( void ) { printf("--------------------------------------------------------------------------------"); }
 
@@ -825,6 +828,7 @@ public:
 // note: we would want to expand the following macro into (Doxygen) comments!
 // we can not do that with a macro.  these are here just as a reminder until completion
 #  define ConsoleMethodGroupBeginWithDocs(className, superclassName)
+#  define ConsoleMethodGroupEndWithDocs(className)
 
 #  define ConsoleMethod(className,name,returnType,minArgs,maxArgs,usage1)                                                 \
       static inline returnType c##className##name(className *, S32, const char **argv);                                   \

+ 0 - 1485
engine/source/console/consoleFunctions.cc

@@ -22,13 +22,7 @@
 
 #include "platform/platform.h"
 #include "console/console.h"
-#include "console/consoleInternal.h"
-#include "console/ast.h"
 #include "io/resource/resourceManager.h"
-#include "io/fileStream.h"
-#include "console/compiler.h"
-#include "platform/event.h"
-#include "game/gameInterface.h"
 #include "platform/platformInput.h"
 
 #if defined(TORQUE_OS_IOS) || defined(TORQUE_OS_OSX)
@@ -36,608 +30,14 @@
 #include <arpa/inet.h>
 #endif
 
-
-// Buffer for expanding script filenames.
-static char pathBuffer[1024];
-
-static U32 execDepth = 0;
-
 #ifdef TORQUE_ALLOW_JOURNALING
    static U32 journalDepth = 1;
 #endif
 
 //----------------------------------------------------------------
 
-ConsoleFunctionGroupBegin(StringFunctions, "General string manipulation functions.");
-
-ConsoleFunction(strcmp, S32, 3, 3, "( string1 , string2 ) Use the strcmp function to do a lexicographic case sensitive string comparison between string1 and string2.\n"
-                                                                "@param string1 String to be compared to string2.\n"
-                                                                "@param string2 String to be compared to string1.\n"
-                                                                "@return Returns a numeric value: <-1 (string1 is less than string2, including case), 0 (string1 is equal to string2, including case), 1 (string1 is greater than string2, including case)>.\n"
-                                                                "@sa see stricmp, strstr")
-{
-   TORQUE_UNUSED( argc );
-   return dStrcmp(argv[1], argv[2]);
-}
-
-ConsoleFunction(stricmp, S32, 3, 3, "( string1 , string2 ) Use the stricmp function to do a lexicographic case in-sensitive string comparison between string1 and string2.\n"
-                                                                "@param string1 String to be compared to string2.\n"
-                                                                "@param string2 String to be compared to string1.\n"
-                                                                "@return Returns a numeric value: <-1 (string1 is less than string2, ignoring case), 0 (string1 is equal to string2, ignoring case), 1 (string1 is greater than string2, ignoring case)>.\n"
-                                                                "@sa see strcmp, strstr")
-{
-   TORQUE_UNUSED( argc );
-   return dStricmp(argv[1], argv[2]);
-}
-
-ConsoleFunction(strlen, S32, 2, 2, "( string ) Use the strlen function to determine how many characters there are in string.\n"
-                                                                "@param string The string to count characters for.\n"
-                                                                "@return Returns the number of characters in string, or 0 if string is invalid or a NULL string")
-{
-   TORQUE_UNUSED( argc );
-   return dStrlen(argv[1]);
-}
-
-ConsoleFunction(strstr, S32 , 3, 3, "( sourceString , searchString ) Use the strstr function to locate the first instance of searchString in sourceString.\n"
-                                                                "@param sourceString The string in which to search for searchString.\n"
-                                                                "@param searchString The string for which to search for in sourceString.\n"
-                                                                "@return Returns a numeric character index representing the position in sourceString at which searchString was found, or -1 to indicate that no instance of searchString was found.\n"
-                                                                "@sa strpos")
-{
-   TORQUE_UNUSED( argc );
-   // returns the start of the sub string argv[2] in argv[1]
-   // or -1 if not found.
-
-   const char *retpos = dStrstr(argv[1], argv[2]);
-   if(!retpos)
-      return -1;
-   return retpos - argv[1];
-}
-
-ConsoleFunction(strpos, S32, 3, 4, "( sourceString , searchString [ , offset ] ) Use the strPos function to locate the first instance of searchString in sourceString, starting at character 0, or at an optional offset.\n"
-                                                                "@param sourceString The string in which to search for searchString.\n"
-                                                                "@param searchString The string for which to search for in sourceString.\n"
-                                                                "@param offset An optional non-negative integer value representing the character offset within sourceString at which to begin the search.\n"
-                                                                "@return Returns a numeric character index representing the postion in sourceString at which searchString was found, or -1 to indicate that no instance of searchString was found.\n"
-                                                                "@sa strstr")
-{
-   S32 start = 0;
-   if(argc == 4)
-      start = dAtoi(argv[3]);
-   U32 sublen = dStrlen(argv[2]);
-   U32 strlen = dStrlen(argv[1]);
-   if(start < 0)
-      return -1;
-   if(sublen + start > strlen)
-      return -1;
-   for(; start + sublen <= strlen; start++)
-      if(!dStrncmp(argv[1] + start, argv[2], sublen))
-         return start;
-   return -1;
-}
-
-ConsoleFunction(ltrim, const char *,2,2,"( sourceString ) Use the ltrim function to strip the leading white space from sourceString.\n"
-                                                                "White space is any character in this set: spaces, TABs, and NULL strings.\n"
-                                                                "@param sourceString The string to be trimmed.\n"
-                                                                "@return Returns sourceString with all the leading white spaces removed.\n"
-                                                                "@sa stripChars, stripMLControlChars, stripTrailingSpaces, rtrim, trim")
-{
-   TORQUE_UNUSED( argc );
-   const char *ret = argv[1];
-   while(*ret == ' ' || *ret == '\n' || *ret == '\t')
-      ret++;
-   return ret;
-}
-
-ConsoleFunction(rtrim, const char *,2,2, "( sourceString ) Use the rtrim function to strip the trailing white space from sourceString.\n"
-                                                                "White space is any character in this set: spaces, TABs, and NULL strings.\n"
-                                                                "@param sourceString The string to be trimmed.\n"
-                                                                "@return Returns sourceString with all the trailing white spaces removed.\n"
-                                                                "@sa stripChars, stripMLControlChars, stripTrailingSpaces, ltrim, trim")
-{
-   TORQUE_UNUSED( argc );
-   S32 firstWhitespace = 0;
-   S32 pos = 0;
-   const char *str = argv[1];
-   while(str[pos])
-   {
-      if(str[pos] != ' ' && str[pos] != '\n' && str[pos] != '\t')
-         firstWhitespace = pos + 1;
-      pos++;
-   }
-   char *ret = Con::getReturnBuffer(firstWhitespace + 1);
-   dStrncpy(ret, argv[1], firstWhitespace);
-   ret[firstWhitespace] = 0;
-   return ret;
-}
-
-ConsoleFunction(trim, const char *,2,2,"( sourceString ) Use the trim function to strip the leading and trailing white space from sourceString.\n"
-                                                                "White space is any character in this set: spaces, TABs, and NULL strings.\n"
-                                                                "@param sourceString The string to be trimmed.\n"
-                                                                "@return Returns sourceString with all the leading and trailing white spaces removed.\n"
-                                                                "@sa stripChars, stripMLControlChars, stripTrailingSpaces, ltrim, rtrim")
-{
-   TORQUE_UNUSED( argc );
-   const char *ptr = argv[1];
-   while(*ptr == ' ' || *ptr == '\n' || *ptr == '\t')
-      ptr++;
-   S32 firstWhitespace = 0;
-   S32 pos = 0;
-   const char *str = ptr;
-   while(str[pos])
-   {
-      if(str[pos] != ' ' && str[pos] != '\n' && str[pos] != '\t')
-         firstWhitespace = pos + 1;
-      pos++;
-   }
-   char *ret = Con::getReturnBuffer(firstWhitespace + 1);
-   dStrncpy(ret, ptr, firstWhitespace);
-   ret[firstWhitespace] = 0;
-   return ret;
-}
-
-ConsoleFunction(stripChars, const char*, 3, 3, "( sourceString , chars ) Use the stripChars function to remove chars from sourceString.\n"
-                                                                "@param sourceString The string to be modified.\n"
-                                                                "@param chars The character or characters to search for and remove.\n"
-                                                                "@return Returns a copy of sourceString, from which all instances of chars have been removed. This may be the original sourceString, if chars was not found.\n"
-                                                                "@sa stripMLControlChars, stripTrailingSpaces")
-{
-   TORQUE_UNUSED( argc );
-   char* ret = Con::getReturnBuffer( dStrlen( argv[1] ) + 1 );
-   dStrcpy( ret, argv[1] );
-   U32 pos = dStrcspn( ret, argv[2] );
-   while ( pos < dStrlen( ret ) )
-   {
-      dStrcpy( ret + pos, ret + pos + 1 );
-      pos = dStrcspn( ret, argv[2] );
-   }
-   return( ret );
-}
-
-ConsoleFunction(stripColorCodes, const char*, 2,2,  "(stringtoStrip) - "
-                "remove TorqueML color codes from the string.\n"
-                "@param stringtoString The string from which to remove TorqueML color codes\n"
-                "@return A string consisting of the original string minus color codes")
-{
-   char* ret = Con::getReturnBuffer( dStrlen( argv[1] ) + 1 );
-   dStrcpy(ret, argv[1]);
-   Con::stripColorChars(ret);
-   return ret;
-}
-
-ConsoleFunction(strlwr,const char *,2,2, "( sourceString ) Use the strlwr function to convert all alpha characters in sourceString to lower-case equivalents.\n"
-                                                                "@param sourceString The string to be modified.\n"
-                                                                "@return Returns a copy of sourceString in which all upper-case characters have been converted to lower-case letters.\n"
-                                                                "@sa strupr")
-{
-   TORQUE_UNUSED( argc );
-   char *ret = Con::getReturnBuffer(dStrlen(argv[1]) + 1);
-   dStrcpy(ret, argv[1]);
-   return dStrlwr(ret);
-}
-
-ConsoleFunction(strupr,const char *,2,2, "( sourceString ) Use the strupr function to convert all alpha characters in sourceString to upper-case equivalents.\n"
-                                                                "@param sourceString The string to be modified.\n"
-                                                                "@return Returns a copy of sourceString in which all lower-case characters have been converted to upper-case letters.\n"
-                                                                "@sa strlwr")
-{
-   TORQUE_UNUSED( argc );
-   char *ret = Con::getReturnBuffer(dStrlen(argv[1]) + 1);
-   dStrcpy(ret, argv[1]);
-   return dStrupr(ret);
-}
-
-ConsoleFunction(strchr,const char *,3,3,"( sourceString , char ) Use the strchr function to extract a sub-string of sourceString, where the sub-string is equal to the first occurence of char in sourceString followed by the remainder of sourceString.\n"
-                                                                "@param sourceString The string from which to extract a sub-string.\n"
-                                                                "@param char The character to search for in sourceString.\n"
-                                                                "@return Returns a string composed of first instance of char in sourceString, and all of the characters after it. If char is not found, a NULL string is returned.\n"
-                                                                "@sa getSubStr")
-{
-   TORQUE_UNUSED( argc );
-   const char *ret = dStrchr(argv[1], argv[2][0]);
-   return ret ? ret : "";
-}
-
-ConsoleFunction(strrchr,const char *,3,3,"( sourceString , char ) strrchr searches the sourceString for the last occurance of the giuven char\n"
-                "@param sourceString The string to search\n"
-                "@return Either a string consisting of the given string from the last occurance of the given char on or an empty string if not found")
-{
-   TORQUE_UNUSED( argc );
-   const char *ret = dStrrchr(argv[1], argv[2][0]);
-   return ret ? ret : "";
-}
-
-ConsoleFunction(strreplace, const char *, 4, 4, "( sourceString , from , to ) Use the strreplace function to replace every instance of from in sourceString with to.\n"
-                                                                "This function is case-sensitive and only does exact matching\n"
-                                                                "@param sourceString The string to do replacement operations on.\n"
-                                                                "@param from The old value to be replaced.\n"
-                                                                "@param to The new value to replace old values with.\n"
-                                                                "@return Returns a new version of sourceString in which every instance of the value in from was replaced with the value in to.")
-{
-   TORQUE_UNUSED( argc );
-   S32 fromLen = dStrlen(argv[2]);
-   if(!fromLen)
-      return argv[1];
-
-   S32 toLen = dStrlen(argv[3]);
-   S32 count = 0;
-   const char *scan = argv[1];
-   while(scan)
-   {
-      scan = dStrstr(scan, argv[2]);
-      if(scan)
-      {
-         scan += fromLen;
-         count++;
-      }
-   }
-   char *ret = Con::getReturnBuffer(dStrlen(argv[1]) + 1 + (toLen - fromLen) * count);
-   U32 scanp = 0;
-   U32 dstp = 0;
-   for(;;)
-   {
-      const char *scan = dStrstr(argv[1] + scanp, argv[2]);
-      if(!scan)
-      {
-         dStrcpy(ret + dstp, argv[1] + scanp);
-         return ret;
-      }
-      U32 len = scan - (argv[1] + scanp);
-      dStrncpy(ret + dstp, argv[1] + scanp, len);
-      dstp += len;
-      dStrcpy(ret + dstp, argv[3]);
-      dstp += toLen;
-      scanp += len + fromLen;
-   }
-   return ret;
-}
-
-ConsoleFunction(getSubStr, const char *, 4, 4, "( sourceString , start , count ) Use the getSubStr function to get a sub-string of sourceString, starting at character index start and ending at character index start + count, or the end-of-string, which ever comes first.\n"
-                                                                "If start + count is greater than the length of sourceString, the extraction will return a string shorter than count.\n"
-                                                                "@param sourceString The string from which to extract a sub-string.\n"
-                                                                "@param start The character index at which the extraction starts.\n"
-                                                                "@param count The length of the sub-string to extract.\n"
-                                                                "@return Returns a string made up of the character at start in sourceString and ending at the end of the original sourceString, or start + count, whichever comes first.\n"
-                                                                "@sa strchr")
-{
-   TORQUE_UNUSED( argc );
-   // Returns the substring of argv[1], starting at argv[2], and continuing
-   //  to either the end of the string, or argv[3] characters, whichever
-   //  comes first.
-   //
-   S32 startPos   = dAtoi(argv[2]);
-   S32 desiredLen = dAtoi(argv[3]);
-   if (startPos < 0 || desiredLen < 0) {
-      Con::errorf(ConsoleLogEntry::Script, "getSubStr(...): error, starting position and desired length must be >= 0: (%d, %d)", startPos, desiredLen);
-
-      return "";
-   }
-
-   S32 baseLen = dStrlen(argv[1]);
-   if (baseLen < startPos)
-      return "";
-
-   U32 actualLen = desiredLen;
-   if (startPos + desiredLen > baseLen)
-      actualLen = baseLen - startPos;
-
-   char *ret = Con::getReturnBuffer(actualLen + 1);
-   dStrncpy(ret, argv[1] + startPos, actualLen);
-   ret[actualLen] = '\0';
-
-   return ret;
-}
-
-// Used?
-ConsoleFunction( stripTrailingSpaces, const char*, 2, 2, "( string )Removes all spaces after the final \n"
-                "@param string from which to remove trailing spaces\n"
-                "@return the source string minus trailing spaces")
-{
-   TORQUE_UNUSED( argc );
-   S32 temp = S32(dStrlen( argv[1] ));
-   if ( temp )
-   {
-      while ( ( argv[1][temp - 1] == ' ' || argv[1][temp - 1] == '_' ) && temp >= 1 )
-         temp--;
-
-      if ( temp )
-      {
-         char* returnString = Con::getReturnBuffer( temp + 1 );
-         dStrncpy( returnString, argv[1], U32(temp) );
-         returnString[temp] = '\0';
-         return( returnString );			
-      }
-   }
-
-   return( "" );	
-}
-
-ConsoleFunctionGroupEnd(StringFunctions);
-
-//--------------------------------------
-
 #include "string/stringUnit.h"
 
-//--------------------------------------
-ConsoleFunctionGroupBegin( FieldManipulators, "Functions to manipulate data returned in the form of \"x y z\".");
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(getUnit, const char*, 4, 4, "( sourceString ,index, separator )" )
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::getUnit(argv[1], dAtoi(argv[2]), argv[3] ) );
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(getUnitCount, S32, 3, 3, "( sourceString, separator )")
-{
-   TORQUE_UNUSED( argc );
-   return StringUnit::getUnitCount(argv[1], argv[2] );
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(setUnit, const char *, 5, 5, "( sourceString ,index, replace, separator)")
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::setUnit(argv[1], dAtoi(argv[2]), argv[3], argv[4]) );
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(getWord, const char *, 3, 3, "( sourceString ,index ) Use the getWord function to get the word at index in sourceString.\n"
-                                                                "@param sourceString A string containing one or more words.\n"
-                                                                "@return Returns word at index in sourceString, or null string if no word exists at that index.\n"
-                                                                "@sa getWords, setWord")
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::getUnit(argv[1], dAtoi(argv[2]), " \t\n") );
-}
-
-ConsoleFunction(getWords, const char *, 3, 4, "( sourceString ,index [,endindex]) Use the getWords function to retrieve a set of words from a sourceString.\n"
-                                                                "@param sourceString A string containing one or more words.\n"
-                                                                "@param index The index of the first word to retrieve.\n"
-                                                                "@param endindex The index of the final word to retrieve.\n"
-                                                                "@return Returns all words (separated by current delimiter) from sourceString, starting at index and ending at endIndex or end of string, whichever comes first. If no endIndex is specified, all remaining words are returned.\n"
-                                                                "@sa getWord, setWord")
-{
-   U32 endIndex;
-   if(argc==3)
-      endIndex = 1000000;
-   else
-      endIndex = dAtoi(argv[3]);
-   return Con::getReturnBuffer( StringUnit::getUnits(argv[1], dAtoi(argv[2]), endIndex, " \t\n") );
-}
-
-ConsoleFunction(setWord, const char *, 4, 4, "( sourceString ,index,replace) Use the setWord function to replace an existing word with a new word(s), or to add word(s) to a string..\n"
-                                                                "@param sourceString A string containing one or more words.\n"
-                                                                "@param index The index of the word to remove.\n"
-                                                                "@param replace The new word(s) to replace the word at index with.\n"
-                                                                "@return There are multiple return cases:\n- In the first case, a simple one-to-one replacement, the word at index in sourceString will be replaced with the value in replace, and the new string will be returned.\n- In the first case, a multi-to-one replacement, the word at index in sourceString will be replaced with the value in replace, which can be two or more words, and the new string will be returned.\n- In the third and final case, new records, empty or filled, can be appended to the end of sourceString. If index is beyond the end of the sourceString, that is, the index is greater than the total count of words in sourceString, the requisite number of empty (null-string) words will be appended to the end of sourceString and the value in replace will be appended to the end of this new string. This entire resultant string will be returned.\n"
-                                                                "@sa getWord, getWords, removeWord")
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::setUnit(argv[1], dAtoi(argv[2]), argv[3], " \t\n") );
-}
-
-ConsoleFunction(removeWord, const char *, 3, 3, "( sourceString ,index) Use the removeWord function to remove a single indexed word from a sourceString.\n"
-                                                                "@param sourceString A string containing one or more words.\n"
-                                                                "@param index The index of the word to remove.\n"
-                                                                "@return Returns sourceString minus the removed word. If the index is greater than the number of words in sourceString, the original string is returned.\n"
-                                                                "@sa setWord")
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::removeUnit(argv[1], dAtoi(argv[2]), " \t\n") );
-}
-
-ConsoleFunction(getWordCount, S32, 2, 2, "( sourceString ) Use the getWordCount function to get the number of words in sourceString.\n"
-                                                                "@param sourceString A string containing one or more words.\n"
-                                                                "@return Returns number of words in sourceString or 0 if no words are present")
-{
-   TORQUE_UNUSED( argc );
-   return StringUnit::getUnitCount(argv[1], " \t\n");
-}
-
-//--------------------------------------
-ConsoleFunction(getField, const char *, 3, 3, "( sourceString , index ) Use the getField function to get the field at index in sourceString.\n"
-                                                                "@param sourceString A string containing one or more fields.\n"
-                                                                "@return Returns field at index in sourceString, or null string if no field exists at that index.\n"
-                                                                "@sa getFields, setField")
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::getUnit(argv[1], dAtoi(argv[2]), "\t\n") );
-}
-
-ConsoleFunction(getFields, const char *, 3, 4, "( sourceString , index [ , endindex ] ) Use the getFields function to retrieve a set of fields from a sourceString.\n"
-                                                                "@param sourceString A string containing one or more fields.\n"
-                                                                "@param index The index of the first field to retrieve.\n"
-                                                                "@param endindex The index of the final field to retrieve.\n"
-                                                                "@return Returns all fields (separated by current delimiter) from sourceString, starting at index and ending at endIndex or end of string, whichever comes first. If no endIndex is specified, all remaining fields are returned.\n"
-                                                                "@sa getField, setField")
-{
-   U32 endIndex;
-   if(argc==3)
-      endIndex = 1000000;
-   else
-      endIndex = dAtoi(argv[3]);
-   return Con::getReturnBuffer( StringUnit::getUnits(argv[1], dAtoi(argv[2]), endIndex, "\t\n") );
-}
-
-ConsoleFunction(setField, const char *, 4, 4, "( sourceString , index , replace ) Use the setField function to replace an existing field with a new field(s), or to add field(s) to a string..\n"
-                                                                "@param sourceString A string containing one or more fields.\n"
-                                                                "@param index The index of the field to remove.\n"
-                                                                "@param replace The new field(s) to replace the field at index with.\n"
-                                                                "@return There are multiple return cases:\n- In the first case, a simple one-to-one replacement, the field at index in sourceString will be replaced with the value in replace, and the new string will be returned.\n- In the first case, a multi-to-one replacement, the field at index in sourceString will be replaced with the value in replace, which can be two or more fields, and the new string will be returned.\n- In the thrid and final case, new records, empty or filled, can be appended to the end of sourceString. If index is beyond the end of the sourceString, that is, the index is greater than the total count of fields in sourceString, the requisite number of empty (null-string) fields will be appended to the end of sourceString and the value in replace will be appended to the end of this new string. This entire resultant string will be returned.\n"
-                                                                "@sa getField, getFields, removeField")
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::setUnit(argv[1], dAtoi(argv[2]), argv[3], "\t\n") );
-}
-
-ConsoleFunction(removeField, const char *, 3, 3, "( sourceString , index ) Use the removeField function to remove a single indexed field from a sourceString.\n"
-                                                                "@param sourceString A string containing one or more fields.\n"
-                                                                "@param index The index of the field to remove.\n"
-                                                                "@return Returns sourceString minus the removed field. If the index is greater than the number of fields in sourceString, the original string is returned.\n"
-                                                                "@sa setField")
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::removeUnit(argv[1], dAtoi(argv[2]), "\t\n") );
-}
-
-ConsoleFunction(getFieldCount, S32, 2, 2, "( sourceString ) Use the getFieldCount function to get the number of fields in sourceString.\n"
-                                                                "@param sourceString A string containing one or more fields.\n"
-                                                                "@return Returns number of fields in sourceString or 0 if no fields are present")
-{
-   TORQUE_UNUSED( argc );
-   return StringUnit::getUnitCount(argv[1], "\t\n");
-}
-
-//--------------------------------------
-ConsoleFunction(getRecord, const char *, 3, 3, "( sourceString , index ) Use the getRecord function to get the record at index in sourceString.\n"
-                                                                "@param sourceString A string containing one or more records.\n"
-                                                                "@return Returns record at index in sourceString, or NULL string if no record exists at that index.\n"
-                                                                "@sa getRecords, setRecord")
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::getUnit(argv[1], dAtoi(argv[2]), "\n") );
-}
-
-ConsoleFunction(getRecords, const char *, 3, 4, "( sourceString , index [ , endindex ] ) Use the getRecords function to retrieve a set of records from a sourceString.\n"
-                                                                "@param sourceString A string containing one or more records.\n"
-                                                                "@param index The index of the first record to retrieve.\n"
-                                                                "@param endindex The index of the final record to retrieve.\n"
-                                                                "@return Returns all records (separated by current delimiter) from sourceString, starting at index and ending at endIndex or end of string, whichever comes first. If no endIndex is specified, all remaining records are returned.\n"
-                                                                "@sa getRecord, setRecord")
-{
-   U32 endIndex;
-   if(argc==3)
-      endIndex = 1000000;
-   else
-      endIndex = dAtoi(argv[3]);
-   return Con::getReturnBuffer( StringUnit::getUnits(argv[1], dAtoi(argv[2]), endIndex, "\n") );
-}
-
-ConsoleFunction(setRecord, const char *, 4, 4, "( sourceString , index , replace ) Use the setRecord function to replace an existing record with a new record(s), or to add record(s) to a string..\n"
-                                                                "@param sourceString A string containing one or more records.\n"
-                                                                "@param index The index of the record to remove.\n"
-                                                                "@param replace The new record(s) to replace the record at index with.\n"
-                                                                "@return There are multiple return cases:\n- In the first case, a simple one-to-one replacement, the record at index in sourceString will be replaced with the value in replace, and the new string will be returned.\n- In the first case, a multi-to-one replacement, the record at index in sourceString will be replaced with the value in replace, which can be two or more records, and the new string will be returned.\n- In the thrid and final case, new records, empty or filled, can be appended to the end of sourceString. If index is beyond the end of the sourceString, that is, the index is greater than the total count of records in sourceString, the requisite number of empty (null-string) records will be appended to the end of sourceString and the value in replace will be appended to the end of this new string. This entire resultant string will be returned.\n"
-                                                                "@sa getRecord, getRecords, removeRecord")
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::setUnit(argv[1], dAtoi(argv[2]), argv[3], "\n") );
-}
-
-ConsoleFunction(removeRecord, const char *, 3, 3, "( sourceString , index ) Use the removeRecord function to remove a single indexed record from a sourceString.\n"
-                                                                "@param sourceString A string containing one or more records.\n"
-                                                                "@param index The index of the record to remove.\n"
-                                                                "@return Returns sourceString minus the removed record. If the index is greater than the number of records in sourceString, the original string is returned.\n"
-                                                                "@sa setRecord")
-{
-   TORQUE_UNUSED( argc );
-   return Con::getReturnBuffer( StringUnit::removeUnit(argv[1], dAtoi(argv[2]), "\n") );
-}
-
-ConsoleFunction(getRecordCount, S32, 2, 2, "( sourceString ) Use the getRecordCount function to get the number of records in sourceString.\n"
-                                                                "@param sourceString A string containing one or more records.\n"
-                                                                "@return Returns number of records in sourceString or 0 if no records are present")
-{
-   TORQUE_UNUSED( argc );
-   return StringUnit::getUnitCount(argv[1], "\n");
-}
-//--------------------------------------
-ConsoleFunction(firstWord, const char *, 2, 2, "( sourceString ) Use the firstWord function to retrieve the first word found in sourceString.\n"
-                                                                "@param sourceString A string containing one or more words.\n"
-                                                                "@return Returns the first word found in sourceString, or a NULL string, if no words are found.\n"
-                                                                "@sa restWords")
-{
-   TORQUE_UNUSED( argc );
-   const char *word = dStrchr(argv[1], ' ');
-   U32 len;
-   if(word == NULL)
-      len = dStrlen(argv[1]);
-   else
-      len = word - argv[1];
-   char *ret = Con::getReturnBuffer(len + 1);
-   dStrncpy(ret, argv[1], len);
-   ret[len - 1] = 0;
-   return ret;
-}
-
-ConsoleFunction(restWords, const char *, 2, 2, "( sourceString ) Use the restWords function to retrieve all words after the first word in sourceString.\n"
-                                                                "@param sourceString A string containing one or more words.\n"
-                                                                "@return Returns a string containing all the words after the first word found in sourceString, or a NULL string if no words remain after the first word (or if no words at all remain).\n"
-                                                                "@sa firstWord")
-{
-   TORQUE_UNUSED( argc );
-   const char *word = dStrchr(argv[1], ' ');
-   if(word == NULL)
-      return "";
-   char *ret = Con::getReturnBuffer(dStrlen(word + 1) + 1);
-   dStrcpy(ret, word + 1);
-   return ret;
-}
-
-static bool isInSet(char c, const char *set)
-{
-   if (set)
-      while (*set)
-         if (c == *set++)
-            return true;
-
-   return false;
-}
-
-ConsoleFunction(NextToken,const char *,4,4,"( tokenList , tokenVar , delimeter ) Use the nextToken function to get the first token found in tokenList, where tokens are separated by the character(s) specified in delimeter. The token itself is stored in a variable whose name is specified in tokenVar. This function provides complex power in a simple package. Please read the notes below, they are very important.\n"
-                                                                "This function is scope-smart. That is, when we specify the name of the variable to store a token in by passing a value in tokenVar, we do not include either a local symbol (%), or a global symbol ($). We just pass in an un-adorned name, let's say \"George\". Then, depending on where this function is called, \"George\" will become a local (%George), or a global ($George) variable. If this function is called within a function or method definition, \"George\" will be local (%George). If this function is called from the file-scope (executed as part of a file and not within the scope of a function or method), \"George\" will become a global ($George). There is one additional special case. If you attempt to use this from the console command line, the token will vaporize and no variable will be created\n"
-                                                                "@param tokenList The string containing token(s).\n"
-                                                                "@param tokenVar The 'name' of the variable to store the token in.\n"
-                                                                "@param delimeter The character(s) to use as a delimeter. A delimeter may be a single character, or a sequence of characters.\n"
-                                                                "@return Returns a copy of tokenList, less the first token and the first delimiter. If there are no more tokens, a NULL string is returned.")
-{
-   TORQUE_UNUSED( argc );
-
-   char *str = (char *) argv[1];
-   const char *token = argv[2];
-   const char *delim = argv[3];
-
-   if (str)
-   {
-      // skip over any characters that are a member of delim
-      // no need for special '\0' check since it can never be in delim
-      while (isInSet(*str, delim))
-         str++;
-
-      // skip over any characters that are NOT a member of delim
-      const char *tmp = str;
-
-      while (*str && !isInSet(*str, delim))
-         str++;
-
-      // terminate the token
-      if (*str)
-         *str++ = 0;
-
-      // set local variable if inside a function
-      if (gEvalState.stack.size() && 
-         gEvalState.stack.last()->scopeName)
-         Con::setLocalVariable(token,tmp);
-      else
-         Con::setVariable(token,tmp);
-
-      // advance str past the 'delim space'
-      while (isInSet(*str, delim))
-         str++;
-   }
-
-   return str;
-}
-
-ConsoleFunctionGroupEnd( FieldManipulators )
-//----------------------------------------------------------------
-
 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"
@@ -688,891 +88,6 @@ ConsoleFunctionGroupEnd( TaggedStrings );
 
 //----------------------------------------------------------------
 
-ConsoleFunctionGroupBegin( Output, "Functions to output to the console." );
-
-ConsoleFunction(echo, void, 2, 0, "( text [ , ... ] ) Use the echo function to print messages to the console.\n"
-                                                                "@param text Any valid text string.\n"
-                                                                "@param ... Any additional valid text string(s).\n"
-                                                                "@return No return value.\n"
-                                                                "@sa error, warn")
-{
-   U32 len = 0;
-   S32 i;
-   for(i = 1; i < argc; i++)
-      len += dStrlen(argv[i]);
-
-   char *ret = Con::getReturnBuffer(len + 1);
-   ret[0] = 0;
-   for(i = 1; i < argc; i++)
-      dStrcat(ret, argv[i]);
-
-   Con::printf("%s", ret);
-   ret[0] = 0;
-}
-
-ConsoleFunction(echoSeparator, void, 0, 0, "() - Prints a separator to the console.\n" )
-{
-    Con::printSeparator();
-}
-
-ConsoleFunction(warn, void, 2, 0, "( text [ , ... ] ) Use the warn function to print warning messages to the console. These messages usually yellow or orange.\n"
-                                                                "@param text Any valid text string.\n"
-                                                                "@param ... Any additional valid text string(s).\n"
-                                                                "@return No return value.\n"
-                                                                "@sa warn, error")
-{
-   U32 len = 0;
-   S32 i;
-   for(i = 1; i < argc; i++)
-      len += dStrlen(argv[i]);
-
-   char *ret = Con::getReturnBuffer(len + 1);
-   ret[0] = 0;
-   for(i = 1; i < argc; i++)
-      dStrcat(ret, argv[i]);
-
-   Con::warnf(ConsoleLogEntry::General, "%s", ret);
-   ret[0] = 0;
-}
-
-ConsoleFunction(error, void, 2, 0, "( text [ , ... ] ) Use the error function to print error messages to the console. These messages usually print in red.\n"
-                                                                "@param text Any valid text string.\n"
-                                                                "@param ... Any additional valid text string(s).\n"
-                                                                "@return No return value.\n"
-                                                                "@sa echo, warn")
-{
-   U32 len = 0;
-   S32 i;
-   for(i = 1; i < argc; i++)
-      len += dStrlen(argv[i]);
-
-   char *ret = Con::getReturnBuffer(len + 1);
-   ret[0] = 0;
-   for(i = 1; i < argc; i++)
-      dStrcat(ret, argv[i]);
-
-   Con::errorf(ConsoleLogEntry::General, "%s", ret);
-   ret[0] = 0;
-}
-
-ConsoleFunction(expandEscape, const char *, 2, 2, "( text ) Use the collapseEscape function to replace all escape sequences ('xx') with an expanded version ('xx').\n"
-                                                                "@param text A string, possibly containing escape sequences.\n"
-                                                                "@return Returns a copy of text with all escape sequences expanded.\n"
-                                                                "@sa collapseEscape")
-{
-   TORQUE_UNUSED( argc );
-   char *ret = Con::getReturnBuffer(dStrlen(argv[1])*2 + 1);  // worst case situation
-   expandEscape(ret, argv[1]);
-   return ret;
-}
-
-ConsoleFunction(collapseEscape, const char *, 2, 2, "( text ) Use the collapseEscape function to replace all escape sequences ('xx') with a collapsed version ('xx').\n"
-                                                                "@param text A string, possibly containing escape sequences.\n"
-                                                                "@return Returns a copy of text with all escape sequences converted to an encoding.\n"
-                                                                "@sa expandEscape")
-{
-   TORQUE_UNUSED( argc );
-   char *ret = Con::getReturnBuffer(dStrlen(argv[1]) + 1);  // worst case situation
-   dStrcpy( ret, argv[1] );
-   collapseEscape( ret );
-   return ret;
-}
-
-ConsoleFunction(setLogMode, void, 2, 2, "( mode ) Use the setLogMode function to set the logging level based on bits that are set in the mode argument.\n"
-                                                                "This is a general debug method and should be used in all but release cases and perhaps even then.\n"
-                                                                "@param mode A bitmask enabling various types of logging. See 'Logging Modes' table below.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa intputLog")
-{
-   TORQUE_UNUSED( argc );
-   Con::setLogMode(dAtoi(argv[1]));
-}
-
-ConsoleFunction(setEchoFileLoads, void, 2, 2, "( enable ) Use the setEchoFileLoads function to enable/disable echoing of file loads (to console).\n"
-                                                                "This does not completely disable message, but rather adds additional methods when echoing is set to true. File loads will always echo a compile statement if compiling is required, and an exec statement at all times\n"
-                                                                "@param enable A boolean value. If this value is true, extra information will be dumped to the console when files are loaded.\n"
-                                                                "@return No return value.")
-{
-   TORQUE_UNUSED( argc );
-   ResourceManager->setFileNameEcho(dAtob(argv[1]));
-}
-
-ConsoleFunctionGroupEnd( Output );
-
-//----------------------------------------------------------------
-
-ConsoleFunction(quit, void, 1, 1, "() Use the quit function to stop the engine and quit to the command line.\n"
-                                                                "@return No return value")
-{
-   TORQUE_UNUSED( argc );
-   TORQUE_UNUSED( argv );
-   Platform::postQuitMessage(0);
-}
-
-ConsoleFunction(quitWithErrorMessage, void, 2, 2, "(msg string) quitWithErrorMessage(msg)"
-                " - Quit, showing the provided error message. This is equivalent"
-                " to an AssertISV.\n"
-                "@param Error Message\n"
-                "@return No return value")
-{
-   AssertISV(false, argv[1]);
-}
-
-//----------------------------------------------------------------
-
-ConsoleFunction( gotoWebPage, void, 2, 2, "( address ) - Open a URL in the user's favorite web browser." )
-{
-   TORQUE_UNUSED( argc );
-   char* protocolSep = dStrstr(argv[1],"://");
-
-   if( protocolSep != NULL )
-   {
-      Platform::openWebBrowser(argv[1]);
-      return;
-   }
-
-   // if we don't see a protocol seperator, then we know that some bullethead
-   // sent us a bad url. We'll first check to see if a file inside the sandbox
-   // with that name exists, then we'll just glom "http://" onto the front of 
-   // the bogus url, and hope for the best.
-   
-   char urlBuf[2048];
-   if(Platform::isFile(argv[1]) || Platform::isDirectory(argv[1]))
-   {
-      dSprintf(urlBuf, sizeof(urlBuf), "file://%s",argv[1]);
-   }
-   else
-      dSprintf(urlBuf, sizeof(urlBuf), "http://%s",argv[1]);
-   
-   Platform::openWebBrowser(urlBuf);
-   return;
-}
-
-
-//----------------------------------------------------------------
-
-ConsoleFunctionGroupBegin(MetaScripting, "Functions that let you manipulate the scripting engine programmatically.");
-
-ConsoleFunction(call, const char *, 2, 0, "( funcName [ , args ... ] ) Use the call function to dynamically build and call a function.\n"
-                                                                "@param funcName A string containing the unadorned name of a function to be executed.\n"
-                                                                "@param args .. - Any arguments that should be passed to the function.\n"
-                                                                "@return Returns a string containing the results from the function that is built and called.\n"
-                                                                "@sa eval")
-{
-   return Con::execute(argc - 1, argv + 1);
-}
-
-static StringTableEntry getDSOPath(const char *scriptPath)
-{
-   const char *slash = dStrrchr(scriptPath, '/');
-   return StringTable->insertn(scriptPath, slash - scriptPath, true);
-}
-
-ConsoleFunction(getDSOPath, const char *, 2, 2, "(scriptFileName) Returns the DSO path of the given filename\n"
-                "@param scriptFileName A string contains the file to search for\n"
-                "@return Returns either the requested pathname as a string, or an empty string if not found.")
-{
-   Con::expandPath(pathBuffer, sizeof(pathBuffer), argv[1]);  
-
-   const char *filename = getDSOPath(pathBuffer);
-   if(filename == NULL || *filename == 0)
-      return "";
-
-   return filename;
-}
-
-ConsoleFunction(compile, bool, 2, 2, "( fileName ) Use the compile function to pre-compile a script file without executing the contents.\n"
-                                                                "@param fileName A path to the script to compile.\n"
-                                                                "@return Returns 1 if the script compiled without errors and 0 if the file did not compile correctly or if the path is wrong. Also, ff the path is invalid, an error will print to the console.\n"
-                                                                "@sa exec")
-{
-   TORQUE_UNUSED( argc );
-   char nameBuffer[512];
-   char* script = NULL;
-   U32 scriptSize = 0;
-
-   FileTime comModifyTime, scrModifyTime;
-
-   Con::expandPath(pathBuffer, sizeof(pathBuffer), argv[1]);
-
-   // Figure out where to put DSOs
-   StringTableEntry dsoPath = getDSOPath(pathBuffer);
-
-   // If the script file extention is '.ed.cs' then compile it to a different compiled extention
-   bool isEditorScript = false;
-   const char *ext = dStrrchr( pathBuffer, '.' );
-   if( ext && ( dStricmp( ext, ".cs" ) == 0 ) )
-   {
-      const char* ext2 = ext - 3;
-      if( dStricmp( ext2, ".ed.cs" ) == 0 )
-         isEditorScript = true;
-   }
-   else if( ext && ( dStricmp( ext, ".gui" ) == 0 ) )
-   {
-      const char* ext2 = ext - 3;
-      if( dStricmp( ext2, ".ed.gui" ) == 0 )
-         isEditorScript = true;
-   }
-
-   const char *filenameOnly = dStrrchr(pathBuffer, '/');
-   if(filenameOnly)
-      ++filenameOnly;
-   else
-      filenameOnly = pathBuffer;
-
-   if( isEditorScript )
-      dStrcpyl(nameBuffer, sizeof(nameBuffer), dsoPath, "/", filenameOnly, ".edso", NULL);
-   else
-      dStrcpyl(nameBuffer, sizeof(nameBuffer), dsoPath, "/", filenameOnly, ".dso", NULL);
-   
-   ResourceObject *rScr = ResourceManager->find(pathBuffer);
-   ResourceObject *rCom = ResourceManager->find(nameBuffer);
-
-   if(rCom)
-      rCom->getFileTimes(NULL, &comModifyTime);
-   if(rScr)
-      rScr->getFileTimes(NULL, &scrModifyTime);
-
-   Stream *s = ResourceManager->openStream(pathBuffer);
-   if(s)
-   {
-      scriptSize = ResourceManager->getSize(pathBuffer);
-      script = new char [scriptSize+1];
-      s->read(scriptSize, script);
-      ResourceManager->closeStream(s);
-      script[scriptSize] = 0;
-   }
-
-   if (!scriptSize || !script)
-   {
-      delete [] script;
-      Con::errorf(ConsoleLogEntry::Script, "compile: invalid script file %s.", pathBuffer);
-      return false;
-   }
-   // compile this baddie.
-// -Mat reducing console noise
-#if defined(TORQUE_DEBUG)
-   Con::printf("Compiling %s...", pathBuffer);
-#endif
-   CodeBlock *code = new CodeBlock();
-   code->compile(nameBuffer, pathBuffer, script);
-   delete code;
-   code = NULL;
-
-   delete[] script;
-   return true;
-}
-
-ConsoleFunction(compilePath, const char*, 2, 2, "compilePath( path )")
-{
-    if ( !Con::expandPath(pathBuffer, sizeof(pathBuffer), argv[1]) )
-        return "-1 0";
-    
-    const char *compileArgs[2] = { "compile", NULL };
-    
-    S32 failedScripts = 0;
-    S32 totalScripts = 0;
-    ResourceObject *match = NULL;
-    
-    while ( (match = ResourceManager->findMatch( pathBuffer, &compileArgs[1], match )) )
-    {
-        if ( !ccompile( NULL, 1, compileArgs ) )
-            failedScripts++;
-        
-        totalScripts++;
-    }
-    
-    char* result = Con::getReturnBuffer(32);
-    dSprintf( result, 32, "%d %d", failedScripts, totalScripts );
-   return result;
-}
-
-static bool scriptExecutionEcho = false;
-ConsoleFunction(setScriptExecEcho, void, 2, 2, "(echo?) - Whether to echo script file execution or not." )
-{
-    scriptExecutionEcho = dAtob(argv[1]);
-}
-
-ConsoleFunction(exec, bool, 2, 4, "( fileName [ , nocalls [ , journalScript ] ] ) Use the exec function to compile and execute a normal script, or a special journal script.\n"
-                                                                "If $Pref::ignoreDSOs is set to true, the system will use .cs before a .dso file if both are found.\n"
-                                                                "@param fileName A string containing a path to the script to be compiled and executed.\n"
-                                                                "@param nocalls A boolean value. If this value is set to true, then all function calls encountered while executing the script file will be skipped and not called. This allows us to re-define function definitions found in a script file, without re-executing other worker scripts in the same file.\n"
-                                                                "@param journalScript A boolean value. If this value is set tot true, and if a journal is being played, the engine will attempt to read this script from the journal stream. If no journal is playing, this field is ignored.\n"
-                                                                "@return Returns true if the file compiled and executed w/o errors, false otherwise.\n"
-                                                                "@sa compile")
-{
-   execDepth++;
-
-#ifdef TORQUE_ALLOW_JOURNALING
-   bool journal = false;
-
-   if(journalDepth >= execDepth)
-      journalDepth = execDepth + 1;
-   else
-      journal = true;
-#endif //TORQUE_ALLOW_JOURNALING
-
-   bool noCalls = false;
-   bool ret = false;
-
-   if(argc >= 3 && dAtoi(argv[2]))
-      noCalls = true;
-
-#ifdef TORQUE_ALLOW_JOURNALING
-   if(argc >= 4 && dAtoi(argv[3]) && !journal)
-   {
-      journal = true;
-      journalDepth = execDepth;
-   }
-#endif //TORQUE_ALLOW_JOURNALING
-
-   // Determine the filename we actually want...
-   Con::expandPath(pathBuffer, sizeof(pathBuffer), argv[1]);
-
-   // Figure out where to put DSOs
-   StringTableEntry dsoPath = getDSOPath(pathBuffer);
-
-   const char *ext = dStrrchr(pathBuffer, '.');
-
-   if(!ext)
-   {
-      // We need an extension!
-      Con::errorf(ConsoleLogEntry::Script, "exec: invalid script file name %s.", pathBuffer);
-      execDepth--;
-      return false;
-   }
-
-   // Check Editor Extensions
-   bool isEditorScript = false;
-
-#ifdef TORQUE_ALLOW_DSO_GENERATION
-   // If the script file extension is '.ed.cs' then compile it to a different compiled extension
-   if( dStricmp( ext, ".cs" ) == 0 )
-   {
-      const char* ext2 = ext - 3;
-      if( dStricmp( ext2, ".ed.cs" ) == 0 )
-         isEditorScript = true;
-   }
-   else if( dStricmp( ext, ".gui" ) == 0 )
-   {
-      const char* ext2 = ext - 3;
-      if( dStricmp( ext2, ".ed.gui" ) == 0 )
-         isEditorScript = true;
-   }
-#endif //TORQUE_ALLOW_DSO_GENERATION
-
-   // rdbhack: if we can't find the script file in the game directory, look for it
-   //   in the Application Data directory. This makes it possible to keep the user
-   //   ignorant of where the files are actually saving to, thus eliminating the need
-   //   for the script functions: execPrefs, getUserDataDirectory, etc.
-   //
-   //   This works because we know that script files located in the prefs path will 
-   //   not have compiled versions (it checks for this further down). Otherwise this
-   //   would be a big problem!
-   
-   StringTableEntry scriptFileName = StringTable->EmptyString;
-
-
-//Luma : This is redundant, we wont be building dso's on the device - 
-//plus saving dso to the user directory when attempting build for the
-//release tests on iPhone is irrelevant.
-#ifdef TORQUE_ALLOW_DSO_GENERATION
-
-   if(!ResourceManager->find(pathBuffer))
-   {
-      // NOTE: this code is pretty much a duplication of code much further down in this
-      //       function...
-
-      // our work just got a little harder.. if we couldn't find the .cs, then we need to
-      // also look for the .dso BEFORE we can try the prefs path.. UGH
-      const char *filenameOnly = dStrrchr(pathBuffer, '/');
-      if(filenameOnly)
-         ++filenameOnly;
-      else
-         filenameOnly = pathBuffer;
-
-      // we could skip this step and rid ourselves of a bunch of nonsense but we can't be
-      // certain the dso path is the same as the path given to use in scriptFileNameBuffer
-      char pathAndFilename[1024]; 
-      Platform::makeFullPathName(filenameOnly, pathAndFilename, sizeof(pathAndFilename), dsoPath);
-
-      char nameBuffer[1024];
-      if( isEditorScript ) // this should never be the case since we are a PLAYER not a TOOL, but you never know
-         dStrcpyl(nameBuffer, sizeof(nameBuffer), pathAndFilename, ".edso", NULL);
-      else
-         dStrcpyl(nameBuffer, sizeof(nameBuffer), pathAndFilename, ".dso", NULL);
-
-      if(!ResourceManager->find(nameBuffer))
-         scriptFileName = Platform::getPrefsPath(Platform::stripBasePath(pathBuffer));
-      else
-         scriptFileName = StringTable->insert(pathBuffer);
-   }
-   else
-      scriptFileName = StringTable->insert(pathBuffer);
-#else //TORQUE_ALLOW_DSO_GENERATION
-
-    //Luma : Just insert the file name.
-    scriptFileName = StringTable->insert(pathBuffer);
-
-#endif //TORQUE_ALLOW_DSO_GENERATION
-
-    //Luma : Something screwed up so get out early
-   if(scriptFileName == NULL || *scriptFileName == 0)
-   {
-      execDepth--;
-      return false;
-   }
-
-#ifdef TORQUE_ALLOW_JOURNALING
-   
-   bool compiled = dStricmp(ext, ".mis") && !journal && !Con::getBoolVariable("Scripts::ignoreDSOs");
-#else
-   bool compiled = dStricmp(ext, ".mis")  && !Con::getBoolVariable("Scripts::ignoreDSOs");
-#endif //TORQUE_ALLOW_JOURNALING
-
-   // [tom, 12/5/2006] stripBasePath() messes up if the filename is not in the exe
-   // path, current directory or prefs path. Thus, getDSOFilename() will also mess
-   // up and so this allows the scripts to still load but without a DSO.
-   if(Platform::isFullPath(Platform::stripBasePath(pathBuffer)))
-      compiled = false;
-
-   // [tom, 11/17/2006] It seems to make sense to not compile scripts that are in the
-   // prefs directory. However, getDSOPath() can handle this situation and will put
-   // the dso along with the script to avoid name clashes with tools/game dsos.
-#ifdef TORQUE_ALLOW_DSO_GENERATION
-    // Is this a file we should compile? (anything in the prefs path should not be compiled)
-    StringTableEntry prefsPath = Platform::getPrefsPath();
-
-   if( dStrlen(prefsPath) > 0 && dStrnicmp(scriptFileName, prefsPath, dStrlen(prefsPath)) == 0)
-      compiled = false;
-#endif //TORQUE_ALLOW_DSO_GENERATION
-
-   // If we're in a journaling mode, then we will read the script
-   // from the journal file.
-#ifdef TORQUE_ALLOW_JOURNALING
-   if(journal && Game->isJournalReading())
-   {
-      char fileNameBuf[256];
-      bool fileRead;
-      U32 fileSize;
-
-      Game->getJournalStream()->readString(fileNameBuf);
-      Game->getJournalStream()->read(&fileRead);
-      if(!fileRead)
-      {
-         Con::errorf(ConsoleLogEntry::Script, "Journal script read (failed) for %s", fileNameBuf);
-         execDepth--;
-         return false;
-      }
-      Game->journalRead(&fileSize);
-      char *script = new char[fileSize + 1];
-      Game->journalRead(fileSize, script);
-      script[fileSize] = 0;
-      Con::printf("Executing (journal-read) %s.", scriptFileName);
-      CodeBlock *newCodeBlock = new CodeBlock();
-      newCodeBlock->compileExec(scriptFileName, script, noCalls, 0);
-      delete [] script;
-
-      execDepth--;
-      return true;
-   }
-#endif //TORQUE_ALLOW_JOURNALING
-
-   // Ok, we let's try to load and compile the script.
-   ResourceObject *rScr = ResourceManager->find(scriptFileName);
-   ResourceObject *rCom = NULL;
-
-   char nameBuffer[512];
-   char* script = NULL;
-   U32 scriptSize = 0;
-   U32 version;
-
-   Stream *compiledStream = NULL;
-   FileTime comModifyTime, scrModifyTime;
-
-   // Check here for .edso
-   //bool edso = false;
-   //if( dStricmp( ext, ".edso" ) == 0  && rScr )
-   //{
-   //   edso = true;
-   //   rCom = rScr;
-   //   rScr = NULL;
-
-   //   rCom->getFileTimes( NULL, &comModifyTime );
-   //   dStrcpy( nameBuffer, scriptFileName );
-   //}
-
-   // If we're supposed to be compiling this file, check to see if there's a DSO
-   if(compiled /*&& !edso*/)
-   {
-      const char *filenameOnly = dStrrchr(scriptFileName, '/');
-      if(filenameOnly)
-         ++filenameOnly; //remove the / at the front
-      else
-         filenameOnly = scriptFileName;
-
-      char pathAndFilename[1024];
-      Platform::makeFullPathName(filenameOnly, pathAndFilename, sizeof(pathAndFilename), dsoPath);
-
-      if( isEditorScript )
-         dStrcpyl(nameBuffer, sizeof(nameBuffer), pathAndFilename, ".edso", NULL);
-      else
-         dStrcpyl(nameBuffer, sizeof(nameBuffer), pathAndFilename, ".dso", NULL);
-
-      rCom = ResourceManager->find(nameBuffer);
-
-      if(rCom)
-         rCom->getFileTimes(NULL, &comModifyTime);
-      if(rScr)
-         rScr->getFileTimes(NULL, &scrModifyTime);
-   }
-
-   // Let's do a sanity check to complain about DSOs in the future.
-   //
-   // MM:	This doesn't seem to be working correctly for now so let's just not issue
-   //		the warning until someone knows how to resolve it.
-   //
-   //if(compiled && rCom && rScr && Platform::compareFileTimes(comModifyTime, scrModifyTime) < 0)
-   //{
-   //Con::warnf("exec: Warning! Found a DSO from the future! (%s)", nameBuffer);
-   //}
-
-    // If we had a DSO, let's check to see if we should be reading from it.
-    if((compiled && rCom) && (!rScr || Platform::compareFileTimes(comModifyTime, scrModifyTime) >= 0))
-    {
-      compiledStream = ResourceManager->openStream(nameBuffer);
-      if (compiledStream)
-      {
-         // Check the version!
-         compiledStream->read(&version);
-         if(version != DSO_VERSION)
-         {
-            Con::warnf("exec: Found an old DSO (%s, ver %d < %d), ignoring.", nameBuffer, version, DSO_VERSION);
-            ResourceManager->closeStream(compiledStream);
-            compiledStream = NULL;
-         }
-      }
-    }
-
-#ifdef TORQUE_ALLOW_JOURNALING
-   // If we're journalling, let's write some info out.
-   if(journal && Game->isJournalWriting())
-      Game->getJournalStream()->writeString(scriptFileName);
-#endif //TORQUE_ALLOW_JOURNALING
-
-   if(rScr && !compiledStream)
-   {
-      // If we have source but no compiled version, then we need to compile
-      // (and journal as we do so, if that's required).
-
-       //Con::errorf( "No DSO found! : %s", scriptFileName );
-       
-      Stream *s = ResourceManager->openStream(scriptFileName);
-       
-#ifdef	TORQUE_ALLOW_JOURNALING
-      if(journal && Game->isJournalWriting())
-         Game->getJournalStream()->write(bool(s != NULL));
-#endif	//TORQUE_ALLOW_JOURNALING
-
-      if(s)
-      {
-         scriptSize = ResourceManager->getSize(scriptFileName);
-         script = new char [scriptSize+1];
-         s->read(scriptSize, script);
-
-#ifdef	TORQUE_ALLOW_JOURNALING
-         if(journal && Game->isJournalWriting())
-         {
-            Game->journalWrite(scriptSize);
-            Game->journalWrite(scriptSize, script);
-         }
-#endif	//TORQUE_ALLOW_JOURNALING
-         ResourceManager->closeStream(s);
-         script[scriptSize] = 0;
-      }
-
-      if (!scriptSize || !script)
-      {
-         delete [] script;
-         Con::errorf(ConsoleLogEntry::Script, "exec: invalid script file %s.", scriptFileName);
-         execDepth--;
-         return false;
-      }
-
-//Luma: Sven -
-// no dsos in the editor, seems to fail with so many console changes and version crap. Leaving it to
-// work with cs files as is, as they are included with the source either way.
-
-//Also, no DSO generation on iPhone
-#ifdef TORQUE_OS_IOS
-      if(false) 
-#else
-      if(compiled)
-#endif
-      {
-         // compile this baddie.
-         #if defined(TORQUE_DEBUG)
-         Con::printf("Compiling %s...", scriptFileName);
-         #endif
-         CodeBlock *code = new CodeBlock();
-         code->compile(nameBuffer, scriptFileName, script);
-         delete code;
-         code = NULL;
-
-         compiledStream = ResourceManager->openStream(nameBuffer);
-         if(compiledStream)
-         {
-            compiledStream->read(&version);
-         }
-         else
-         {
-            // We have to exit out here, as otherwise we get double error reports.
-            delete [] script;
-            execDepth--;
-            return false;
-         }
-      }
-   }
-   else
-   {
-#ifdef	TORQUE_ALLOW_JOURNALING
-      if(journal && Game->isJournalWriting())
-         Game->getJournalStream()->write(bool(false));
-#endif	//TORQUE_ALLOW_JOURNALING
-   }
-    
-    //Luma : Load compiled script here
-   if(compiledStream)
-   {
-      // Delete the script object first to limit memory used
-      // during recursive execs.
-      delete [] script;
-      script = 0;
-
-      // We're all compiled, so let's run it.
-      
-      //Luma: Profile script executions 
-      F32 st1 = (F32)Platform::getRealMilliseconds();
-
-      CodeBlock *code = new CodeBlock;
-      code->read(scriptFileName, *compiledStream);
-      ResourceManager->closeStream(compiledStream);
-      code->exec(0, scriptFileName, NULL, 0, NULL, noCalls, NULL, 0);
-
-        F32 et1 = (F32)Platform::getRealMilliseconds();
-        
-        F32 etf = et1 - st1;
-
-        if ( scriptExecutionEcho )
-            Con::printf("Loaded compiled script %s. Took %.0f ms", scriptFileName, etf);
-
-      ret = true;
-   }
-   else if(rScr) //Luma : Load normal cs file here.
-   {
-         // No compiled script,  let's just try executing it
-         // directly... this is either a mission file, or maybe
-         // we're on a readonly volume.
-        
-         CodeBlock *newCodeBlock = new CodeBlock();
-         StringTableEntry name = StringTable->insert(scriptFileName);
-
-      
-      //Luma: Profile script executions 
-         F32 st1 = (F32)Platform::getRealMilliseconds();
-         
-         newCodeBlock->compileExec(name, script, noCalls, 0);
-
-         F32 et1 = (F32)Platform::getRealMilliseconds();
-
-         F32 etf = et1 - st1;
-         
-        if ( scriptExecutionEcho )
-            Con::printf("Executed %s. Took %.0f ms", scriptFileName, etf);
-
-         ret = true;
-   }
-   else
-   {
-      // Don't have anything.
-      Con::warnf(ConsoleLogEntry::Script, "Missing file: %s!", pathBuffer);
-      ret = false;
-   }
-
-   delete [] script;
-   execDepth--;
-   return ret;
-}
-
-ConsoleFunction(eval, const char *, 2, 2, "( script ) Use the eval function to execute any valid script statement.\n"
-                                                                "If you choose to eval a multi-line statement, be sure that there are no comments or comment blocks embedded in the script string.\n"
-                                                                "@param script A string containing a valid script statement. This may be a single line statement or multiple lines concatenated together with new-line characters.\n"
-                                                                "@return Returns the result of executing the script statement.\n"
-                                                                "@sa call")
-{
-   TORQUE_UNUSED( argc );
-   return Con::evaluate(argv[1], false, NULL);
-}
-
-ConsoleFunction(getVariable, const char *, 2, 2, "(string varName) Grabs the relevant data for the variable represented by the given string\n"
-                "@param varName A String representing the variable to check\n"
-                "@return Returns a string containing component data for the requested variable or an empty string if not found.")
-{
-   return Con::getVariable(argv[1]);
-}
-
-ConsoleFunction(isFunction, bool, 2, 2, "(string funcName) Checks whether given name represents a current valid function.\n"
-                "@param funcName The name of the function to check.\n"
-                "@return Returns either true if the string represents a valid function or false if not.")
-{
-   return Con::isFunction(argv[1]);
-}
-
-ConsoleFunction(isMethod, bool, 3, 3, "(string namespace, string method) Checks whether the given method name represents a valid method within the given namespace.\n"
-                "@param namespace A string representing the namespace in which the method should reside.\n"
-                "@param method The name of the method in question.\n"
-                "@return Returns a boolean value which is true if the given mathod name represents a valid method in the namespace and false otherwise.")
-{
-   Namespace* ns = Namespace::find( StringTable->insert( argv[1] ) );
-   Namespace::Entry* nse = ns->lookup( StringTable->insert( argv[2] ) );
-   if( !nse )
-      return false;
-
-   return true;
-}
-
-ConsoleFunction(getModNameFromPath, const char *, 2, 2, "(string path) Attempts to extract a mod directory from path. Returns empty string on failure.")
-{
-   StringTableEntry modPath = Con::getModNameFromPath(argv[1]);
-   return modPath ? modPath : "";
-}
-
-//----------------------------------------------------------------
-
-ConsoleFunction(getPrefsPath, const char *, 1, 2, "([fileName])")
-{
-   const char *filename = Platform::getPrefsPath(argc > 1 ? argv[1] : NULL);
-   if(filename == NULL || *filename == 0)
-      return "";
-     
-   return filename;
-}
-
-ConsoleFunction(execPrefs, bool, 2, 4, "execPrefs(fileName [, nocalls [,journalScript]])")
-{
-   const char *filename = Platform::getPrefsPath(argv[1]);
-   if (filename == NULL || *filename == 0)
-      return false;
-
-   if ( !Platform::isFile(filename) )
-    return false;
-
-   argv[0] = "exec";
-   argv[1] = filename;
-   return dAtob(Con::execute(argc, argv));
-}
-
-ConsoleFunction(export, void, 2, 4, "( wildCard [ ,fileName [ , append  ] ]) Use the export function to save all global variables matching the specified name pattern in wildCard to a file, either appending to that file or over-writing it.\n"
-                                                                "@param wildCard A string identifying what variable(s) to export. All characters used to create a global are allowed and the special symbol \"*\", meaning 0 or more instances of any character.\n"
-                                                                "@param fileName A string containing a path to a file in which to save the globals and their definitions.\n"
-                                                                "@param append A boolean value. If this value is true, the file will be appended to if it exists, otherwise it will be created/over-written.\n"
-                                                                "@return No return value")
-{
-    // Fetch the wildcard.
-    const char* pWildcard = argv[1];
-
-    // Fetch the filename.
-    const char* pFilename = NULL;
-    if ( argc >= 3 )
-    {
-        Con::expandPath( pathBuffer, sizeof(pathBuffer), argv[2] );
-        pFilename = pathBuffer;
-    }
-
-    // Fetch append flag.
-    const bool append = argc >= 4 ? dAtob(argv[3] ) : false;
-
-    // Export the variables.
-    gEvalState.globalVars.exportVariables( pWildcard, pFilename, append );
-}
-
-ConsoleFunction(deleteVariables, void, 2, 2, "( wildCard ) Use the deleteVariables function to delete any global variable matching the wildCard statement.\n"
-                                                                "@param wildCard A string identifying what variable(s) to delete. All characters used to create a global are allowed and the special symbol \"*\", meaning 0 or more instances of any character.\n"
-                                                                "@return No return value")
-{
-   TORQUE_UNUSED( argc );
-   gEvalState.globalVars.deleteVariables(argv[1]);
-}
-
-//----------------------------------------------------------------
-
-ConsoleFunction(trace, void, 2, 2, "( enable ) Use the trace function to enable (or disable) function call tracing. If enabled, tracing will print a message every time a function is entered, showing what arguments it received, and it will print a message every time a function is exited, showing the return value (or last value of last statement) for that function.\n"
-                                                                "@param enable A boolean value. If set to true, tracing is enabled, otherwise it is disabled.\n"
-                                                                "@return No return value")
-{
-   TORQUE_UNUSED( argc );
-   gEvalState.traceOn = dAtob(argv[1]);
-   Con::printf("Console trace is %s", gEvalState.traceOn ? "on." : "off.");
-}
-
-//----------------------------------------------------------------
-
-#if defined(TORQUE_DEBUG) || defined(INTERNAL_RELEASE)
-ConsoleFunction(debug, void, 1, 1, "() Use the debug function to cause the engine to issue a debug break and to break into an active debugger.\n"
-                                                                "For this to work, the engine must have been compiled with either TORQUE_DEBUG, or INTERNAL_RELEASE defined\n"
-                                                                "@return No return value.")
-{
-   TORQUE_UNUSED( argc );
-   TORQUE_UNUSED( argv );
-   Platform::debugBreak();
-}
-#endif
-
-#if defined(TORQUE_OS_IOS) || defined(TORQUE_OS_OSX)
-//Some code for allowing torsion to connect, this code returns the ipads local ip address
-//code was obtained from http://blog.zachwaugh.com/post/309927273/programmatically-retrieving-ip-address-of-iphone
-//adapted to iT2D by me
-ConsoleFunction(getAppleDeviceIPAddress, const char*, 1, 1, "Gets the Apple hardware local IP on wifi. Should work on OS X and iOS")
-{
-    char *address = Con::getReturnBuffer(32);
-    dStrcpy(address, "error");
-    struct ifaddrs *interfaces = NULL;
-    struct ifaddrs *temp_addr = NULL;
-    int success = 0;
-
-    // retrieve the current interfaces - returns 0 on success
-    success = getifaddrs(&interfaces);
-    if (success == 0)
-    {
-        // Loop through linked list of interfaces
-        temp_addr = interfaces;
-        while(temp_addr != NULL)
-        {
-            if(temp_addr->ifa_addr->sa_family == AF_INET)
-            {
-                // Check if interface is en0 which is the wifi connection on the iPhone
-                // Note: Could be different on MacOSX and simulator and may need modifying
-                if(dStrcmp(temp_addr->ifa_name, "en0") == 0)
-                {
-                    dStrcpy(address, inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr));
-                }
-            }
-
-            temp_addr = temp_addr->ifa_next;
-        }
-    }
-
-    // Free memory
-    freeifaddrs(interfaces);
-
-    return address;
-}
-#endif
-
-ConsoleFunctionGroupEnd( MetaScripting );
-
-//----------------------------------------------------------------
-
 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"

BIN
engine/source/console/expando_ScriptBinding.h


BIN
engine/source/console/metaScripting_ScriptBinding.cc


BIN
engine/source/console/output_ScriptBinding.h


+ 1 - 0
engine/source/console/scriptBinding.dox

@@ -203,6 +203,7 @@ typedef type NL;
 	@{
 */
 
+
 /*! @} */ // arithmetic operators
 
 /*! @} */ // all operators

BIN
engine/source/debug/remote/RemoteDebugger1_ScriptBinding.h


BIN
engine/source/debug/remote/RemoteDebuggerBase_ScriptBinding.h


BIN
engine/source/debug/remote/RemoteDebuggerBridge_ScriptBinding.h


BIN
engine/source/game/gameInterface_ScriptBinding.h


+ 12 - 55
engine/source/game/version.cc

@@ -26,6 +26,8 @@
 #include "string/stringTable.h"
 #include "io/resource/resourceManager.h"
 
+#include "version_ScriptBinding.h"
+
 //-----------------------------------------------------------------------------
 
 static const U32 csgVersionNumber = TORQUE_GAME_ENGINE;
@@ -52,78 +54,33 @@ const char* getCompileTimeString()
 {
    return __DATE__ " at " __TIME__;
 }
-//----------------------------------------------------------------
-
-ConsoleFunction(isDebugBuild, bool, 1, 1, "() Use the isDebugBuild function to determine if this is a debug build.\n"
-                                                                "@return Returns true if this is a debug build, otherwise false.\n"
-                                                                "@sa getBuildString, getCompileTimeString, getVersionNumber, getVersionString")
-{
-#ifdef TORQUE_DEBUG
-   return true;
-#else
-   return false;
-#endif
-}
-
-ConsoleFunction( getVersionNumber, S32, 1, 1, "() Use the getVersionNumber function to get the version number of the currently executing engine.\n"
-                                                                "@return Returns an integer representing the engine's version number.\n"
-                                                                "@sa getBuildString, getCompileTimeString, getVersionString, isDebugBuild")
-{
-   return getVersionNumber();
-}
-
-ConsoleFunction( getVersionString, const char*, 1, 1, "() Use the getVersionString function to get the version name and number for the currently executing engine.\n"
-                                                                "@return Returns a string containing a name and an integer representing the engine's version type and version number.\n"
-                                                                "@sa getBuildString, getCompileTimeString, getVersionNumber, isDebugBuild")
-{
-   return getVersionString();
-}
 
-ConsoleFunction( getCompileTimeString, const char*, 1, 1, "() Use the getCompileTimeString function to determine when the currently running engine was built.\n"
-                                                                "@return Returns a string containing \"Month Day Year at Hour:Minute:Second\" showing when this executable was built.\n"
-                                                                "@sa getBuildString, getVersionNumber, getVersionString, isDebugBuild")
-{
-   return getCompileTimeString();
-}
+//-----------------------------------------------------------------------------
 
-ConsoleFunction( getBuildString, const char*, 1, 1, "() Use the getBuildString function to determine if this build is a \"Debug\" release, or a \"Release\" build.\n"
-                                                                "@return Returns a string, either \"Debug\" for a debug build, or \"Release\" for a release build.\n"
-                                                                "@sa getCompileTimeString, getVersionNumber, getVersionString, isDebugBuild")
+const char* getCompanyName()
 {
-#ifdef TORQUE_DEBUG
-   return "Debug";
-#else
-   return "Release";
-#endif
+	return sgCompanyName;
 }
 
 //-----------------------------------------------------------------------------
 
-ConsoleFunction( getEngineVersion, const char*, 1, 1, "() - Gets the engine version.")
+const char* getProductName()
 {
-    return T2D_ENGINE_VERSION;
+	return sgProductName;
 }
 
 //-----------------------------------------------------------------------------
 
-ConsoleFunction( getiPhoneToolsVersion, const char*, 1, 1, "Returns iPhone Tools Version")
+void setCompanyName(StringTableEntry companyName)
 {
-    return T2D_IPHONETOOLS_VERSION;
+	sgCompanyName = companyName;
 }
 
 //-----------------------------------------------------------------------------
 
-ConsoleFunction(setCompanyAndProduct, void, 3, 3, "(company, product) Sets the company and product information.")
+void setProductName(StringTableEntry productName)
 {
-   sgCompanyName = StringTable->insert(argv[1]);
-   sgProductName = StringTable->insert(argv[2]);
-
-   Con::setVariable("$Game::CompanyName", sgCompanyName);
-   Con::setVariable("$Game::ProductName", sgProductName);
-
-   char appDataPath[1024];
-   dSprintf(appDataPath, sizeof(appDataPath), "%s/%s/%s", Platform::getUserDataDirectory(), sgCompanyName, sgProductName);
-   
-   ResourceManager->addPath(appDataPath);
+	sgProductName = productName;
 }
 
+//-----------------------------------------------------------------------------

+ 6 - 0
engine/source/game/version.h

@@ -36,4 +36,10 @@ const char* getVersionString();
 /// Gets the compile date and time
 const char* getCompileTimeString();
 
+const char* getCompanyName();
+const char* getProductName();
+
+void setCompanyName(StringTableEntry companyName);
+void setProductName(StringTableEntry productName);
+
 #endif // _ENGINE_VERSION_H_

BIN
engine/source/game/version_ScriptBinding.h


+ 2 - 79
engine/source/graphics/color.cc

@@ -24,6 +24,8 @@
 #include "console/console.h"
 #include "console/consoleTypes.h"
 
+#include "color_ScriptBinding.h"
+
 #ifndef _STRINGUNIT_H_
 #include "string/stringUnit.h"
 #endif
@@ -574,82 +576,3 @@ ConsoleSetType( TypeColorI )
         Con::printf("Color must be set as { r, g, b [,a] }, { r g b [b] }  or { stockColorName }");
 }
 
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( getStockColorCount, S32, 1, 1, "() - Gets a count of available stock colors.\n"
-                                                "@return A count of available stock colors." )
-{
-    return StockColor::getCount();
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( getStockColorName, const char*, 2, 2,  "(stockColorIndex) - Gets the stock color name at the specified index.\n"
-                                                        "@param stockColorIndex The zero-based index of the stock color name to retrieve.\n"
-                                                        "@return The stock color name at the specified index or nothing if the string is invalid." )
-{
-    // Fetch stock color index.
-    const S32 stockColorIndex = dAtoi(argv[1]);
-
-    // Fetch the color item.
-    const StockColorItem* pColorItem = StockColor::getColorItem( stockColorIndex );
-
-    return pColorItem == NULL ? NULL : pColorItem->getColorName();
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( isStockColor, bool, 2, 2,  "(stockColorName) - Gets whether the specified name is a stock color or not.\n"
-                                            "@param stockColorName - The stock color name to test for.\n"
-                                            "@return Whether the specified name is a stock color or not.\n" )
-{
-    // Fetch stock color name.
-    const char* pStockColorName = argv[1];
-
-    // Return whether this is a stock color name or not.
-    return StockColor::isColor( pStockColorName );
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( getStockColorF, const char*, 2, 2, "(stockColorName) - Gets a floating-point-based stock color by name.\n"
-                                                    "@param stockColorName - The stock color name to retrieve.\n"
-                                                    "@return The stock color that matches the specified color name.  Returns nothing if the color name is not found.\n" )
-{
-    // Fetch stock color name.
-    const char* pStockColorName = argv[1];
-
-    // Return nothing if stock color name is invalid.
-    if ( !StockColor::isColor( pStockColorName ) )
-        return StringTable->EmptyString;
-
-    // Fetch stock color.
-    const ColorF& color = StockColor::colorF( pStockColorName );
-
-    // Format stock color.
-    char* returnBuffer = Con::getReturnBuffer(256);
-    dSprintf(returnBuffer, 256, "%g %g %g %g", color.red, color.green, color.blue, color.alpha);
-    return(returnBuffer);
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( getStockColorI, const char*, 2, 2, "(stockColorName) - Gets a byte-based stock color by name.\n"
-                                                    "@param stockColorName - The stock color name to retrieve.\n"
-                                                    "@return The stock color that matches the specified color name.  Returns nothing if the color name is not found.\n" )
-{
-    // Fetch stock color name.
-    const char* pStockColorName = argv[1];
-
-    // Return nothing if stock color name is invalid.
-    if ( !StockColor::isColor( pStockColorName ) )
-        return StringTable->EmptyString;
-
-    // Fetch stock color.
-    const ColorI& color = StockColor::colorI( pStockColorName );
-
-    // Format stock color.
-    char* returnBuffer = Con::getReturnBuffer(256);
-    dSprintf(returnBuffer, 256, "%d %d %d %d", color.red, color.green, color.blue, color.alpha);
-    return(returnBuffer);
-}

BIN
engine/source/graphics/color_ScriptBinding.h


+ 2 - 372
engine/source/gui/guiCanvas.cc

@@ -32,382 +32,12 @@
 #include "gui/guiCanvas.h"
 #include "game/gameInterface.h"
 
+#include "guiCanvas_ScriptBinding.h"
+
 IMPLEMENT_CONOBJECT(GuiCanvas);
 
 GuiCanvas *Canvas = NULL;
 
-ConsoleMethod( GuiCanvas, getContent, S32, 2, 2, "() Use the getContent method to get the ID of the control which is being used as the current canvas content.\n"
-                                                                "@return Returns the ID of the current canvas content (a control), or 0 meaning the canvas is empty")
-{
-   GuiControl *ctrl = object->getContentControl();
-   if(ctrl)
-      return ctrl->getId();
-   return -1;
-}
-
-ConsoleMethod( GuiCanvas, setContent, void, 3, 3, "( handle ) Use the setContent method to set the control identified by handle as the current canvas content.\n"
-                                                                "@param handle The numeric ID or name of the control to be made the canvas contents.\n"
-                                                                "@return No return value")
-{
-   GuiControl *gui = NULL;
-   if(argv[2][0])
-   {
-      if (!Sim::findObject(argv[2], gui))
-      {
-         Con::printf("%s(): Invalid control: %s", argv[0], argv[2]);
-         return;
-      }
-   }
-
-   //set the new content control
-   Canvas->setContentControl(gui);
-}
-
-ConsoleMethod( GuiCanvas, pushDialog, void, 3, 4, "( handle [ , layer ] ) Use the pushDialog method to open a dialog on a specific canvas layer, or in the same layer the last openned dialog. Newly placed dialogs placed in a layer with another dialog(s) will overlap the prior dialog(s).\n"
-                                                                "@param handle The numeric ID or name of the dialog to be opened.\n"
-                                                                "@param layer A integer value in the range [ 0 , inf ) specifying the canvas layer to place the dialog in.\n"
-                                                                "@return No return value")
-{
-   GuiControl *gui;
-
-   if (!	Sim::findObject(argv[2], gui))
-   {
-      Con::printf("%s(): Invalid control: %s", argv[0], argv[2]);
-      return;
-   }
-
-   //find the layer
-   S32 layer = 0;
-   if (argc == 4)
-      layer = dAtoi(argv[3]);
-
-   //set the new content control
-   Canvas->pushDialogControl(gui, layer);
-}
-
-ConsoleMethod( GuiCanvas, popDialog, void, 2, 3, "( handle ) Use the popDialog method to remove a currently showing dialog. If no handle is provided, the top most dialog is popped.\n"
-                                                                "@param handle The ID or a previously pushed dialog.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa pushDialog, popLayer")
-{
-   // Must initialize this to NULL to avoid crash on the if (gui) statement further down [KNM | 07/28/11 | ITGB-120]
-   //GuiControl * gui;
-   GuiControl * gui = NULL;
-   if (argc == 3)
-   {
-      if (!Sim::findObject(argv[2], gui))
-      {
-         Con::printf("%s(): Invalid control: %s", argv[0], argv[2]);
-         return;
-      }
-   }
-
-   if (gui)
-      Canvas->popDialogControl(gui);
-   else
-      Canvas->popDialogControl();
-}
-
-ConsoleMethod( GuiCanvas, popLayer, void, 2, 3, "( layer ) Use the popLayer method to remove (close) all dialogs in the specified canvas �layer�.\n"
-                                                                "@param layer A integer value in the range [ 0 , inf ) specifying the canvas layer to clear.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa pushDialog, popDialog")
-{
-   S32 layer = 0;
-   if (argc == 3)
-      layer = dAtoi(argv[2]);
-
-   Canvas->popDialogControl(layer);
-}
-
-ConsoleMethod(GuiCanvas, cursorOn, void, 2, 2, "() Use the cursorOn method to enable the cursor.\n"
-                                                                "@return No return value")
-{
-   Canvas->setCursorON(true);
-}
-
-ConsoleMethod(GuiCanvas, cursorOff, void, 2, 2, "() Use the cursorOff method to disable the cursor.\n"
-                                                                "@return No return value")
-{
-   Canvas->setCursorON(false);
-}
-
-ConsoleMethod( GuiCanvas, setCursor, void, 3, 3, "( cursorHandle ) Use the setCursor method to select the current cursor.\n"
-                                                                "@param cursorHandle The ID of a previously defined GuiCursor object.\n"
-                                                                "@return No return value")
-{
-   GuiCursor *curs = NULL;
-   if(argv[2][0])
-   {
-      if(!Sim::findObject(argv[2], curs))
-      {
-         Con::printf("%s is not a valid cursor.", argv[2]);
-         return;
-      }
-   }
-   Canvas->setCursor(curs);
-}
-
-ConsoleMethod( GuiCanvas, renderFront, void, 3, 3, "(bool enable)")
-{
-   Canvas->setRenderFront(dAtob(argv[2]));
-}
-
-ConsoleMethod( GuiCanvas, showCursor, void, 2, 2, "")
-{
-   Canvas->showCursor(true);
-}
-
-ConsoleMethod( GuiCanvas, hideCursor, void, 2, 2, "")
-{
-   Canvas->showCursor(false);
-}
-
-ConsoleMethod( GuiCanvas, isCursorOn, bool, 2, 2, "")
-{
-   return Canvas->isCursorON();
-}
-
-ConsoleMethod( GuiCanvas, setDoubleClickDelay, void, 3, 3, "")
-{
-   Canvas->setDoubleClickTime(dAtoi(argv[2]));
-}
-
-ConsoleMethod( GuiCanvas, setDoubleClickMoveBuffer, void, 4, 4, "")
-{
-   Canvas->setDoubleClickWidth(dAtoi(argv[2]));
-   Canvas->setDoubleClickHeight(dAtoi(argv[3]));
-}
-
-ConsoleMethod( GuiCanvas, repaint, void, 2, 2, "() Use the repaint method to force the canvas to redraw all elements.\n"
-                                                                "@return No return value")
-{
-   Canvas->paint();
-}
-
-ConsoleMethod( GuiCanvas, reset, void, 2, 2, "() Use the reset method to reset the current canvas update region.\n"
-                                                                "@return No return value")
-{
-   Canvas->resetUpdateRegions();
-}
-
-ConsoleMethod( GuiCanvas, getCursorPos, const char*, 2, 2, "() Use the getCursorPos method to retrieve the current position of the mouse pointer.\n"
-                                                                "@return Returns a vector containing the �x y� coordinates of the cursor in the canvas")
-{
-   Point2I pos = Canvas->getCursorPos();
-   char * ret = Con::getReturnBuffer(32);
-   dSprintf(ret, 32, "%d %d", pos.x, pos.y);
-   return(ret);
-}
-
-ConsoleMethod( GuiCanvas, setCursorPos, void, 3, 4, "( ) Use the setCursorPos method to set the position of the cursor in the cavas.\n"
-                                                                "@param position An \"x y\" position vector specifying the new location of the cursor.\n"
-                                                                "@return No return value")
-{
-   Point2I pos(0,0);
-
-   if(argc == 4)
-      pos.set(dAtoi(argv[2]), dAtoi(argv[3]));
-   else
-      dSscanf(argv[2], "%d %d", &pos.x, &pos.y);
-
-   Canvas->setCursorPos(pos);
-}
-
-ConsoleMethod( GuiCanvas, getMouseControl, S32, 2, 2, "Gets the gui control under the mouse.")
-{
-   GuiControl* control = object->getMouseControl();
-   if (control)
-      return control->getId();
-   
-   return NULL;
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(GuiCanvas, setBackgroundColor, void, 3, 6,    "(float red, float green, float blue, [float alpha = 1.0]) - Sets the background color for the canvas."
-                                                            "@param red The red value.\n"
-                                                            "@param green The green value.\n"
-                                                            "@param blue The blue value.\n"
-                                                            "@param alpha The alpha value.\n"
-                                                            "@return No return Value.")
-{
-    // The colors.
-    F32 red;
-    F32 green;
-    F32 blue;
-    F32 alpha = 1.0f;
-
-    // Space separated.
-    if (argc == 3)
-    {
-        // Grab the element count.
-        const U32 elementCount = Utility::mGetStringElementCount(argv[2]);
-
-        // Has a single argument been specified?
-        if ( elementCount == 1 )
-        {
-            object->setDataField( StringTable->insert("BackgroundColor"), NULL, argv[2] );
-            return;
-        }
-
-        // ("R G B [A]")
-        if ((elementCount == 3) || (elementCount == 4))
-        {
-            // Extract the color.
-            red   = dAtof(Utility::mGetStringElement(argv[2], 0));
-            green = dAtof(Utility::mGetStringElement(argv[2], 1));
-            blue  = dAtof(Utility::mGetStringElement(argv[2], 2));
-
-            // Grab the alpha if it's there.
-            if (elementCount > 3)
-                alpha = dAtof(Utility::mGetStringElement(argv[2], 3));
-        }
-
-        // Invalid.
-        else
-        {
-            Con::warnf("GuiCanvas::setBackgroundColor() - Invalid Number of parameters!");
-            return;
-        }
-    }
-
-    // (R, G, B)
-    else if (argc >= 5)
-    {
-        red   = dAtof(argv[2]);
-        green = dAtof(argv[3]);
-        blue  = dAtof(argv[4]);
-
-        // Grab the alpha if it's there.
-        if (argc > 5)
-            alpha = dAtof(argv[5]);
-    }
-
-    // Invalid.
-    else
-    {
-        Con::warnf("GuiCanvas::setBackgroundColor() - Invalid Number of parameters!");
-        return;
-    }
-
-    // Set background color.
-    object->setBackgroundColor(ColorF(red, green, blue, alpha) );
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(GuiCanvas, getBackgroundColor, const char*, 2, 2, "Gets the background color for the canvas.\n"
-                                                                "@return (float red / float green / float blue / float alpha) The background color for the canvas.")
-{
-    // Get the background color.
-    const ColorF& color = object->getBackgroundColor();
-
-    // Fetch color name.
-    StringTableEntry colorName = StockColor::name( color );
-
-    // Return the color name if it's valid.
-    if ( colorName != StringTable->EmptyString )
-        return colorName;
-
-    // Create Returnable Buffer.
-    char* pBuffer = Con::getReturnBuffer(64);
-
-    // Format Buffer.
-    dSprintf(pBuffer, 64, "%g %g %g %g", color.red, color.green, color.blue, color.alpha );
-
-    // Return buffer.
-    return pBuffer;
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(GuiCanvas, setUseBackgroundColor, void, 3, 3, "Sets whether to use the canvas background color or not.\n"
-                                                            "@param useBackgroundColor Whether to use the canvas background color or not.\n"
-                                                            "@return No return value." )
-{
-    // Fetch flag.
-    const bool useBackgroundColor = dAtob(argv[2]);
-
-    // Set the flag.
-    object->setUseBackgroundColor( useBackgroundColor );
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(GuiCanvas, getUseBackgroundColor, bool, 2, 2, "Gets whether the canvas background color is in use or not.\n"
-                                                            "@return Whether the canvas background color is in use or not." )
-{
-    // Get the flag.
-    return object->getUseBackgroundColor();
-}
-
-
-ConsoleFunction( createCanvas, bool, 2, 2, "( WindowTitle ) Use the createCanvas function to initialize the canvas.\n"
-                                                                "@return Returns true on success, false on failure.\n"
-                                                                "@sa createEffectCanvas")
-{
-    AssertISV(!Canvas, "CreateCanvas: canvas has already been instantiated");
-
-    Platform::initWindow(Point2I(MIN_RESOLUTION_X, MIN_RESOLUTION_Y), argv[1]);
-
-
-    if (!Video::getResolutionList())
-        return false;
-
-    // create the canvas, and add it to the manager
-    Canvas = new GuiCanvas();
-    Canvas->registerObject("Canvas"); // automatically adds to GuiGroup
-    return true;
-}
-
-ConsoleFunction( setCanvasTitle, void, 2, 2, "(string windowTitle) Sets the title to the provided string\n" 
-                "@param windowTitle The desired title\n"
-                "@return No Return Value")
-{
-   Platform::setWindowTitle( argv[1] );
-}
-
-ConsoleFunction(screenShot, void, 3, 3, "(string file, string format)"
-                "Take a screenshot.\n\n"
-                "@param format One of JPEG or PNG.")
-{
-#ifndef TORQUE_OS_IOS
-// PUAP -Mat no screenshots on iPhone can do it from Xcode
-    FileStream fStream;
-   if(!fStream.open(argv[1], FileStream::Write))
-   {   
-      Con::printf("Failed to open file '%s'.", argv[1]);
-      return;
-   }
-    
-   glReadBuffer(GL_FRONT);
-   
-   Point2I extent = Canvas->getExtent();
-   U8 * pixels = new U8[extent.x * extent.y * 4];
-   glReadPixels(0, 0, 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[2], "JPEG" ) == 0 )
-      bitmap->writeJPEG(fStream);
-   else if( dStrcmp( argv[2], "PNG" ) == 0)
-      bitmap->writePNG(fStream);
-   else
-      bitmap->writePNG(fStream);
-
-   fStream.close();
-   delete [] pixels;
-   delete bitmap;
-#endif
-}
-
-
 GuiCanvas::GuiCanvas()
 {
 #ifdef TORQUE_OS_IOS

BIN
engine/source/gui/guiCanvas_ScriptBinding.h


+ 2 - 228
engine/source/gui/guiControl.cc

@@ -35,6 +35,8 @@
 #include "string/unicode.h"
 #include "collection/vector.h"
 
+#include "guiControl_ScriptBinding.h"
+
 #ifndef _FRAMEALLOCATOR_H_
 #include "memory/frameAllocator.h"
 #endif
@@ -880,12 +882,6 @@ void GuiControl::setCanSave(bool bCanSave)
    mCanSave	=	bCanSave;
 }
 
-ConsoleMethod( GuiControl, setCanSave, void, 3,3,"(bool canSave) Sets whether this control can serialize itself to the hard disk\n"
-              "@param Flag setting\n"
-              "@return No Return Value")
-{
-   object->setCanSave( dAtob( argv[2] ) );
-}
 
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -905,217 +901,7 @@ void GuiControl::write(Stream &stream, U32 tabStop, U32 flags)
 }
 
 
-ConsoleMethod(GuiControl, pointInControl, bool, 4,4,"(int x, int y) Check if point id in the control\n"
-              "@param x Point x coordinate in parent coords\n"
-              "@param y Point y coordinate in parent coords\n"
-              "@return Returns true if the point is in the control, false otherwise")
-{
-   Point2I kPoint(dAtoi(argv[2]), dAtoi(argv[3]));
-   return object->pointInControl(kPoint);
-}
-
-
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //
-ConsoleMethod( GuiControl, addGuiControl, void, 3, 3, "(int controlId) Adds the gui control\n"
-              "@param controlId integer ID of the control to add\n"
-              "@return No Return value")
-{
-
-   GuiControl *ctrl = dynamic_cast<GuiControl *>(Sim::findObject(argv[2]));
-   if(ctrl)
-   {
-      object->addObject(ctrl);
-   }
-
-}
-
-//-----------------------------------------------------------------------------
-//	Make Sure Child 1 is Ordered Just Under Child 2.
-//-----------------------------------------------------------------------------
-ConsoleMethod(GuiControl, reorderChild, void, 4,4," (child1, child2) uses simset reorder to push child 1 after child 2 - both must already be child controls of this control")
-{
-   GuiControl* pControl = dynamic_cast<GuiControl*>(Sim::findObject(dAtoi(argv[2])));
-   GuiControl* pTarget	 = dynamic_cast<GuiControl*>(Sim::findObject(dAtoi(argv[3])));
-
-   if(pControl && pTarget)
-   {
-      object->reOrder(pControl,pTarget);
-   }
-}
-
-ConsoleMethod( GuiControl, getParent, S32, 2, 2, "() @return Returns the Id of the parent control")
-{
-
-   GuiControl* pParent		= object->getParent();
-   if(pParent)
-   {
-      return pParent->getId();
-   }
-
-   return 0;
-
-}
-
-ConsoleMethod( GuiControl, setValue, void, 3, 3, "( value ) Use the setValue method to set the control specific value to value. Purpose and type varies by control type.\n"
-                                                                "@param value Some control specific value.\n"
-                                                                "@return No return value")
-{
-   object->setScriptValue(argv[2]);
-}
-
-ConsoleMethod( GuiControl, getValue, const char*, 2, 2, "() Use the getValue method to get the control-specific 'value' for this control.\n"
-                                                                "@return Returns a control-specific specific value. Varies by control")
-{
-   return object->getScriptValue();
-}
-
-ConsoleMethod( GuiControl, setActive, void, 3, 3, "( isActive ) Use the setActive method to (de)activate this control. Once active, a control can accept inputs. Controls automatically re-shade/skin themselves to reflect their active/inactive state.\n"
-                                                                "@param isActive A boolean value. f isActive is true, this control is activated, else it is set to inactive.\n"
-                                                                "@return No return value")
-{
-   object->setActive(dAtob(argv[2]));
-}
-
-ConsoleMethod( GuiControl, isActive, bool, 2, 2, "() Use the isActive method to determine if this control is active.\n"
-                                                                "An inactive control may visible, but will not accept inputs. It will also normally re-shade or re-skin itself to reflect its inactive state\n"
-                                                                "@return Returns true if this control is active.")
-{
-   return object->isActive();
-}
-
-ConsoleMethod( GuiControl, setVisible, void, 3, 3, "( isVisible ) Use the setVisible method to (un)hide this control.\n"
-                                                                "@param isVisible A boolean value. If true, the control will be made visible, otherwise the control will be hidden.\n"
-                                                                "@return No return value")
-{
-   object->setVisible(dAtob(argv[2]));
-}
-
-ConsoleMethod( GuiControl, makeFirstResponder, void, 3, 3, "( isFirst ) Use the makeFirstResponder method to force this control to become the first responder.\n"
-                                                                "@param isFirst A boolean value. If true, then this control become first reponder and at captures inputs before all other controls, excluding dialogs above this control.\n"
-                                                                "@return No return value")
-{
-   object->makeFirstResponder(dAtob(argv[2]));
-}
-
-ConsoleMethod( GuiControl, isVisible, bool, 2, 2, "() Use the isVisible method to determine if this control is visible.\n"
-                                                                "This can return true, even if the entire control covered by another. This merely means that the control will render if not covered\n"
-                                                                "@return Returns true if the control is visible.")
-{
-   return object->isVisible();
-}
-
-ConsoleMethod( GuiControl, isAwake, bool, 2, 2, "() Use the isAwake method to determine if this control is awake.\n"
-                                                                "@return Returns true if this control is awake and ready to display")
-{
-   return object->isAwake();
-}
-
-ConsoleMethod( GuiControl, setProfile, void, 3, 3, "(GuiControlProfile p) Sets the currently used from for the GuiControl\n"
-              "@param p The profile you wish to set the control to use\n"
-              "@return No return value")
-{
-   GuiControlProfile * profile;
-
-   if(Sim::findObject(argv[2], profile))
-      object->setControlProfile(profile);
-}
-
-ConsoleMethod( GuiControl, resize, void, 6, 6, "(int x, int y, int w, int h) Resizes the control to the given dimensions")
-{
-   Point2I newPos(dAtoi(argv[2]), dAtoi(argv[3]));
-   Point2I newExt(dAtoi(argv[4]), dAtoi(argv[5]));
-   object->resize(newPos, newExt);
-}
-
-ConsoleMethod( GuiControl, getPosition, const char*, 2, 2, "() @return A string set up as \"<pos.x> <pos.y>\"")
-{
-   char *retBuffer = Con::getReturnBuffer(64);
-   const Point2I &pos = object->getPosition();
-   dSprintf(retBuffer, 64, "%d %d", pos.x, pos.y);
-   return retBuffer;
-}
-ConsoleMethod( GuiControl, getCenter, const char*, 2, 2, "() @return Returns center of control, as space seperated ints")
-{
-   char *retBuffer = Con::getReturnBuffer(64);
-   const Point2I pos = object->getPosition();
-   const Point2I ext = object->getExtent();
-   Point2I center(pos.x + ext.x/2, pos.y + ext.y/2);
-   dSprintf(retBuffer, 64, "%d %d", center.x, center.y);
-   return retBuffer;
-}
-
-ConsoleMethod( GuiControl, setCenter, void, 4, 4, "(int x, int y) Sets control position, by center - coords are local not global\n"
-              "@return No Return value.")
-{
-   const Point2I ext = object->getExtent();
-   Point2I newpos(dAtoi(argv[2])-ext.x/2, dAtoi(argv[3])-ext.y/2);
-   object->setPosition(newpos);
-}
-
-ConsoleMethod( GuiControl, getGlobalCenter, const char*, 2, 2, "@return Returns center of control, as space seperated ints")
-{
-   char *retBuffer = Con::getReturnBuffer(64);
-   const Point2I tl(0,0);
-   Point2I pos		 =	object->localToGlobalCoord(tl);
-   const Point2I ext = object->getExtent();
-   Point2I center(pos.x + ext.x/2, pos.y + ext.y/2);
-   dSprintf(retBuffer, 64, "%d %d", center.x, center.y);
-   return retBuffer;
-}
-
-ConsoleMethod( GuiControl, getGlobalPosition, const char*, 2, 2, "() @return Returns the control's position converted to global coordinates (position as space-separted integers)")
-{
-   char *retBuffer = Con::getReturnBuffer(64);
-   const Point2I pos(0,0);
-   Point2I gPos	=	object->localToGlobalCoord(pos);
-
-   dSprintf(retBuffer, 64, "%d %d", gPos.x, gPos.y);
-   return retBuffer;
-}
-ConsoleMethod( GuiControl, setPositionGlobal, void, 4, 4, "(int x, int y) Sets the control's position in global space\n"
-              "@return No return value")
-{
-   //see if we can turn the x/y into ints directly, 
-   Point2I gPos(dAtoi(argv[2]), dAtoi(argv[3]));
-   Point2I lPosOffset	=	object->globalToLocalCoord(gPos);
-   lPosOffset.x += object->mBounds.point.x;
-   lPosOffset.y += object->mBounds.point.y;
-
-   object->mBounds.set(lPosOffset,object->mBounds.extent);
-}
-
-ConsoleMethod( GuiControl, setPosition, void, 4, 4, "(int x, int y) Sets the current control position in local space\n"
-              "@return No Return Value.")
-{
-   //see if we can turn the x/y into ints directly, 
-   Point2I lPos(dAtoi(argv[2]), dAtoi(argv[3]));
-   object->mBounds.set(lPos,object->mBounds.extent);
-}
-
-ConsoleMethod( GuiControl, getExtent, const char*, 2, 2, "Get the width and height of the control.\n"
-              "@return The height and width as a string with space-separated integers")
-{
-   char *retBuffer = Con::getReturnBuffer(64);
-   const Point2I &ext = object->getExtent();
-   dSprintf(retBuffer, 64, "%d %d", ext.x, ext.y);
-   return retBuffer;
-}
-
-ConsoleMethod( GuiControl, setExtent, void, 4, 4, "(int width, int height) Sets the width & height of the control.\n"
-              "@return No Return Value.")
-{
-   Point2I kExt(dAtoi(argv[2]), dAtoi(argv[3]));
-   object->setExtent(kExt);
-}
 
-ConsoleMethod( GuiControl, getMinExtent, const char*, 2, 2, "() Get the minimum allowed size of the control.\n"
-              "@return Returns the minimum extent as a string with space separated point values <width> <height>")
-{
-   char *retBuffer = Con::getReturnBuffer(64);
-   const Point2I &minExt = object->getMinExtent();
-   dSprintf(retBuffer, 64, "%d %d", minExt.x, minExt.y);
-   return retBuffer;
-}
 
 void GuiControl::onRemove()
 {
@@ -1247,13 +1033,6 @@ bool GuiControl::pointInControl(const Point2I& parentCoordPoint)
    return xt >= 0 && yt >= 0 && xt < mBounds.extent.x && yt < mBounds.extent.y;
 }
 
-ConsoleMethod( GuiControl, findHitControl, S32, 4, 4, "(int x, int y) Searches for the control at the given point\n" 
-              "@return Returns the Id of the control at the point")
-{
-   Point2I pos(dAtoi(argv[2]), dAtoi(argv[3]));
-   GuiControl *hit = object->findHitControl(pos);
-   return hit ? hit->getId() : 0;
-}
 
 GuiControl* GuiControl::findHitControl(const Point2I &pt, S32 initialLayer)
 {
@@ -1547,11 +1326,6 @@ void GuiControl::setFirstResponder()
     }
 }
 
-ConsoleMethod(GuiControl, setFirstResponder, void , 2, 2, "Sets this control as the first responder")
-{
-   object->setFirstResponder();
-}
-
 void GuiControl::clearFirstResponder()
 {
    GuiControl *parent = this;

BIN
engine/source/gui/guiControl_ScriptBinding.h


+ 3 - 153
engine/source/input/actionMap.cc

@@ -29,6 +29,9 @@
 #include "io/fileStream.h"
 #include "io/resource/resourceManager.h"
 
+// Script bindings.
+#include "actionMap_ScriptBinding.h"
+
 IMPLEMENT_CONOBJECT(ActionMap);
 
 // This is used for determing keys that have ascii codes for the foreign keyboards. IsAlpha doesn't work on foreign keys.
@@ -1556,159 +1559,6 @@ bool ActionMap::handleEventGlobal(const InputEvent* pEvent)
    return ((ActionMap*)pActionMapSet->first())->processAction(pEvent);
 }
 
-//------------------------------------------------------------------------------
-//-------------------------------------- Console stuff
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, bind, void, 5, 10, "( device , action , [ modifier , mod... ] , command ) Use the bind method to associate a function to a keystroke or other device input.\n"
-                                                                "The command bound via the bind function must be specified as a flat name with no elipses or semi-colon termination and will be called on make and break events (i.e. key press and release for a mapped key). Args: Warning: When a function is bound to a keystroke or other device input, and no other versions of the binding are provided, the function will be called even if a modifier key like CTRL, ALT, or SHIFT is also pressed.\n"
-                                                                "@param device Name of the device to bind the command to.\n"
-                                                                "@param action Name of the action to watch for.\n"
-                                                                "@param modifier Special modifiers (mouse only), such as dead spot, etc.\n"
-                                                                "@param command The function to be called on make and break.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa bindCmd, getBinding, unbind")
-{
-   object->processBind( argc - 2, argv + 2, NULL );
-}
-
-ConsoleMethod( ActionMap, bindObj, void, 6, 11, "(device, action, [modifier spec, mod...], command, object) Use the bindObj method to associate a function to a keystroke or other device input.\n"
-                                                                "The command bound via the bind function must be specified as a flat name with no elipses or semi-colon termination and will be called on make and break events (i.e. key press and release for a mapped key). Args: Warning: When a function is bound to a keystroke or other device input, and no other versions of the binding are provided, the function will be called even if a modifier key like CTRL, ALT, or SHIFT is also pressed.\n"
-                                                                "@param device Name of the device to bind the command to.\n"
-                                                                "@param action Name of the action to watch for.\n"
-                                                                "@param modifier Special modifiers (mouse only), such as dead spot, etc.\n"
-                                                                "@param command The function to be called on make and break.\n"
-                                                                "@param object The explicit object (it defaults to NULL when you call bind() )\n"
-                                                                "@return No return value.\n"
-                                                                "@sa bindCmd, getBinding, unbind")
-{
-   SimObject* obj = Sim::findObject(argv[argc - 1]);
-   object->processBind( argc - 3, argv + 2, obj );
-}
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, bindCmd, void, 6, 6, "( device , action , makeCmd , breakCmd ) Use the bindCmd method to associate up to two functions to a keystroke or other device input.\n"
-                                                                "The makeCmd is bound to the make event and the breakCmd is bound to the break event and in both cases, the commands are specified as complete scripts, with all arguments, elipses, and the terminating semi-colon. Either of these commands may be non-specified (NULL strings). For clarification, see 'Bind Sample' example below.\n"
-                                                                "@param device Name of the device to bind the command to (see 'Device Table' below).\n"
-                                                                "@param action Name of the action to watch for(see 'Action Table' below).\n"
-                                                                "@param makeCmd The function to be called on make event.\n"
-                                                                "@param breakCmd The function to be called on break event.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa bind, getBinding, unbind")
-{
-   object->processBindCmd( argv[2], argv[3], argv[4], argv[5] );
-}
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, unbind, void, 4, 4, "( device , action ) Use the unbind method to remove a previosly specified device + action pair from the action map.\n"
-                                                                "@param device Name of the device to bound to a command (see 'Device Table' below).\n"
-                                                                "@param action Name of the action to watch for (see 'Action Table' below).\n"
-                                                                "@return No return value.\n"
-                                                                "@sa bind, bindCmd")
-{
-   object->processUnbind( argv[2], argv[3] );
-}
-ConsoleMethod( ActionMap, unbindObj, void, 5, 5, "(device, action, object) Use the unbind method to remove a previosly specified device + action pair from the action map.\n"
-                                                                "@param device Name of the device to bound to a command (see 'Device Table' below).\n"
-                                                                "@param action Name of the action to watch for (see 'Action Table' below).\n"
-                                                                "@param object Explicit object (it defaults to NULL when you call unbind() )."
-                                                                "@return No return value.\n"
-                                                                "@sa bind, bindCmd")
-{
-   SimObject* obj = Sim::findObject(argv[4]);
-   object->processUnbind( argv[2], argv[3], obj );
-}
-
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, save, void, 2, 4, "( [ fileName ] [ , append ] ) Use the save method to save an entire action map specification to a file. If append is not specified, or specified as false, fileName will be overwritten, otherwise the action map will be appended to the file.\n"
-                                                                "@param fileName Full path to file in which to store action map definition.\n"
-                                                                "@param append If true, do not overwrite the file, else start from scratch.\n"
-                                                                "@return No return value")
-{
-   const char* fileName = argc > 2 ? argv[2]        : NULL;
-   bool append          = argc > 3 ? dAtob(argv[3]) : false;
-
-   char buffer[1024];
-
-   if(fileName)
-   {
-      if(Con::expandPath(buffer, sizeof(buffer), fileName))       
-         fileName = buffer;
-   }
-
-   object->dumpActionMap( fileName, append );
-}
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, push, void, 2, 2, "() Use the push method to activate an ActionMap and place it at the top of the non-global ActionMap stack.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa pop")
-{
-   SimSet* pActionMapSet = Sim::getActiveActionMapSet();
-   pActionMapSet->pushObject( object );
-}
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, pop, void, 2, 2, "() Use the pop method to de-activate an ActionMap and remove it from non-global ActionMap stack.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa push")
-{
-   SimSet* pActionMapSet = Sim::getActiveActionMapSet();
-   pActionMapSet->removeObject( object );
-}
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, getBinding, const char*, 3, 3, "( command ) Use the getBinding method to get the binding for a specified command.\n"
-                                                                "@param command The function to seek a binding for.\n"
-                                                                "@return Returns a string containing the binding as a field (TAB separated string), or a NULL string meaning 'no binding found'.\n"
-                                                                "@sa bind, bindCmd")
-{
-    return( object->getBinding( argv[2] ) );	
-}
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, getCommand, const char*, 4, 4, "( device , action ) Use the getCommand method to get the function associated with a specific device + action pair.\n"
-                                                                "@param device Name of the device to bound to a command (see 'Device Table' below).\n"
-                                                                "@param action Name of the action to watch for (see 'Action Table' below).\n"
-                                                                "@return Returns the function name or specification associated with the specified device + action pair, or a NULL-string meaning 'no binding found'.\n"
-                                                                "@sa bind, bindCmd, getBinding")
-{
-    return( object->getCommand( argv[2], argv[3] ) );	
-}
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, isInverted, bool, 4, 4, "( device , action ) Use the Purpose method to determine if a specific device + action pair in inverted.\n"
-                                                                "This only applies to scrolling devices.\n"
-                                                                "@param device Name of the device to bound to a command (see 'Device Table' below).\n"
-                                                                "@param action Name of the action to watch for (see 'Action Table' below).\n"
-                                                                "@return Returns 1 if the mouse (or other scrolling device) is inverted, 0 otherwise.\n"
-                                                                "@sa bind, bindCmd")
-{
-    return( object->isInverted( argv[2], argv[3] ) );
-}
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, getScale, F32, 4, 4, "( device , action ) Use the getScale method to get the scale associated with a specific device + action pair.\n"
-                                                                "@param device Name of the device to bound to a command (see 'Device Table' below).\n"
-                                                                "@param action Name of the action to watch for (see 'Action Table' below).\n"
-                                                                "@return Returns 1 if no scale is associated with the specified device + action pair, or the mapping was not found.\n"
-                                                                "@sa bind, bindCmd")
-{
-    return( object->getScale( argv[2], argv[3] ) );
-}
-
-//------------------------------------------------------------------------------
-ConsoleMethod( ActionMap, getDeadZone, const char*, 4, 4, "( device , action ) Use the getDeadZone method to get the dead-zone associated with a specific device + action pair.\n"
-                                                                "@param device Name of the device to bound to a command (see 'Device Table' below).\n"
-                                                                "@param action Name of the action to watch for (see 'Action Table' below).\n"
-                                                                "@return Returns a dead-zone specification, or \"0 0\" meaning that there is no dead-zone, or a NULL string meaning the mapping was not found.\n"
-                                                                "@sa bind, bindCmd")
-{
-    return( object->getDeadZone( argv[2], argv[3] ) );
-}
-
-
 //------------------------------------------------------------------------------
 //-------------------------------------- Key code to string mapping
 //                                        TODO: Add most obvious aliases...

BIN
engine/source/input/actionMap_ScriptBinding.h


+ 0 - 592
engine/source/io/fileSystemFunctions.cpp

@@ -1,592 +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.
-//-----------------------------------------------------------------------------
-
-#include "platform/platform.h"
-#include "console/console.h"
-#include "console/consoleInternal.h"
-#include "console/ast.h"
-#include "io/resource/resourceManager.h"
-#include "io/fileStream.h"
-#include "console/compiler.h"
-#include "platform/event.h"
-#include "game/gameInterface.h"
-#include "platform/platformInput.h"
-#include "torqueConfig.h"
-#include "memory/frameAllocator.h"
-
-// Buffer for expanding script filenames.
-static char scriptFilenameBuffer[1024];
-
-//-------------------------------------- Helper Functions
-static void forwardslash(char *str)
-{
-   while(*str)
-   {
-      if(*str == '\\')
-         *str = '/';
-      str++;
-   }
-}
-
-static void backslash(char *str)
-{
-   while(*str)
-   {
-      if(*str == '/')
-         *str = '\\';
-      str++;
-   }
-}
-
-
-//----------------------------------------------------------------
-ConsoleFunctionGroupBegin( FileSystem, "Functions allowing you to search for files, read them, write them, and access their properties.");
-
-static ResourceObject *firstMatch = NULL;
-
-ConsoleFunction(findFirstFile, const char *, 2, 2, "( strPattern )\n"
-                "@param strPattern The string pattern to search for.\n"
-                "@return Returns a string representing the first file in the directory system matching the given pattern.")
-{
-   TORQUE_UNUSED( argc );
-   const char *fn = NULL;
-   firstMatch = NULL;
-   if(Con::expandPath(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]))
-      firstMatch = ResourceManager->findMatch(scriptFilenameBuffer, &fn, NULL);
-
-   if(firstMatch)
-      return fn;
-   else
-      return "";
-}
-
-ConsoleFunction(findNextFile, const char *, 2, 2, "( strPattern )\n" 
-                "@param strPattern The string pattern to search for.\n"
-                "@return Returns the next file matching a search begun in findFirstFile.")
-{
-   TORQUE_UNUSED( argc );
-   const char *fn = NULL;
-   if(Con::expandPath(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]))
-      firstMatch = ResourceManager->findMatch(scriptFilenameBuffer, &fn, firstMatch);
-   else
-      firstMatch = NULL;
-
-   if(firstMatch)
-      return fn;
-   else
-      return "";
-}
-
-ConsoleFunction(getFileCount, S32, 2, 2, "(strPattern) \n" 
-                "@param strPattern The string pattern to search for.\n"
-                "@return Returns the number of files in the directory tree that match the given pattern")
-{
-   TORQUE_UNUSED( argc );
-   const char* fn;
-   U32 count = 0;
-   firstMatch = ResourceManager->findMatch(argv[1], &fn, NULL);
-   if ( firstMatch )
-   {
-      count++;
-      while ( 1 )
-      {
-         firstMatch = ResourceManager->findMatch(argv[1], &fn, firstMatch);
-         if ( firstMatch )
-            count++;
-         else
-            break;
-      }
-   }
-
-   return( count );
-}
-
-ConsoleFunction(findFirstFileMultiExpr, const char *, 2, 2, "(strPattern)\n" 
-                "@param strPattern The string pattern to search for.\n"
-                "@return Returns the first file in the directory system matching the given pattern.")
-{
-   TORQUE_UNUSED( argc );
-   const char *fn = NULL;
-   firstMatch = NULL;
-   if(Con::expandPath(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]))
-      firstMatch = ResourceManager->findMatchMultiExprs(scriptFilenameBuffer, &fn, NULL);
-
-   if(firstMatch)
-      return fn;
-   else
-      return "";
-}
-
-ConsoleFunction(findNextFileMultiExpr, const char *, 2, 2, "(string pattern) Returns the next file matching a search begun in findFirstFile.")
-{
-   TORQUE_UNUSED( argc );
-   const char *fn = NULL;
-   if(Con::expandPath(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]))
-      firstMatch = ResourceManager->findMatchMultiExprs(scriptFilenameBuffer, &fn, firstMatch);
-   else
-      firstMatch = NULL;
-
-   if(firstMatch)
-      return fn;
-   else
-      return "";
-}
-
-ConsoleFunction(getFileCountMultiExpr, S32, 2, 2, "(strPattern) \n" 
-                "@param strPattern The string pattern to search for.\n"
-                "@return Returns the number of files in the directory tree that match the given pattern")
-{
-   TORQUE_UNUSED( argc );
-   const char* fn;
-   U32 count = 0;
-   firstMatch = ResourceManager->findMatchMultiExprs(argv[1], &fn, NULL);
-   if ( firstMatch )
-   {
-      count++;
-      while ( 1 )
-      {
-         firstMatch = ResourceManager->findMatchMultiExprs(argv[1], &fn, firstMatch);
-         if ( firstMatch )
-            count++;
-         else
-            break;
-      }
-   }
-
-   return( count );
-}
-
-ConsoleFunction(getFileCRC, S32, 2, 2, "(filename)\n"
-                "@param filename The string representing the file from which to get the CRC\n"
-                "@return An integer")
-{
-   TORQUE_UNUSED( argc );
-   U32 crcVal;
-   Con::expandPath(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]);
-
-   if(!ResourceManager->getCrc(scriptFilenameBuffer, crcVal))
-      return(-1);
-   return(S32(crcVal));
-}
-
-ConsoleFunction(isDirectory, bool, 2, 2, "(path)\n @param pathName Path to check.\n @return Returns true if the given path is a folder/directory, false otherwise")
-{
-    bool doesExist = Platform::isDirectory(argv[1]);
-    if(doesExist)
-        return true;
-
-    return false;
-}
-
-ConsoleFunction(isFile, bool, 2, 2, "(fileName)\n"
-                "@param fileName Filename to check.\n"
-                "@return Returns true if the given filename is an existing file or false otherwise")
-{
-   Con::expandPath(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]);
-   return bool(ResourceManager->find(scriptFilenameBuffer));
-}
-
-ConsoleFunction(isWriteableFileName, bool, 2, 2, "(fileName)\n"
-                "@param fileName Filename to check.\n"
-                "@return Returns true if the given filename is an existing file and is not Read-Only or false otherwise")
-{
-   TORQUE_UNUSED( argc );
-
-   char filename[1024];
-   Con::expandPath(filename, sizeof(filename), argv[1]);
-
-   if (filename == NULL || *filename == 0)
-      return false;
-
-   // in a writeable directory?
-   if(!ResourceManager->isValidWriteFileName(filename))
-      return(false);
-
-   // exists?
-   FileStream fs;
-   if(!fs.open(filename, FileStream::Read))
-      return(true);
-
-   // writeable? (ReadWrite will create file if it does not exist)
-   fs.close();
-   if(!fs.open(filename, FileStream::ReadWrite))
-      return(false);
-
-   return(true);
-}
-
-ConsoleFunction(getDirectoryList, const char*, 2, 3, "(strPath, [intDepth])\n"
-                "@param strPath The path in which to check\n"
-                "@param intDepth The depth in which to return (default 0 if not specified)\n"
-                "@return The directory contents")
-{
-   // Grab the full path.
-   char path[1024];
-   Platform::makeFullPathName(dStrcmp(argv[1], "/") == 0 ? "" : argv[1], path, sizeof(path));
-
-   // Append a trailing backslash if it's not present already.
-   if (path[dStrlen(path) - 1] != '/')
-   {
-      S32 pos = dStrlen(path);
-      path[pos] = '/';
-      path[pos + 1] = '\0';
-   }
-
-   // Grab the depth to search.
-   S32 depth = 0;
-   if (argc > 2)
-      depth = dAtoi(argv[2]);
-
-   // Dump the directories.
-   Vector<StringTableEntry> directories;
-   Platform::dumpDirectories(path, directories, depth, true);
-
-   if( directories.empty() )
-      return "";
-
-   // Grab the required buffer length.
-   S32 length = 0;
-
-   for (S32 i = 0; i < directories.size(); i++)
-      length += dStrlen(directories[i]) + 1;
-
-   // Get a return buffer.
-   char* buffer = Con::getReturnBuffer(length);
-   char* p = buffer;
-
-   // Copy the directory names to the buffer.
-   for (S32 i = 0; i < directories.size(); i++)
-   {
-      dStrcpy(p, directories[i]);
-      p += dStrlen(directories[i]);
-      // Tab separated.
-      p[0] = '\t';
-      p++;
-   }
-   p--;
-   p[0] = '\0';
-
-   return buffer;
-}
-
-ConsoleFunction(getFileList, const char*, 2, 2, "(strPath) - Gets all the files in the specified directory.\n"
-                "@param strPath The path in which to check\n"
-                "@return A list of files in the specified directory.")
-{
-   // Grab the full path.
-   char basePath[1024];
-   Con::expandPath( basePath, sizeof(basePath), argv[1] );
-
-   Vector<Platform::FileInfo> files;
-   if ( !Platform::dumpPath( basePath, files, 0 ) )
-   {
-       Con::warnf("Failed to get file list in directory '%s'", basePath );
-       return "";
-   }
-
-   if ( files.size() == 0 )
-       return "";
-
-   // Grab the required buffer length.
-   S32 length = 0;
-
-   for (S32 i = 0; i < files.size(); i++)
-       length += dStrlen(files[i].pFileName) + 1;
-
-   // Get a return buffer.
-   char* buffer = Con::getReturnBuffer(length);
-   char* p = buffer;
-
-   // Copy the directory names to the buffer.
-   for (S32 i = 0; i < files.size(); i++)
-   {
-       dStrcpy(p, files[i].pFileName);
-       p += dStrlen(files[i].pFileName);
-      // Tab separated.
-      p[0] = '\t';
-      p++;
-   }
-   p--;
-   p[0] = '\0';
-
-   return buffer;
-}
-
-ConsoleFunction(fileSize, S32, 2, 2, "(fileName)\n"
-                "@param fileName The name of the file to check.\n" 
-                "@return Returns the size of the file as an integer or -1 if file not found")
-{
-   TORQUE_UNUSED( argc );
-   Con::expandPath(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]);
-   return Platform::getFileSize( scriptFilenameBuffer );
-}
-
-ConsoleFunction(fileDelete, bool, 2,2, "(fileName)\n"
-                "@param fileName Name of the file to remove"
-                "@return Returns true on success and false on failure")
-{
-   static char fileName[1024];
-   static char sandboxFileName[1024];
-
-   Con::expandPath( fileName, sizeof( fileName ), argv[1] );
-   Platform::makeFullPathName(fileName, sandboxFileName, sizeof(sandboxFileName));
-
-   return Platform::fileDelete(sandboxFileName);
-}
-
-ConsoleFunction(directoryDelete, bool, 2,2, "(directoryName)\n"
-                "@param directoryName Name of the directory to remove"
-                "@return Returns true on success and false on failure")
-{
-   static char directoryName[1024];
-   static char sandboxdirectoryName[1024];
-
-   Con::expandPath( directoryName, sizeof( directoryName ), argv[1] );
-   Platform::makeFullPathName(directoryName, sandboxdirectoryName, sizeof(sandboxdirectoryName));
-
-   return Platform::deleteDirectory(sandboxdirectoryName);
-}
-
-//----------------------------------------------------------------
-
-ConsoleFunction(isValidImageFile, bool, 2, 2, "(string filePath)\n"
-                "@param filePath Full path of file to check.\n"
-                "@return Returns true if the given filename is a valid image file or false otherwise")
-{
-    Con::expandPath(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]);
-    
-    // does file exist?
-    if (!ResourceManager->find(scriptFilenameBuffer))
-        return false;
-
-    const char *ext = dStrrchr(argv[1], '.');
-    if (!ext)
-        return false;	// no extension
-
-    Stream *stream = ResourceManager->openStream(scriptFilenameBuffer);
-    if(stream == NULL)
-        return false;
-
-    bool ret = false;
-
-    if (dStricmp(ext, ".jpg") == 0)
-    {
-        U8 bArray[2];
-        stream->read(2, bArray);
-        // check header signature
-        ret = ((bArray[0] == 0xFF) && (bArray[1] == 0xD8));
-    } 
-    else if (dStricmp(ext, ".png") == 0)
-    {
-        int i = 0;
-        U8 bArray[8];
-        stream->read(8, bArray);
-        // check header signature
-        ret = ((bArray[i++] == 0x89) && (bArray[i++] == 0x50) && (bArray[i++] == 0x4E) && (bArray[i++] == 0x47));
-    }
-
-    ResourceManager->closeStream(stream);
-
-    return ret;
-}
-
-ConsoleFunction(fileExt, const char *, 2, 2, "(fileName)\n "
-                "@param Name of file from which to extract extension\n"
-                "@return A string containing the file's extension (assuming all data after first '.' is the extension) or returns empty string on failure")
-{
-   TORQUE_UNUSED( argc );
-   const char *ret = dStrrchr(argv[1], '.');
-   if(ret)
-      return ret;
-   return "";
-}
-
-ConsoleFunction(fileBase, const char *, 2, 2, "fileBase(fileName)")
-{
-
-   S32 pathLen = dStrlen( argv[1] );
-   FrameTemp<char> szPathCopy( pathLen + 1);
-   
-   dStrcpy( szPathCopy, argv[1] );
-   forwardslash( szPathCopy );
-
-   TORQUE_UNUSED( argc );
-   const char *path = dStrrchr(szPathCopy, '/');
-   if(!path)
-      path = szPathCopy;
-   else
-      path++;
-   char *ret = Con::getReturnBuffer(dStrlen(path) + 1);
-   dStrcpy(ret, path);
-   char *ext = dStrrchr(ret, '.');
-   if(ext)
-      *ext = 0;
-   return ret;
-}
-
-ConsoleFunction(fileName, const char *, 2, 2, "(filePathName) Extract the filename from the full path description")
-{
-   S32 pathLen = dStrlen( argv[1] );
-   FrameTemp<char> szPathCopy( pathLen + 1);
-
-   dStrcpy( szPathCopy, argv[1] );
-   forwardslash( szPathCopy );
-
-   TORQUE_UNUSED( argc );
-   const char *name = dStrrchr(szPathCopy, '/');
-   if(!name)
-      name = szPathCopy;
-   else
-      name++;
-   char *ret = Con::getReturnBuffer(dStrlen(name));
-   dStrcpy(ret, name);
-   return ret;
-}
-
-ConsoleFunction(filePath, const char *, 2, 2, "(fileName) Extract the file path from a file's full desciption")
-{
-   S32 pathLen = dStrlen( argv[1] );
-   FrameTemp<char> szPathCopy( pathLen + 1);
-
-   dStrcpy( szPathCopy, argv[1] );
-   forwardslash( szPathCopy );
-
-   TORQUE_UNUSED( argc );
-   const char *path = dStrrchr(szPathCopy, '/');
-   if(!path)
-      return "";
-   U32 len = path - (char*)szPathCopy;
-   char *ret = Con::getReturnBuffer(len + 1);
-   dStrncpy(ret, szPathCopy, len);
-   ret[len] = 0;
-   return ret;
-}
-
-ConsoleFunction(getCurrentDate, const char *, 2, 2, "(bool reverse) Gets the current date and time.\n"
-                                                 "@param reverse Determines if the format will be Month/Day/Year/Hour:Min:Seconds or Year/Month/Day/Hour:Min:Seconds")
-{
-    Platform::LocalTime lt;
-    Platform::getLocalTime(lt);
-
-    char temp[128];
-    
-    if (dAtob(argv[1]))
-        dSprintf(temp, 256, "%d/%d/%d:%d:%d:%d", lt.year+1900, lt.month+1, lt.monthday, lt.hour, lt.min, lt.sec);
-    else
-        dSprintf(temp, 256, "%d/%d/%d:%d:%d:%d", lt.month+1, lt.monthday, lt.year+1900, lt.hour, lt.min, lt.sec);
-
-    char* returnBuffer = Con::getReturnBuffer(dStrlen(temp + 1));
-    dStrcpy(returnBuffer, temp);
-
-    return returnBuffer;
-}
-
-ConsoleFunction(openFolder, void, 2 ,2,"openFolder(%path);")
-{
-   Platform::openFolder( argv[1] );
-}
-
-ConsoleFunction(pathCopy, bool, 3, 4, "pathCopy(fromFile, toFile [, nooverwrite = true])")
-{
-   bool nooverwrite = true;
-
-   if( argc > 3 )
-      nooverwrite = dAtob( argv[3] );
-
-   static char fromFile[1024];
-   static char toFile[1024];
-
-   static char qualifiedFromFile[1024];
-   static char qualifiedToFile[1024];
-
-   Con::expandPath( fromFile, sizeof( fromFile ), argv[1] );
-   Con::expandPath( toFile, sizeof( toFile ), argv[2] );
-
-   Platform::makeFullPathName(fromFile, qualifiedFromFile, sizeof(qualifiedFromFile));
-   Platform::makeFullPathName(toFile, qualifiedToFile, sizeof(qualifiedToFile));
-
-   return Platform::pathCopy( qualifiedFromFile, qualifiedToFile, nooverwrite );
-}
-
-ConsoleFunction(getCurrentDirectory, const char *, 1, 1, "getCurrentDirectory()")
-{
-   return Platform::getCurrentDirectory();
-}
-
-ConsoleFunction( setCurrentDirectory, bool, 2, 2, "setCurrentDirectory(absolutePathName)" )
-{
-   return Platform::setCurrentDirectory( StringTable->insert( argv[1] ) );
-
-}
-
-ConsoleFunction(getExecutableName, const char *, 1, 1, "getExecutableName()")
-{
-   return Platform::getExecutableName();
-}
-
-ConsoleFunction(getMainDotCsDir, const char *, 1, 1, "getMainDotCsDir()")
-{
-   return Platform::getMainDotCsDir();
-}
-
-ConsoleFunction(makeFullPath, const char *, 2, 3, "(string path, [string currentWorkingDir])")
-{
-   char *buf = Con::getReturnBuffer(512);
-   Platform::makeFullPathName(argv[1], buf, 512, argc > 2 ? argv[2] : NULL);
-   return buf;
-}
-
-ConsoleFunction(makeRelativePath, const char *, 3, 3, "(string path, string to)")
-{
-   return Platform::makeRelativePathName(argv[1], argv[2]);
-}
-
-ConsoleFunction(pathConcat, const char *, 3, 0, "(string path, string file1, [... fileN])")
-{
-   char *buf = Con::getReturnBuffer(1024);
-   char pathBuf[1024];
-   dStrcpy(buf, argv[1]);
-
-   for(S32 i = 2;i < argc;++i)
-   {
-      Platform::makeFullPathName(argv[i], pathBuf, 1024, buf);
-      dStrcpy(buf, pathBuf);
-   }
-   return buf;
-}
-
-ConsoleFunction(restartInstance, void, 1, 1, "restartInstance()")
-{
-   Game->setRestart( true );
-   Platform::postQuitMessage( 0 );
-}
-
-ConsoleFunction( createPath, bool, 2,2, "createPath(\"file name or path name\");  creates the path or path to the file name")
-{
-   static char pathName[1024];
-
-   Con::expandPath( pathName, sizeof( pathName ), argv[1] );
-
-   return Platform::createPath( pathName );
-}
-
-ConsoleFunctionGroupEnd( FileSystem );

BIN
engine/source/io/fileSystem_ScriptBinding.cc


+ 0 - 308
engine/source/math/mConsoleFunctions.cc

@@ -1,308 +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.
-//-----------------------------------------------------------------------------
-
-#include "platform/platform.h"
-#include "console/console.h"
-#include "math/mMathFn.h"
-#include "math/mRandom.h"
-#include "string/stringUnit.h"
-
-ConsoleFunctionGroupBegin( GeneralMath, "General math functions. Use these whenever possible, as they'll run much faster than script equivalents.");
-
-ConsoleFunction( mSolveQuadratic, const char *, 4, 4, "(float a, float b, float c)"
-              "Solve a quadratic equation of form a*x^2 + b*x + c = 0.\n\n"
-              "@returns A triple, contanining: sol x0 x1. sol is the number of"
-              " solutions (being 0, 1, or 2), and x0 and x1 are the solutions, if any."
-              " Unused x's are undefined.")
-{
-   char * retBuffer = Con::getReturnBuffer(256);
-   F32 x[2];
-   U32 sol = mSolveQuadratic(dAtof(argv[1]), dAtof(argv[2]), dAtof(argv[3]), x);
-   dSprintf(retBuffer, 256, "%d %g %g", sol, x[0], x[1]);
-   return retBuffer;
-}
-
-ConsoleFunction( mSolveCubic, const char *, 5, 5, "(float a, float b, float c, float d)"
-              "Solve a cubic equation of form a*x^3 + b*x^2 + c*x + d = 0.\n\n"
-              "@returns A 4-tuple, contanining: sol x0 x1 x2. sol is the number of"
-              " solutions (being 0, 1, 2, or 3), and x0, x1, x2 are the solutions, if any."
-              " Unused x's are undefined.")
-{
-   char * retBuffer = Con::getReturnBuffer(256);
-   F32 x[3];
-   U32 sol = mSolveCubic(dAtof(argv[1]), dAtof(argv[2]), dAtof(argv[3]), dAtof(argv[4]), x);
-   dSprintf(retBuffer, 256, "%d %g %g %g", sol, x[0], x[1], x[2]);
-   return retBuffer;
-}
-
-ConsoleFunction( mSolveQuartic, const char *, 6, 6, "(float a, float b, float c, float d, float e)"
-              "Solve a quartic equation of form a*x^4 + b*x^3 + c*x^2 + d*x + e = 0.\n\n"
-              "@returns A 5-tuple, contanining: sol x0 x1 x2 x3. sol is the number of"
-              " solutions (ranging from 0-4), and x0, x1, x2 and x3 are the solutions, if any."
-              " Unused x's are undefined.")
-{
-   char * retBuffer = Con::getReturnBuffer(256);
-   F32 x[4];
-   U32 sol = mSolveQuartic(dAtof(argv[1]), dAtof(argv[2]), dAtof(argv[3]), dAtof(argv[4]), dAtof(argv[5]), x);
-   dSprintf(retBuffer, 256, "%d %g %g %g %g", sol, x[0], x[1], x[2], x[3]);
-   return retBuffer;
-}
-
-ConsoleFunction( mFloor, S32, 2, 2, "( val ) Use the mFloor function to calculate the next lowest integer value from val.\n"
-                                                                "@param val A floating-point value.\n"
-                                                                "@return Returns an integer representing the next lowest integer from val.\n"
-                                                                "@sa mCeil")
-{
-   return (S32)mFloor(dAtof(argv[1]));
-}
-ConsoleFunction( mRound, F32, 2, 2, "(float v) Rounds a number. 0.5 is rounded up.\n"
-                "@param val A floating-point value\n"
-                "@return Returns the integer value closest to the given float")
-
-{
-   return mRound( dAtof(argv[1]) );
-}
-
-ConsoleFunction( mCeil, S32, 2, 2, "( val ) Use the mCeil function to calculate the next highest integer value from val.\n"
-                                                                "@param val A floating-point value.\n"
-                                                                "@return Returns an integer representing the next highest integer from val.\n"
-                                                                "@sa mFloor")
-{
-   return (S32)mCeil(dAtof(argv[1]));
-}
-
-
-ConsoleFunction( mFloatLength, const char *, 3, 3, "( val , numDecimals ) Use the mFloatLength function to limit the number of decimal places in val to numDecimals.\n"
-                                                                "@param val A floating-point value.\n"
-                                                                "@param numDecimals An integer between 0 and inf representing the number of decimal places to allow val to have.\n"
-                                                                "@return Returns a floating-point value equivalent to a truncated version of val, where the new version has numDecimals decimal places")
-{
-   char * outBuffer = Con::getReturnBuffer(256);
-   char fmtString[8] = "%.0f";
-   U32 precision = dAtoi(argv[2]);
-   if (precision > 9)
-      precision = 9;
-   fmtString[2] = '0' + precision;
-
-   dSprintf(outBuffer, 255, fmtString, dAtof(argv[1]));
-   return outBuffer;
-}
-
-//------------------------------------------------------------------------------
-ConsoleFunction( mAbs, F32, 2, 2, "( val ) Use the mAbs function to get the magnitude of val.\n"
-                                                                "@param val An integer or a floating-point value.\n"
-                                                                "@return Returns the magnitude of val")
-{
-   return(mFabs(dAtof(argv[1])));
-}
-
-ConsoleFunction( mSqrt, F32, 2, 2, "( val ) Use the mSqrt function to calculated the square root of val.\n"
-                                                                "@param val A numeric value.\n"
-                                                                "@return Returns the the squareroot of val")
-{
-   return(mSqrt(dAtof(argv[1])));
-}
-
-ConsoleFunction( mPow, F32, 3, 3, "( val , power ) Use the mPow function to calculated val raised to the power of power.\n"
-                                                                "@param val A numeric (integer or floating-point) value to be raised to a power.\n"
-                                                                "@param power A numeric (integer or floating-point) power to raise val to.\n"
-                                                                "@return Returns val^power")
-{
-   return(mPow(dAtof(argv[1]), dAtof(argv[2])));
-}
-
-ConsoleFunction( mLog, F32, 2, 2, "( val ) Use the mLog function to calculate the natural logarithm of val.\n"
-                                                                "@param val A numeric value.\n"
-                                                                "@return Returns the natural logarithm of val")
-{
-   return(mLog(dAtof(argv[1])));
-}
-
-ConsoleFunction( mSin, F32, 2, 2, "( val ) Use the mSin function to get the sine of the radian angle val.\n"
-                                                                "@param val A value between -3.14159 and 3.14159.\n"
-                                                                "@return Returns the sine of val. This value will be in the range [ -1.0 , 1.0 ].\n"
-                                                                "@sa mAsin")
-{
-   return(mSin(dAtof(argv[1])));
-}
-
-ConsoleFunction( mCos, F32, 2, 2, "( val ) Use the mCos function to get the cosine of the radian angle val.\n"
-                                                                "@param val A value between -3.14159 and 3.14159.\n"
-                                                                "@return Returns the cosine of val. This value will be in the range [ -1.0 , 1.0 ].\n"
-                                                                "@sa mAcos")
-{
-   return(mCos(dAtof(argv[1])));
-}
-
-ConsoleFunction( mTan, F32, 2, 2, "( val ) Use the mTan function to get the tangent of the radian angle val.\n"
-                                                                "@param val A value between -3.14159/2 and 3.14159/2.\n"
-                                                                "@return Returns the tangent of val. This value will be in the range [ -inf.0 , inf.0 ].\n"
-                                                                "@sa mAtan")
-{
-   return(mTan(dAtof(argv[1])));
-}
-
-ConsoleFunction( mAsin, F32, 2, 2, "( val ) Use the mAsin function to get the inverse sine of val in radians.\n"
-                                                                "@param val A value between -1.0 and 1.0 equal to the sine of some angle theta.\n"
-                                                                "@return Returns the inverse sine of val in radians. This value will be in the range [ - 3.14159/2 , 3.14159/2 ].\n"
-                                                                "@sa mSin")
-{
-   return(mAsin(dAtof(argv[1])));
-}
-
-ConsoleFunction( mAcos, F32, 2, 2, "( val ) Use the mAcos function to get the inverse cosine of val in radians.\n"
-                                                                "@param val A value between -1.0 and 1.0 equal to the cosine of some angle theta.\n"
-                                                                "@return Returns the inverse cosine of val in radians. This value will be in the range [ 0 , 3.14159 ].\n"
-                                                                "@sa mCos")
-{
-   return(mAcos(dAtof(argv[1])));
-}
-
-ConsoleFunction( mAtan, F32, 3, 3, "( val ) Use the mAtan function to get the inverse tangent of rise/run in radians.\n"
-                                                                "@param rise Vertical component of a line.\n"
-                                                                "@param run Horizontal component of a line.\n"
-                                                                "@return Returns the slope in radians (the arc-tangent) of a line with the given rise and run.\n"
-                                                                "@sa mTan")
-{
-   return(mAtan(dAtof(argv[1]), dAtof(argv[2])));
-}
-
-ConsoleFunction( mRadToDeg, F32, 2, 2, "( val ) Use the mRadToDeg function to convert radians to degrees.\n"
-                                                                "@param val A floating-point number representing some number of radians.\n"
-                                                                "@return Returns the equivalent of the radian value val in degrees.\n"
-                                                                "@sa mDegToRad")
-{
-   return(mRadToDeg(dAtof(argv[1])));
-}
-
-ConsoleFunction( mDegToRad, F32, 2, 2, "( val ) Use the mDegToRad function to convert degrees to radians.\n"
-                                                                "@param val A floating-point number representing some number of degrees.\n"
-                                                                "@return Returns the equivalent of the degree value val in radians.\n"
-                                                                "@sa mRadToDeg")
-{
-   return(mDegToRad(dAtof(argv[1])));
-}
-
-ConsoleFunction( mClamp, F32, 4, 4, "(float number, float min, float max) Clamp a value between two other values.\n"
-                "@param number A float value representing the number to clamp\n"
-                "@param min The lower bound\n"
-                "@param max The upper bound\n"
-                "@return A float value the is within the given range")
-{
-   F32 value = dAtof( argv[1] );
-   F32 min = dAtof( argv[2] );
-   F32 max = dAtof( argv[3] );
-   return mClampF( value, min, max );
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( mGetMin, F32, 3, 3, "(a, b) - Returns the Minimum of two values.")
-{
-   return getMin(dAtof(argv[1]), dAtof(argv[2]));
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( mGetMax, F32, 3, 3, "(a, b) - Returns the Maximum of two values.")
-{
-   return getMax(dAtof(argv[1]), dAtof(argv[2]));
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( bits, const char*, 2, 2, "Converts a list of bit-positions into a value." )
-{
-    // Calculate Element Count.
-    U32 elementCount = StringUnit::getUnitCount( argv[1], " \t\n" );
-
-    // Return nothing if there's no elements.
-    if ( elementCount < 1 )
-    {
-        // Error!
-        Con::printf("bits() - Invalid number of parameters!");
-        return "0";
-    }
-
-    // Reset Bit Value.
-    U32 bitValue = 0;
-
-    // Parse Bits.
-    for ( U32 n = 0; n < elementCount; n++ )
-    {
-        // Merge Bit Value.
-        bitValue |= (U32)BIT(dAtoi(StringUnit::getUnit(argv[1], n, " \t\n")));
-    }
-
-    // Create Returnable Buffer.
-    char* pBuffer = Con::getReturnBuffer(16);
-    // Format Output.
-    dSprintf( pBuffer, 16, "%u", bitValue );
-    // Return Buffer.
-    return pBuffer;
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( bit, const char*, 2, 2, "Converts a bit-position into a value." )
-{
-    // Create Returnable Buffer.
-    char* pBuffer = Con::getReturnBuffer(16);
-
-    // Format Output.
-    dSprintf( pBuffer, 16, "%u", U32(BIT(dAtoi(argv[1]))) );
-
-    // Return Buffer.
-    return pBuffer;
-}
-
-ConsoleFunction( bitInverse, const char*, 2, 2, "Returns the ones complement of a bit." )
-{
-    // Create Returnable Buffer.
-    char* pBuffer = Con::getReturnBuffer(16);
-
-    // Format Output.
-    dSprintf( pBuffer, 16, "%u", U32(~BIT(dAtoi(argv[1]))) );
-
-    // Return Buffer.
-    return pBuffer;
-}
-
-ConsoleFunction( addBitToMask, S32, 3, 3, "( mask, bit ) - Returns the mask with a bit added to it" )
-{
-   U32 mask;
-   dSscanf( argv[1], "%u", &mask );
-   U32 bit = BIT( dAtoi( argv[2] ) );
-   
-   return mask | bit;
-}
-
-ConsoleFunction( removeBitFromMask, S32, 3, 3, "( mask, bit ) - Returns the mask with a bit removed from it" )
-{
-   U32 mask;
-   dSscanf( argv[1], "%u", &mask );
-   U32 bit = BIT( dAtoi( argv[2] ) );
-   
-   return mask & ~bit;
-}
-
-ConsoleFunctionGroupEnd( GeneralMath );

BIN
engine/source/math/math_ScriptBinding.cc


BIN
engine/source/module/moduleDefinition_ScriptBinding.h


BIN
engine/source/module/moduleManager_ScriptBinding.h


BIN
engine/source/persistence/taml/taml_ScriptBinding.h


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


BIN
engine/source/platform/platformInput_ScriptBinding.h


+ 6 - 1
engine/source/platform/platformString.cc

@@ -22,4 +22,9 @@
 
 #ifndef _PLATFORM_H_
 #include "platform/platform.h"
-#endif
+#endif
+
+#include "console/console.h"
+
+#include "platform_ScriptBinding.h"
+#include "platformString_ScriptBinding.h"

BIN
engine/source/platform/platformString_ScriptBinding.h


+ 2 - 220
engine/source/platform/platformVideo.cc

@@ -25,6 +25,8 @@
 #include "console/console.h"
 #include "game/gameInterface.h"
 
+#include "platformVideo_ScriptBinding.h"
+
 extern void GameDeactivate( bool noRender );
 extern void GameReactivate();
 
@@ -37,206 +39,6 @@ bool					Video::smNeedResurrect = false;
 Resolution  DisplayDevice::smCurrentRes;
 bool        DisplayDevice::smIsFullScreen;
 
-
-ConsoleFunctionGroupBegin(Video, "Video control functions.");
-
-//--------------------------------------------------------------------------
-ConsoleFunction( setDisplayDevice, bool, 2, 6, "( deviceName [, width [ , height [, bpp [, fullScreen ]]]] ) Use the setDisplayDevice function to select a display device and to set the initial width, height and bits-per-pixel (bpp) setting, as well as whether the application is windowed or in fullScreen.\n"
-                                                                "If no resolution information is specified, the first legal resolution on this device's resolution list will be used. Furthermore, for each optional argument if the subsequent arguments are not specified, the first matching case will be used. Lastly, if the application is not told to display in full screen, but the device only supports windowed, the application will be forced into windowed mode.\n"
-                                                                "@param deviceName A supported display device name.\n"
-                                                                "@param width Resolution width in pixels.\n"
-                                                                "@param height Resolution height in pixels.\n"
-                                                                "@param bpp Pixel resolution in bits-per-pixel (16 or 32).\n"
-                                                                "@param fullScreen A boolean value. If set to true, the application displays in full- screen mode, otherwise it will attempt to display in windowed mode.\n"
-                                                                "@return Returns true on success, false otherwise.\n"
-                                                                "@sa getDesktopResolution, getDisplayDeviceList, getResolutionList, nextResolution, prevResolution, setRes, setScreenMode, switchBitDepth")
-{
-    Resolution currentRes = Video::getResolution();
-
-    U32 width = ( argc > 2 ) ? dAtoi( argv[2] ) : currentRes.w;
-    U32 height =  ( argc > 3 ) ? dAtoi( argv[3] ) : currentRes.h;
-    U32 bpp = ( argc > 4 ) ? dAtoi( argv[4] ) : currentRes.bpp;
-    bool fullScreen = ( argc > 5 ) ? dAtob( argv[5] ) : Video::isFullScreen();
-
-   return( Video::setDevice( argv[1], width, height, bpp, fullScreen ) );
-}
-
-
-//--------------------------------------------------------------------------
-ConsoleFunction( setScreenMode, bool, 5, 5, "( width , height , bpp , fullScreen ) Use the setScreenMode function to set the screen to the specified width, height, and bits-per-pixel (bpp). Additionally, if fullScreen is set to true the engine will attempt to display the application in full-screen mode, otherwise it will attempt to used windowed mode.\n"
-                                                                "@param width Resolution width in pixels.\n"
-                                                                "@param height Resolution height in pixels.\n"
-                                                                "@param bpp Pixel resolution in bits-per-pixel (16 or 32).\n"
-                                                                "@param fullScreen A boolean value. If set to true, the application displays in full- screen mode, otherwise it will attempt to display in windowed mode.\n"
-                                                                "@return Returns true if successful, otherwise false.\n"
-                                                                "@sa getDesktopResolution, getDisplayDeviceList, getResolutionList, nextResolution, prevResolution, setDisplayDevice, setRes, switchBitDepth")
-{
-   return( Video::setScreenMode( dAtoi( argv[1] ), dAtoi( argv[2] ), dAtoi( argv[3] ), dAtob( argv[4] ) ) );
-}
-
-
-//------------------------------------------------------------------------------
-ConsoleFunction( toggleFullScreen, bool, 1, 1, "() Use the toggleFullScreen function to switch from full-screen mode to windowed, or vice versa.\n"
-                                                                "@return Returns true on success, false otherwise")
-{
-   return( Video::toggleFullScreen() );
-}
-
-
-//------------------------------------------------------------------------------
-ConsoleFunction( isFullScreen, bool, 1, 1, "() Use the isFullScreen function to determine if the current application is displayed in full-screen mode.\n"
-                                                                "@return Returns true if the engine is currently displaying full-screen, otherwise returns false")
-{
-   return( Video::isFullScreen() );
-}
-
-
-//--------------------------------------------------------------------------
-ConsoleFunction( switchBitDepth, bool, 1, 1, "() Use the switchBitDepth function to toggle the bits-per-pixel (bpp) pixel resolution between 16 and 32.\n"
-                                                                "@return Returns true on success, false otherwise.\n"
-                                                                "@sa getDesktopResolution, getDisplayDeviceList, getResolutionList, nextResolution, prevResolution, setDisplayDevice, setRes")
-{
-   if ( !Video::isFullScreen() )
-   {
-      Con::warnf( ConsoleLogEntry::General, "Can only switch bit depth in full-screen mode!" );
-      return( false );
-   }
-
-   Resolution res = Video::getResolution();
-   return( Video::setResolution( res.w, res.h, ( res.bpp == 16 ? 32 : 16 ) ) );
-}
-
-
-//--------------------------------------------------------------------------
-ConsoleFunction( prevResolution, bool, 1, 1, "() Use the prevResolution function to switch to the previous valid (lower) resolution for the current display device.\n"
-                                                                "@return Returns true if switch was successful, false otherwise.\n"
-                                                                "@sa getDesktopResolution, nextResolution, getResolutionList, setRes, setScreenMode, switchBitDepth")
-{
-   return( Video::prevRes() );
-}
-
-
-//--------------------------------------------------------------------------
-ConsoleFunction( nextResolution, bool, 1, 1, "() Use the nextResolution function to switch to the next valid (higher) resolution for the current display device.\n"
-                                                                "@return Returns true if switch was successful, false otherwise.\n"
-                                                                "@sa getDesktopResolution, prevResolution, getResolutionList, setRes, setScreenMode, switchBitDepth")
-{
-   return( Video::nextRes() );
-}
-
-
-//--------------------------------------------------------------------------
-ConsoleFunction( getRes, const char*, 1, 1, "Get the width, height, and bitdepth of the screen."
-                "@return A string formatted as \"<width> <height> <bitdepth>\"")
-{
-   static char resBuf[16];
-   Resolution res = Video::getResolution();
-   dSprintf( resBuf, sizeof(resBuf), "%d %d %d", res.w, res.h, res.bpp );
-   return( resBuf );
-}
-
-//--------------------------------------------------------------------------
-ConsoleFunction( setRes, bool, 3, 4, "( width , height , bpp ) Use the setRes function to set the screen to the specified width, height, and bits-per-pixel (bpp).\n"
-                                                                "@param width Resolution width in pixels.\n"
-                                                                "@param height Resolution height in pixels.\n"
-                                                                "@param bpp Pixel resolution in bits-per-pixel (16 or 32).\n"
-                                                                "@return Returns true if successful, otherwise false.\n"
-                                                                "@sa getDesktopResolution, getDisplayDeviceList, getResolutionList, nextResolution, prevResolution, setDisplayDevice, setScreenMode, switchBitDepth")
-{
-   U32 width = dAtoi( argv[1] );
-   U32 height = dAtoi( argv[2] );
-   U32 bpp = 0;
-   if ( argc == 4 )
-   {
-      bpp = dAtoi( argv[3] );
-      if ( bpp != 16 && bpp != 32 )
-         bpp = 0;
-   }
-
-   return( Video::setResolution( width, height, bpp ) );
-}
-
-//------------------------------------------------------------------------------
-ConsoleFunction( getDesktopResolution, const char*, 1, 1, "() Use the getDesktopResolution function to determine the current resolution of the desktop (not the application).\n"
-                                                                "To get the current resolution of a windowed display of the torque game engine, simply examine the global variable '$pref::Video::resolution'.\n"
-                                                                "@return Returns a string containing the current desktop resolution, including the width height and the current bits per pixel.\n"
-                                                                "@sa getDisplayDeviceList, getResolutionList, nextResolution, prevResolution, setDisplayDevice, setRes, setScreenMode, switchBitDepth")
-{
-   static char resBuf[16];
-   Resolution res = Video::getDesktopResolution();
-   dSprintf( resBuf, sizeof(resBuf), "%d %d %d", res.w, res.h, res.bpp );
-   return( resBuf );
-}
-
-
-//------------------------------------------------------------------------------
-ConsoleFunction( getDisplayDeviceList, const char*, 1, 1, "() Use the getDisplayDeviceList function to get a list of valid display devices.\n"
-                                                                "@return Returns a tab separated list of valid display devices.\n"
-                                                                "@sa getDesktopResolution, getResolutionList, setRes, setScreenMode, switchBitDepth")
-{
-    return( Video::getDeviceList() );	
-}
-
-
-//------------------------------------------------------------------------------
-ConsoleFunction( getResolutionList, const char*, 2, 2, "( devicename ) Use the getResolutionList function to get a semicolon separated list of legal resolutions for a specified device.\n"
-                                                                "Resolutions are always in the form: width height bpp, where width and height are in pixels and bpp is bits-per-pixel.\n"
-                                                                "@param deviceName A string containing a supported display device.\n"
-                                                                "@return Returns a tab separated list of valid display resolutions for devicename.\n"
-                                                                "@sa getDesktopResolution, getDisplayDeviceList, setRes, setScreenMode, switchBitDepth")
-{
-    DisplayDevice* device = Video::getDevice( argv[1] );
-    if ( !device )
-    {
-        Con::warnf( ConsoleLogEntry::General, "\"%s\" display device not found!", argv[1] );
-        return( NULL );
-    }
-    
-    return( device->getResolutionList() );		
-}
-
-//------------------------------------------------------------------------------
-ConsoleFunction( getVideoDriverInfo, const char*, 1, 1, "() Use the getVideoDriverInfo function to dump information on the video driver to the console.\n"
-                                                                "@return No return value")
-{
-    return( Video::getDriverInfo() );
-}
-
-//------------------------------------------------------------------------------
-ConsoleFunction( isDeviceFullScreenOnly, bool, 2, 2, "( devicename ) Use the isDeviceFullScreenOnly function to determine if the device specified in devicename is for full screen display only, or whether it supports windowed mode too.\n"
-                                                                "@param deviceName A string containing a supported display device.\n"
-                                                                "@return Returns true if the device can only display full scree, false otherwise.\n"
-                                                                "@sa getResolutionList")
-{
-    DisplayDevice* device = Video::getDevice( argv[1] );
-    if ( !device )
-    {
-        Con::warnf( ConsoleLogEntry::General, "\"%s\" display device not found!", argv[1] );
-        return( false );
-    }
-    
-    return( device->isFullScreenOnly() );		
-}
-
-
-//------------------------------------------------------------------------------
-static F32 sgOriginalGamma = -1.0;
-static F32 sgGammaCorrection = 0.0;
-
-ConsoleFunction(videoSetGammaCorrection, void, 2, 2, "( gamma ) Use the videoSetGammaCorrection function to adjust the gamma for the video card.\n"
-                                                                "The card will revert to it's default gamma setting as long as the application closes normally\n"
-                                                                "@param gamma A floating-point value between 0.0 and 1.0.\n"
-                                                                "@return No return value.")
-{
-   F32 g = mClampF(dAtof(argv[1]),0.0,1.0);
-   F32 d = -(g - 0.5f);
-
-   if (d != sgGammaCorrection &&
-     (sgOriginalGamma != -1.0f || Video::getGammaCorrection(sgOriginalGamma)))
-      Video::setGammaCorrection(sgOriginalGamma+d);
-    sgGammaCorrection = d;
-}
-
 //------------------------------------------------------------------------------
 void Video::init()
 {
@@ -662,26 +464,6 @@ bool Video::setVerticalSync( bool on )
    return( false );
 }
 
-ConsoleFunction( setVerticalSync, bool, 2, 2, "( enable ) Use the setVerticalSync function to force the framerate to sync up with the vertical refresh rate.\n"
-                                                                "This is used to reduce excessive swapping/rendering. There is generally no purpose in rendering any faster than the monitor will support. Those extra 'ergs' can be used for something else\n"
-                                                                "@param enable A boolean value. If set to true, the engine will only swap front and back buffers on or before a vertical refresh pass.\n"
-                                                                "@return Returns true on success, false otherwise.")
-{
-   return( Video::setVerticalSync( dAtob( argv[1] ) ) );
-}
-
-ConsoleFunction( minimizeWindow, void, 1, 1, "minimizeWindow() - Minimize the game window" )
-{
-    Platform::minimizeWindow();
-}
-
-ConsoleFunction( restoreWindow, void, 1, 1, "restoreWindow() - Restore the game window" )
-{
-   Platform::restoreWindow();
-}
-
-ConsoleFunctionGroupEnd(Video);
-
 //------------------------------------------------------------------------------
 DisplayDevice::DisplayDevice()
 {

BIN
engine/source/platform/platformVideo_ScriptBinding.h


BIN
engine/source/platform/platform_ScriptBinding.h


+ 2 - 0
engine/source/string/stringUnit.cpp

@@ -24,6 +24,8 @@
 #include "string/stringUnit.h"
 #include "string/stringTable.h"
 
+#include "stringUnit_ScriptBinding.h"
+
 namespace StringUnit
 {
    static char _returnBuffer[4096];

BIN
engine/source/string/stringUnit_ScriptBinding.h


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

@@ -1643,8 +1643,8 @@ PREDEFINED            += ConsoleBool=bool
 
 # PREDEFINED            += ConsoleFunctionGroupBegin(groupName,usage)="namespace Functions { namespace groupName {"
 # PREDEFINED            += ConsoleFunctionGroupEnd(groupName)=" "
-PREDEFINED            += ConsoleFunctionGroupBegin(groupName,usage)="/*! @defgroup groupName \n\n @{ */"
-PREDEFINED            += ConsoleFunctionGroupEnd(groupName)="/*! @} */"
+PREDEFINED            += ConsoleFunctionGroupBegin(groupName,usage)=""
+PREDEFINED            += ConsoleFunctionGroupEnd(groupName)=""
 
 PREDEFINED            += ConsoleFunction(name,returnType,minArgs,maxArgs,usage1)="returnType name (...) "