diff --git a/Engine/lib/nativeFileDialogs/nfd_win.cpp b/Engine/lib/nativeFileDialogs/nfd_win.cpp index a73fd8a46..1187fc84b 100644 --- a/Engine/lib/nativeFileDialogs/nfd_win.cpp +++ b/Engine/lib/nativeFileDialogs/nfd_win.cpp @@ -183,7 +183,7 @@ static nfdresult_t AddFiltersToDialog( ::IFileDialog *fileOpenDialog, const char /* end of filter -- add it to specList */ // Empty filter name -- Windows describes them by extension. - specList[specIdx].pszName = EMPTY_WSTR; + CopyNFDCharToWChar(specbuf, (wchar_t**)&specList[specIdx].pszName); CopyNFDCharToWChar( specbuf, (wchar_t**)&specList[specIdx].pszSpec ); memset( specbuf, 0, sizeof(char)*NFD_MAX_STRLEN ); @@ -203,7 +203,7 @@ static nfdresult_t AddFiltersToDialog( ::IFileDialog *fileOpenDialog, const char /* Add wildcard */ specList[specIdx].pszSpec = WILDCARD; - specList[specIdx].pszName = EMPTY_WSTR; + specList[specIdx].pszName = WILDCARD; fileOpenDialog->SetFileTypes( filterCount+1, specList ); diff --git a/Engine/source/T3D/aiClient.cpp b/Engine/source/T3D/aiClient.cpp index 0fab8f428..8801e3460 100644 --- a/Engine/source/T3D/aiClient.cpp +++ b/Engine/source/T3D/aiClient.cpp @@ -418,7 +418,7 @@ void AIClient::onAdd( const char *nameSpace ) { /** * Sets the move speed for an AI object */ -DefineConsoleMethod( AIClient, setMoveSpeed, void, (F32 speed), , "ai.setMoveSpeed( float );" ) +DefineEngineMethod( AIClient, setMoveSpeed, void, (F32 speed), , "ai.setMoveSpeed( float );" ) { AIClient *ai = static_cast( object ); ai->setMoveSpeed( speed ); @@ -427,7 +427,7 @@ DefineConsoleMethod( AIClient, setMoveSpeed, void, (F32 speed), , "ai.setMoveSpe /** * Stops all AI movement, halt! */ -DefineConsoleMethod( AIClient, stop, void, (),, "ai.stop();" ) +DefineEngineMethod( AIClient, stop, void, (),, "ai.stop();" ) { AIClient *ai = static_cast( object ); ai->setMoveMode( AIClient::ModeStop ); @@ -436,7 +436,7 @@ DefineConsoleMethod( AIClient, stop, void, (),, "ai.stop();" ) /** * Tells the AI to aim at the location provided */ -DefineConsoleMethod( AIClient, setAimLocation, void, (Point3F v), , "ai.setAimLocation( x y z );" ) +DefineEngineMethod( AIClient, setAimLocation, void, (Point3F v), , "ai.setAimLocation( x y z );" ) { AIClient *ai = static_cast( object ); @@ -446,7 +446,7 @@ DefineConsoleMethod( AIClient, setAimLocation, void, (Point3F v), , "ai.setAimLo /** * Tells the AI to move to the location provided */ -DefineConsoleMethod( AIClient, setMoveDestination, void, (Point3F v), , "ai.setMoveDestination( x y z );" ) +DefineEngineMethod( AIClient, setMoveDestination, void, (Point3F v), , "ai.setMoveDestination( x y z );" ) { AIClient *ai = static_cast( object ); @@ -456,7 +456,7 @@ DefineConsoleMethod( AIClient, setMoveDestination, void, (Point3F v), , "ai.setM /** * Returns the point the AI is aiming at */ -DefineConsoleMethod( AIClient, getAimLocation, Point3F, (),, "ai.getAimLocation();" ) +DefineEngineMethod( AIClient, getAimLocation, Point3F, (),, "ai.getAimLocation();" ) { AIClient *ai = static_cast( object ); return ai->getAimLocation(); @@ -465,7 +465,7 @@ DefineConsoleMethod( AIClient, getAimLocation, Point3F, (),, "ai.getAimLocation( /** * Returns the point the AI is set to move to */ -DefineConsoleMethod( AIClient, getMoveDestination, Point3F, (),, "ai.getMoveDestination();" ) +DefineEngineMethod( AIClient, getMoveDestination, Point3F, (),, "ai.getMoveDestination();" ) { AIClient *ai = static_cast( object ); return ai->getMoveDestination(); @@ -474,7 +474,7 @@ DefineConsoleMethod( AIClient, getMoveDestination, Point3F, (),, "ai.getMoveDest /** * Sets the bots target object */ -DefineConsoleMethod( AIClient, setTargetObject, void, (const char * objName), , "ai.setTargetObject( obj );" ) +DefineEngineMethod( AIClient, setTargetObject, void, (const char * objName), , "ai.setTargetObject( obj );" ) { AIClient *ai = static_cast( object ); @@ -489,7 +489,7 @@ DefineConsoleMethod( AIClient, setTargetObject, void, (const char * objName), , /** * Gets the object the AI is targeting */ -DefineConsoleMethod( AIClient, getTargetObject, S32, (),, "ai.getTargetObject();" ) +DefineEngineMethod( AIClient, getTargetObject, S32, (),, "ai.getTargetObject();" ) { AIClient *ai = static_cast( object ); @@ -499,7 +499,7 @@ DefineConsoleMethod( AIClient, getTargetObject, S32, (),, "ai.getTargetObject(); /** * Tells the bot the mission is cycling */ -DefineConsoleMethod( AIClient, missionCycleCleanup, void, (),, "ai.missionCycleCleanup();" ) +DefineEngineMethod( AIClient, missionCycleCleanup, void, (),, "ai.missionCycleCleanup();" ) { AIClient *ai = static_cast( object ); ai->missionCycleCleanup(); @@ -508,7 +508,7 @@ DefineConsoleMethod( AIClient, missionCycleCleanup, void, (),, "ai.missionCycleC /** * Sets the AI to run mode */ -DefineConsoleMethod( AIClient, move, void, (),, "ai.move();" ) +DefineEngineMethod( AIClient, move, void, (),, "ai.move();" ) { AIClient *ai = static_cast( object ); ai->setMoveMode( AIClient::ModeMove ); @@ -517,7 +517,7 @@ DefineConsoleMethod( AIClient, move, void, (),, "ai.move();" ) /** * Gets the AI's location in the world */ -DefineConsoleMethod( AIClient, getLocation, Point3F, (),, "ai.getLocation();" ) +DefineEngineMethod( AIClient, getLocation, Point3F, (),, "ai.getLocation();" ) { AIClient *ai = static_cast( object ); return ai->getLocation(); @@ -526,7 +526,7 @@ DefineConsoleMethod( AIClient, getLocation, Point3F, (),, "ai.getLocation();" ) /** * Adds an AI Player to the game */ -DefineConsoleFunction( aiAddPlayer, S32, (const char * name, const char * ns), (""), "'playerName'[, 'AIClassType'] );") +DefineEngineFunction( aiAddPlayer, S32, (const char * name, const char * ns), (""), "'playerName'[, 'AIClassType'] );") { // Create the player AIClient *aiPlayer = new AIClient(); @@ -559,7 +559,7 @@ DefineConsoleFunction( aiAddPlayer, S32, (const char * name, const char * ns), ( /** * Tells the AI to move forward 100 units...TEST FXN */ -DefineConsoleMethod( AIClient, moveForward, void, (),, "ai.moveForward();" ) +DefineEngineMethod( AIClient, moveForward, void, (),, "ai.moveForward();" ) { AIClient *ai = static_cast( object ); diff --git a/Engine/source/T3D/aiConnection.cpp b/Engine/source/T3D/aiConnection.cpp index af60b1d3c..42ed1dff3 100644 --- a/Engine/source/T3D/aiConnection.cpp +++ b/Engine/source/T3D/aiConnection.cpp @@ -130,7 +130,7 @@ static inline F32 moveClamp(F32 v) //----------------------------------------------------------------------------- /// Construct and connect an AI connection object -ConsoleFunction(aiConnect, S32 , 2, 20, "(...)" +DefineEngineStringlyVariadicFunction(aiConnect, S32 , 2, 20, "(...)" "@brief Creates a new AIConnection, and passes arguments to its onConnect script callback.\n\n" "@returns The newly created AIConnection\n" "@see GameConnection for parameter information\n" @@ -160,7 +160,7 @@ ConsoleFunction(aiConnect, S32 , 2, 20, "(...)" //----------------------------------------------------------------------------- -DefineConsoleMethod(AIConnection, setMove, void, (const char * field, F32 value), ,"(string field, float value)" +DefineEngineMethod(AIConnection, setMove, void, (const char * field, F32 value), ,"(string field, float value)" "Set a field on the current move.\n\n" "@param field One of {'x','y','z','yaw','pitch','roll'}\n" "@param value Value to set field to.") @@ -190,7 +190,7 @@ DefineConsoleMethod(AIConnection, setMove, void, (const char * field, F32 value) object->setMove(&move); } -DefineConsoleMethod(AIConnection,getMove,F32, (const char * field), ,"(string field)" +DefineEngineMethod(AIConnection,getMove,F32, (const char * field), ,"(string field)" "Get the given field of a move.\n\n" "@param field One of {'x','y','z','yaw','pitch','roll'}\n" "@returns The requested field on the current move.") @@ -212,7 +212,7 @@ DefineConsoleMethod(AIConnection,getMove,F32, (const char * field), ,"(string fi } -DefineConsoleMethod(AIConnection,setFreeLook,void,(bool isFreeLook), ,"(bool isFreeLook)" +DefineEngineMethod(AIConnection,setFreeLook,void,(bool isFreeLook), ,"(bool isFreeLook)" "Enable/disable freelook on the current move.") { Move move = object->getMove(); @@ -220,7 +220,7 @@ DefineConsoleMethod(AIConnection,setFreeLook,void,(bool isFreeLook), ,"(bool isF object->setMove(&move); } -DefineConsoleMethod(AIConnection, getFreeLook, bool, (), ,"getFreeLook()" +DefineEngineMethod(AIConnection, getFreeLook, bool, (), ,"getFreeLook()" "Is freelook on for the current move?") { return object->getMove().freeLook; @@ -229,7 +229,7 @@ DefineConsoleMethod(AIConnection, getFreeLook, bool, (), ,"getFreeLook()" //----------------------------------------------------------------------------- -DefineConsoleMethod(AIConnection,setTrigger,void, (S32 idx, bool set), ,"(int trigger, bool set)" +DefineEngineMethod(AIConnection,setTrigger,void, (S32 idx, bool set), ,"(int trigger, bool set)" "Set a trigger.") { if (idx >= 0 && idx < MaxTriggerKeys) @@ -240,7 +240,7 @@ DefineConsoleMethod(AIConnection,setTrigger,void, (S32 idx, bool set), ,"(int tr } } -DefineConsoleMethod(AIConnection,getTrigger,bool, (S32 idx), ,"(int trigger)" +DefineEngineMethod(AIConnection,getTrigger,bool, (S32 idx), ,"(int trigger)" "Is the given trigger set?") { if (idx >= 0 && idx < MaxTriggerKeys) @@ -251,7 +251,7 @@ DefineConsoleMethod(AIConnection,getTrigger,bool, (S32 idx), ,"(int trigger)" //----------------------------------------------------------------------------- -DefineConsoleMethod(AIConnection,getAddress,const char*,(), ,"") +DefineEngineMethod(AIConnection,getAddress,const char*,(), ,"") { // Override the netConnection method to return to indicate // this is an ai connection. diff --git a/Engine/source/T3D/aiPlayer.cpp b/Engine/source/T3D/aiPlayer.cpp index 6e1c39328..565bb742c 100644 --- a/Engine/source/T3D/aiPlayer.cpp +++ b/Engine/source/T3D/aiPlayer.cpp @@ -1251,7 +1251,7 @@ ConsoleDocFragment _setAimObject( "void setAimObject(GameBase targetObject, Point3F offset);" ); -DefineConsoleMethod( AIPlayer, setAimObject, void, ( const char * objName, Point3F offset ), (Point3F::Zero), "( GameBase obj, [Point3F offset] )" +DefineEngineMethod( AIPlayer, setAimObject, void, ( const char * objName, Point3F offset ), (Point3F::Zero), "( GameBase obj, [Point3F offset] )" "Sets the bot's target object. Optionally set an offset from target location." "@hide") { diff --git a/Engine/source/T3D/assets/MaterialAsset.cpp b/Engine/source/T3D/assets/MaterialAsset.cpp index 697f21e37..6cf3561a1 100644 --- a/Engine/source/T3D/assets/MaterialAsset.cpp +++ b/Engine/source/T3D/assets/MaterialAsset.cpp @@ -157,7 +157,7 @@ void MaterialAsset::copyTo(SimObject* object) Parent::copyTo(object); } -ConsoleMethod(MaterialAsset, compileShader, void, 2, 2, "() - Compiles the material's generated shader, if any. Not yet implemented\n") +DefineEngineMethod(MaterialAsset, compileShader, void, (), , "Compiles the material's generated shader, if any. Not yet implemented\n") { object->compileShader(); } diff --git a/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h b/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h index 2c3f1dbef..412d8e5b6 100644 --- a/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h +++ b/Engine/source/T3D/components/camera/cameraComponent_ScriptBinding.h @@ -24,13 +24,14 @@ #include "T3D/components/camera/cameraComponent.h" //Basically, this only exists for backwards compatibility for parts of the editors -ConsoleMethod(CameraComponent, getMode, const char*, 2, 2, "() - We get the first behavior of the requested type on our owner object.\n" +DefineEngineMethod(CameraComponent, getMode, const char*, (),, + "@brief We get the first behavior of the requested type on our owner object.\n" "@return (string name) The type of the behavior we're requesting") { return "fly"; } -DefineConsoleMethod(CameraComponent, getForwardVector, VectorF, (), , +DefineEngineMethod(CameraComponent, getForwardVector, VectorF, (), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -44,7 +45,7 @@ DefineConsoleMethod(CameraComponent, getForwardVector, VectorF, (), , return returnVec; } -DefineConsoleMethod(CameraComponent, getRightVector, VectorF, (), , +DefineEngineMethod(CameraComponent, getRightVector, VectorF, (), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -58,7 +59,7 @@ DefineConsoleMethod(CameraComponent, getRightVector, VectorF, (), , return returnVec; } -DefineConsoleMethod(CameraComponent, getUpVector, VectorF, (), , +DefineEngineMethod(CameraComponent, getUpVector, VectorF, (), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -72,14 +73,14 @@ DefineConsoleMethod(CameraComponent, getUpVector, VectorF, (), , return returnVec; } -DefineConsoleMethod(CameraComponent, setForwardVector, void, (VectorF newForward), (VectorF(0, 0, 0)), +DefineEngineMethod(CameraComponent, setForwardVector, void, (VectorF newForward), (VectorF(0, 0, 0)), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { object->setForwardVector(newForward); } -DefineConsoleMethod(CameraComponent, getWorldPosition, Point3F, (), , +DefineEngineMethod(CameraComponent, getWorldPosition, Point3F, (), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { diff --git a/Engine/source/T3D/components/collision/collisionComponent_ScriptBinding.h b/Engine/source/T3D/components/collision/collisionComponent_ScriptBinding.h index 3b8e83d11..30c41da2b 100644 --- a/Engine/source/T3D/components/collision/collisionComponent_ScriptBinding.h +++ b/Engine/source/T3D/components/collision/collisionComponent_ScriptBinding.h @@ -24,21 +24,21 @@ #include "T3D/components/collision/collisionComponent.h" #include "materials/baseMatInstance.h" -DefineConsoleMethod(CollisionComponent, getNumberOfContacts, S32, (), , +DefineEngineMethod(CollisionComponent, getNumberOfContacts, S32, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { return object->getCollisionList()->getCount(); } -DefineConsoleMethod(CollisionComponent, getBestContact, S32, (), , +DefineEngineMethod(CollisionComponent, getBestContact, S32, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { return 0; } -DefineConsoleMethod(CollisionComponent, getContactNormal, Point3F, (), , +DefineEngineMethod(CollisionComponent, getContactNormal, Point3F, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { @@ -53,7 +53,7 @@ DefineConsoleMethod(CollisionComponent, getContactNormal, Point3F, (), , return Point3F::Zero; } -DefineConsoleMethod(CollisionComponent, getContactMaterial, S32, (), , +DefineEngineMethod(CollisionComponent, getContactMaterial, S32, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { @@ -69,7 +69,7 @@ DefineConsoleMethod(CollisionComponent, getContactMaterial, S32, (), , return 0; } -DefineConsoleMethod(CollisionComponent, getContactObject, S32, (), , +DefineEngineMethod(CollisionComponent, getContactObject, S32, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { @@ -81,7 +81,7 @@ DefineConsoleMethod(CollisionComponent, getContactObject, S32, (), , return 0; } -DefineConsoleMethod(CollisionComponent, getContactPoint, Point3F, (), , +DefineEngineMethod(CollisionComponent, getContactPoint, Point3F, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { @@ -96,7 +96,7 @@ DefineConsoleMethod(CollisionComponent, getContactPoint, Point3F, (), , return Point3F::Zero; } -DefineConsoleMethod(CollisionComponent, getContactTime, S32, (), , +DefineEngineMethod(CollisionComponent, getContactTime, S32, (), , "Gets the number of contacts this collider has hit.\n" "@return The number of static fields defined on the object.") { diff --git a/Engine/source/T3D/components/component.cpp b/Engine/source/T3D/components/component.cpp index c7f9dcc2c..92c9dda44 100644 --- a/Engine/source/T3D/components/component.cpp +++ b/Engine/source/T3D/components/component.cpp @@ -605,8 +605,8 @@ void Component::addDependency(StringTableEntry name) ////////////////////////////////////////////////////////////////////////// // Console Methods ////////////////////////////////////////////////////////////////////////// -ConsoleMethod(Component, beginGroup, void, 3, 3, "(groupName)\n" - "Starts the grouping for following fields being added to be grouped into\n" +DefineEngineMethod(Component, beginGroup, void, (String groupName),, + "@brief Starts the grouping for following fields being added to be grouped into\n" "@param groupName The name of this group\n" "@param desc The Description of this field\n" "@param type The DataType for this field (default, int, float, Point2F, bool, enum, Object, keybind, color)\n" @@ -616,11 +616,11 @@ ConsoleMethod(Component, beginGroup, void, 3, 3, "(groupName)\n" "-object: the T2D object type that are valid choices for the field. The object types observe inheritance, so if you have a t2dSceneObject field you will be able to choose t2dStaticSrpites, t2dAnimatedSprites, etc.\n" "@return Nothing\n") { - object->beginFieldGroup(argv[2]); + object->beginFieldGroup(groupName); } -ConsoleMethod(Component, endGroup, void, 2, 2, "()\n" - "Ends the grouping for prior fields being added to be grouped into\n" +DefineEngineMethod(Component, endGroup, void, (),, + "@brief Ends the grouping for prior fields being added to be grouped into\n" "@param groupName The name of this group\n" "@param desc The Description of this field\n" "@param type The DataType for this field (default, int, float, Point2F, bool, enum, Object, keybind, color)\n" @@ -633,7 +633,7 @@ ConsoleMethod(Component, endGroup, void, 2, 2, "()\n" object->endFieldGroup(); } -DefineConsoleMethod(Component, addComponentField, void, (String fieldName, String fieldDesc, String fieldType, String defValue, String userData, bool hidden), +DefineEngineMethod(Component, addComponentField, void, (String fieldName, String fieldDesc, String fieldType, String defValue, String userData, bool hidden), ("", "", "", "", "", false), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") @@ -641,7 +641,8 @@ DefineConsoleMethod(Component, addComponentField, void, (String fieldName, Strin object->addComponentField(fieldName, fieldDesc, fieldType, defValue, userData, hidden); } -ConsoleMethod(Component, getComponentFieldCount, S32, 2, 2, "() - Get the number of ComponentField's on this object\n" +DefineEngineMethod(Component, getComponentFieldCount, S32, (),, + "@brief Get the number of ComponentField's on this object\n" "@return Returns the number of BehaviorFields as a nonnegative integer\n") { return object->getComponentFieldCount(); @@ -650,11 +651,12 @@ ConsoleMethod(Component, getComponentFieldCount, S32, 2, 2, "() - Get the number // [tom, 1/12/2007] Field accessors split into multiple methods to allow space // for long descriptions and type data. -ConsoleMethod(Component, getComponentField, const char *, 3, 3, "(int index) - Gets a Tab-Delimited list of information about a ComponentField specified by Index\n" +DefineEngineMethod(Component, getComponentField, const char *, (S32 index),, + "@brief Gets a Tab-Delimited list of information about a ComponentField specified by Index\n" "@param index The index of the behavior\n" "@return FieldName, FieldType and FieldDefaultValue, each separated by a TAB character.\n") { - ComponentField *field = object->getComponentField(dAtoi(argv[2])); + ComponentField *field = object->getComponentField(index); if (field == NULL) return ""; @@ -664,11 +666,12 @@ ConsoleMethod(Component, getComponentField, const char *, 3, 3, "(int index) - G return buf; } -ConsoleMethod(Component, setComponentield, const char *, 3, 3, "(int index) - Gets a Tab-Delimited list of information about a ComponentField specified by Index\n" +DefineEngineMethod(Component, setComponentield, const char *, (S32 index),, + "@brief Gets a Tab-Delimited list of information about a ComponentField specified by Index\n" "@param index The index of the behavior\n" "@return FieldName, FieldType and FieldDefaultValue, each separated by a TAB character.\n") { - ComponentField *field = object->getComponentField(dAtoi(argv[2])); + ComponentField *field = object->getComponentField(index); if (field == NULL) return ""; @@ -678,7 +681,7 @@ ConsoleMethod(Component, setComponentield, const char *, 3, 3, "(int index) - Ge return buf; } -DefineConsoleMethod(Component, getComponentFieldType, const char *, (String fieldName), , +DefineEngineMethod(Component, getComponentFieldType, const char *, (String fieldName), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -689,36 +692,40 @@ DefineConsoleMethod(Component, getComponentFieldType, const char *, (String fiel return field->mFieldTypeName;; } -ConsoleMethod(Component, getBehaviorFieldUserData, const char *, 3, 3, "(int index) - Gets the UserData associated with a field by index in the field list\n" +DefineEngineMethod(Component, getBehaviorFieldUserData, const char *, (S32 index),, + "@brief Gets the UserData associated with a field by index in the field list\n" "@param index The index of the behavior\n" "@return Returns a string representing the user data of this field\n") { - ComponentField *field = object->getComponentField(dAtoi(argv[2])); + ComponentField *field = object->getComponentField(index); if (field == NULL) return ""; return field->mUserData; } -ConsoleMethod(Component, getComponentFieldDescription, const char *, 3, 3, "(int index) - Gets a field description by index\n" +DefineEngineMethod(Component, getComponentFieldDescription, const char *, (S32 index),, + "@brief Gets a field description by index\n" "@param index The index of the behavior\n" "@return Returns a string representing the description of this field\n") { - ComponentField *field = object->getComponentField(dAtoi(argv[2])); + ComponentField *field = object->getComponentField(index); if (field == NULL) return ""; return field->mFieldDescription ? field->mFieldDescription : ""; } -ConsoleMethod(Component, addDependency, void, 3, 3, "(string behaviorName) - Gets a field description by index\n" +DefineEngineMethod(Component, addDependency, void, (String behaviorName),, + "@brief Gets a field description by index\n" "@param index The index of the behavior\n" "@return Returns a string representing the description of this field\n") { - object->addDependency(argv[2]); + object->addDependency(behaviorName); } -ConsoleMethod(Component, setDirty, void, 2, 2, "() - Gets a field description by index\n" +DefineEngineMethod(Component, setDirty, void, (),, + "@brief Gets a field description by index\n" "@param index The index of the behavior\n" "@return Returns a string representing the description of this field\n") { diff --git a/Engine/source/T3D/convexShape.h b/Engine/source/T3D/convexShape.h index 413877a36..62b38f354 100644 --- a/Engine/source/T3D/convexShape.h +++ b/Engine/source/T3D/convexShape.h @@ -201,6 +201,8 @@ public: /// @} + String getMaterialName() { return mMaterialName; } + protected: void _updateMaterial(); diff --git a/Engine/source/T3D/entity.cpp b/Engine/source/T3D/entity.cpp index 8e9426a23..ffe724406 100644 --- a/Engine/source/T3D/entity.cpp +++ b/Engine/source/T3D/entity.cpp @@ -1798,7 +1798,7 @@ DefineEngineMethod(Entity, setBox, void, } -/*DefineConsoleMethod(Entity, callOnComponents, void, (const char* functionName), , +/*DefineEngineMethod(Entity, callOnComponents, void, (const char* functionName), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1821,12 +1821,11 @@ ConsoleMethod(Entity, addComponents, void, 2, 2, "() - Add all fielded behaviors object->addComponents(); }*/ -ConsoleMethod(Entity, addComponent, bool, 3, 3, "(ComponentInstance bi) - Add a behavior to the object\n" +DefineEngineMethod(Entity, addComponent, bool, (Component* comp),, + "@brief Add a behavior to the object\n" "@param bi The behavior instance to add" "@return (bool success) Whether or not the behavior was successfully added") { - Component *comp = dynamic_cast(Sim::findObject(argv[2])); - if (comp != NULL) { bool success = object->addComponent(comp); @@ -1846,40 +1845,33 @@ ConsoleMethod(Entity, addComponent, bool, 3, 3, "(ComponentInstance bi) - Add a return false; } -ConsoleMethod(Entity, removeComponent, bool, 3, 4, "(ComponentInstance bi, [bool deleteBehavior = true])\n" +DefineEngineMethod(Entity, removeComponent, bool, (Component* comp, bool deleteComponent), (true), "@param bi The behavior instance to remove\n" "@param deleteBehavior Whether or not to delete the behavior\n" "@return (bool success) Whether the behavior was successfully removed") { - bool deleteComponent = true; - if (argc > 3) - deleteComponent = dAtob(argv[3]); - - return object->removeComponent(dynamic_cast(Sim::findObject(argv[2])), deleteComponent); + return object->removeComponent(comp, deleteComponent); } -ConsoleMethod(Entity, clearComponents, void, 2, 2, "() - Clear all behavior instances\n" +DefineEngineMethod(Entity, clearComponents, void, (),, "Clear all behavior instances\n" "@return No return value") { object->clearComponents(); } -ConsoleMethod(Entity, getComponentByIndex, S32, 3, 3, "(int index) - Gets a particular behavior\n" +DefineEngineMethod(Entity, getComponentByIndex, Component*, (S32 index),, + "@brief Gets a particular behavior\n" "@param index The index of the behavior to get\n" "@return (ComponentInstance bi) The behavior instance you requested") { - Component *comp = object->getComponent(dAtoi(argv[2])); - - return (comp != NULL) ? comp->getId() : 0; + return object->getComponent(index); } -DefineConsoleMethod(Entity, getComponent, S32, (String componentName), (""), +DefineEngineMethod(Entity, getComponent, Component*, (String componentName), (""), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { - Component *comp = object->getComponent(componentName); - - return (comp != NULL) ? comp->getId() : 0; + return object->getComponent(componentName); } /*ConsoleMethod(Entity, getBehaviorByType, S32, 3, 3, "(string BehaviorTemplateName) - gets a behavior\n" @@ -1908,13 +1900,14 @@ DefineConsoleMethod(Entity, getComponent, S32, (String componentName), (""), return object->reOrder(inst, idx); }*/ -ConsoleMethod(Entity, getComponentCount, S32, 2, 2, "() - Get the count of behaviors on an object\n" +DefineEngineMethod(Entity, getComponentCount, S32, (),, + "@brief Get the count of behaviors on an object\n" "@return (int count) The number of behaviors on an object") { return object->getComponentCount(); } -DefineConsoleMethod(Entity, setComponentDirty, void, (S32 componentID, bool forceUpdate), (0, false), +DefineEngineMethod(Entity, setComponentDirty, void, (S32 componentID, bool forceUpdate), (0, false), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1923,7 +1916,7 @@ DefineConsoleMethod(Entity, setComponentDirty, void, (S32 componentID, bool forc object->setComponentDirty(comp, forceUpdate);*/ } -DefineConsoleMethod(Entity, getMoveVector, VectorF, (),, +DefineEngineMethod(Entity, getMoveVector, VectorF, (),, "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1937,7 +1930,7 @@ DefineConsoleMethod(Entity, getMoveVector, VectorF, (),, return VectorF::Zero; } -DefineConsoleMethod(Entity, getMoveRotation, VectorF, (), , +DefineEngineMethod(Entity, getMoveRotation, VectorF, (), , "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1951,7 +1944,7 @@ DefineConsoleMethod(Entity, getMoveRotation, VectorF, (), , return VectorF::Zero; } -DefineConsoleMethod(Entity, getMoveTrigger, bool, (S32 triggerNum), (0), +DefineEngineMethod(Entity, getMoveTrigger, bool, (S32 triggerNum), (0), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { @@ -1972,28 +1965,28 @@ DefineEngineMethod(Entity, getForwardVector, VectorF, (), , return forVec; } -DefineConsoleMethod(Entity, setForwardVector, void, (VectorF newForward), (VectorF(0,0,0)), +DefineEngineMethod(Entity, setForwardVector, void, (VectorF newForward), (VectorF(0,0,0)), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { object->setForwardVector(newForward); } -DefineConsoleMethod(Entity, lookAt, void, (Point3F lookPosition),, +DefineEngineMethod(Entity, lookAt, void, (Point3F lookPosition),, "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { //object->setForwardVector(newForward); } -DefineConsoleMethod(Entity, rotateTo, void, (Point3F lookPosition, F32 degreePerSecond), (1.0), +DefineEngineMethod(Entity, rotateTo, void, (Point3F lookPosition, F32 degreePerSecond), (1.0), "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object.") { //object->setForwardVector(newForward); } -DefineConsoleMethod(Entity, notify, void, (String signalFunction, String argA, String argB, String argC, String argD, String argE), +DefineEngineMethod(Entity, notify, void, (String signalFunction, String argA, String argB, String argC, String argD, String argE), ("", "", "", "", "", ""), "Triggers a signal call to all components for a certain function.") { @@ -2003,7 +1996,7 @@ DefineConsoleMethod(Entity, notify, void, (String signalFunction, String argA, S object->notifyComponents(signalFunction, argA, argB, argC, argD, argE); } -DefineConsoleFunction(findEntitiesByTag, const char*, (SimGroup* searchingGroup, String tags), (nullAsType(), ""), +DefineEngineFunction(findEntitiesByTag, const char*, (SimGroup* searchingGroup, String tags), (nullAsType(), ""), "Finds all entities that have the provided tags.\n" "@param searchingGroup The SimGroup to search inside. If null, we'll search the entire dictionary(this can be slow!).\n" "@param tags Word delimited list of tags to search for. If multiple tags are included, the list is eclusively parsed, requiring all tags provided to be found on an entity for a match.\n" diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index cfe87de6d..dc5f69367 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -326,7 +326,7 @@ DefineEngineMethod( GameConnection, setJoinPassword, void, (const char* password object->setJoinPassword(password); } -ConsoleMethod(GameConnection, setConnectArgs, void, 3, 17, +DefineEngineStringlyVariadicMethod(GameConnection, setConnectArgs, void, 3, 17, "(const char* args) @brief On the client, pass along a variable set of parameters to the server.\n\n" "Once the connection is established with the server, the server calls its onConnect() method " @@ -2451,41 +2451,37 @@ DefineEngineMethod( GameConnection, getVisibleGhostDistance, F32, (),, // Object Selection in Torque by Dave Myers // http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7335 -ConsoleMethod(GameConnection, setSelectedObj, bool, 3, 4, "(object, [propagate_to_client])") +DefineEngineMethod(GameConnection, setSelectedObj, bool, (SceneObject* obj, bool propagate_to_client), (false), "") { - SceneObject* pending_selection; - if (!Sim::findObject(argv[2], pending_selection)) + if (!obj) return false; - bool propagate_to_client = (argc > 3) ? dAtob(argv[3]) : false; - object->setSelectedObj(pending_selection, propagate_to_client); + object->setSelectedObj(obj, propagate_to_client); return true; } -ConsoleMethod(GameConnection, getSelectedObj, S32, 2, 2, "()") +DefineEngineMethod(GameConnection, getSelectedObj, SimObject*, (),, "") { - SimObject* selected = object->getSelectedObj(); - return (selected) ? selected->getId(): -1; + return object->getSelectedObj(); } -ConsoleMethod(GameConnection, clearSelectedObj, void, 2, 3, "([propagate_to_client])") +DefineEngineMethod(GameConnection, clearSelectedObj, void, (bool propagate_to_client), (false), "") { - bool propagate_to_client = (argc > 2) ? dAtob(argv[2]) : false; object->setSelectedObj(NULL, propagate_to_client); } -ConsoleMethod(GameConnection, setPreSelectedObjFromRollover, void, 2, 2, "()") +DefineEngineMethod(GameConnection, setPreSelectedObjFromRollover, void, (),, "") { object->setPreSelectedObjFromRollover(); } -ConsoleMethod(GameConnection, clearPreSelectedObj, void, 2, 2, "()") +DefineEngineMethod(GameConnection, clearPreSelectedObj, void, (),, "") { object->clearPreSelectedObj(); } -ConsoleMethod(GameConnection, setSelectedObjFromPreSelected, void, 2, 2, "()") +DefineEngineMethod(GameConnection, setSelectedObjFromPreSelected, void, (),, "") { object->setSelectedObjFromPreSelected(); } @@ -2722,33 +2718,32 @@ void GameConnection::resetDatablockCache() afx_saved_db_cache_CRC = 0xffffffff; } -ConsoleFunction(resetDatablockCache, void, 1, 1, "resetDatablockCache()") +DefineEngineFunction(resetDatablockCache, void, (),,"") { GameConnection::resetDatablockCache(); } -ConsoleFunction(isDatablockCacheSaved, bool, 1, 1, "resetDatablockCache()") +DefineEngineFunction(isDatablockCacheSaved, bool, (),,"") { return afx_saved_db_cache; } -ConsoleFunction(getDatablockCacheCRC, S32, 1, 1, "getDatablockCacheCRC()") +DefineEngineFunction(getDatablockCacheCRC, S32, (),,"") { return (S32)afx_saved_db_cache_CRC; } -ConsoleFunction(extractDatablockCacheCRC, S32, 2, 2, "extractDatablockCacheCRC(filename)") +DefineEngineFunction(extractDatablockCacheCRC, S32, (const char* fileName),,"") { FileStream f_stream; - const char* fileName = argv[1]; - if(!f_stream.open(fileName, Torque::FS::File::Read)) + if (!f_stream.open(fileName, Torque::FS::File::Read)) { Con::errorf("Failed to open file '%s'.", fileName); return -1; } U32 stream_sz = f_stream.getStreamSize(); - if (stream_sz < 4*32) + if (stream_sz < 4 * 32) { Con::errorf("File '%s' is not a valid datablock cache.", fileName); f_stream.close(); @@ -2777,17 +2772,16 @@ ConsoleFunction(extractDatablockCacheCRC, S32, 2, 2, "extractDatablockCacheCRC(f return (S32)crc_code; } -ConsoleFunction(setDatablockCacheCRC, void, 2, 2, "setDatablockCacheCRC(crc)") +DefineEngineFunction(setDatablockCacheCRC, void, (U32 crc), , "") { GameConnection *conn = GameConnection::getConnectionToServer(); - if(!conn) + if (!conn) return; - U32 crc_u = (U32)dAtoi(argv[1]); - conn->setServerCacheCRC(crc_u); + conn->setServerCacheCRC(crc); } -ConsoleMethod( GameConnection, saveDatablockCache, void, 2, 2, "saveDatablockCache()") +DefineEngineMethod(GameConnection, saveDatablockCache, void, (),, "") { if (GameConnection::serverCacheEnabled() && !afx_saved_db_cache) { @@ -2802,14 +2796,14 @@ ConsoleMethod( GameConnection, saveDatablockCache, void, 2, 2, "saveDatablockCac Con::expandScriptFilename(filename_buffer, sizeof(filename_buffer), filename.c_str()); Torque::Path givenPath(Torque::Path::CompressPath(filename_buffer)); Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(givenPath); - if ( fileRef == NULL ) + if (fileRef == NULL) Con::errorf("saveDatablockCache() failed to get CRC for file '%s'.", filename.c_str()); else afx_saved_db_cache_CRC = (S32)fileRef->getChecksum(); } } -ConsoleMethod( GameConnection, loadDatablockCache, void, 2, 2, "loadDatablockCache()") +DefineEngineMethod(GameConnection, loadDatablockCache, void, (),, "") { if (GameConnection::clientCacheEnabled()) { @@ -2817,7 +2811,7 @@ ConsoleMethod( GameConnection, loadDatablockCache, void, 2, 2, "loadDatablockCac } } -ConsoleMethod( GameConnection, loadDatablockCache_Begin, bool, 2, 2, "loadDatablockCache_Begin()") +DefineEngineMethod(GameConnection, loadDatablockCache_Begin, bool, (),, "") { if (GameConnection::clientCacheEnabled()) { @@ -2827,7 +2821,7 @@ ConsoleMethod( GameConnection, loadDatablockCache_Begin, bool, 2, 2, "loadDatabl return false; } -ConsoleMethod( GameConnection, loadDatablockCache_Continue, bool, 2, 2, "loadDatablockCache_Continue()") +DefineEngineMethod(GameConnection, loadDatablockCache_Continue, bool, (),, "") { if (GameConnection::clientCacheEnabled()) { diff --git a/Engine/source/T3D/gameBase/gameProcess.cpp b/Engine/source/T3D/gameBase/gameProcess.cpp index 2df8a850e..6aa5c0e63 100644 --- a/Engine/source/T3D/gameBase/gameProcess.cpp +++ b/Engine/source/T3D/gameBase/gameProcess.cpp @@ -34,7 +34,7 @@ ClientProcessList* ClientProcessList::smClientProcessList = NULL; ServerProcessList* ServerProcessList::smServerProcessList = NULL; static U32 gNetOrderNextId = 0; -DefineConsoleFunction( dumpProcessList, void, ( ), , +DefineEngineFunction( dumpProcessList, void, ( ), , "Dumps all ProcessObjects in ServerProcessList and ClientProcessList to the console." ) { Con::printf( "client process list:" ); diff --git a/Engine/source/T3D/gameFunctions.cpp b/Engine/source/T3D/gameFunctions.cpp index 23d048f7c..c49c75cb3 100644 --- a/Engine/source/T3D/gameFunctions.cpp +++ b/Engine/source/T3D/gameFunctions.cpp @@ -114,7 +114,7 @@ static U32 sgServerQueryIndex = 0; //SERVER FUNCTIONS ONLY ConsoleFunctionGroupBegin( Containers, "Spatial query functions. Server side only!"); -DefineConsoleFunction( containerFindFirst, const char*, (U32 typeMask, Point3F origin, Point3F size), , "(int mask, Point3F point, float x, float y, float z)" +DefineEngineFunction( containerFindFirst, const char*, (U32 typeMask, Point3F origin, Point3F size), , "(int mask, Point3F point, float x, float y, float z)" "@brief Find objects matching the bitmask type within a box centered at point, with extents x, y, z.\n\n" "@returns The first object found, or an empty string if nothing was found. Thereafter, you can get more " "results using containerFindNext()." @@ -146,7 +146,7 @@ DefineConsoleFunction( containerFindFirst, const char*, (U32 typeMask, Point3F o return buff; } -DefineConsoleFunction( containerFindNext, const char*, (), , "()" +DefineEngineFunction( containerFindNext, const char*, (), , "()" "@brief Get more results from a previous call to containerFindFirst().\n\n" "@note You must call containerFindFirst() to begin the search.\n" "@returns The next object found, or an empty string if nothing else was found.\n" diff --git a/Engine/source/T3D/lightBase.cpp b/Engine/source/T3D/lightBase.cpp index 6cc739ed3..007f2ca32 100644 --- a/Engine/source/T3D/lightBase.cpp +++ b/Engine/source/T3D/lightBase.cpp @@ -440,7 +440,7 @@ static ConsoleDocFragment _lbplayAnimation2( "void playAnimation(LightAnimData anim);" ); -DefineConsoleMethod( LightBase, playAnimation, void, (const char * anim), (""), "( [LightAnimData anim] )\t" +DefineEngineMethod( LightBase, playAnimation, void, (const char * anim), (""), "( [LightAnimData anim] )\t" "Plays a light animation on the light. If no LightAnimData is passed the " "existing one is played." "@hide") @@ -484,7 +484,7 @@ void LightBase::playAnimation( LightAnimData *animData ) } } -DefineConsoleMethod( LightBase, pauseAnimation, void, (), , "Stops the light animation." ) +DefineEngineMethod( LightBase, pauseAnimation, void, (), , "Stops the light animation." ) { object->pauseAnimation(); } diff --git a/Engine/source/T3D/missionMarker.cpp b/Engine/source/T3D/missionMarker.cpp index 0a7f11e0e..005ec3491 100644 --- a/Engine/source/T3D/missionMarker.cpp +++ b/Engine/source/T3D/missionMarker.cpp @@ -494,7 +494,7 @@ ConsoleDocFragment _SpawnSpherespawnObject1( "bool spawnObject(string additionalProps);" ); -DefineConsoleMethod(SpawnSphere, spawnObject, S32, (String additionalProps), , +DefineEngineMethod(SpawnSphere, spawnObject, S32, (String additionalProps), , "([string additionalProps]) Spawns the object based on the SpawnSphere's " "class, datablock, properties, and script settings. Allows you to pass in " "extra properties." diff --git a/Engine/source/T3D/physics/physicsDebris.cpp b/Engine/source/T3D/physics/physicsDebris.cpp index 44d421c86..33bc2d936 100644 --- a/Engine/source/T3D/physics/physicsDebris.cpp +++ b/Engine/source/T3D/physics/physicsDebris.cpp @@ -238,7 +238,7 @@ void PhysicsDebrisData::unpackData(BitStream* stream) shapeName = stream->readSTString(); } -DefineConsoleMethod( PhysicsDebrisData, preload, void, (), , +DefineEngineMethod( PhysicsDebrisData, preload, void, (), , "@brief Loads some information to have readily available at simulation time.\n\n" "Forces generation of shaders, materials, and other data used by the %PhysicsDebris object. " "This function should be used while a level is loading in order to shorten " diff --git a/Engine/source/T3D/physics/physicsPlugin.cpp b/Engine/source/T3D/physics/physicsPlugin.cpp index b2f06b55e..daaad7813 100644 --- a/Engine/source/T3D/physics/physicsPlugin.cpp +++ b/Engine/source/T3D/physics/physicsPlugin.cpp @@ -35,12 +35,11 @@ #include "T3D/physics/physicsWorld.h" #include "core/util/tNamedFactory.h" - PhysicsPlugin* PhysicsPlugin::smSingleton = NULL; PhysicsResetSignal PhysicsPlugin::smPhysicsResetSignal; bool PhysicsPlugin::smSinglePlayer = false; U32 PhysicsPlugin::smThreadCount = 2; - +bool PhysicsPlugin::smGpuAccelerationAllowed = false; String PhysicsPlugin::smServerWorldName( "server" ); String PhysicsPlugin::smClientWorldName( "client" ); @@ -51,6 +50,10 @@ AFTER_MODULE_INIT( Sim ) "@brief Informs the physics simulation if only a single player exists.\n\n" "If true, optimizations will be implemented to better cater to a single player environmnent.\n\n" "@ingroup Physics\n"); + Con::addVariable("$Physics::gpuAccelerationAllowed", TypeBool, &PhysicsPlugin::smGpuAccelerationAllowed, + "@brief Informs the physics plugin if it is allowed to use gpu acceleration.\n\n" + "Not all physics implemenations or gpus can support gpu acceleration, this simply informs the plugin if it is allowed to try and use it or not.\n\n" + "@ingroup Physics\n"); Con::addVariable( "$pref::Physics::threadCount", TypeS32, &PhysicsPlugin::smThreadCount, "@brief Number of threads to use in a single pass of the physics engine.\n\n" "Defaults to 2 if not set.\n\n" @@ -124,31 +127,31 @@ void PhysicsPlugin::_debugDraw( SceneManager *graph, const SceneRenderState *sta world->onDebugDraw( state ); } -DefineConsoleFunction( physicsPluginPresent, bool, (), , "physicsPluginPresent()" +DefineEngineFunction( physicsPluginPresent, bool, (), , "physicsPluginPresent()" "@brief Returns true if a physics plugin exists and is initialized.\n\n" "@ingroup Physics" ) { return PHYSICSMGR != NULL; } -DefineConsoleFunction( physicsInit, bool, (const char * library), ("default"), "physicsInit( [string library] )") +DefineEngineFunction( physicsInit, bool, (const char * library), ("default"), "physicsInit( [string library] )") { return PhysicsPlugin::activate( library ); } -DefineConsoleFunction( physicsDestroy, void, (), , "physicsDestroy()") +DefineEngineFunction( physicsDestroy, void, (), , "physicsDestroy()") { if ( PHYSICSMGR ) PHYSICSMGR->destroyPlugin(); } -DefineConsoleFunction( physicsInitWorld, bool, (const char * worldName), , "physicsInitWorld( String worldName )") +DefineEngineFunction( physicsInitWorld, bool, (const char * worldName), , "physicsInitWorld( String worldName )") { bool res = PHYSICSMGR && PHYSICSMGR->createWorld( String( worldName ) ); return res; } -DefineConsoleFunction( physicsDestroyWorld, void, (const char * worldName), , "physicsDestroyWorld( String worldName )") +DefineEngineFunction( physicsDestroyWorld, void, (const char * worldName), , "physicsDestroyWorld( String worldName )") { if ( PHYSICSMGR ) PHYSICSMGR->destroyWorld( worldName ); @@ -157,19 +160,19 @@ DefineConsoleFunction( physicsDestroyWorld, void, (const char * worldName), , "p // Control/query of the stop/started state // of the currently running simulation. -DefineConsoleFunction( physicsStartSimulation, void, (const char * worldName), , "physicsStartSimulation( String worldName )") +DefineEngineFunction( physicsStartSimulation, void, (const char * worldName), , "physicsStartSimulation( String worldName )") { if ( PHYSICSMGR ) PHYSICSMGR->enableSimulation( String( worldName ), true ); } -DefineConsoleFunction( physicsStopSimulation, void, (const char * worldName), , "physicsStopSimulation( String worldName )") +DefineEngineFunction( physicsStopSimulation, void, (const char * worldName), , "physicsStopSimulation( String worldName )") { if ( PHYSICSMGR ) PHYSICSMGR->enableSimulation( String( worldName ), false ); } -DefineConsoleFunction( physicsSimulationEnabled, bool, (), , "physicsStopSimulation( String worldName )") +DefineEngineFunction( physicsSimulationEnabled, bool, (), , "physicsStopSimulation( String worldName )") { return PHYSICSMGR && PHYSICSMGR->isSimulationEnabled(); } @@ -177,14 +180,14 @@ DefineConsoleFunction( physicsSimulationEnabled, bool, (), , "physicsStopSimulat // Used for slowing down time on the // physics simulation, and for pausing/restarting // the simulation. -DefineConsoleFunction( physicsSetTimeScale, void, (F32 scale), , "physicsSetTimeScale( F32 scale )") +DefineEngineFunction( physicsSetTimeScale, void, (F32 scale), , "physicsSetTimeScale( F32 scale )") { if ( PHYSICSMGR ) PHYSICSMGR->setTimeScale( scale ); } // Get the currently set time scale. -DefineConsoleFunction( physicsGetTimeScale, F32, (), , "physicsGetTimeScale()") +DefineEngineFunction( physicsGetTimeScale, F32, (), , "physicsGetTimeScale()") { return PHYSICSMGR && PHYSICSMGR->getTimeScale(); } @@ -193,7 +196,7 @@ DefineConsoleFunction( physicsGetTimeScale, F32, (), , "physicsGetTimeScale()") // physics simulation that they should store // their current state for later restoration, // such as when the editor is closed. -DefineConsoleFunction( physicsStoreState, void, (), , "physicsStoreState()") +DefineEngineFunction( physicsStoreState, void, (), , "physicsStoreState()") { PhysicsPlugin::getPhysicsResetSignal().trigger( PhysicsResetEvent_Store ); } @@ -201,13 +204,13 @@ DefineConsoleFunction( physicsStoreState, void, (), , "physicsStoreState()") // Used to send a signal to objects in the // physics simulation that they should restore // their saved state, such as when the editor is opened. -DefineConsoleFunction( physicsRestoreState, void, (), , "physicsRestoreState()") +DefineEngineFunction( physicsRestoreState, void, (), , "physicsRestoreState()") { if ( PHYSICSMGR ) PHYSICSMGR->reset(); } -DefineConsoleFunction( physicsDebugDraw, void, (bool enable), , "physicsDebugDraw( bool enable )") +DefineEngineFunction( physicsDebugDraw, void, (bool enable), , "physicsDebugDraw( bool enable )") { if ( PHYSICSMGR ) PHYSICSMGR->enableDebugDraw( enable ); diff --git a/Engine/source/T3D/physics/physicsPlugin.h b/Engine/source/T3D/physics/physicsPlugin.h index 91c187473..bf5040941 100644 --- a/Engine/source/T3D/physics/physicsPlugin.h +++ b/Engine/source/T3D/physics/physicsPlugin.h @@ -96,6 +96,10 @@ public: /// @see PHYSICSPLUGIN static PhysicsPlugin* getSingleton() { return smSingleton; } + /// Allow gpu acceleration if supported + static bool smGpuAccelerationAllowed; + static bool gpuAccelerationAllowed() { return smGpuAccelerationAllowed; } + /// static bool activate( const char *library ); diff --git a/Engine/source/T3D/physics/physicsWorld.cpp b/Engine/source/T3D/physics/physicsWorld.cpp index 65b254885..7298987c3 100644 --- a/Engine/source/T3D/physics/physicsWorld.cpp +++ b/Engine/source/T3D/physics/physicsWorld.cpp @@ -26,6 +26,8 @@ //Physics timing F32 PhysicsWorld::smPhysicsStepTime = 1.0f / 60.f; //default 60fps U32 PhysicsWorld::smPhysicsMaxSubSteps = 4; +//Gpu acceleration +bool PhysicsWorld::smGpuEnabled = false; PhysicsWorld::PhysicsWorld() : mGravity( 0, 0, -20.0f ) // NOTE: This matches the gravity used for player objects. diff --git a/Engine/source/T3D/physics/physicsWorld.h b/Engine/source/T3D/physics/physicsWorld.h index a18cffb98..e03d088c5 100644 --- a/Engine/source/T3D/physics/physicsWorld.h +++ b/Engine/source/T3D/physics/physicsWorld.h @@ -49,6 +49,9 @@ protected: /// The current gravity force. Point3F mGravity; + /// Gpu acceleration + static bool smGpuEnabled; + public: /// The constructor. @@ -115,6 +118,9 @@ public: /// Physics timing static F32 smPhysicsStepTime; static U32 smPhysicsMaxSubSteps; + + /// Gpu acceleration + static bool isGpuEnabled() { return smGpuEnabled; } }; diff --git a/Engine/source/T3D/physics/physx3/px3.h b/Engine/source/T3D/physics/physx3/px3.h index 6db611b51..ef273e009 100644 --- a/Engine/source/T3D/physics/physx3/px3.h +++ b/Engine/source/T3D/physics/physx3/px3.h @@ -33,19 +33,43 @@ #define WIN32 #endif +// macOS _DEBUG & NDEBUG +#if defined(TORQUE_OS_MAC) && defined(TORQUE_DEBUG) && !defined(_DEBUG) + #define _DEBUG +#elif defined(TORQUE_OS_MAC) && defined(TORQUE_RELEASE) && !defined(NDEBUG) + #define NDEBUG +#endif + +// Linux _DEBUG & NDEBUG +#if defined(TORQUE_OS_LINUX) && defined(TORQUE_DEBUG) && !defined(_DEBUG) +#define _DEBUG +#elif defined(TORQUE_OS_LINUX) && defined(TORQUE_RELEASE) && !defined(NDEBUG) +#define NDEBUG +#endif + //------------------------------------------------------------------------- +//safe release template +template void SafeReleasePhysx(T* a) +{ + if (a) + { + a->release(); + a = NULL; + } +} + #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include extern physx::PxPhysics* gPhysics3SDK; diff --git a/Engine/source/T3D/physics/physx3/px3Body.cpp b/Engine/source/T3D/physics/physx3/px3Body.cpp index ec4e3b979..4bab75dc1 100644 --- a/Engine/source/T3D/physics/physx3/px3Body.cpp +++ b/Engine/source/T3D/physics/physx3/px3Body.cpp @@ -52,12 +52,9 @@ void Px3Body::_releaseActor() if ( !mActor ) return; - mWorld->releaseWriteLock(); - mActor->userData = NULL; - mActor->release(); - mActor = NULL; + SafeReleasePhysx(mActor); mBodyFlags = 0; if ( mMaterial ) @@ -80,7 +77,7 @@ bool Px3Body::init( PhysicsCollision *shape, AssertFatal( shape, "Px3Body::init - Got a null collision shape!" ); AssertFatal( dynamic_cast( shape ), "Px3Body::init - The collision shape is the wrong type!" ); AssertFatal( !((Px3Collision*)shape)->getShapes().empty(), "Px3Body::init - Got empty collision shape!" ); - + // Cleanup any previous actor. _releaseActor(); @@ -96,18 +93,20 @@ bool Px3Body::init( PhysicsCollision *shape, { mActor = gPhysics3SDK->createRigidDynamic(physx::PxTransform(physx::PxIDENTITY())); physx::PxRigidDynamic *actor = mActor->is(); - actor->setRigidDynamicFlag(physx::PxRigidDynamicFlag::eKINEMATIC, true); + actor->setRigidBodyFlag(physx::PxRigidBodyFlag::eKINEMATIC, true); actor->setMass(getMax( mass, 1.0f )); } else if ( mass > 0.0f ) { mActor = gPhysics3SDK->createRigidDynamic(physx::PxTransform(physx::PxIDENTITY())); + physx::PxRigidDynamic *actor = mActor->is(); + actor->setMaxAngularVelocity(80.f); } else { mActor = gPhysics3SDK->createRigidStatic(physx::PxTransform(physx::PxIDENTITY())); mIsStatic = true; - } + } mMaterial = gPhysics3SDK->createMaterial(0.6f,0.4f,0.1f); @@ -123,12 +122,13 @@ bool Px3Body::init( PhysicsCollision *shape, Con::errorf("PhysX3 Dynamic Triangle Mesh is not supported."); } } - physx::PxShape * pShape = mActor->createShape(*desc->pGeometry,*mMaterial); + + physx::PxShape * pShape = physx::PxRigidActorExt::createExclusiveShape(*mActor, *desc->pGeometry, *mMaterial); physx::PxFilterData colData; if(isDebris) colData.word0 = PX3_DEBRIS; else if(isTrigger) - colData.word0 = PX3_TRIGGER; + colData.word0 = PX3_TRIGGER; else colData.word0 = PX3_DEFAULT; @@ -149,10 +149,6 @@ bool Px3Body::init( PhysicsCollision *shape, physx::PxRigidBodyExt::setMassAndUpdateInertia(*actor,mass); } - // This sucks, but it has to happen if we want - // to avoid write lock errors from PhysX right now. - mWorld->releaseWriteLock(); - mWorld->getScene()->addActor(*mActor); mIsEnabled = true; @@ -178,9 +174,9 @@ void Px3Body::setMaterial( F32 restitution, actor->wakeUp(); } - mMaterial->setRestitution(restitution); - mMaterial->setStaticFriction(staticFriction); - mMaterial->setDynamicFriction(friction); + mMaterial->setRestitution(restitution); + mMaterial->setStaticFriction(staticFriction); + mMaterial->setDynamicFriction(friction); } @@ -322,15 +318,14 @@ Box3F Px3Body::getWorldBounds() physx::PxBounds3 bounds; bounds.setEmpty(); - physx::PxBounds3 shapeBounds; - + physx::PxBounds3 shapeBounds; U32 shapeCount = mActor->getNbShapes(); physx::PxShape **shapes = new physx::PxShape*[shapeCount]; mActor->getShapes(shapes, shapeCount); for ( U32 i = 0; i < shapeCount; i++ ) { - // Get the shape's bounds. + // Get the shape's bounds. shapeBounds = physx::PxShapeExt::getWorldBounds(*shapes[i],*mActor); // Combine them into the total bounds. bounds.include( shapeBounds ); @@ -350,10 +345,6 @@ void Px3Body::setSimulationEnabled( bool enabled ) if(mBodyFlags & BF_TRIGGER) return; - // This sucks, but it has to happen if we want - // to avoid write lock errors from PhysX right now. - mWorld->releaseWriteLock(); - U32 shapeCount = mActor->getNbShapes(); physx::PxShape **shapes = new physx::PxShape*[shapeCount]; mActor->getShapes(shapes, shapeCount); @@ -367,12 +358,6 @@ void Px3Body::setSimulationEnabled( bool enabled ) void Px3Body::setTransform( const MatrixF &transform ) { AssertFatal( mActor, "Px3Body::setTransform - The actor is null!" ); - - - // This sucks, but it has to happen if we want - // to avoid write lock errors from PhysX right now. - mWorld->releaseWriteLock(); - mActor->setGlobalPose(px3Cast(transform),false); @@ -380,7 +365,7 @@ void Px3Body::setTransform( const MatrixF &transform ) return; physx::PxRigidDynamic *actor = mActor->is(); - bool kinematic = actor->getRigidDynamicFlags() & physx::PxRigidDynamicFlag::eKINEMATIC; + bool kinematic = actor->getRigidBodyFlags() & physx::PxRigidBodyFlag::eKINEMATIC; // If its dynamic we have more to do. if ( isDynamic() && !kinematic ) { @@ -395,10 +380,6 @@ void Px3Body::applyCorrection( const MatrixF &transform ) AssertFatal( mActor, "Px3Body::applyCorrection - The actor is null!" ); AssertFatal( isDynamic(), "Px3Body::applyCorrection - This call is only for dynamics!" ); - // This sucks, but it has to happen if we want - // to avoid write lock errors from PhysX right now. - mWorld->releaseWriteLock(); - mActor->setGlobalPose( px3Cast(transform) ); } @@ -406,35 +387,27 @@ void Px3Body::applyImpulse( const Point3F &origin, const Point3F &force ) { AssertFatal( mActor, "Px3Body::applyImpulse - The actor is null!" ); - // This sucks, but it has to happen if we want - // to avoid write lock errors from PhysX right now. - mWorld->releaseWriteLock(); physx::PxRigidDynamic *actor = mActor->is(); if ( mIsEnabled && isDynamic() ) - physx::PxRigidBodyExt::addForceAtPos(*actor,px3Cast(force), - px3Cast(origin), - physx::PxForceMode::eIMPULSE); - + physx::PxRigidBodyExt::addForceAtPos( *actor,px3Cast(force), px3Cast(origin), physx::PxForceMode::eIMPULSE ); } -void Px3Body::applyTorque( const Point3F &torque ) +void Px3Body::applyTorque(const Point3F &torque) { AssertFatal(mActor, "Px3Body::applyImpulse - The actor is null!"); - mWorld->releaseWriteLock(); physx::PxRigidDynamic *actor = mActor->is(); if (mIsEnabled && isDynamic()) - actor->addTorque( px3Cast(torque), physx::PxForceMode::eFORCE, true); + actor->addTorque(px3Cast(torque), physx::PxForceMode::eFORCE, true); } -void Px3Body::applyForce( const Point3F &force ) +void Px3Body::applyForce(const Point3F &force) { AssertFatal(mActor, "Px3Body::applyTorque - The actor is null!"); - mWorld->releaseWriteLock(); physx::PxRigidDynamic *actor = mActor->is(); if (mIsEnabled && isDynamic()) - actor->addForce( px3Cast(force), physx::PxForceMode::eFORCE, true); + actor->addForce(px3Cast(force), physx::PxForceMode::eFORCE, true); } void Px3Body::findContact(SceneObject **contactObject, diff --git a/Engine/source/T3D/physics/physx3/px3Body.h b/Engine/source/T3D/physics/physx3/px3Body.h index 30f6f8895..ad348c122 100644 --- a/Engine/source/T3D/physics/physx3/px3Body.h +++ b/Engine/source/T3D/physics/physx3/px3Body.h @@ -40,7 +40,8 @@ class Px3World; class Px3Collision; struct Px3CollisionDesc; -namespace physx{ +namespace physx +{ class PxRigidActor; class PxMaterial; class PxShape; diff --git a/Engine/source/T3D/physics/physx3/px3Collision.cpp b/Engine/source/T3D/physics/physx3/px3Collision.cpp index e03a0f00b..ad8d8ad0b 100644 --- a/Engine/source/T3D/physics/physx3/px3Collision.cpp +++ b/Engine/source/T3D/physics/physx3/px3Collision.cpp @@ -36,136 +36,124 @@ Px3Collision::Px3Collision() } Px3Collision::~Px3Collision() -{ - - for ( U32 i=0; i < mColShapes.size(); i++ ) - { - Px3CollisionDesc *desc = mColShapes[i]; - delete desc->pGeometry; - // Delete the descriptor. - delete desc; - } +{ + for ( U32 i=0; i < mColShapes.size(); i++ ) + { + Px3CollisionDesc *desc = mColShapes[i]; + delete desc->pGeometry; + // Delete the descriptor. + delete desc; + } - mColShapes.clear(); + mColShapes.clear(); } void Px3Collision::addPlane( const PlaneF &plane ) { - physx::PxVec3 pos = px3Cast(plane.getPosition()); - Px3CollisionDesc *desc = new Px3CollisionDesc; + physx::PxVec3 pos = px3Cast(plane.getPosition()); + Px3CollisionDesc *desc = new Px3CollisionDesc; desc->pGeometry = new physx::PxPlaneGeometry(); desc->pose = physx::PxTransform(pos, physx::PxQuat(physx::PxHalfPi, physx::PxVec3(0.0f, -1.0f, 0.0f))); - mColShapes.push_back(desc); + mColShapes.push_back(desc); } void Px3Collision::addBox( const Point3F &halfWidth,const MatrixF &localXfm ) { - Px3CollisionDesc *desc = new Px3CollisionDesc; - desc->pGeometry = new physx::PxBoxGeometry(px3Cast(halfWidth)); - desc->pose = px3Cast(localXfm); - mColShapes.push_back(desc); + Px3CollisionDesc *desc = new Px3CollisionDesc; + desc->pGeometry = new physx::PxBoxGeometry(px3Cast(halfWidth)); + desc->pose = px3Cast(localXfm); + mColShapes.push_back(desc); } -void Px3Collision::addSphere( F32 radius, - const MatrixF &localXfm ) +void Px3Collision::addSphere( F32 radius, const MatrixF &localXfm ) { - Px3CollisionDesc *desc = new Px3CollisionDesc; - desc->pGeometry = new physx::PxSphereGeometry(radius); - desc->pose = px3Cast(localXfm); - mColShapes.push_back(desc); + Px3CollisionDesc *desc = new Px3CollisionDesc; + desc->pGeometry = new physx::PxSphereGeometry(radius); + desc->pose = px3Cast(localXfm); + mColShapes.push_back(desc); } -void Px3Collision::addCapsule( F32 radius, - F32 height, - const MatrixF &localXfm ) +void Px3Collision::addCapsule( F32 radius, F32 height, const MatrixF &localXfm ) { - Px3CollisionDesc *desc = new Px3CollisionDesc; - desc->pGeometry = new physx::PxCapsuleGeometry(radius,height*0.5);//uses half height - desc->pose = px3Cast(localXfm); - mColShapes.push_back(desc); + Px3CollisionDesc *desc = new Px3CollisionDesc; + desc->pGeometry = new physx::PxCapsuleGeometry(radius,height*0.5);//uses half height + desc->pose = px3Cast(localXfm); + mColShapes.push_back(desc); } -bool Px3Collision::addConvex( const Point3F *points, - U32 count, - const MatrixF &localXfm ) +bool Px3Collision::addConvex( const Point3F *points, U32 count, const MatrixF &localXfm ) { - physx::PxCooking *cooking = Px3World::getCooking(); - physx::PxConvexMeshDesc convexDesc; - convexDesc.points.data = points; - convexDesc.points.stride = sizeof(Point3F); - convexDesc.points.count = count; - convexDesc.flags = physx::PxConvexFlag::eFLIPNORMALS|physx::PxConvexFlag::eCOMPUTE_CONVEX | physx::PxConvexFlag::eINFLATE_CONVEX; + physx::PxCooking *cooking = Px3World::getCooking(); + physx::PxConvexMeshDesc convexDesc; + convexDesc.points.data = points; + convexDesc.points.stride = sizeof(Point3F); + convexDesc.points.count = count; + convexDesc.flags = physx::PxConvexFlag::eCOMPUTE_CONVEX | physx::PxConvexFlag::eCHECK_ZERO_AREA_TRIANGLES; + if(PhysicsWorld::isGpuEnabled()) + convexDesc.flags |= physx::PxConvexFlag::eGPU_COMPATIBLE; - Px3MemOutStream stream; - if(!cooking->cookConvexMesh(convexDesc,stream)) - return false; + Px3MemOutStream stream; + if(!cooking->cookConvexMesh(convexDesc,stream)) + return false; - physx::PxConvexMesh* convexMesh; - Px3MemInStream in(stream.getData(), stream.getSize()); - convexMesh = gPhysics3SDK->createConvexMesh(in); + physx::PxConvexMesh* convexMesh; + Px3MemInStream in(stream.getData(), stream.getSize()); + convexMesh = gPhysics3SDK->createConvexMesh(in); - Px3CollisionDesc *desc = new Px3CollisionDesc; + Px3CollisionDesc *desc = new Px3CollisionDesc; physx::PxVec3 scale = px3Cast(localXfm.getScale()); physx::PxQuat rotation = px3Cast(QuatF(localXfm)); physx::PxMeshScale meshScale(scale,rotation); - desc->pGeometry = new physx::PxConvexMeshGeometry(convexMesh,meshScale); - desc->pose = px3Cast(localXfm); - mColShapes.push_back(desc); - return true; + desc->pGeometry = new physx::PxConvexMeshGeometry(convexMesh,meshScale); + desc->pose = px3Cast(localXfm); + mColShapes.push_back(desc); + return true; } -bool Px3Collision::addTriangleMesh( const Point3F *vert, - U32 vertCount, - const U32 *index, - U32 triCount, - const MatrixF &localXfm ) +bool Px3Collision::addTriangleMesh( const Point3F *vert, U32 vertCount, const U32 *index, U32 triCount, const MatrixF &localXfm ) { - physx::PxCooking *cooking = Px3World::getCooking(); - physx::PxTriangleMeshDesc meshDesc; - meshDesc.points.count = vertCount; - meshDesc.points.data = vert; - meshDesc.points.stride = sizeof(Point3F); + physx::PxCooking *cooking = Px3World::getCooking(); + physx::PxTriangleMeshDesc meshDesc; + meshDesc.points.count = vertCount; + meshDesc.points.data = vert; + meshDesc.points.stride = sizeof(Point3F); - meshDesc.triangles.count = triCount; - meshDesc.triangles.data = index; - meshDesc.triangles.stride = 3*sizeof(U32); - meshDesc.flags = physx::PxMeshFlag::eFLIPNORMALS; + meshDesc.triangles.count = triCount; + meshDesc.triangles.data = index; + meshDesc.triangles.stride = 3*sizeof(U32); + meshDesc.flags = physx::PxMeshFlag::eFLIPNORMALS; - Px3MemOutStream stream; - if(!cooking->cookTriangleMesh(meshDesc,stream)) - return false; + Px3MemOutStream stream; + if(!cooking->cookTriangleMesh(meshDesc,stream)) + return false; - physx::PxTriangleMesh *mesh; - Px3MemInStream in(stream.getData(), stream.getSize()); - mesh = gPhysics3SDK->createTriangleMesh(in); + physx::PxTriangleMesh *mesh; + Px3MemInStream in(stream.getData(), stream.getSize()); + mesh = gPhysics3SDK->createTriangleMesh(in); - Px3CollisionDesc *desc = new Px3CollisionDesc; - desc->pGeometry = new physx::PxTriangleMeshGeometry(mesh); - desc->pose = px3Cast(localXfm); - mColShapes.push_back(desc); - return true; + Px3CollisionDesc *desc = new Px3CollisionDesc; + desc->pGeometry = new physx::PxTriangleMeshGeometry(mesh); + desc->pose = px3Cast(localXfm); + mColShapes.push_back(desc); + return true; } -bool Px3Collision::addHeightfield( const U16 *heights, - const bool *holes, - U32 blockSize, - F32 metersPerSample, - const MatrixF &localXfm ) +bool Px3Collision::addHeightfield( const U16 *heights, const bool *holes, U32 blockSize, F32 metersPerSample, const MatrixF &localXfm ) { - const F32 heightScale = 0.03125f; - physx::PxHeightFieldSample* samples = (physx::PxHeightFieldSample*) new physx::PxHeightFieldSample[blockSize*blockSize]; - memset(samples,0,blockSize*blockSize*sizeof(physx::PxHeightFieldSample)); + const F32 heightScale = 0.03125f; + physx::PxHeightFieldSample* samples = (physx::PxHeightFieldSample*) new physx::PxHeightFieldSample[blockSize*blockSize]; + memset(samples,0,blockSize*blockSize*sizeof(physx::PxHeightFieldSample)); - physx::PxHeightFieldDesc heightFieldDesc; - heightFieldDesc.nbColumns = blockSize; - heightFieldDesc.nbRows = blockSize; - heightFieldDesc.thickness = -10.f; - heightFieldDesc.convexEdgeThreshold = 0; - heightFieldDesc.format = physx::PxHeightFieldFormat::eS16_TM; - heightFieldDesc.samples.data = samples; - heightFieldDesc.samples.stride = sizeof(physx::PxHeightFieldSample); + physx::PxHeightFieldDesc heightFieldDesc; + heightFieldDesc.nbColumns = blockSize; + heightFieldDesc.nbRows = blockSize; + heightFieldDesc.thickness = -10.f; + heightFieldDesc.convexEdgeThreshold = 0; + heightFieldDesc.format = physx::PxHeightFieldFormat::eS16_TM; + heightFieldDesc.samples.data = samples; + heightFieldDesc.samples.stride = sizeof(physx::PxHeightFieldSample); - physx::PxU8 *currentByte = (physx::PxU8*)heightFieldDesc.samples.data; + physx::PxU8 *currentByte = (physx::PxU8*)heightFieldDesc.samples.data; for ( U32 row = 0; row < blockSize; row++ ) { const U32 tess = ( row + 1 ) % 2; @@ -177,7 +165,6 @@ bool Px3Collision::addHeightfield( const U16 *heights, U32 index = ( blockSize - row - 1 ) + ( column * blockSize ); currentSample->height = (physx::PxI16)heights[ index ]; - if ( holes && holes[ getMax( (S32)index - 1, 0 ) ] ) // row index for holes adjusted so PhysX collision shape better matches rendered terrain { currentSample->materialIndex0 = physx::PxHeightFieldMaterial::eHOLE; @@ -189,29 +176,30 @@ bool Px3Collision::addHeightfield( const U16 *heights, currentSample->materialIndex1 = 0; } - int flag = ( column + tess ) % 2; - if(flag) - currentSample->clearTessFlag(); - else - currentSample->setTessFlag(); + S32 flag = ( column + tess ) % 2; + if(flag) + currentSample->clearTessFlag(); + else + currentSample->setTessFlag(); currentByte += heightFieldDesc.samples.stride; } } - physx::PxHeightField * hf = gPhysics3SDK->createHeightField(heightFieldDesc); - physx::PxHeightFieldGeometry *geom = new physx::PxHeightFieldGeometry(hf,physx::PxMeshGeometryFlags(),heightScale,metersPerSample,metersPerSample); + physx::PxCooking *cooking = Px3World::getCooking(); + physx::PxHeightField * hf = cooking->createHeightField(heightFieldDesc,gPhysics3SDK->getPhysicsInsertionCallback()); + physx::PxHeightFieldGeometry *geom = new physx::PxHeightFieldGeometry(hf,physx::PxMeshGeometryFlags(),heightScale,metersPerSample,metersPerSample); - physx::PxTransform pose= physx::PxTransform(physx::PxQuat(Float_HalfPi, physx::PxVec3(1, 0, 0 ))); - physx::PxTransform pose1= physx::PxTransform(physx::PxQuat(Float_Pi, physx::PxVec3(0, 0, 1 ))); - physx::PxTransform pose2 = pose1 * pose; - pose2.p = physx::PxVec3(( blockSize - 1 ) * metersPerSample, 0, 0 ); - Px3CollisionDesc *desc = new Px3CollisionDesc; - desc->pGeometry = geom; - desc->pose = pose2; + physx::PxTransform pose= physx::PxTransform(physx::PxQuat(Float_HalfPi, physx::PxVec3(1, 0, 0 ))); + physx::PxTransform pose1= physx::PxTransform(physx::PxQuat(Float_Pi, physx::PxVec3(0, 0, 1 ))); + physx::PxTransform pose2 = pose1 * pose; + pose2.p = physx::PxVec3(( blockSize - 1 ) * metersPerSample, 0, 0 ); + Px3CollisionDesc *desc = new Px3CollisionDesc; + desc->pGeometry = geom; + desc->pose = pose2; - mColShapes.push_back(desc); + mColShapes.push_back(desc); SAFE_DELETE(samples); - return true; + return true; } diff --git a/Engine/source/T3D/physics/physx3/px3Collision.h b/Engine/source/T3D/physics/physx3/px3Collision.h index 69bf38778..8697b7f74 100644 --- a/Engine/source/T3D/physics/physx3/px3Collision.h +++ b/Engine/source/T3D/physics/physx3/px3Collision.h @@ -23,6 +23,9 @@ #ifndef _PX3COLLISION_H_ #define _PX3COLLISION_H_ +#ifndef _PHYSX3_H_ +#include "T3D/physics/physx3/px3.h" +#endif #ifndef _T3D_PHYSICS_PHYSICSCOLLISION_H_ #include "T3D/physics/physicsCollision.h" #endif diff --git a/Engine/source/T3D/physics/physx3/px3Player.cpp b/Engine/source/T3D/physics/physx3/px3Player.cpp index 10dc65e86..8c1d66546 100644 --- a/Engine/source/T3D/physics/physx3/px3Player.cpp +++ b/Engine/source/T3D/physics/physx3/px3Player.cpp @@ -53,7 +53,7 @@ void Px3Player::_releaseController() { mController->getActor()->userData = NULL; mWorld->getStaticChangedSignal().remove( this, &Px3Player::_onStaticChanged ); - mController->release(); + SafeReleasePhysx(mController); } } @@ -136,8 +136,6 @@ Point3F Px3Player::move( const VectorF &disp, CollisionList &outCol ) return newPos; } - mWorld->releaseWriteLock(); - mCollisionList = &outCol; physx::PxVec3 dispNx( disp.x, disp.y, disp.z ); @@ -151,8 +149,8 @@ Point3F Px3Player::move( const VectorF &disp, CollisionList &outCol ) physx::PxFilterData data; data.word0=groups; filter.mFilterData = &data; - filter.mFilterFlags = physx::PxSceneQueryFilterFlags(physx::PxControllerFlag::eCOLLISION_DOWN|physx::PxControllerFlag::eCOLLISION_SIDES|physx::PxControllerFlag::eCOLLISION_UP); - + filter.mFilterFlags = physx::PxQueryFlags(physx::PxQueryFlag::eDYNAMIC | physx::PxQueryFlag::eSTATIC); + mController->move( dispNx,0.0001f,0, filter ); Point3F newPos = px3Cast( mController->getPosition() ); @@ -272,7 +270,6 @@ void Px3Player::enableCollision() { AssertFatal( mController, "Px3Player::enableCollision - The controller is null!" ); - mWorld->releaseWriteLock(); px3GetFirstShape(mController->getActor())->setFlag(physx::PxShapeFlag::eSIMULATION_SHAPE,true); } @@ -280,7 +277,6 @@ void Px3Player::disableCollision() { AssertFatal( mController, "Px3Player::disableCollision - The controller is null!" ); - mWorld->releaseWriteLock(); px3GetFirstShape(mController->getActor())->setFlag(physx::PxShapeFlag::eSIMULATION_SHAPE,false); } @@ -293,8 +289,6 @@ void Px3Player::setTransform( const MatrixF &transform ) { AssertFatal( mController, "Px3Player::setTransform - The controller is null!" ); - mWorld->releaseWriteLock(); - Point3F newPos = transform.getPosition(); newPos.z += mOriginOffset; @@ -355,7 +349,6 @@ void Px3Player::setSpacials(const Point3F &nPos, const Point3F &nSize) F32 height = nSize.z - (radius * 2.0f); height -= mSkinWidth * 2.0f; - mWorld->releaseWriteLock(); mController->resize(height); px3GetFirstShape(mController->getActor())->getCapsuleGeometry(mGeometry); } \ No newline at end of file diff --git a/Engine/source/T3D/physics/physx3/px3Stream.cpp b/Engine/source/T3D/physics/physx3/px3Stream.cpp index f8374cf89..ec76508be 100644 --- a/Engine/source/T3D/physics/physx3/px3Stream.cpp +++ b/Engine/source/T3D/physics/physx3/px3Stream.cpp @@ -83,10 +83,7 @@ Px3ConsoleStream::~Px3ConsoleStream() { } -void Px3ConsoleStream::reportError( physx::PxErrorCode code, const char *message, const char* file, int line ) +void Px3ConsoleStream::reportError(physx::PxErrorCode::Enum code, const char* message, const char* file, int line) { - UTF8 info[1024]; - dSprintf( info, 1024, "File: %s\nLine: %d\n%s", file, line, message ); - Platform::AlertOK( "PhysX Error", info ); - // Con::printf( "PhysX Error:\n %s(%d) : %s\n", file, line, message ); -} \ No newline at end of file + Con::warnf( "PhysX Warning: %s(%d) : %s", file, line, message ); +} diff --git a/Engine/source/T3D/physics/physx3/px3Stream.h b/Engine/source/T3D/physics/physx3/px3Stream.h index b7538b5e2..bf1641a3b 100644 --- a/Engine/source/T3D/physics/physx3/px3Stream.h +++ b/Engine/source/T3D/physics/physx3/px3Stream.h @@ -62,11 +62,11 @@ protected: }; -class Px3ConsoleStream : public physx::PxDefaultErrorCallback +class Px3ConsoleStream : public physx::PxErrorCallback { protected: - virtual void reportError( physx::PxErrorCode code, const char *message, const char* file, int line ); + virtual void reportError(physx::PxErrorCode::Enum code, const char* message, const char* file, int line); public: diff --git a/Engine/source/T3D/physics/physx3/px3World.cpp b/Engine/source/T3D/physics/physx3/px3World.cpp index a3732634e..5a27e190f 100644 --- a/Engine/source/T3D/physics/physx3/px3World.cpp +++ b/Engine/source/T3D/physics/physx3/px3World.cpp @@ -41,27 +41,31 @@ #include "gfx/sim/debugDraw.h" #include "gfx/primBuilder.h" - physx::PxPhysics* gPhysics3SDK = NULL; physx::PxCooking* Px3World::smCooking = NULL; physx::PxFoundation* Px3World::smFoundation = NULL; -physx::PxProfileZoneManager* Px3World::smProfileZoneManager = NULL; -physx::PxDefaultCpuDispatcher* Px3World::smCpuDispatcher=NULL; +physx::PxDefaultCpuDispatcher* Px3World::smCpuDispatcher = NULL; +#ifndef TORQUE_OS_MAC +physx::PxCudaContextManager* Px3World::smCudaContextManager = NULL; +#endif Px3ConsoleStream* Px3World::smErrorCallback = NULL; -physx::PxVisualDebuggerConnection* Px3World::smPvdConnection=NULL; +physx::PxPvd* Px3World::smPvdConnection = NULL; +physx::PxPvdTransport* Px3World::smPvdTransport = NULL; physx::PxDefaultAllocator Px3World::smMemoryAlloc; -Px3World::Px3World(): mScene( NULL ), - mProcessList( NULL ), - mIsSimulating( false ), - mErrorReport( false ), - mTickCount( 0 ), +Px3World::Px3World() : + mScene( NULL ), mIsEnabled( false ), + mIsSimulating( false ), + mIsServer( false ), + mIsSceneLocked( false ), + mTickCount( 0 ), + mProcessList( NULL ), mEditorTimeScale( 1.0f ), - mAccumulator( 0 ), + mErrorReport( false ), mControllerManager(NULL), - mIsSceneLocked(false), - mRenderBuffer(NULL) + mRenderBuffer(NULL), + mAccumulator( 0 ) { } @@ -80,33 +84,25 @@ bool Px3World::restartSDK( bool destroyOnly, Px3World *clientWorld, Px3World *se // then we cannot reset the SDK. if ( clientWorld || serverWorld ) return false; - - if(smPvdConnection) - smPvdConnection->release(); - - if(smCooking) - smCooking->release(); - - if(smCpuDispatcher) - smCpuDispatcher->release(); +#ifndef TORQUE_OS_MAC + SafeReleasePhysx(smCudaContextManager); +#endif + SafeReleasePhysx(smCpuDispatcher); + SafeReleasePhysx(smCooking); + smGpuEnabled = false; // Destroy the existing SDK. if ( gPhysics3SDK ) { PxCloseExtensions(); - gPhysics3SDK->release(); + SafeReleasePhysx(gPhysics3SDK); } - if(smErrorCallback) - { - SAFE_DELETE(smErrorCallback); - } + SafeReleasePhysx(smPvdConnection); + SafeReleasePhysx(smPvdTransport); - if(smFoundation) - { - smFoundation->release(); - SAFE_DELETE(smErrorCallback); - } + SAFE_DELETE(smErrorCallback); + SafeReleasePhysx(smFoundation); // If we're not supposed to restart... return. if ( destroyOnly ) @@ -114,20 +110,18 @@ bool Px3World::restartSDK( bool destroyOnly, Px3World *clientWorld, Px3World *se bool memTrack = false; #ifdef TORQUE_DEBUG - memTrack = true; + memTrack = false; #endif - + smErrorCallback = new Px3ConsoleStream; - smFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, smMemoryAlloc, *smErrorCallback); - smProfileZoneManager = &physx::PxProfileZoneManager::createProfileZoneManager(smFoundation); - gPhysics3SDK = PxCreatePhysics(PX_PHYSICS_VERSION, *smFoundation, physx::PxTolerancesScale(),memTrack,smProfileZoneManager); + smFoundation = PxCreateFoundation(PX_FOUNDATION_VERSION, smMemoryAlloc, *smErrorCallback); + smPvdConnection = PxCreatePvd(*smFoundation); + gPhysics3SDK = PxCreatePhysics(PX_PHYSICS_VERSION, *smFoundation, physx::PxTolerancesScale(),memTrack, smPvdConnection); if ( !gPhysics3SDK ) { Con::errorf( "PhysX3 failed to initialize!" ); - Platform::messageBox( Con::getVariable( "$appName" ), - avar("PhysX3 could not be started!\r\n"), - MBOk, MIStop ); + Platform::messageBox( Con::getVariable( "$appName" ), avar("PhysX3 could not be started!\r\n"), MBOk, MIStop ); Platform::forceShutdown( -1 ); // We shouldn't get here, but this shuts up @@ -135,33 +129,67 @@ bool Px3World::restartSDK( bool destroyOnly, Px3World *clientWorld, Px3World *se return false; } - if(!PxInitExtensions(*gPhysics3SDK)) + if(!PxInitExtensions(*gPhysics3SDK, smPvdConnection)) { Con::errorf( "PhysX3 failed to initialize extensions!" ); - Platform::messageBox( Con::getVariable( "$appName" ), - avar("PhysX3 could not be started!\r\n"), - MBOk, MIStop ); + Platform::messageBox( Con::getVariable( "$appName" ), avar("PhysX3 could not be started!\r\n"), MBOk, MIStop ); Platform::forceShutdown( -1 ); return false; } +//no gpu support on macOS +#ifndef TORQUE_OS_MAC + //check if we are allowed to use gpu acceleration + if (PhysicsPlugin::gpuAccelerationAllowed()) + { + // attempt to create a cuda context manager - only works on nvidia gpu (SM 3.0+ i.e kepler or better) + if (!smCpuDispatcher) + { + //check we have capable gpu, -1 means none found + S32 suggestedGpu = PxGetSuggestedCudaDeviceOrdinal(*smErrorCallback); + if (suggestedGpu != -1) + { + physx::PxCudaContextManagerDesc cudaContextManagerDesc; + smCudaContextManager = PxCreateCudaContextManager(*smFoundation, cudaContextManagerDesc); + if (smCudaContextManager) + smGpuEnabled = true; + } + } + } +#endif - smCooking = PxCreateCooking(PX_PHYSICS_VERSION, *smFoundation, physx::PxCookingParams(physx::PxTolerancesScale())); + //cpu dispatcher + if (!smCpuDispatcher) + smCpuDispatcher = physx::PxDefaultCpuDispatcherCreate(PHYSICSMGR->getThreadCount()); + + physx::PxCookingParams params = physx::PxCookingParams(physx::PxTolerancesScale()); + params.meshWeldTolerance = 0.001f; + params.meshPreprocessParams = physx::PxMeshPreprocessingFlags(physx::PxMeshPreprocessingFlag::eWELD_VERTICES); +#ifndef TORQUE_OS_MAC + if(smGpuEnabled) + params.buildGPUData = true; +#endif + + smCooking = PxCreateCooking(PX_PHYSICS_VERSION, *smFoundation, params); if(!smCooking) { Con::errorf( "PhysX3 failed to initialize cooking!" ); - Platform::messageBox( Con::getVariable( "$appName" ), - avar("PhysX3 could not be started!\r\n"), - MBOk, MIStop ); + Platform::messageBox( Con::getVariable( "$appName" ), avar("PhysX3 could not be started!\r\n"), MBOk, MIStop ); Platform::forceShutdown( -1 ); return false; } + //TODO: enable/disable this from script #ifdef TORQUE_DEBUG - physx::PxVisualDebuggerConnectionFlags connectionFlags(physx::PxVisualDebuggerExt::getAllConnectionFlags()); - smPvdConnection = physx::PxVisualDebuggerExt::createConnection(gPhysics3SDK->getPvdConnectionManager(), - "localhost", 5425, 100, connectionFlags); + if(!smPvdTransport) + smPvdTransport = physx::PxDefaultPvdSocketTransportCreate("localhost", 5425, 100); + + smPvdConnection->connect(*smPvdTransport, physx::PxPvdInstrumentationFlag::eALL); #endif + //use legacy heightfield + //TODO: new method causing crashes on collision in debug build (unified HeightFields) + PxRegisterLegacyHeightFields(*gPhysics3SDK); + return true; } @@ -169,8 +197,6 @@ void Px3World::destroyWorld() { getPhysicsResults(); - mRenderBuffer = NULL; - // Release the tick processing signals. if ( mProcessList ) { @@ -179,19 +205,9 @@ void Px3World::destroyWorld() mProcessList = NULL; } - if(mControllerManager) - { - mControllerManager->release(); - mControllerManager = NULL; - } - + SafeReleasePhysx(mControllerManager); // Destroy the scene. - if ( mScene ) - { - // Release the scene. - mScene->release(); - mScene = NULL; - } + SafeReleasePhysx(mScene); } bool Px3World::initWorld( bool isServer, ProcessList *processList ) @@ -203,27 +219,32 @@ bool Px3World::initWorld( bool isServer, ProcessList *processList ) } mIsServer = isServer; - + physx::PxSceneDesc sceneDesc(gPhysics3SDK->getTolerancesScale()); sceneDesc.gravity = px3Cast(mGravity); sceneDesc.userData = this; - if(!sceneDesc.cpuDispatcher) - { - //Create shared cpu dispatcher - if(!smCpuDispatcher) - smCpuDispatcher = physx::PxDefaultCpuDispatcherCreate(PHYSICSMGR->getThreadCount()); - sceneDesc.cpuDispatcher = smCpuDispatcher; - Con::printf("PhysX3 using Cpu: %d workers", smCpuDispatcher->getWorkerCount()); + sceneDesc.cpuDispatcher = smCpuDispatcher; + Con::printf("PhysX3 using Cpu: %d workers", smCpuDispatcher->getWorkerCount()); + +#ifndef TORQUE_OS_MAC + if (smGpuEnabled) + { + sceneDesc.flags |= physx::PxSceneFlag::eENABLE_GPU_DYNAMICS; + sceneDesc.flags |= physx::PxSceneFlag::eENABLE_PCM; + sceneDesc.broadPhaseType = physx::PxBroadPhaseType::eGPU; + sceneDesc.gpuDispatcher = smCudaContextManager->getGpuDispatcher(); + Con::printf("PhysX3 using Gpu: %s", smCudaContextManager->getDeviceName()); } - +#endif + sceneDesc.flags |= physx::PxSceneFlag::eENABLE_CCD; sceneDesc.flags |= physx::PxSceneFlag::eENABLE_ACTIVETRANSFORMS; sceneDesc.filterShader = physx::PxDefaultSimulationFilterShader; - mScene = gPhysics3SDK->createScene(sceneDesc); - //cache renderbuffer for use with debug drawing + mScene = gPhysics3SDK->createScene(sceneDesc); + mRenderBuffer = const_cast(&mScene->getRenderBuffer()); physx::PxDominanceGroupPair debrisDominance( 0.0f, 1.0f ); @@ -252,15 +273,16 @@ bool Px3World::_simulate(const F32 dt) if (numSimulationSubSteps) { //clamp the number of substeps, to prevent simulation grinding spiralling down to a halt - S32 clampedSimulationSteps = (numSimulationSubSteps > smPhysicsMaxSubSteps)? smPhysicsMaxSubSteps : numSimulationSubSteps; - + S32 clampedSimulationSteps = (numSimulationSubSteps > smPhysicsMaxSubSteps) ? smPhysicsMaxSubSteps : numSimulationSubSteps; + for (S32 i=0;ifetchResults(true); + if(i > 0) + mScene->fetchResults(true); mScene->simulate(smPhysicsStepTime); } } - + mIsSimulating = true; return true; @@ -299,36 +321,6 @@ void Px3World::getPhysicsResults() mScene->fetchResults(true); mIsSimulating = false; mTickCount++; - - // Con::printf( "%s PhysXWorld::getPhysicsResults!", this == smClientWorld ? "Client" : "Server" ); -} - -void Px3World::releaseWriteLocks() -{ - Px3World *world = dynamic_cast( PHYSICSMGR->getWorld( "server" ) ); - - if ( world ) - world->releaseWriteLock(); - - world = dynamic_cast( PHYSICSMGR->getWorld( "client" ) ); - - if ( world ) - world->releaseWriteLock(); -} - -void Px3World::releaseWriteLock() -{ - if ( !mScene || !mIsSimulating ) - return; - - PROFILE_SCOPE(PxWorld_ReleaseWriteLock); - - // We use checkResults here to release the write lock - // but we do not change the simulation flag or increment - // the tick count... we may have gotten results, but the - // simulation hasn't really ticked! - mScene->checkResults( true ); - //AssertFatal( mScene->isWritable(), "PhysX3World::releaseWriteLock() - We should have been writable now!" ); } void Px3World::lockScenes() @@ -388,8 +380,7 @@ void Px3World::unlockScene() } bool Px3World::castRay( const Point3F &startPnt, const Point3F &endPnt, RayInfo *ri, const Point3F &impulse ) -{ - +{ physx::PxVec3 orig = px3Cast( startPnt ); physx::PxVec3 dir = px3Cast( endPnt - startPnt ); physx::PxF32 maxDist = dir.magnitude(); @@ -398,15 +389,15 @@ bool Px3World::castRay( const Point3F &startPnt, const Point3F &endPnt, RayInfo U32 groups = 0xffffffff; groups &= ~( PX3_TRIGGER ); // No trigger shapes! - physx::PxHitFlags outFlags(physx::PxHitFlag::eDISTANCE | physx::PxHitFlag::eIMPACT | physx::PxHitFlag::eNORMAL); + physx::PxHitFlags outFlags(physx::PxHitFlag::eDISTANCE | physx::PxHitFlag::ePOSITION | physx::PxHitFlag::eNORMAL); physx::PxQueryFilterData filterData(physx::PxQueryFlag::eSTATIC|physx::PxQueryFlag::eDYNAMIC); filterData.data.word0 = groups; physx::PxRaycastBuffer buf; if(!mScene->raycast(orig,dir,maxDist,buf,outFlags,filterData)) - return false; + return false; if(!buf.hasBlock) - return false; + return false; const physx::PxRaycastHit hit = buf.block; physx::PxRigidActor *actor = hit.actor; @@ -425,8 +416,8 @@ bool Px3World::castRay( const Point3F &startPnt, const Point3F &endPnt, RayInfo } if ( impulse.isZero() || - !actor->isRigidDynamic() || - actor->is()->getRigidDynamicFlags() & physx::PxRigidDynamicFlag::eKINEMATIC ) + !actor->is() || + actor->is()->getRigidBodyFlags() & physx::PxRigidBodyFlag::eKINEMATIC ) return true; physx::PxRigidBody *body = actor->is(); @@ -453,7 +444,7 @@ PhysicsBody* Px3World::castRay( const Point3F &start, const Point3F &end, U32 bo groups &= ~( PX3_TRIGGER ); // triggers groups &= ~( PX3_DEBRIS ); // debris - physx::PxHitFlags outFlags(physx::PxHitFlag::eDISTANCE | physx::PxHitFlag::eIMPACT | physx::PxHitFlag::eNORMAL); + physx::PxHitFlags outFlags(physx::PxHitFlag::eDISTANCE | physx::PxHitFlag::ePOSITION | physx::PxHitFlag::eNORMAL); physx::PxQueryFilterData filterData; if(bodyTypes & BT_Static) filterData.flags |= physx::PxQueryFlag::eSTATIC; @@ -491,12 +482,12 @@ void Px3World::explosion( const Point3F &pos, F32 radius, F32 forceMagnitude ) { physx::PxRigidActor *actor = buffer.touches[i].actor; - bool dynamic = actor->isRigidDynamic(); + bool dynamic = actor->is(); if ( !dynamic ) continue; - bool kinematic = actor->is()->getRigidDynamicFlags() & physx::PxRigidDynamicFlag::eKINEMATIC; + bool kinematic = actor->is()->getRigidBodyFlags() & physx::PxRigidBodyFlag::eKINEMATIC; if ( kinematic ) continue; @@ -523,8 +514,6 @@ physx::PxController* Px3World::createController( physx::PxControllerDesc &desc ) if ( !mScene ) return NULL; - // We need the writelock! - releaseWriteLock(); physx::PxController* pController = mControllerManager->createController(desc); AssertFatal( pController, "Px3World::createController - Got a null!" ); return pController; @@ -543,7 +532,7 @@ static ColorI getDebugColor( physx::PxU32 packed ) void Px3World::onDebugDraw( const SceneRenderState *state ) { - if ( !mScene || !mRenderBuffer ) + if ( !mScene || !mRenderBuffer) return; mScene->setVisualizationParameter(physx::PxVisualizationParameter::eSCALE,1.0f); diff --git a/Engine/source/T3D/physics/physx3/px3World.h b/Engine/source/T3D/physics/physx3/px3World.h index 5399c3f0a..9005d2a07 100644 --- a/Engine/source/T3D/physics/physx3/px3World.h +++ b/Engine/source/T3D/physics/physx3/px3World.h @@ -23,15 +23,15 @@ #ifndef _PX3WORLD_H_ #define _PX3WORLD_H_ +#ifndef _PHYSX3_H_ +#include "T3D/physics/physx3/px3.h" +#endif #ifndef _T3D_PHYSICS_PHYSICSWORLD_H_ #include "T3D/physics/physicsWorld.h" #endif #ifndef _MMATH_H_ #include "math/mMath.h" #endif -#ifndef _PHYSX3_H_ -#include "T3D/physics/physx3/px3.h" -#endif #ifndef _TVECTOR_H_ #include "core/util/tVector.h" #endif @@ -51,26 +51,29 @@ enum Px3CollisionGroup class Px3World : public PhysicsWorld { protected: - physx::PxScene* mScene; bool mIsEnabled; bool mIsSimulating; bool mIsServer; - bool mIsSceneLocked; + bool mIsSceneLocked; U32 mTickCount; ProcessList *mProcessList; F32 mEditorTimeScale; bool mErrorReport; - physx::PxRenderBuffer *mRenderBuffer; physx::PxControllerManager* mControllerManager; + physx::PxRenderBuffer *mRenderBuffer; + F32 mAccumulator; static Px3ConsoleStream *smErrorCallback; static physx::PxDefaultAllocator smMemoryAlloc; static physx::PxFoundation* smFoundation; static physx::PxCooking *smCooking; - static physx::PxProfileZoneManager* smProfileZoneManager; static physx::PxDefaultCpuDispatcher* smCpuDispatcher; - static physx::PxVisualDebuggerConnection* smPvdConnection; - F32 mAccumulator; +#ifndef TORQUE_OS_MAC + static physx::PxCudaContextManager* smCudaContextManager; +#endif + static physx::PxPvd* smPvdConnection; + static physx::PxPvdTransport* smPvdTransport; + bool _simulate(const F32 dt); public: @@ -86,21 +89,20 @@ public: virtual PhysicsBody* castRay( const Point3F &start, const Point3F &end, U32 bodyTypes = BT_All ); virtual void explosion( const Point3F &pos, F32 radius, F32 forceMagnitude ); virtual bool isEnabled() const { return mIsEnabled; } - physx::PxScene* getScene(){ return mScene;} + physx::PxScene* getScene(){ return mScene; } void setEnabled( bool enabled ); U32 getTick() { return mTickCount; } void tickPhysics( U32 elapsedMs ); void getPhysicsResults(); void setEditorTimeScale( F32 timeScale ) { mEditorTimeScale = timeScale; } const F32 getEditorTimeScale() const { return mEditorTimeScale; } - void releaseWriteLock(); - bool isServer(){return mIsServer;} + bool isServer() { return mIsServer; } + physx::PxController* createController( physx::PxControllerDesc &desc ); void lockScene(); void unlockScene(); //static static bool restartSDK( bool destroyOnly = false, Px3World *clientWorld = NULL, Px3World *serverWorld = NULL ); - static void releaseWriteLocks(); static physx::PxCooking *getCooking(); static void lockScenes(); static void unlockScenes(); diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index be3be3bc0..9a2c072a6 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -7518,7 +7518,7 @@ U32 Player::lockAnimation() return last_anim_lock_tag; } -ConsoleMethod(Player, isAnimationLocked, bool, 2, 2, "isAnimationLocked()") +DefineEngineMethod(Player, isAnimationLocked, bool, (),, "") { return object->isAnimationLocked(); } @@ -7534,14 +7534,13 @@ void Player::setLookAnimationOverride(bool flag) #endif } -ConsoleMethod(Player, setLookAnimationOverride, void, 3, 3, "setLookAnimationOverride(flag)") +DefineEngineMethod(Player, setLookAnimationOverride, void, (bool flag),, "") { - object->setLookAnimationOverride(dAtob(argv[2])); + object->setLookAnimationOverride(flag); } -ConsoleMethod(Player, copyHeadRotation, void, 3, 3, "copyHeadRotation(other_player)") +DefineEngineMethod(Player, copyHeadRotation, void, (Player* other_player),, "") { - Player* other_player = dynamic_cast(Sim::findObject(argv[2])); if (other_player) object->copyHeadRotation(other_player); } @@ -7610,9 +7609,9 @@ void Player::restoreMovement(U32 tag) } } -ConsoleMethod(Player, setMovementSpeedBias, void, 3, 3, "setMovementSpeedBias(F32 bias)") +DefineEngineMethod(Player, setMovementSpeedBias, void, (F32 bias),, "setMovementSpeedBias(F32 bias)") { - object->setMovementSpeedBias(dAtof(argv[2])); + object->setMovementSpeedBias(bias); } void Player::overrideFootfallFX(bool decals, bool sounds, bool dust) @@ -7643,12 +7642,11 @@ void Player::setControllers(Vector controllerList) mControllers[1] = controllerList.size() > 1 ? controllerList[1] : NULL; } -ConsoleMethod(Player, setVRControllers, void, 4, 4, "") +DefineEngineMethod(Player, setVRControllers, void, (OpenVRTrackedObject* controllerL, OpenVRTrackedObject* controllerR,, "") { - OpenVRTrackedObject *controllerL, *controllerR; Vector list; - if (Sim::findObject(argv[2], controllerL)) + if (controllerL) { list.push_back(controllerL); } @@ -7657,7 +7655,7 @@ ConsoleMethod(Player, setVRControllers, void, 4, 4, "") list.push_back(NULL); } - if (Sim::findObject(argv[3], controllerR)) + if (controllerR) { list.push_back(controllerR); } diff --git a/Engine/source/T3D/staticShape.cpp b/Engine/source/T3D/staticShape.cpp index 874e31059..9bc7369e1 100644 --- a/Engine/source/T3D/staticShape.cpp +++ b/Engine/source/T3D/staticShape.cpp @@ -314,7 +314,7 @@ void StaticShape::unpackUpdate(NetConnection *connection, BitStream *bstream) // This appears to be legacy T2 stuff // Marked internal, as this is flagged to be deleted // [8/1/2010 mperry] -DefineConsoleMethod( StaticShape, setPoweredState, void, (bool isPowered), , "(bool isPowered)" +DefineEngineMethod( StaticShape, setPoweredState, void, (bool isPowered), , "(bool isPowered)" "@internal") { if(!object->isServerObject()) @@ -322,7 +322,7 @@ DefineConsoleMethod( StaticShape, setPoweredState, void, (bool isPowered), , "(b object->setPowered(isPowered); } -DefineConsoleMethod( StaticShape, getPoweredState, bool, (), , "@internal") +DefineEngineMethod( StaticShape, getPoweredState, bool, (), , "@internal") { if(!object->isServerObject()) return(false); diff --git a/Engine/source/afx/afxCamera.cpp b/Engine/source/afx/afxCamera.cpp index 84acee518..50ba064a4 100644 --- a/Engine/source/afx/afxCamera.cpp +++ b/Engine/source/afx/afxCamera.cpp @@ -450,7 +450,7 @@ const char* afxCamera::getMode() //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// // Console Methods -ConsoleMethod(afxCamera, setOrbitMode, void, 7, 8, +DefineEngineStringlyVariadicMethod(afxCamera, setOrbitMode, void, 7, 8, "(GameBase orbitObject, TransformF mat, float minDistance, float maxDistance, float curDistance, bool ownClientObject)" "Set the camera to orbit around some given object.\n\n" "@param orbitObject Object we want to orbit.\n" @@ -481,108 +481,91 @@ ConsoleMethod(afxCamera, setOrbitMode, void, 7, 8, object->setOrbitMode(orbitObject, pos, aa, minDis, maxDis, curDis, (argc == 8) ? dAtob(argv[7]) : false); } -ConsoleMethod( afxCamera, setFlyMode, void, 2, 2, "()" "Set the camera to be able to fly freely.") +DefineEngineMethod(afxCamera, setFlyMode, void, (),, + "@brief Set the camera to be able to fly freely.") { - object->setFlyMode(); + object->setFlyMode(); } -ConsoleMethod( afxCamera, getPosition, const char *, 2, 2, "()" - "Get the position of the camera.\n\n" - "@returns A string of form \"x y z\".") -{ - Point3F& pos = object->getPosition(); - char buffer[100]; - dSprintf(buffer, sizeof(buffer),"%f %f %f",pos.x,pos.y,pos.z); - return buffer; +DefineEngineMethod(afxCamera, getPosition, Point3F, (),, + "@brief Get the position of the camera.\n\n" + "@returns The position of the camera.") +{ + return object->getPosition(); } -ConsoleMethod(afxCamera, setCameraSubject, bool, 3, 3, "") -{ - SceneObject* subject; - if (!Sim::findObject(argv[2], subject)) - { - Con::errorf("Camera subject \"%s\" not found.", argv[2].getStringValue()); - return false; - } - - object->setCameraSubject(subject); - - return true; +DefineEngineMethod(afxCamera, setCameraSubject, bool, (SceneObject* subject),, "") +{ + if (!subject) + { + Con::errorf("Camera subject not found."); + return false; + } + + object->setCameraSubject(subject); + + return true; } -ConsoleMethod(afxCamera, setThirdPersonDistance, bool, 3, 3, "") -{ - F32 distance; - dSscanf(argv[2], "%f", &distance); +DefineEngineMethod(afxCamera, setThirdPersonDistance, bool, (F32 distance),, "") +{ + object->setThirdPersonDistance(distance); - object->setThirdPersonDistance(distance); - - return true; + return true; } -ConsoleMethod(afxCamera, getThirdPersonDistance, F32, 2, 2, "") +DefineEngineMethod(afxCamera, getThirdPersonDistance, F32, (),, "") { return object->getThirdPersonDistance(); } -ConsoleMethod(afxCamera, setThirdPersonAngle, bool, 3, 3, "") -{ - F32 angle; - dSscanf(argv[2], "%f", &angle); +DefineEngineMethod(afxCamera, setThirdPersonAngle, bool, (F32 distance),, "") +{ + object->setThirdPersonAngle(distance); - object->setThirdPersonAngle(angle); - - return true; + return true; } -ConsoleMethod(afxCamera, getThirdPersonAngle, F32, 2, 2, "") +DefineEngineMethod(afxCamera, getThirdPersonAngle, F32, (),, "") { return object->getThirdPersonAngle(); } -ConsoleMethod(afxCamera, setThirdPersonOffset, void, 3, 4, "(Point3F offset [, Point3F coi_offset])") +DefineEngineMethod(afxCamera, setThirdPersonOffset, void, (Point3F offset, Point3F coi_offset), (Point3F::Max), "") { - Point3F offset; - dSscanf(argv[2], "%f %f %f", &offset.x, &offset.y, &offset.z); - if (argc > 3) - { - Point3F coi_offset; - dSscanf(argv[3], "%f %f %f", &coi_offset.x, &coi_offset.y, &coi_offset.z); - object->setThirdPersonOffset(offset, coi_offset); - } - else - object->setThirdPersonOffset(offset); + if (coi_offset == Point3F::Max) + { + object->setThirdPersonOffset(offset); + } + else + { + object->setThirdPersonOffset(offset, coi_offset); + } } -ConsoleMethod(afxCamera, getThirdPersonOffset, const char *, 2, 2, "()") +DefineEngineMethod(afxCamera, getThirdPersonOffset, Point3F, (),, "") { - const Point3F& pos = object->getThirdPersonOffset(); - char buffer[100]; - dSprintf(buffer, sizeof(buffer),"%f %f %f",pos.x,pos.y,pos.z); - return buffer; + return object->getThirdPersonOffset(); } -ConsoleMethod(afxCamera, getThirdPersonCOIOffset, const char *, 2, 2, "()") +DefineEngineMethod(afxCamera, getThirdPersonCOIOffset, Point3F, (),, "") { - const Point3F& pos = object->getThirdPersonCOIOffset(); - char buffer[100]; - dSprintf(buffer, sizeof(buffer),"%f %f %f",pos.x,pos.y,pos.z); - return buffer; + return object->getThirdPersonCOIOffset(); } -ConsoleMethod(afxCamera, setThirdPersonMode, void, 2, 2, "()") +DefineEngineMethod(afxCamera, setThirdPersonMode, void, (),, "") { - object->setThirdPersonMode(); + object->setThirdPersonMode(); } -ConsoleMethod(afxCamera, setThirdPersonSnap, void, 2, 2, "()") +DefineEngineMethod(afxCamera, setThirdPersonSnap, void, (),, "") { - object->setThirdPersonSnap(); + object->setThirdPersonSnap(); } -ConsoleMethod(afxCamera, getMode, const char *, 2, 2, "()") +DefineEngineMethod(afxCamera, getMode, const char*, (),, "") { - return object->getMode(); + return object->getMode(); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/afxMagicSpell.cpp b/Engine/source/afx/afxMagicSpell.cpp index 513df0d13..029e88e62 100644 --- a/Engine/source/afx/afxMagicSpell.cpp +++ b/Engine/source/afx/afxMagicSpell.cpp @@ -2633,29 +2633,29 @@ DefineEngineMethod(afxMagicSpell, getImpactedObject, S32, (),, return (imp_obj) ? imp_obj->getId() : -1; } -ConsoleMethod(afxMagicSpell, setTimeFactor, void, 3, 4, "(F32 factor) or (string phase, F32 factor)" - "Sets the time-factor for the spell, either overall or for a specific phrase.\n\n" - "@ingroup AFX") +DefineEngineStringlyVariadicMethod(afxMagicSpell, setTimeFactor, void, 3, 4, "(F32 factor) or (string phase, F32 factor)" + "Sets the time-factor for the spell, either overall or for a specific phrase.\n\n" + "@ingroup AFX") { - if (argc == 3) - object->setTimeFactor(dAtof(argv[2])); - else - { - if (dStricmp(argv[2], "overall") == 0) - object->setTimeFactor(dAtof(argv[3])); - else if (dStricmp(argv[2], "casting") == 0) - object->setTimeFactor(afxMagicSpell::CASTING_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "launch") == 0) - object->setTimeFactor(afxMagicSpell::LAUNCH_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "delivery") == 0) - object->setTimeFactor(afxMagicSpell::DELIVERY_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "impact") == 0) - object->setTimeFactor(afxMagicSpell::IMPACT_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "linger") == 0) - object->setTimeFactor(afxMagicSpell::LINGER_PHRASE, dAtof(argv[3])); - else - Con::errorf("afxMagicSpell::setTimeFactor() -- unknown spell phrase [%s].", argv[2].getStringValue()); - } + if (argc == 3) + object->setTimeFactor(dAtof(argv[2])); + else + { + if (dStricmp(argv[2], "overall") == 0) + object->setTimeFactor(dAtof(argv[3])); + else if (dStricmp(argv[2], "casting") == 0) + object->setTimeFactor(afxMagicSpell::CASTING_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "launch") == 0) + object->setTimeFactor(afxMagicSpell::LAUNCH_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "delivery") == 0) + object->setTimeFactor(afxMagicSpell::DELIVERY_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "impact") == 0) + object->setTimeFactor(afxMagicSpell::IMPACT_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "linger") == 0) + object->setTimeFactor(afxMagicSpell::LINGER_PHRASE, dAtof(argv[3])); + else + Con::errorf("afxMagicSpell::setTimeFactor() -- unknown spell phrase [%s].", argv[2].getStringValue()); + } } DefineEngineMethod(afxMagicSpell, interruptStage, void, (),, diff --git a/Engine/source/afx/arcaneFX.cpp b/Engine/source/afx/arcaneFX.cpp index cec0c870a..385c056f6 100644 --- a/Engine/source/afx/arcaneFX.cpp +++ b/Engine/source/afx/arcaneFX.cpp @@ -584,69 +584,33 @@ DefineEngineFunction(getRandomDir, Point3F, (Point3F axis, float thetaMin, float return MathUtils::randomDir(axis, thetaMin, thetaMax, phiMin, phiMax); } -ConsoleFunction( MatrixInverseMulVector, const char*, 3, 3, "(MatrixF xfrm, Point3F vector)" - "@brief Multiply the vector by the affine inverse of the transform.\n\n" - "@ingroup AFX") +DefineEngineFunction(MatrixInverseMulVector, Point3F, (MatrixF xfrm, Point3F vector),, + "@brief Multiply the vector by the affine inverse of the transform.\n\n" + "@ingroup AFX") { - Point3F pos1(0.0f,0.0f,0.0f); - AngAxisF aa1(Point3F(0.0f,0.0f,0.0f),0.0f); - dSscanf(argv[1], "%g %g %g %g %g %g %g", &pos1.x, &pos1.y, &pos1.z, &aa1.axis.x, &aa1.axis.y, &aa1.axis.z, &aa1.angle); - - MatrixF temp1(true); - aa1.setMatrix(&temp1); - temp1.setColumn(3, pos1); - - Point3F vec1(0.0f,0.0f,0.0f); - dSscanf(argv[2], "%g %g %g", &vec1.x, &vec1.y, &vec1.z); - - temp1.affineInverse(); + xfrm.affineInverse(); Point3F result; - temp1.mulV(vec1, &result); + xfrm.mulV(vector, &result); - char* ret = Con::getReturnBuffer(256); - dSprintf(ret, 255, "%g %g %g", result.x, result.y, result.z); - return ret; + return result; } -ConsoleFunction(moveTransformAbs, const char*, 3, 3, "(MatrixF xfrm, Point3F pos)" - "@brief Move the transform to the new absolute position.\n\n" - "@ingroup AFX") +DefineEngineFunction(moveTransformAbs, MatrixF, (MatrixF xfrm, Point3F pos),, + "@brief Move the transform to the new absolute position.\n\n" + "@ingroup AFX") { - Point3F pos1(0.0f,0.0f,0.0f); - AngAxisF aa1(Point3F(0.0f,0.0f,0.0f),0.0f); - dSscanf(argv[1], "%g %g %g %g %g %g %g", &pos1.x, &pos1.y, &pos1.z, &aa1.axis.x, &aa1.axis.y, &aa1.axis.z, &aa1.angle); - - Point3F pos2(0.0f,0.0f,0.0f); - dSscanf(argv[2], "%g %g %g", &pos2.x, &pos2.y, &pos2.z); - - char* returnBuffer = Con::getReturnBuffer(256); - dSprintf(returnBuffer, 255, "%g %g %g %g %g %g %g", - pos2.x, pos2.y, pos2.z, - aa1.axis.x, aa1.axis.y, aa1.axis.z, - aa1.angle); - return returnBuffer; + xfrm.setPosition(pos); + return xfrm; } -ConsoleFunction(moveTransformRel, const char*, 3, 3, "(MatrixF xfrm, Point3F pos)" - "@brief Move the transform to the new relative position.\n\n" - "@ingroup AFX") +DefineEngineFunction(moveTransformRel, MatrixF, (MatrixF xfrm, Point3F pos),, + "@brief Move the transform to the new relative position.\n\n" + "@ingroup AFX") { - Point3F pos1(0.0f,0.0f,0.0f); - AngAxisF aa1(Point3F(0.0f,0.0f,0.0f),0.0f); - dSscanf(argv[1], "%g %g %g %g %g %g %g", &pos1.x, &pos1.y, &pos1.z, &aa1.axis.x, &aa1.axis.y, &aa1.axis.z, &aa1.angle); - - Point3F pos2(0.0f,0.0f,0.0f); - dSscanf(argv[2], "%g %g %g", &pos2.x, &pos2.y, &pos2.z); - - pos2 += pos1; - - char* returnBuffer = Con::getReturnBuffer(256); - dSprintf(returnBuffer, 255, "%g %g %g %g %g %g %g", - pos2.x, pos2.y, pos2.z, - aa1.axis.x, aa1.axis.y, aa1.axis.z, - aa1.angle); - return returnBuffer; + pos += xfrm.getPosition(); + xfrm.setPosition(pos); + return xfrm; } DefineEngineFunction(getFreeTargetPosition, Point3F, (),, @@ -896,18 +860,18 @@ DefineEngineFunction(getMaxF, F32, (float a, float b),, return getMax(a, b); } -ConsoleFunction(echoThru, const char*, 2, 0, "(string passthru, string text...)" - "Like echo(), but first argument is returned.\n" - "@ingroup AFX") +DefineEngineStringlyVariadicFunction(echoThru, const char*, 2, 0, "(string passthru, string text...)" + "Like echo(), but first argument is returned.\n" + "@ingroup AFX") { U32 len = 0; S32 i; - for(i = 2; i < argc; i++) + for (i = 2; i < argc; i++) len += dStrlen(argv[i]); char *ret = Con::getReturnBuffer(len + 1); ret[0] = 0; - for(i = 2; i < argc; i++) + for (i = 2; i < argc; i++) dStrcat(ret, argv[i], len + 1); Con::printf("%s -- [%s]", ret, argv[1].getStringValue()); @@ -916,7 +880,7 @@ ConsoleFunction(echoThru, const char*, 2, 0, "(string passthru, string text...)" return argv[1]; } -ConsoleFunction(warnThru, const char*, 2, 0, "(string passthru, string text...)" +DefineEngineStringlyVariadicFunction(warnThru, const char*, 2, 0, "(string passthru, string text...)" "Like warn(), but first argument is returned.\n" "@ingroup AFX") { @@ -936,7 +900,7 @@ ConsoleFunction(warnThru, const char*, 2, 0, "(string passthru, string text...)" return argv[1]; } -ConsoleFunction(errorThru, const char*, 2, 0, "(string passthru, string text...)" +DefineEngineStringlyVariadicFunction(errorThru, const char*, 2, 0, "(string passthru, string text...)" "Like error(), but first argument is returned.\n" "@ingroup AFX") { diff --git a/Engine/source/app/game.cpp b/Engine/source/app/game.cpp index 05f63e84c..5878accd6 100644 --- a/Engine/source/app/game.cpp +++ b/Engine/source/app/game.cpp @@ -67,7 +67,7 @@ bool gEditingMission = false; ConsoleFunctionGroupBegin( InputManagement, "Functions that let you deal with input from scripts" ); -DefineConsoleFunction( deactivateDirectInput, void, (), , +DefineEngineFunction( deactivateDirectInput, void, (), , "()" "@brief Disables DirectInput.\n\n" "Also deactivates any connected joysticks.\n\n" @@ -77,7 +77,7 @@ DefineConsoleFunction( deactivateDirectInput, void, (), , Input::deactivate(); } -DefineConsoleFunction( activateDirectInput, void, (), , +DefineEngineFunction( activateDirectInput, void, (), , "()" "@brief Activates DirectInput.\n\n" "Also activates any connected joysticks." @@ -91,7 +91,7 @@ ConsoleFunctionGroupEnd( InputManagement ); //-------------------------------------------------------------------------- static const U32 MaxPlayerNameLength = 16; -DefineConsoleFunction( strToPlayerName, const char*, (const char* ptr ), , "strToPlayerName(string);" ) +DefineEngineFunction( strToPlayerName, const char*, (const char* ptr ), , "strToPlayerName(string);" ) { // Strip leading spaces and underscores: @@ -147,7 +147,7 @@ DefineConsoleFunction( strToPlayerName, const char*, (const char* ptr ), , "strT ConsoleFunctionGroupBegin( Platform , "General platform functions."); -DefineConsoleFunction( lockMouse, void, (bool isLocked ), , "(bool isLocked)" +DefineEngineFunction( lockMouse, void, (bool isLocked ), , "(bool isLocked)" "@brief Lock or unlock the mouse to the window.\n\n" "When true, prevents the mouse from leaving the bounds of the game window.\n\n" "@ingroup Input") @@ -156,7 +156,7 @@ DefineConsoleFunction( lockMouse, void, (bool isLocked ), , "(bool isLocked)" } -DefineConsoleFunction( setNetPort, bool, (int port, bool bind), (true), "(int port, bool bind=true)" +DefineEngineFunction( setNetPort, bool, (int port, bool bind), (true), "(int port, bool bind=true)" "@brief Set the network port for the game to use.\n\n" "@param port The port to use.\n" @@ -171,28 +171,28 @@ DefineConsoleFunction( setNetPort, bool, (int port, bool bind), (true), "(int po return Net::openPort((S32)port, bind); } -DefineConsoleFunction(isAddressTypeAvailable, bool, (int addressType), , "(protocol id)" +DefineEngineFunction(isAddressTypeAvailable, bool, (int addressType), , "(protocol id)" "@brief Determines if a specified address type can be reached.\n\n" "@ingroup Networking") { return Net::isAddressTypeAvailable((NetAddress::Type)addressType); } -DefineConsoleFunction( closeNetPort, void, (), , "()" +DefineEngineFunction( closeNetPort, void, (), , "()" "@brief Closes the current network port\n\n" "@ingroup Networking") { Net::closePort(); } -DefineConsoleFunction( saveJournal, void, (const char * filename), , "(string filename)" +DefineEngineFunction( saveJournal, void, (const char * filename), , "(string filename)" "Save the journal to the specified file.\n\n" "@ingroup Platform") { Journal::Record(filename); } -DefineConsoleFunction( playJournal, void, (const char * filename), , "(string filename)" +DefineEngineFunction( playJournal, void, (const char * filename), , "(string filename)" "@brief Begin playback of a journal from a specified field.\n\n" "@param filename Name and path of file journal file\n" "@ingroup Platform") @@ -202,7 +202,7 @@ DefineConsoleFunction( playJournal, void, (const char * filename), , "(string fi Journal::Play(filename); } -DefineConsoleFunction( getSimTime, S32, (), , "()" +DefineEngineFunction( getSimTime, S32, (), , "()" "Return the current sim time in milliseconds.\n\n" "@brief Sim time is time since the game started.\n\n" "@ingroup Platform") @@ -210,7 +210,7 @@ DefineConsoleFunction( getSimTime, S32, (), , "()" return Sim::getCurrentTime(); } -DefineConsoleFunction( getRealTime, S32, (), , "()" +DefineEngineFunction( getRealTime, S32, (), , "()" "@brief Return the current real time in milliseconds.\n\n" "Real time is platform defined; typically time since the computer booted.\n\n" "@ingroup Platform") @@ -218,8 +218,10 @@ DefineConsoleFunction( getRealTime, S32, (), , "()" return Platform::getRealMilliseconds(); } -ConsoleFunction( getLocalTime, const char *, 1, 1, "Return the current local time as: weekday month day year hour min sec.\n\n" - "Local time is platform defined.") +DefineEngineFunction(getLocalTime, const char*, (),, + "@brief Return the current local time as: weekday month day year hour min sec.\n\n" + "Local time is platform defined." + "@ingroup Platform") { Platform::LocalTime lt; Platform::getLocalTime(lt); diff --git a/Engine/source/app/mainLoop.cpp b/Engine/source/app/mainLoop.cpp index b08363f8a..ea2322d81 100644 --- a/Engine/source/app/mainLoop.cpp +++ b/Engine/source/app/mainLoop.cpp @@ -61,6 +61,7 @@ // For the TickMs define... fix this for T2D... #include "T3D/gameBase/processList.h" +#include "cinterface/cinterface.h" #ifdef TORQUE_ENABLE_VFS #include "platform/platformVFS.h" @@ -267,6 +268,9 @@ void StandardMainLoop::init() ThreadPool::GlobalThreadPool::createSingleton(); + // Set engineAPI initialized to true + engineAPI::gIsInitialized = true; + // Initialize modules. EngineModuleManager::initializeSystem(); @@ -440,6 +444,11 @@ bool StandardMainLoop::handleCommandLine( S32 argc, const char **argv ) // directly because the resource system restricts // access to the "root" directory. + bool foundExternalMain = false; + CInterface::CallMain(&foundExternalMain); + if (foundExternalMain) + return true; + #ifdef TORQUE_ENABLE_VFS Zip::ZipArchive *vfs = openEmbeddedVFSArchive(); bool useVFS = vfs != NULL; diff --git a/Engine/source/app/net/net.cpp b/Engine/source/app/net/net.cpp index c5f1be189..abec3ccc1 100644 --- a/Engine/source/app/net/net.cpp +++ b/Engine/source/app/net/net.cpp @@ -212,7 +212,7 @@ ConsoleDocClass( RemoteCommandEvent, ConsoleFunctionGroupBegin( Net, "Functions for use with the network; tagged strings and remote commands."); -ConsoleFunction( commandToServer, void, 2, RemoteCommandEvent::MaxRemoteCommandArgs + 1, "(string func, ...)" +DefineEngineStringlyVariadicFunction( commandToServer, void, 2, RemoteCommandEvent::MaxRemoteCommandArgs + 1, "(string func, ...)" "@brief Send a command to the server.\n\n" "@param func Name of the server command being called\n" @@ -255,7 +255,7 @@ ConsoleFunction( commandToServer, void, 2, RemoteCommandEvent::MaxRemoteCommandA RemoteCommandEvent::sendRemoteCommand(conn, args.count(), args); } -ConsoleFunction( commandToClient, void, 3, RemoteCommandEvent::MaxRemoteCommandArgs + 2, "(NetConnection client, string func, ...)" +DefineEngineStringlyVariadicFunction( commandToClient, void, 3, RemoteCommandEvent::MaxRemoteCommandArgs + 2, "(NetConnection client, string func, ...)" "@brief Send a command from the server to the client\n\n" "@param client The numeric ID of a client GameConnection\n" @@ -349,7 +349,7 @@ DefineEngineFunction(getTaggedString, const char* , (const char *tag), (""), -ConsoleFunction( buildTaggedString, const char*, 2, 11, "(string format, ...)" +DefineEngineStringlyVariadicFunction( buildTaggedString, const char*, 2, 11, "(string format, ...)" "@brief Build a string using the specified tagged string format.\n\n" "This function takes an already tagged string (passed in as a tagged string ID) and one " diff --git a/Engine/source/app/net/serverQuery.cpp b/Engine/source/app/net/serverQuery.cpp index 6b555629a..17caac478 100644 --- a/Engine/source/app/net/serverQuery.cpp +++ b/Engine/source/app/net/serverQuery.cpp @@ -429,7 +429,7 @@ void queryLanServers(U32 port, U8 flags, const char* gameType, const char* missi //----------------------------------------------------------------------------- -DefineConsoleFunction( queryAllServers +DefineEngineFunction( queryAllServers , void, ( U32 lanPort , U32 flags , const char * gameType @@ -455,7 +455,7 @@ DefineConsoleFunction( queryAllServers } -DefineConsoleFunction( queryLanServers +DefineEngineFunction( queryLanServers , void, ( U32 lanPort , U32 flags , const char * gameType @@ -560,7 +560,7 @@ void queryMasterServer(U8 flags, const char* gameType, const char* missionType, processMasterServerQuery( gPingSession ); } -DefineConsoleFunction( queryMasterServer +DefineEngineFunction( queryMasterServer , void, ( U32 flags , const char * gameType , const char * missionType @@ -582,7 +582,7 @@ DefineConsoleFunction( queryMasterServer //----------------------------------------------------------------------------- -DefineConsoleFunction( querySingleServer +DefineEngineFunction( querySingleServer , void, ( const char* addrText, U8 flags ) , (0), "querySingleServer(address, flags);" ) { @@ -668,7 +668,7 @@ void cancelServerQuery() } } -DefineConsoleFunction( cancelServerQuery, void, (), , "cancelServerQuery();" ) +DefineEngineFunction( cancelServerQuery, void, (), , "cancelServerQuery();" ) { cancelServerQuery(); } @@ -696,14 +696,14 @@ void stopServerQuery() } } -DefineConsoleFunction( stopServerQuery, void, (), , "stopServerQuery();" ) +DefineEngineFunction( stopServerQuery, void, (), , "stopServerQuery();" ) { stopServerQuery(); } //----------------------------------------------------------------------------- -DefineConsoleFunction( startHeartbeat, void, (), , "startHeartbeat();" ) +DefineEngineFunction( startHeartbeat, void, (), , "startHeartbeat();" ) { if (validateAuthenticatedServer()) { gHeartbeatSeq++; @@ -711,19 +711,19 @@ DefineConsoleFunction( startHeartbeat, void, (), , "startHeartbeat();" ) } } -DefineConsoleFunction( stopHeartbeat, void, (), , "stopHeartbeat();" ) +DefineEngineFunction( stopHeartbeat, void, (), , "stopHeartbeat();" ) { gHeartbeatSeq++; } //----------------------------------------------------------------------------- -DefineConsoleFunction( getServerCount, int, (), , "getServerCount();" ) +DefineEngineFunction( getServerCount, int, (), , "getServerCount();" ) { return gServerList.size(); } -DefineConsoleFunction( setServerInfo, bool, (U32 index), , "setServerInfo(index);" ) +DefineEngineFunction( setServerInfo, bool, (U32 index), , "setServerInfo(index);" ) { if (index < gServerList.size()) { ServerInfo& info = gServerList[index]; diff --git a/Engine/source/app/version.cpp b/Engine/source/app/version.cpp index bced8730a..7a26adb3d 100644 --- a/Engine/source/app/version.cpp +++ b/Engine/source/app/version.cpp @@ -92,44 +92,44 @@ const char* getCompileTimeString() ConsoleFunctionGroupBegin( CompileInformation, "Functions to get version information about the current executable." ); -DefineConsoleFunction( getVersionNumber, S32, (), , "Get the version of the engine build, as a string.\n\n" +DefineEngineFunction( getVersionNumber, S32, (), , "Get the version of the engine build, as a string.\n\n" "@ingroup Debugging") { return getVersionNumber(); } -DefineConsoleFunction( getAppVersionNumber, S32, (), , "Get the version of the application build, as a string.\n\n" +DefineEngineFunction( getAppVersionNumber, S32, (), , "Get the version of the application build, as a string.\n\n" "@ingroup Debugging") { return getAppVersionNumber(); } -DefineConsoleFunction( getVersionString, const char*, (), , "Get the version of the engine build, as a human readable string.\n\n" +DefineEngineFunction( getVersionString, const char*, (), , "Get the version of the engine build, as a human readable string.\n\n" "@ingroup Debugging") { return getVersionString(); } -DefineConsoleFunction( getAppVersionString, const char*, (), , "Get the version of the aplication build, as a human readable string.\n\n" +DefineEngineFunction( getAppVersionString, const char*, (), , "Get the version of the aplication build, as a human readable string.\n\n" "@ingroup Debugging") { return getAppVersionString(); } -DefineConsoleFunction( getEngineName, const char*, (), , "Get the name of the engine product that this is running from, as a string.\n\n" +DefineEngineFunction( getEngineName, const char*, (), , "Get the name of the engine product that this is running from, as a string.\n\n" "@ingroup Debugging") { return getEngineProductString(); } -DefineConsoleFunction( getCompileTimeString, const char*, (), , "Get the time of compilation.\n\n" +DefineEngineFunction( getCompileTimeString, const char*, (), , "Get the time of compilation.\n\n" "@ingroup Debugging") { return getCompileTimeString(); } -DefineConsoleFunction( getBuildString, const char*, (), , "Get the type of build, \"Debug\" or \"Release\".\n\n" +DefineEngineFunction( getBuildString, const char*, (), , "Get the type of build, \"Debug\" or \"Release\".\n\n" "@ingroup Debugging") { #ifdef TORQUE_DEBUG diff --git a/Engine/source/assets/assetQuery_ScriptBinding.h b/Engine/source/assets/assetQuery_ScriptBinding.h index 3324054e1..71cc58f1a 100644 --- a/Engine/source/assets/assetQuery_ScriptBinding.h +++ b/Engine/source/assets/assetQuery_ScriptBinding.h @@ -26,7 +26,7 @@ #include "console/engineAPI.h" -DefineConsoleMethod(AssetQuery, clear, void, (),,"Clears all asset Id results." +DefineEngineMethod(AssetQuery, clear, void, (),,"Clears all asset Id results." "Clears all asset Id results.\n" "@return () No return value.\n") { @@ -36,7 +36,7 @@ DefineConsoleMethod(AssetQuery, clear, void, (),,"Clears all asset Id results." //----------------------------------------------------------------------------- -DefineConsoleMethod(AssetQuery, set, bool, (S32 queryId), , +DefineEngineMethod(AssetQuery, set, bool, (S32 queryId), , "Sets the asset query to a copy of the specified asset query.\n" "@param assetQuery The asset query to copy.\n" "@return Whether the operation succeeded or not.\n") @@ -59,7 +59,7 @@ DefineConsoleMethod(AssetQuery, set, bool, (S32 queryId), , //----------------------------------------------------------------------------- -DefineConsoleMethod(AssetQuery, getCount, S32, (), , +DefineEngineMethod(AssetQuery, getCount, S32, (), , "Gets the count of asset Id results.\n" "@return (int)The count of asset Id results.\n") { @@ -68,7 +68,7 @@ DefineConsoleMethod(AssetQuery, getCount, S32, (), , //----------------------------------------------------------------------------- -DefineConsoleMethod(AssetQuery, getAsset, const char*, (S32 resultIndex), (-1), +DefineEngineMethod(AssetQuery, getAsset, const char*, (S32 resultIndex), (-1), "Gets the asset Id at the specified query result index.\n" "@param resultIndex The query result index to use.\n" "@return (assetId)The asset Id at the specified index or NULL if not valid.\n") diff --git a/Engine/source/cinterface/c_consoleInterface.cpp b/Engine/source/cinterface/c_consoleInterface.cpp index 21a2e48fd..09b406da3 100644 --- a/Engine/source/cinterface/c_consoleInterface.cpp +++ b/Engine/source/cinterface/c_consoleInterface.cpp @@ -20,154 +20,59 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- -#include "platform/platform.h" -#include "console/compiler.h" #include "console/consoleInternal.h" #include "console/simSet.h" +#include "console/engineAPI.h" -extern "C" { - - // SimObject C interface - const char *SimObject_GetName(SimObject *so) +namespace Con +{ + DefineNewEngineFunction(AddConsumer, void, (ConsumerCallback cb), , "") { - return so->getName(); + addConsumer(cb); } - U32 SimObject_GetId(SimObject *so) + DefineNewEngineFunction(RemoveConsumer, void, (ConsumerCallback cb), , "") { - return so->getId(); + removeConsumer(cb); } - const char *SimObject_GetClassName(SimObject *so) + DefineNewEngineFunction(GetConsoleString, String, (String name),, "") { - return so->getClassName(); + return getVariable(StringTable->insert(name)); } - void *SimObject_GetFieldList(SimObject *so, S32 &outNumFields) + DefineNewEngineFunction(SetConsoleString, void, (String name, String value),, "") { - const AbstractClassRep::FieldList &fl = so->getFieldList(); - outNumFields = fl.size(); - return fl.address(); + setVariable(StringTable->insert(name), StringTable->insert(value)); } - bool SimObject_IsLocked(SimObject *so) + DefineNewEngineFunction(GetConsoleInt, S32, (String name),, "") { - return so->isLocked(); + return getIntVariable(StringTable->insert(name)); } - void SimObject_SetDataField(SimObject *so, const char *fieldName, const char *arr, const char *val) + DefineNewEngineFunction(SetConsoleInt, void, (String name, S32 value),, "") { - so->setDataField(StringTable->insert(fieldName), arr, val); + setIntVariable(StringTable->insert(name), value); } - const char *SimObject_GetDataField(SimObject *so, const char *fieldName, const char *arr) + DefineNewEngineFunction(GetConsoleFloat, F32, (String name),, "") { - return so->getDataField(StringTable->insert(fieldName), arr); + return getFloatVariable(StringTable->insert(name)); } - void SimObject_InspectPreApply(SimObject *so) + DefineNewEngineFunction(SetConsoleFloat, void, (String name, F32 value),, "") { - so->inspectPreApply(); + setFloatVariable(StringTable->insert(name), value); } - void SimObject_InspectPostApply(SimObject *so) + DefineNewEngineFunction(GetConsoleBool, bool, (String name),, "") { - so->inspectPostApply(); + return getBoolVariable(StringTable->insert(name)); } - // Con C interface - void Con_AddConsumer(ConsumerCallback cb) + DefineNewEngineFunction(SetConsoleBool, void, (String name, bool value),, "") { - Con::addConsumer(cb); + setBoolVariable(StringTable->insert(name), value); } - - void Con_RemoveConsumer(ConsumerCallback cb) - { - Con::removeConsumer(cb); - } - - void Con_AddCommand_String(StringCallback cb, const char *nameSpace, const char *funcName, const char* usage, S32 minArgs, S32 maxArgs) - { - if (!nameSpace || !dStrlen(nameSpace)) - Con::addCommand(funcName, cb, usage, minArgs + 1, maxArgs + 1); - else - Con::addCommand(nameSpace, funcName, cb, usage, minArgs + 1, maxArgs + 1); - } - - // ConsoleBaseType C interface - ConsoleBaseType *ConsoleBaseType_GetTypeById(const S32 typeId) - { - return ConsoleBaseType::getType(typeId); - } - - S32 ConsoleBaseType_GetTypeId(ConsoleBaseType *cbt) - { - return cbt->getTypeID(); - } - - S32 ConsoleBaseType_GetTypeSize(ConsoleBaseType *cbt) - { - return cbt->getTypeSize(); - } - - const char *ConsoleBaseType_GetTypeName(ConsoleBaseType *cbt) - { - return cbt->getTypeName(); - } - - const char *ConsoleBaseType_GetInspectorFieldType(ConsoleBaseType *cbt) - { - return cbt->getInspectorFieldType(); - } - - void ConsoleBaseType_SetData(ConsoleBaseType *cbt, void *dptr, S32 argc, const char **argv, const EnumTable *tbl, BitSet32 flag) - { - return cbt->setData(dptr, argc, argv, tbl, flag); - } - - const char *ConsoleBaseType_GetData(ConsoleBaseType *cbt, void *dptr, const EnumTable *tbl, BitSet32 flag) - { - return cbt->getData(dptr, tbl, flag); - } - - // Abstract Class Rep - AbstractClassRep *AbstractClassRep_GetCommonParent(AbstractClassRep *acr, AbstractClassRep *otheracr) - { - return acr->getCommonParent(otheracr); - } - - AbstractClassRep *AbstractClassRep_FindClassRep(const char* in_pClassName) - { - return AbstractClassRep::findClassRep(in_pClassName); - } - - U32 AbstractClassRep_GetFieldStructSize() - { - return sizeof(AbstractClassRep::Field); - } - - // Sim C interface - SimObject *Sim_FindObjectByString(const char *param) - { - return Sim::findObject(param); - } - - SimObject *Sim_FindObjectById(S32 param) - { - return Sim::findObject(param); - } - - // Sim Set - SimObject **SimSet_Begin(SimObject *simObject) - { - return dynamic_cast(simObject)->begin(); - } - - SimObject **SimSet_End(SimObject *simObject) - { - return dynamic_cast(simObject)->end(); - } - -}; - - +} \ No newline at end of file diff --git a/Engine/source/cinterface/c_controlInterface.cpp b/Engine/source/cinterface/c_controlInterface.cpp new file mode 100644 index 000000000..4a07d49db --- /dev/null +++ b/Engine/source/cinterface/c_controlInterface.cpp @@ -0,0 +1,239 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 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 "c_controlInterface.h" + +#include "console/consoleInternal.h" +#include "console/simSet.h" +#include "app/mainLoop.h" +#include "windowManager/platformWindow.h" +#include "windowManager/platformWindowMgr.h" + +#ifdef TORQUE_OS_WIN +#include "windowManager/win32/win32Window.h" +#include "windowManager/win32/winDispatch.h" +extern void createFontInit(void); +extern void createFontShutdown(void); +#endif + + +#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) +extern S32 CreateMiniDump(LPEXCEPTION_POINTERS ExceptionInfo); +#endif + +extern bool LinkConsoleFunctions; + +extern "C" { + + // reset the engine, unloading any current level and returning to the main menu + void torque_reset() + { + Con::evaluate("disconnect();"); + } + + // initialize Torque 3D including argument handling + bool torque_engineinit(S32 argc, const char **argv) + { + +#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) + __try { +#endif + + LinkConsoleFunctions = true; + +#if defined(_MSC_VER) + createFontInit(); +#endif + + // Initialize the subsystems. + StandardMainLoop::init(); + + // Handle any command line args. + if (!StandardMainLoop::handleCommandLine(argc, argv)) + { + Platform::AlertOK("Error", "Failed to initialize game, shutting down."); + return false; + } + +#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) + } + + __except (CreateMiniDump(GetExceptionInformation())) + { + _exit(0); + } +#endif + + return true; + + } + + // tick Torque 3D's main loop + S32 torque_enginetick() + { + +#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) + __try { +#endif + + bool ret = StandardMainLoop::doMainLoop(); + return ret; + +#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) + } + __except (CreateMiniDump(GetExceptionInformation())) + { + _exit(0); + } +#endif + + } + + S32 torque_getreturnstatus() + { + return StandardMainLoop::getReturnStatus(); + } + + // signal an engine shutdown (as with the quit(); console command) + void torque_enginesignalshutdown() + { + Con::evaluate("quit();"); + } + + // shutdown the engine + S32 torque_engineshutdown() + { + +#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) + __try { +#endif + + // Clean everything up. + StandardMainLoop::shutdown(); + +#if defined(_MSC_VER) + createFontShutdown(); +#endif + +#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) + } + + __except (CreateMiniDump(GetExceptionInformation())) + { + _exit(0); + } +#endif + + // Return. + return true; + + } + + bool torque_isdebugbuild() + { +#ifdef _DEBUG + return true; +#else + return false; +#endif + + } + + // set Torque 3D into web deployment mode (disable fullscreen exlusive mode, etc) + void torque_setwebdeployment() + { + Platform::setWebDeployment(true); + } + + // resize the Torque 3D child window to the specified width and height + void torque_resizewindow(S32 width, S32 height) + { + if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow()) + PlatformWindowManager::get()->getFirstWindow()->setSize(Point2I(width, height)); + } + +#if defined(TORQUE_OS_WIN) && !defined(TORQUE_SDL) + // retrieve the hwnd of our render window + void* torque_gethwnd() + { + if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow()) + { + Win32Window* w = (Win32Window*)PlatformWindowManager::get()->getFirstWindow(); + return (void *)w->getHWND(); + } + + return NULL; + } + + // directly add a message to the Torque 3D event queue, bypassing the Windows event queue + // this is useful in the case of the IE plugin, where we are hooking into an application + // level message, and posting to the windows queue would cause a hang + void torque_directmessage(U32 message, U32 wparam, U32 lparam) + { + if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow()) + { + Win32Window* w = (Win32Window*)PlatformWindowManager::get()->getFirstWindow(); + Dispatch(DelayedDispatch, w->getHWND(), message, wparam, lparam); + } + } + +#endif + +#ifdef TORQUE_OS_WIN + void torque_inputevent(S32 type, S32 value1, S32 value2) + { + if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow()) + { + Win32Window* w = (Win32Window*)PlatformWindowManager::get()->getFirstWindow(); + WindowId devId = w->getWindowId(); + + switch (type) + { + case 0: + w->mouseEvent.trigger(devId, 0, value1, value2, w->isMouseLocked()); + break; + case 1: + if (value2) + w->buttonEvent.trigger(devId, 0, IA_MAKE, value1); + else + w->buttonEvent.trigger(devId, 0, IA_BREAK, value1); + break; + + } + } + } +#endif + + static char* gExecutablePath = NULL; + + const char* torque_getexecutablepath() + { + return gExecutablePath; + } + + void torque_setexecutablepath(const char* directory) + { + dsize_t pathLen = dStrlen(directory) + 1; + gExecutablePath = new char[pathLen]; + dStrcpy(gExecutablePath, directory, pathLen); + } +} \ No newline at end of file diff --git a/Engine/source/cinterface/c_controlInterface.h b/Engine/source/cinterface/c_controlInterface.h new file mode 100644 index 000000000..229b07b88 --- /dev/null +++ b/Engine/source/cinterface/c_controlInterface.h @@ -0,0 +1,48 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 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 C_CONTROLINTERFACE_H +#define C_CONTROLINTERFACE_H +#include "platform/platformDlibrary.h" +#include "console/engineFunctions.h" + +TORQUE_API void torque_reset(); +TORQUE_API bool torque_engineinit(S32 argc, const char **argv); +TORQUE_API S32 torque_enginetick(); +TORQUE_API S32 torque_getreturnstatus(); +TORQUE_API void torque_enginesignalshutdown(); +TORQUE_API S32 torque_engineshutdown(); +TORQUE_API bool torque_isdebugbuild(); +TORQUE_API void torque_setwebdeployment(); +TORQUE_API void torque_resizewindow(S32 width, S32 height); + +#if defined(TORQUE_OS_WIN) && !defined(TORQUE_SDL) +TORQUE_API void* torque_gethwnd(); +TORQUE_API void torque_directmessage(U32 message, U32 wparam, U32 lparam); +#endif +#ifdef TORQUE_OS_WIN +TORQUE_API void torque_inputevent(S32 type, S32 value1, S32 value2); +#endif + +TORQUE_API const char* torque_getexecutablepath(); + +#endif // C_CONTROLINTERFACE_H diff --git a/Engine/source/cinterface/c_scripting.cpp b/Engine/source/cinterface/c_scripting.cpp deleted file mode 100644 index 1138cbc1c..000000000 --- a/Engine/source/cinterface/c_scripting.cpp +++ /dev/null @@ -1,426 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 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/compiler.h" -#include "console/console.h" -#include "console/consoleInternal.h" -#include "core/util/tDictionary.h" -#include "app/mainLoop.h" - -// External scripting cinterface, suitable for import into any scripting system which support "C" interfaces (C#, Python, Lua, Java, etc) - -#ifdef TORQUE_OS_WIN -#include "windowManager/win32/win32Window.h" -#include "windowManager/win32/winDispatch.h" -#endif - -extern "C" { - - struct MarshalNativeEntry - { - const char* nameSpace; - const char* name; - Namespace::Entry* entry; - S32 minArgs; - S32 maxArgs; - S32 cbType; - }; - - - static Namespace::Entry* GetEntry(const char* nameSpace, const char* name) - { - Namespace* ns = NULL; - - if (!nameSpace || !dStrlen(nameSpace)) - ns = Namespace::mGlobalNamespace; - else - { - nameSpace = StringTable->insert(nameSpace); - ns = Namespace::find(nameSpace); //can specify a package here, maybe need, maybe not - } - - if (!ns) - return NULL; - - name = StringTable->insert(name); - - Namespace::Entry* entry = ns->lookupRecursive(name); - - return entry; - } - - const char * script_getconsolexml() - { - Namespace::Entry* entry = GetEntry("", "consoleExportXML"); - - if (!entry) - return ""; - - static const char* exportArgv[1] = { "consoleExportXML" }; - static StringStackConsoleWrapper exportCmd(1, exportArgv); - - return entry->cb.mStringCallbackFunc(NULL, exportCmd.argc, exportCmd.argv); - } - - MarshalNativeEntry* script_get_namespace_entry(const char* nameSpace, const char* name) - { - static MarshalNativeEntry mentry; - - Namespace::Entry* e = GetEntry(nameSpace, name); - - if (!e) - return NULL; - - mentry.nameSpace = e->mNamespace->mName; - mentry.name = e->mFunctionName; - mentry.minArgs = e->mMinArgs; - mentry.maxArgs = e->mMaxArgs; - mentry.cbType = e->mType; - mentry.entry = e; - - return &mentry; - } - - void* script_get_stringtable_entry(const char* string) - { - return (void*)StringTable->insert(string); - } - - // FIELD ACCESS - - // fieldNames must be from stringTable coming in! See Engine.stringTable - - const char* script_simobject_getfield_string(U32 id, const char* fieldName) - { - SimObject *object = Sim::findObject( id ); - if( object ) - { - return (const char *) object->getDataField(fieldName, ""); - } - return ""; - } - - void script_simobject_setfield_string(U32 objectId, const char* fieldName, const char* v) - { - SimObject *object = Sim::findObject( objectId ); - if( object ) - { - object->setDataField(fieldName, "", v); - } - } - - - bool script_simobject_getfield_bool(U32 objectId, const char* fieldName) - { - SimObject *object = Sim::findObject( objectId ); - if( object ) - { - const char *v = object->getDataField(fieldName, ""); - - return dAtob(v); - } - - return false; - } - - void script_simobject_setfield_bool(U32 objectId, const char* fieldName, bool v) - { - SimObject *object = Sim::findObject( objectId ); - if( object ) - { - object->setDataField(fieldName, "", v ? "1" : "0"); - } - } - - S32 script_simobject_getfield_int(U32 objectId, const char* fieldName) - { - SimObject *object = Sim::findObject( objectId ); - if( object ) - { - const char *v = object->getDataField(fieldName, ""); - - return dAtoi(v); - } - - return false; - } - - void script_simobject_setfield_int(U32 objectId, const char* fieldName, S32 v) - { - SimObject *object = Sim::findObject( objectId ); - if( object ) - { - // this seems pretty lame, though it is how it is handled in consoleType.cpp - char buf[256]; - dSprintf(buf, 256, "%d", v ); - object->setDataField(fieldName, "", buf); - } - } - - F32 script_simobject_getfield_float(U32 objectId, const char* fieldName) - { - SimObject *object = Sim::findObject( objectId ); - if( object ) - { - const char *v = object->getDataField(fieldName, ""); - - return dAtof(v); - } - - return false; - } - - void script_simobject_setfield_float(U32 objectId, const char* fieldName, F32 v) - { - SimObject *object = Sim::findObject( objectId ); - if( object ) - { - char buf[256]; - dSprintf(buf, 256, "%g", v ); - object->setDataField(fieldName, "", buf); - } - } - - const char* script_call_namespace_entry_string(Namespace::Entry* entry, S32 argc, const char** argv) - { - // maxArgs improper on a number of console function/methods - if (argc < entry->mMinArgs)// || argc > entry->mMaxArgs) - return ""; - - SimObject* o = NULL; - - if (entry->mNamespace && entry->mNamespace->isClass()) - { - o = Sim::findObject(dAtoi(argv[1])); - if (!o) - return ""; - } - - StringStackConsoleWrapper args(argc, argv); - return entry->cb.mStringCallbackFunc(o, args.count(), args); - } - - bool script_call_namespace_entry_bool(Namespace::Entry* entry, S32 argc, const char** argv) - { - // maxArgs improper on a number of console function/methods - if (argc < entry->mMinArgs)// || argc > entry->mMaxArgs) - return false; - - SimObject* o = NULL; - - if (entry->mNamespace && entry->mNamespace->isClass()) - { - o = Sim::findObject(dAtoi(argv[1])); - if (!o) - return false; - } - - StringStackConsoleWrapper args(argc, argv); - return entry->cb.mBoolCallbackFunc(o, args.count(), args); - } - - S32 script_call_namespace_entry_int(Namespace::Entry* entry, S32 argc, const char** argv) - { - // maxArgs improper on a number of console function/methods - if (argc < entry->mMinArgs)// || argc > entry->mMaxArgs) - return 0; - - SimObject* o = NULL; - - if (entry->mNamespace && entry->mNamespace->isClass()) - { - o = Sim::findObject(dAtoi(argv[1])); - if (!o) - return 0; - } - - StringStackConsoleWrapper args(argc, argv); - return entry->cb.mIntCallbackFunc(o, args.count(), args); - } - - F32 script_call_namespace_entry_float(Namespace::Entry* entry, S32 argc, const char** argv) - { - // maxArgs improper on a number of console function/methods - if (argc < entry->mMinArgs)// || argc > entry->mMaxArgs) - return 0.0f; - - SimObject* o = NULL; - - if (entry->mNamespace && entry->mNamespace->isClass()) - { - o = Sim::findObject(dAtoi(argv[1])); - if (!o) - return 0.0f; - } - - StringStackConsoleWrapper args(argc, argv); - return entry->cb.mFloatCallbackFunc(o, args.count(), args); - } - - - void script_call_namespace_entry_void(Namespace::Entry* entry, S32 argc, const char** argv) - { - // maxArgs improper on a number of console function/methods - if (argc < entry->mMinArgs)// || argc > entry->mMaxArgs) - return; - - SimObject* o = NULL; - - if (entry->mNamespace && entry->mNamespace->isClass()) - { - Sim::findObject(dAtoi(argv[1])); - if (!o) - return; - } - - StringStackConsoleWrapper args(argc, argv); - entry->cb.mVoidCallbackFunc(o, args.count(), args); - } - - S32 script_simobject_get_id(SimObject* so) - { - return so->getId(); - } - - S32 script_simobject_find(const char* classname, const char* name) - { - SimObject *object; - if( Sim::findObject( name, object ) ) - { - // if we specified a classname do type checking - if (classname && dStrlen(classname)) - { - AbstractClassRep* ocr = object->getClassRep(); - while (ocr) - { - if (!dStricmp(ocr->getClassName(), classname)) - return object->getId(); - ocr = ocr->getParentClass(); - } - - } - - // invalid type - return 0; - } - - // didn't find object - return 0; - } - - void script_export_callback_string(StringCallback cb, const char *nameSpace, const char *funcName, const char* usage, S32 minArgs, S32 maxArgs) - { - if (!nameSpace || !dStrlen(nameSpace)) - Con::addCommand(funcName, cb, usage, minArgs + 1, maxArgs + 1); - else - Con::addCommand(nameSpace, funcName, cb, usage, minArgs + 1, maxArgs + 1); - } - - void script_export_callback_void(VoidCallback cb, const char *nameSpace, const char *funcName, const char* usage, S32 minArgs, S32 maxArgs) - { - - if (!nameSpace || !dStrlen(nameSpace)) - Con::addCommand(funcName, cb, usage, minArgs + 1, maxArgs + 1); - else - Con::addCommand(nameSpace, funcName, cb, usage, minArgs + 1, maxArgs + 1); - - - - // example of package support - // note that Parent:: does not work with this, at least not yet anyway - - /* - Namespace* ns; - - StringTableEntry nspace = NULL; - - if (nameSpace && dStrlen(nameSpace)) - nspace = StringTable->insert(nameSpace); - - Namespace::unlinkPackages(); - ns = Namespace::find(nspace, StringTable->insert("fps")); - ns->addCommand(StringTable->insert(funcName), cb, StringTable->insert(usage), minArgs + 1, maxArgs + 1 ); - Namespace::relinkPackages(); - */ - } - - void script_export_callback_bool(BoolCallback cb, const char *nameSpace, const char *funcName, const char* usage, S32 minArgs, S32 maxArgs) - { - if (!nameSpace || !dStrlen(nameSpace)) - Con::addCommand(funcName, cb, usage, minArgs + 1, maxArgs + 1); - else - Con::addCommand(nameSpace, funcName, cb, usage, minArgs + 1, maxArgs + 1); - } - - void script_export_callback_int(IntCallback cb, const char *nameSpace, const char *funcName, const char* usage, S32 minArgs, S32 maxArgs) - { - if (!nameSpace || !dStrlen(nameSpace)) - Con::addCommand(funcName, cb, usage, minArgs + 1, maxArgs + 1); - else - Con::addCommand(nameSpace, funcName, cb, usage, minArgs + 1, maxArgs + 1); - } - - void script_export_callback_float(FloatCallback cb, const char *nameSpace, const char *funcName, const char* usage, S32 minArgs, S32 maxArgs) - { - if (!nameSpace || !dStrlen(nameSpace)) - Con::addCommand(funcName, cb, usage, minArgs + 1, maxArgs + 1); - else - Con::addCommand(nameSpace, funcName, cb, usage, minArgs + 1, maxArgs + 1); - } - - -#ifdef TORQUE_OS_WIN - - void script_input_event(S32 type, S32 value1, S32 value2) - { - if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow()) - { - Win32Window* w = (Win32Window*) PlatformWindowManager::get()->getFirstWindow(); - WindowId devId = w->getWindowId(); - - switch (type) - { - case 0: - w->mouseEvent.trigger(devId,0,value1,value2,w->isMouseLocked()); - break; - case 1: - if (value2) - w->buttonEvent.trigger(devId,0,IA_MAKE,value1); - else - w->buttonEvent.trigger(devId,0,IA_BREAK,value1); - break; - - } - - } - - } -#endif - -} - - -ConsoleFunction(TestFunction2Args, const char *, 3, 3, "testFunction(arg1, arg2)") -{ - return "Return Value"; -} diff --git a/Engine/source/cinterface/c_simInterface.cpp b/Engine/source/cinterface/c_simInterface.cpp new file mode 100644 index 000000000..d3b0ea58f --- /dev/null +++ b/Engine/source/cinterface/c_simInterface.cpp @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 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 "console/consoleInternal.h" +#include "console/simDatablock.h" +#include "console/simSet.h" +#include "console/engineAPI.h" + +namespace Sim +{ + DefineNewEngineFunction(FindObjectById, SimObject*, (U32 pId), , "") + { + return Sim::findObject(pId); + } + + DefineNewEngineFunction(FindObjectByName, SimObject*, (String pName), , "") + { + return Sim::findObject(StringTable->insert(pName)); + } + + DefineNewEngineFunction(FindDataBlockByName, SimObject*, (String pName), , "") + { + return Sim::getDataBlockGroup()->findObject(StringTable->insert(pName)); + } + + // EngineAPI doesn't work with SimObjectPtr + TORQUE_API SimObjectPtr* fnWrapObject (SimObject* pObject) + { + return new SimObjectPtr(pObject); + } + + TORQUE_API void fnDeleteObjectPtr(SimObjectPtr* pObjectPtr) + { + delete pObjectPtr; + } +} \ No newline at end of file diff --git a/Engine/source/cinterface/c_simdatablockInterface.cpp b/Engine/source/cinterface/c_simdatablockInterface.cpp new file mode 100644 index 000000000..2d7f862a3 --- /dev/null +++ b/Engine/source/cinterface/c_simdatablockInterface.cpp @@ -0,0 +1,40 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 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 "console/simDatablock.h" +#include "console/engineAPI.h" + +DefineNewEngineMethod(SimDataBlock, AssignId, void, (),, "") +{ + object->assignId(); +} + +DefineNewEngineMethod(SimDataBlock, Preload, void, (),, "") +{ + static String errorStr; + if (!object->preload(true, errorStr)) + { + Con::errorf(ConsoleLogEntry::General, "Preload failed for %s: %s.", + object->getName(), errorStr.c_str()); + object->deleteObject(); + } +} \ No newline at end of file diff --git a/Engine/source/cinterface/c_simobjectInterface.cpp b/Engine/source/cinterface/c_simobjectInterface.cpp new file mode 100644 index 000000000..4c018c0ab --- /dev/null +++ b/Engine/source/cinterface/c_simobjectInterface.cpp @@ -0,0 +1,69 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 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 "console/engineAPI.h" +#include "console/simObject.h" + +DefineNewEngineMethod(SimObject, RegisterObject, bool, (),,"") +{ + return object->registerObject(); +} + +DefineNewEngineMethod(SimObject, GetField, String, (String fieldName, String arrayIndex),, "") +{ + return object->getDataField(StringTable->insert(fieldName), StringTable->insert(arrayIndex)); +} + +DefineNewEngineMethod(SimObject, SetField, void, (String fieldName, String arrayIndex, String value),, "") +{ + object->setDataField(StringTable->insert(fieldName), StringTable->insert(arrayIndex), StringTable->insert(value)); +} + +DefineNewEngineMethod(SimObject, CopyFrom, void, (SimObject* parent),, "") +{ + if (parent) + { + object->setCopySource(parent); + object->assignFieldsFrom(parent); + } +} + +DefineNewEngineMethod(SimObject, SetMods, void, (bool modStaticFields, bool modDynamicFields), , "") +{ + object->setModStaticFields(modStaticFields); + object->setModDynamicFields(modDynamicFields); +} + +DefineNewEngineMethod(SimObject, IsLocked, bool, (), , "") +{ + return object->isLocked(); +} + +DefineNewEngineMethod(SimObject, InspectPreApply, void, (), , "") +{ + object->inspectPreApply(); +} + +DefineNewEngineMethod(SimObject, InspectPostApply, void, (), , "") +{ + object->inspectPostApply(); +} \ No newline at end of file diff --git a/Engine/source/cinterface/cinterface.cpp b/Engine/source/cinterface/cinterface.cpp index aa0fae035..e62db2c91 100644 --- a/Engine/source/cinterface/cinterface.cpp +++ b/Engine/source/cinterface/cinterface.cpp @@ -19,449 +19,78 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- +#include "cinterface.h" -#include "platform/platform.h" #include "console/compiler.h" -#include "console/consoleInternal.h" -#include "console/engineAPI.h" -#include "core/util/tDictionary.h" -#include "core/strings/stringFunctions.h" -#include "app/mainLoop.h" #include "windowManager/platformWindow.h" -#include "windowManager/platformWindowMgr.h" -#ifdef TORQUE_OS_WIN -#include "windowManager/win32/win32Window.h" -#include "windowManager/win32/winDispatch.h" -extern void createFontInit(void); -extern void createFontShutdown(void); -#endif - -#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) - extern S32 CreateMiniDump(LPEXCEPTION_POINTERS ExceptionInfo); -#endif - -static HashTable gSecureScript; - -extern bool LinkConsoleFunctions; - -extern "C" { - - // reset the engine, unloading any current level and returning to the main menu - void torque_reset() - { - Con::evaluate("disconnect();"); - } - - // initialize Torque 3D including argument handling - S32 torque_engineinit(S32 argc, const char **argv) - { - -#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) - __try { -#endif - - LinkConsoleFunctions = true; - -#if defined(_MSC_VER) - createFontInit(); -#endif - - // Initialize the subsystems. - StandardMainLoop::init(); - - // Handle any command line args. - if(!StandardMainLoop::handleCommandLine(argc, argv)) - { - Platform::AlertOK("Error", "Failed to initialize game, shutting down."); - return false; - } - -#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) - } - - __except( CreateMiniDump(GetExceptionInformation()) ) - { - _exit(0); - } -#endif - - return true; - - } - - // tick Torque 3D's main loop - S32 torque_enginetick() - { - -#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) - __try { -#endif - - bool ret = StandardMainLoop::doMainLoop(); - return ret; - -#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) - } - __except( CreateMiniDump(GetExceptionInformation()) ) - { - _exit(0); - } -#endif - - - - } - - S32 torque_getreturnstatus() - { - return StandardMainLoop::getReturnStatus(); - } - - // signal an engine shutdown (as with the quit(); console command) - void torque_enginesignalshutdown() - { - Con::evaluate("quit();"); - } - - // shutdown the engine - S32 torque_engineshutdown() - { - -#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) - __try { -#endif - - // Clean everything up. - StandardMainLoop::shutdown(); - -#if defined(_MSC_VER) - createFontShutdown(); -#endif - -#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) - } - - __except( CreateMiniDump(GetExceptionInformation()) ) - { - _exit(0); - } -#endif - - // Return. - return true; - - } - - bool torque_isdebugbuild() - { -#ifdef _DEBUG - return true; -#else - return false; -#endif - - } - - S32 torque_getconsolebool(const char* name) - { - return Con::getBoolVariable(name); - } - - void torque_setconsolebool(const char* name, bool value) - { - Con::setBoolVariable(name, value); - } - - static char* gExecutablePath = NULL; - - const char* torque_getexecutablepath() - { - return gExecutablePath; - } - - void torque_setexecutablepath(const char* directory) - { - dsize_t pathLen = dStrlen(directory) + 1; - gExecutablePath = new char[pathLen]; - dStrcpy(gExecutablePath, directory, pathLen); - } - - // set Torque 3D into web deployment mode (disable fullscreen exlusive mode, etc) - void torque_setwebdeployment() - { - Platform::setWebDeployment(true); - } - - // Get a console variable - const char* torque_getvariable(const char* name) - { - return Con::getVariable(StringTable->insert(name)); - } - - // Set a console variable - void torque_setvariable(const char* name, const char* value) - { - Con::setVariable(StringTable->insert(name), StringTable->insert(value)); - } - - static Namespace::Entry* GetEntry(const char* nameSpace, const char* name) - { - Namespace* ns = NULL; - - if (!nameSpace || !dStrlen(nameSpace)) - ns = Namespace::mGlobalNamespace; - else - { - nameSpace = StringTable->insert(nameSpace); - ns = Namespace::find(nameSpace); //can specify a package here, maybe need, maybe not - } - - if (!ns) - return NULL; - - name = StringTable->insert(name); - - Namespace::Entry* entry = ns->lookupRecursive(name); - - return entry; - } - - // Export a function to the Torque 3D console system which matches the StringCallback function prototype - // specify the nameSpace, functionName, usage, min and max arguments - void torque_exportstringcallback(StringCallback cb, const char *nameSpace, const char *funcName, const char* usage, S32 minArgs, S32 maxArgs) - { - if (!nameSpace || !dStrlen(nameSpace)) - Con::addCommand(funcName, cb, usage, minArgs + 1, maxArgs + 1); - else - Con::addCommand(nameSpace, funcName, cb, usage, minArgs + 1, maxArgs + 1); - } - - void torque_callvoidfunction(const char* nameSpace, const char* name, S32 argc, const char ** argv) - { - - Namespace::Entry* entry = GetEntry(nameSpace, name); - - if (!entry) - return; - - StringStackConsoleWrapper args(argc, argv); - entry->cb.mVoidCallbackFunc(NULL, args.count(), args); - } - - F32 torque_callfloatfunction(const char* nameSpace, const char* name, S32 argc, const char ** argv) - { - - Namespace::Entry* entry = GetEntry(nameSpace, name); - - if (!entry) - return 0.0f; - - StringStackConsoleWrapper args(argc, argv); - return entry->cb.mFloatCallbackFunc(NULL, args.count(), args); - } - - S32 torque_callintfunction(const char* nameSpace, const char* name, S32 argc, const char ** argv) - { - - Namespace::Entry* entry = GetEntry(nameSpace, name); - - if (!entry) - return 0; - - StringStackConsoleWrapper args(argc, argv); - return entry->cb.mIntCallbackFunc(NULL, args.count(), args); - } - - - const char * torque_callstringfunction(const char* nameSpace, const char* name, S32 argc, const char ** argv) - { - Namespace::Entry* entry = GetEntry(nameSpace, name); - - if (!entry) - return ""; - - StringStackConsoleWrapper args(argc, argv); - return entry->cb.mStringCallbackFunc(NULL, args.count(), args); - } - - bool torque_callboolfunction(const char* nameSpace, const char* name, S32 argc, const char ** argv) - { - Namespace::Entry* entry = GetEntry(nameSpace, name); - - if (!entry) - return false; - - StringStackConsoleWrapper args(argc, argv); - return entry->cb.mBoolCallbackFunc(NULL, args.count(), args); - } - - - const char * torque_callscriptfunction(const char* nameSpace, const char* name, S32 argc, const char ** argv) - { - Namespace::Entry* entry = GetEntry(nameSpace, name); - - if (!entry) - return ""; - - if(!entry->mFunctionOffset) - return ""; - - StringStackConsoleWrapper args(argc, argv); - const char* ret = entry->mCode->exec(entry->mFunctionOffset, StringTable->insert(name), entry->mNamespace, args.count(), args, false, entry->mPackage); - - if (!ret || !dStrlen(ret)) - return ""; - - return ret; - - } - - - // Call a TorqueScript console function that has been marked as secure - const char* torque_callsecurefunction(const char* nameSpace, const char* name, S32 argc, const char ** argv) - { - static const char* invalidChars = "()=:{}"; - String s = nameSpace; - s += "::"; - s += name; - s = String::ToUpper(s); - - if (!gSecureScript.count(StringTable->insert(s.c_str()))) - { - Con::warnf("\nAttempt to call insecure script: %s\n", s.c_str()); - return ""; - } - - // scan through for invalid characters - for (S32 i = 0; i < argc ; i++) - for (S32 j = 0; j < dStrlen(invalidChars) ; j++) - for (S32 k = 0; k < dStrlen(argv[i]); k++) - if (invalidChars[j] == argv[i][k]) - { - Con::warnf("\nInvalid parameter passed to secure script: %s, %s\n", s.c_str(), argv[i]); - return ""; - } - - Namespace::Entry* entry = GetEntry(nameSpace, name); - - if (!entry) - return ""; - - static char returnBuffer[32]; - - switch(entry->mType) - { - case Namespace::Entry::ConsoleFunctionType: - return torque_callscriptfunction(nameSpace, name, argc, argv); - - case Namespace::Entry::StringCallbackType: - return torque_callstringfunction(nameSpace, name, argc, argv); - - case Namespace::Entry::IntCallbackType: - dSprintf(returnBuffer, sizeof(returnBuffer), "%d", torque_callintfunction(nameSpace, name, argc, argv)); - return returnBuffer; - - case Namespace::Entry::FloatCallbackType: - dSprintf(returnBuffer, sizeof(returnBuffer), "%g", torque_callfloatfunction(nameSpace, name, argc, argv)); - return returnBuffer; - - case Namespace::Entry::VoidCallbackType: - torque_callvoidfunction(nameSpace, name, argc, argv); - return ""; - - case Namespace::Entry::BoolCallbackType: - dSprintf(returnBuffer, sizeof(returnBuffer), "%d", (U32) torque_callboolfunction(nameSpace, name, argc, argv)); - return returnBuffer; - }; - - return ""; - - } - - // Set a TorqueScript console function as secure and available for JavaScript via the callScript plugin method - void torque_addsecurefunction(const char* nameSpace, const char* fname) - { - String s = nameSpace; - s += "::"; - s += fname; - s = String::ToUpper(s); - - gSecureScript.insertEqual(StringTable->insert(s.c_str()), StringTable->insert(s.c_str())); - } - - - // Evaluate arbitrary TorqueScript (ONLY CALL torque_evaluate FROM TRUSTED CODE!!!) - const char* torque_evaluate(const char* code) - { - return Con::evaluate(code); - } - - // resize the Torque 3D child window to the specified width and height - void torque_resizewindow(S32 width, S32 height) - { - if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow()) - PlatformWindowManager::get()->getFirstWindow()->setSize(Point2I(width,height)); - } - -#if defined(TORQUE_OS_WIN) && !defined(TORQUE_SDL) - // retrieve the hwnd of our render window - void* torque_gethwnd() - { - if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow()) - { - Win32Window* w = (Win32Window*) PlatformWindowManager::get()->getFirstWindow(); - return (void *) w->getHWND(); - } - - return NULL; - } - - // directly add a message to the Torque 3D event queue, bypassing the Windows event queue - // this is useful in the case of the IE plugin, where we are hooking into an application - // level message, and posting to the windows queue would cause a hang - void torque_directmessage(U32 message, U32 wparam, U32 lparam) - { - if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow()) - { - Win32Window* w = (Win32Window*) PlatformWindowManager::get()->getFirstWindow(); - Dispatch(DelayedDispatch,w->getHWND(),message,wparam,lparam); - } - } - -#endif -} - -// This function is solely to test the TorqueScript <-> Javascript binding -// By default, it is marked as secure by the web plugins and then can be called from -// Javascript on the web page to ensure that function calls across the language -// boundry are working with arguments and return values -DefineConsoleFunction( testJavaScriptBridge, const char *, (const char* arg1, const char* arg2, const char* arg3), , "testBridge(arg1, arg2, arg3)") +CInterface& CInterface::GetCInterface() { - S32 failed = 0; - if (dStrcmp(arg1,"one")) - failed = 2; - if (dStrcmp(arg2,"two")) - failed = 2; - if (dStrcmp(arg3,"three")) - failed = 2; - - - //attempt to call from TorqueScript -> JavaScript - const char* jret = Con::evaluate("JS::bridgeCallback(\"one\",\"two\",\"three\");"); - - if (dStrcmp(jret,"42")) - failed = 3; - - static const U32 bufSize = 256; - char *ret = Con::getReturnBuffer(bufSize); - - dSprintf(ret, bufSize, "%i", failed); - - return ret; + static CInterface INSTANCE; + return INSTANCE; } +bool CInterface::isMethod(const char* className, const char* methodName) +{ + return GetCInterface()._isMethod(className, methodName); +} +const char* CInterface::CallFunction(const char* nameSpace, const char* name, const char **argv, int argc, bool *result) +{ + return GetCInterface()._CallFunction(nameSpace, name, argv, argc, result); +} +const char* CInterface::CallMethod(SimObject* obj, const char* name, const char **argv, int argc, bool *res) +{ + return GetCInterface()._CallMethod(obj->getClassName(), obj->getClassNamespace(), obj->getId(), name, argv, argc, res); +} +void CInterface::CallMain(bool *res) +{ + GetCInterface()._CallMain(res); +} +bool CInterface::_isMethod(const char* className, const char* methodName) const +{ + if (mIsMethodCallback) + return mIsMethodCallback(className, methodName); + + return NULL; +} + +const char* CInterface::_CallFunction(const char* nameSpace, const char* name, const char **argv, int argc, bool *result) const +{ + if (mFunctionCallback) + return mFunctionCallback(nameSpace, name, argv, argc, result); + + *result = false; + return NULL; +} + +const char* CInterface::_CallMethod(const char* className, const char* classNamespace, U32 object, const char* name, const char **argv, int argc, bool *res) const +{ + if (mMethodCallback) + return mMethodCallback(className, classNamespace, object, name, argv, argc, res); + + *res = false; + return NULL; +} + +void CInterface::_CallMain(bool *res) const +{ + if (mMainCallback) + { + *res = true; + mMainCallback(); + return; + } + + *res = false; +} + +TORQUE_API void SetCallbacks(void* ptr, void* methodPtr, void* isMethodPtr, void* mainPtr) { + CInterface::GetCInterface().SetCallFunctionCallback(ptr); + CInterface::GetCInterface().SetCallMethodCallback(methodPtr); + CInterface::GetCInterface().SetCallIsMethodCallback(isMethodPtr); + CInterface::GetCInterface().SetMainCallback(mainPtr); +} \ No newline at end of file diff --git a/Engine/source/cinterface/cinterface.h b/Engine/source/cinterface/cinterface.h index d7f839331..a1dcbcc9e 100644 --- a/Engine/source/cinterface/cinterface.h +++ b/Engine/source/cinterface/cinterface.h @@ -21,10 +21,41 @@ //----------------------------------------------------------------------------- #pragma once +#include "platform/platformDlibrary.h" +#include "console/engineAPI.h" +#include "console/simBase.h" -// cinterface can override this (useful for plugins, etc) -extern "C" { +#define CALL_CINTERFACE_FUNCTION(name, ...){const char *v[] = { __VA_ARGS__ }; CInterface::CallFunction(name, v, sizeof(v) / sizeof(*v));} -const char* torque_getexecutablepath(); +class CInterface { + typedef bool(*IsMethodCallback)(const char* className, const char* methodName); + typedef void(*CallMainCallback)(); + typedef const char* (*CallFunctionCallback)(const char* nameSpace, const char* name, const char **argv, int argc, bool *result); + typedef const char* (*CallMethodCallback)(const char* className, const char* classNamespace, U32 object, const char* name, const char **argv, int argc, bool *result); + IsMethodCallback mIsMethodCallback; + CallFunctionCallback mFunctionCallback; + CallMethodCallback mMethodCallback; + CallMainCallback mMainCallback; + const char* _CallFunction(const char* nameSpace, const char* name, const char **argv, int argc, bool *result) const; + const char* _CallMethod(const char* className, const char* classNamespace, U32 object, const char* name, const char **argv, int argc, bool *res) const; + void _CallMain(bool *res) const; + bool _isMethod(const char* className, const char* methodName) const; +public: + CInterface() + { + mFunctionCallback = NULL; + mMethodCallback = NULL; + mIsMethodCallback = NULL; + mMainCallback = NULL; + } -} + static const char* CallFunction(const char* nameSpace, const char* name, const char **argv, int argc, bool *result); + static const char* CallMethod(SimObject* obj, const char* name, const char **argv, int argc, bool *res); + static void CallMain(bool *res); + static bool isMethod(const char* className, const char* methodName); + static CInterface& GetCInterface(); + void SetCallFunctionCallback(void* ptr) { mFunctionCallback = (CallFunctionCallback)ptr; }; + void SetCallMethodCallback(void* ptr) { mMethodCallback = (CallMethodCallback)ptr; }; + void SetCallIsMethodCallback(void* ptr) { mIsMethodCallback = (IsMethodCallback)ptr; }; + void SetMainCallback(void* ptr) { mMainCallback = (CallMainCallback)ptr; }; +}; \ No newline at end of file diff --git a/Engine/source/console/SimXMLDocument.cpp b/Engine/source/console/SimXMLDocument.cpp index 156533503..df45888d1 100644 --- a/Engine/source/console/SimXMLDocument.cpp +++ b/Engine/source/console/SimXMLDocument.cpp @@ -571,7 +571,7 @@ DefineEngineMethod( SimXMLDocument, attribute, const char*, ( const char* attrib } // These two methods don't make a lot of sense the way TS works. Leaving them in for backwards-compatibility. -DefineConsoleMethod( SimXMLDocument, attributeF32, F32, (const char * attributeName), , "(string attributeName)" +DefineEngineMethod( SimXMLDocument, attributeF32, F32, (const char * attributeName), , "(string attributeName)" "@brief Get float attribute from the current Element on the stack.\n\n" "@param attributeName Name of attribute to retrieve.\n" "@return The value of the given attribute in the form of a float.\n" @@ -580,7 +580,7 @@ DefineConsoleMethod( SimXMLDocument, attributeF32, F32, (const char * attributeN return dAtof( object->attribute( attributeName ) ); } -DefineConsoleMethod(SimXMLDocument, attributeS32, S32, (const char * attributeName), , "(string attributeName)" +DefineEngineMethod(SimXMLDocument, attributeS32, S32, (const char * attributeName), , "(string attributeName)" "@brief Get int attribute from the current Element on the stack.\n\n" "@param attributeName Name of attribute to retrieve.\n" "@return The value of the given attribute in the form of an integer.\n" diff --git a/Engine/source/console/codeInterpreter.cpp b/Engine/source/console/codeInterpreter.cpp index 5cb069f9c..186354869 100644 --- a/Engine/source/console/codeInterpreter.cpp +++ b/Engine/source/console/codeInterpreter.cpp @@ -37,6 +37,7 @@ #include "core/strings/stringUnit.h" #include "console/console.h" #include "console/consoleInternal.h" +#include "cinterface/cinterface.h" //#define TORQUE_VALIDATE_STACK @@ -2023,7 +2024,7 @@ OPCodeReturn CodeInterpreter::op_callfunc_resolve(U32 &ip) // Try to look it up. mNSEntry = Namespace::find(fnNamespace)->lookup(fnName); - if (!mNSEntry) + if (!CInterface::GetCInterface().isMethod(fnNamespace, fnName) && !mNSEntry) { ip += 5; Con::warnf(ConsoleLogEntry::General, @@ -2051,6 +2052,7 @@ OPCodeReturn CodeInterpreter::op_callfunc(U32 &ip) U32 *code = mCodeBlock->code; + StringTableEntry fnNamespace = CodeToSTE(mCodeBlock->code, ip + 2); StringTableEntry fnName = CodeToSTE(code, ip); //if this is called from inside a function, append the ip and codeptr @@ -2068,10 +2070,16 @@ OPCodeReturn CodeInterpreter::op_callfunc(U32 &ip) const char *componentReturnValue = ""; Namespace *ns = NULL; + bool cFunctionRes = false; + const char* cRetRes = NULL; + if (callType == FuncCallExprNode::FunctionCall) { if (!mNSEntry) mNSEntry = Namespace::global()->lookup(fnName); + + StringStackWrapper args(mCallArgc, mCallArgv); + cRetRes = CInterface::GetCInterface().CallFunction(fnNamespace, fnName, args.argv, args.argc, &cFunctionRes); } else if (callType == FuncCallExprNode::MethodCall) { @@ -2102,6 +2110,9 @@ OPCodeReturn CodeInterpreter::op_callfunc(U32 &ip) mNSEntry = ns->lookup(fnName); else mNSEntry = NULL; + + StringStackWrapper args(mCallArgc, mCallArgv); + cRetRes = CInterface::GetCInterface().CallMethod(gEvalState.thisObject, fnName, args.argv, args.argc, &cFunctionRes); } else // it's a ParentCall { @@ -2128,7 +2139,7 @@ OPCodeReturn CodeInterpreter::op_callfunc(U32 &ip) nsUsage = mNSEntry->mUsage; routingId = 0; } - if (!mNSEntry || mExec.noCalls) + if (!cFunctionRes && (!mNSEntry || mExec.noCalls)) { if (!mExec.noCalls && !(routingId == MethodOnComponent)) { @@ -2167,11 +2178,19 @@ OPCodeReturn CodeInterpreter::op_callfunc(U32 &ip) // ConsoleFunctionType is for any function defined by script. // Any 'callback' type is an engine function that is exposed to script. - if (mNSEntry->mType == Namespace::Entry::ConsoleFunctionType) + if (mNSEntry->mType == Namespace::Entry::ConsoleFunctionType + || cFunctionRes) { ConsoleValueRef ret; - if (mNSEntry->mFunctionOffset) + if (cFunctionRes) + { + StringStackConsoleWrapper retVal(1, &cRetRes); + ret = retVal.argv[0]; + } + else if (mNSEntry->mFunctionOffset) + { ret = mNSEntry->mCode->exec(mNSEntry->mFunctionOffset, fnName, mNSEntry->mNamespace, mCallArgc, mCallArgv, false, mNSEntry->mPackage); + } STR.popFrame(); // Functions are assumed to return strings, so look ahead to see if we can skip the conversion diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index 219f00c59..d9e86e1c2 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -40,6 +40,7 @@ #include #include "platform/threads/mutex.h" #include "core/util/journal/journal.h" +#include "cinterface/cinterface.h" extern StringStack STR; extern ConsoleValueStack CSTK; @@ -277,7 +278,7 @@ bool useTimestamp = false; ConsoleFunctionGroupBegin( Clipboard, "Miscellaneous functions to control the clipboard and clear the console."); -DefineConsoleFunction( cls, void, (), , "()" +DefineEngineFunction( cls, void, (), , "()" "@brief Clears the console output.\n\n" "@ingroup Console") { @@ -287,14 +288,14 @@ DefineConsoleFunction( cls, void, (), , "()" consoleLog.setSize(0); }; -DefineConsoleFunction( getClipboard, const char*, (), , "()" +DefineEngineFunction( getClipboard, const char*, (), , "()" "@brief Get text from the clipboard.\n\n" "@internal") { return Platform::getClipboard(); }; -DefineConsoleFunction( setClipboard, bool, (const char* text), , "(string text)" +DefineEngineFunction( setClipboard, bool, (const char* text), , "(string text)" "@brief Set the system clipboard.\n\n" "@internal") { @@ -1488,6 +1489,18 @@ ConsoleValueRef evaluatef(const char* string, ...) // Internal execute for global function which does not save the stack ConsoleValueRef _internalExecute(S32 argc, ConsoleValueRef argv[]) { + const char** argv_str = static_cast(malloc((argc - 1) * sizeof(char *))); + for (int i = 0; i < argc - 1; i++) + { + argv_str[i] = argv[i + 1]; + } + bool result; + const char* methodRes = CInterface::CallFunction(NULL, argv[0], argv_str, argc - 1, &result); + if (result) + { + return ConsoleValueRef::fromValue(CSTK.pushString(methodRes)); + } + Namespace::Entry *ent; StringTableEntry funcName = StringTable->insert(argv[0]); ent = Namespace::global()->lookup(funcName); @@ -1559,6 +1572,18 @@ ConsoleValueRef _internalExecute(SimObject *object, S32 argc, ConsoleValueRef ar } } + const char** argv_str = static_cast(malloc((argc - 2) * sizeof(char *))); + for (int i = 0; i < argc - 2; i++) + { + argv_str[i] = argv[i + 2]; + } + bool result; + const char* methodRes = CInterface::CallMethod(object, argv[0], argv_str, argc - 2, &result); + if (result) + { + return ConsoleValueRef::fromValue(CSTK.pushString(methodRes)); + } + if(object->getNamespace()) { U32 ident = object->getId(); @@ -1655,6 +1680,7 @@ inline ConsoleValueRef _executef(S32 checkArgc, S32 argc, ConsoleValueRef *argv) //------------------------------------------------------------------------------ bool isFunction(const char *fn) { + if (CInterface::isMethod(NULL, fn)) return true; const char *string = StringTable->lookup(fn); if(!string) return false; diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index 67138d06c..4c07e926b 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -1191,11 +1191,6 @@ public: # define ConsoleFunctionGroupBegin(groupName, usage) \ static ConsoleConstructor cfg_ConsoleFunctionGroup_##groupName##_GroupBegin(NULL,#groupName,usage) -# define ConsoleFunction(name,returnType,minArgs,maxArgs,usage1) \ - returnType cf_##name(SimObject *, S32, ConsoleValueRef *argv); \ - ConsoleConstructor cc_##name##_obj(NULL,#name,cf_##name,usage1,minArgs,maxArgs); \ - returnType cf_##name(SimObject *, S32 argc, ConsoleValueRef *argv) - # define ConsoleToolFunction(name,returnType,minArgs,maxArgs,usage1) \ returnType ctf_##name(SimObject *, S32, ConsoleValueRef *argv); \ ConsoleConstructor cc_##name##_obj(NULL,#name,ctf_##name,usage1,minArgs,maxArgs, true); \ @@ -1211,24 +1206,6 @@ public: # define ConsoleMethodGroupBegin(className, groupName, usage) \ static ConsoleConstructor cc_##className##_##groupName##_GroupBegin(#className,#groupName,usage) -# define ConsoleMethod(className,name,returnType,minArgs,maxArgs,usage1) \ - inline returnType cm_##className##_##name(className *, S32, ConsoleValueRef *argv); \ - returnType cm_##className##_##name##_caster(SimObject *object, S32 argc, ConsoleValueRef *argv) { \ - AssertFatal( dynamic_cast( object ), "Object passed to " #name " is not a " #className "!" ); \ - conmethod_return_##returnType ) cm_##className##_##name(static_cast(object),argc,argv); \ - }; \ - ConsoleConstructor cc_##className##_##name##_obj(#className,#name,cm_##className##_##name##_caster,usage1,minArgs,maxArgs); \ - inline returnType cm_##className##_##name(className *object, S32 argc, ConsoleValueRef *argv) - -# define ConsoleStaticMethod(className,name,returnType,minArgs,maxArgs,usage1) \ - inline returnType cm_##className##_##name(S32, ConsoleValueRef *); \ - returnType cm_##className##_##name##_caster(SimObject *object, S32 argc, ConsoleValueRef *argv) { \ - conmethod_return_##returnType ) cm_##className##_##name(argc,argv); \ - }; \ - ConsoleConstructor \ - cc_##className##_##name##_obj(#className,#name,cm_##className##_##name##_caster,usage1,minArgs,maxArgs); \ - inline returnType cm_##className##_##name(S32 argc, ConsoleValueRef *argv) - # define ConsoleMethodGroupEnd(className, groupName) \ static ConsoleConstructor cc_##className##_##groupName##_GroupEnd(#className,#groupName,NULL) @@ -1268,15 +1245,6 @@ public: className##name##obj(#className,#name,c##className##name##caster,"",minArgs,maxArgs); \ static inline returnType c##className##name(className *object, S32 argc, ConsoleValueRef *argv) -# define ConsoleStaticMethod(className,name,returnType,minArgs,maxArgs,usage1) \ - static inline returnType c##className##name(S32, ConsoleValueRef*); \ - static returnType c##className##name##caster(SimObject *object, S32 argc, ConsoleValueRef *argv) { \ - conmethod_return_##returnType ) c##className##name(argc,argv); \ - }; \ - static ConsoleConstructor \ - className##name##obj(#className,#name,c##className##name##caster,"",minArgs,maxArgs); \ - static inline returnType c##className##name(S32 argc, ConsoleValueRef *argv) - #define ConsoleDoc( text ) #endif diff --git a/Engine/source/console/consoleDoc.cpp b/Engine/source/console/consoleDoc.cpp index d9ff78020..8e190c11a 100644 --- a/Engine/source/console/consoleDoc.cpp +++ b/Engine/source/console/consoleDoc.cpp @@ -41,7 +41,7 @@ ConsoleFunctionGroupBegin(ConsoleDoc, "Console self-documentation functions. These output psuedo C++ suitable for feeeding through Doxygen or another auto documentation tool."); -DefineConsoleFunction( dumpConsoleClasses, void, (bool dumpScript, bool dumpEngine), ( true, true ), +DefineEngineFunction( dumpConsoleClasses, void, (bool dumpScript, bool dumpEngine), ( true, true ), "@brief Dumps all declared console classes to the console.\n\n" "@param dumpScript Optional parameter specifying whether or not classes defined in script should be dumped.\n" "@param dumpEngine Optional parameter specifying whether or not classes defined in the engine should be dumped.\n" @@ -50,7 +50,7 @@ DefineConsoleFunction( dumpConsoleClasses, void, (bool dumpScript, bool dumpEngi Namespace::dumpClasses( dumpScript, dumpEngine ); } -DefineConsoleFunction(dumpConsoleFunctions, void, ( bool dumpScript, bool dumpEngine ), ( true, true ), +DefineEngineFunction(dumpConsoleFunctions, void, ( bool dumpScript, bool dumpEngine ), ( true, true ), "@brief Dumps all declared console functions to the console.\n" "@param dumpScript Optional parameter specifying whether or not functions defined in script should be dumped.\n" "@param dumpEngine Optional parameter specitying whether or not functions defined in the engine should be dumped.\n" diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index fc14af173..b7ef6b5ee 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -184,7 +184,7 @@ bool isValidPort(U16 port) //----------------------------------------------------------------------------- -DefineConsoleFunction( strasc, int, ( const char* chr ),, +DefineEngineFunction( strasc, int, ( const char* chr ),, "Return the integer character code value corresponding to the first character in the given string.\n" "@param chr a (one-character) string.\n" "@return the UTF32 code value for the first character in the given string.\n" @@ -195,7 +195,7 @@ DefineConsoleFunction( strasc, int, ( const char* chr ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strformat, const char*, ( const char* format, const char* value ),, +DefineEngineFunction( strformat, const char*, ( const char* format, const char* value ),, "Format the given value as a string using printf-style formatting.\n" "@param format A printf-style format string.\n" "@param value The value argument matching the given format string.\n\n" @@ -252,7 +252,7 @@ DefineConsoleFunction( strformat, const char*, ( const char* format, const char* //----------------------------------------------------------------------------- -DefineConsoleFunction( strcmp, S32, ( const char* str1, const char* str2 ),, +DefineEngineFunction( strcmp, S32, ( const char* str1, const char* str2 ),, "Compares two strings using case-sensitive comparison.\n" "@param str1 The first string.\n" "@param str2 The second string.\n" @@ -271,7 +271,7 @@ DefineConsoleFunction( strcmp, S32, ( const char* str1, const char* str2 ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( stricmp, S32, ( const char* str1, const char* str2 ),, +DefineEngineFunction( stricmp, S32, ( const char* str1, const char* str2 ),, "Compares two strings using case-insensitive comparison.\n" "@param str1 The first string.\n" "@param str2 The second string.\n" @@ -290,7 +290,7 @@ DefineConsoleFunction( stricmp, S32, ( const char* str1, const char* str2 ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strnatcmp, S32, ( const char* str1, const char* str2 ),, +DefineEngineFunction( strnatcmp, S32, ( const char* str1, const char* str2 ),, "Compares two strings using \"natural order\" case-sensitive comparison.\n" "Natural order means that rather than solely comparing single character code values, strings are ordered in a " "natural way. For example, the string \"hello10\" is considered greater than the string \"hello2\" even though " @@ -325,7 +325,7 @@ DefineConsoleFunction( strnatcmp, S32, ( const char* str1, const char* str2 ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strinatcmp, S32, ( const char* str1, const char* str2 ),, +DefineEngineFunction( strinatcmp, S32, ( const char* str1, const char* str2 ),, "Compares two strings using \"natural order\" case-insensitive comparison.\n" "Natural order means that rather than solely comparing single character code values, strings are ordered in a " "natural way. For example, the string \"hello10\" is considered greater than the string \"hello2\" even though " @@ -360,7 +360,7 @@ DefineConsoleFunction( strinatcmp, S32, ( const char* str1, const char* str2 ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strlen, S32, ( const char* str ),, +DefineEngineFunction( strlen, S32, ( const char* str ),, "Get the length of the given string in bytes.\n" "@note This does not return a true character count for strings with multi-byte characters!\n" "@param str A string.\n" @@ -371,7 +371,7 @@ DefineConsoleFunction( strlen, S32, ( const char* str ),, } //----------------------------------------------------------------------------- -DefineConsoleFunction( strlenskip, S32, ( const char* str, const char* first, const char* last ),, +DefineEngineFunction( strlenskip, S32, ( const char* str, const char* first, const char* last ),, "Calculate the length of a string in characters, skipping everything between and including first and last.\n" "@param str A string.\n" "@param first First character to look for to skip block of text.\n" @@ -406,7 +406,7 @@ DefineConsoleFunction( strlenskip, S32, ( const char* str, const char* first, co //----------------------------------------------------------------------------- -DefineConsoleFunction( strstr, S32, ( const char* string, const char* substring ),, +DefineEngineFunction( strstr, S32, ( const char* string, const char* substring ),, "Find the start of @a substring in the given @a string searching from left to right.\n" "@param string The string to search.\n" "@param substring The string to search for.\n" @@ -425,7 +425,7 @@ DefineConsoleFunction( strstr, S32, ( const char* string, const char* substring //----------------------------------------------------------------------------- -DefineConsoleFunction( strpos, S32, ( const char* haystack, const char* needle, S32 offset ), ( 0 ), +DefineEngineFunction( strpos, S32, ( const char* haystack, const char* needle, S32 offset ), ( 0 ), "Find the start of @a needle in @a haystack searching from left to right beginning at the given offset.\n" "@param haystack The string to search.\n" "@param needle The string to search for.\n" @@ -450,7 +450,7 @@ DefineConsoleFunction( strpos, S32, ( const char* haystack, const char* needle, //----------------------------------------------------------------------------- -DefineConsoleFunction( strposr, S32, ( const char* haystack, const char* needle, S32 offset ), ( 0 ), +DefineEngineFunction( strposr, S32, ( const char* haystack, const char* needle, S32 offset ), ( 0 ), "Find the start of @a needle in @a haystack searching from right to left beginning at the given offset.\n" "@param haystack The string to search.\n" "@param needle The string to search for.\n" @@ -477,7 +477,7 @@ DefineConsoleFunction( strposr, S32, ( const char* haystack, const char* needle, //----------------------------------------------------------------------------- -DefineConsoleFunction( ltrim, const char*, ( const char* str ),, +DefineEngineFunction( ltrim, const char*, ( const char* str ),, "Remove leading whitespace from the string.\n" "@param str A string.\n" "@return A string that is the same as @a str but with any leading (i.e. leftmost) whitespace removed.\n\n" @@ -496,7 +496,7 @@ DefineConsoleFunction( ltrim, const char*, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( rtrim, const char*, ( const char* str ),, +DefineEngineFunction( rtrim, const char*, ( const char* str ),, "Remove trailing whitespace from the string.\n" "@param str A string.\n" "@return A string that is the same as @a str but with any trailing (i.e. rightmost) whitespace removed.\n\n" @@ -523,7 +523,7 @@ DefineConsoleFunction( rtrim, const char*, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( trim, const char*, ( const char* str ),, +DefineEngineFunction( trim, const char*, ( const char* str ),, "Remove leading and trailing whitespace from the string.\n" "@param str A string.\n" "@return A string that is the same as @a str but with any leading (i.e. leftmost) and trailing (i.e. rightmost) whitespace removed.\n\n" @@ -551,7 +551,7 @@ DefineConsoleFunction( trim, const char*, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( stripChars, const char*, ( const char* str, const char* chars ),, +DefineEngineFunction( stripChars, const char*, ( const char* str, const char* chars ),, "Remove all occurrences of characters contained in @a chars from @a str.\n" "@param str The string to filter characters out from.\n" "@param chars A string of characters to filter out from @a str.\n" @@ -575,7 +575,7 @@ DefineConsoleFunction( stripChars, const char*, ( const char* str, const char* c //----------------------------------------------------------------------------- -DefineConsoleFunction( strlwr, const char*, ( const char* str ),, +DefineEngineFunction( strlwr, const char*, ( const char* str ),, "Return an all lower-case version of the given string.\n" "@param str A string.\n" "@return A version of @a str with all characters converted to lower-case.\n\n" @@ -593,7 +593,7 @@ DefineConsoleFunction( strlwr, const char*, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strupr, const char*, ( const char* str ),, +DefineEngineFunction( strupr, const char*, ( const char* str ),, "Return an all upper-case version of the given string.\n" "@param str A string.\n" "@return A version of @a str with all characters converted to upper-case.\n\n" @@ -611,7 +611,7 @@ DefineConsoleFunction( strupr, const char*, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( strchr, const char*, ( const char* str, const char* chr ),, +DefineEngineFunction( strchr, const char*, ( const char* str, const char* chr ),, "Find the first occurrence of the given character in @a str.\n" "@param str The string to search.\n" "@param chr The character to search for. Only the first character from the string is taken.\n" @@ -625,7 +625,7 @@ DefineConsoleFunction( strchr, const char*, ( const char* str, const char* chr ) //----------------------------------------------------------------------------- -DefineConsoleFunction( strrchr, const char*, ( const char* str, const char* chr ),, +DefineEngineFunction( strrchr, const char*, ( const char* str, const char* chr ),, "Find the last occurrence of the given character in @a str." "@param str The string to search.\n" "@param chr The character to search for. Only the first character from the string is taken.\n" @@ -639,7 +639,7 @@ DefineConsoleFunction( strrchr, const char*, ( const char* str, const char* chr //----------------------------------------------------------------------------- -DefineConsoleFunction( strreplace, const char*, ( const char* source, const char* from, const char* to ),, +DefineEngineFunction( strreplace, const char*, ( const char* source, const char* from, const char* to ),, "Replace all occurrences of @a from in @a source with @a to.\n" "@param source The string in which to replace the occurrences of @a from.\n" "@param from The string to replace in @a source.\n" @@ -690,7 +690,7 @@ DefineConsoleFunction( strreplace, const char*, ( const char* source, const char //----------------------------------------------------------------------------- -DefineConsoleFunction( strrepeat, const char*, ( const char* str, S32 numTimes, const char* delimiter ), ( "" ), +DefineEngineFunction( strrepeat, const char*, ( const char* str, S32 numTimes, const char* delimiter ), ( "" ), "Return a string that repeats @a str @a numTimes number of times delimiting each occurrence with @a delimiter.\n" "@param str The string to repeat multiple times.\n" "@param numTimes The number of times to repeat @a str in the result string.\n" @@ -717,7 +717,7 @@ DefineConsoleFunction( strrepeat, const char*, ( const char* str, S32 numTimes, //----------------------------------------------------------------------------- -DefineConsoleFunction( getSubStr, const char*, ( const char* str, S32 start, S32 numChars ), ( -1 ), +DefineEngineFunction( getSubStr, const char*, ( const char* str, S32 start, S32 numChars ), ( -1 ), "@brief Return a substring of @a str starting at @a start and continuing either through to the end of @a str " "(if @a numChars is -1) or for @a numChars characters (except if this would exceed the actual source " "string length).\n" @@ -758,7 +758,7 @@ DefineConsoleFunction( getSubStr, const char*, ( const char* str, S32 start, S32 //----------------------------------------------------------------------------- -DefineConsoleFunction( strIsMatchExpr, bool, ( const char* pattern, const char* str, bool caseSensitive ), ( false ), +DefineEngineFunction( strIsMatchExpr, bool, ( const char* pattern, const char* str, bool caseSensitive ), ( false ), "Match a pattern against a string.\n" "@param pattern The wildcard pattern to match against. The pattern can include characters, '*' to match " "any number of characters and '?' to match a single character.\n" @@ -777,7 +777,7 @@ DefineConsoleFunction( strIsMatchExpr, bool, ( const char* pattern, const char* //----------------------------------------------------------------------------- -DefineConsoleFunction( strIsMatchMultipleExpr, bool, ( const char* patterns, const char* str, bool caseSensitive ), ( false ), +DefineEngineFunction( strIsMatchMultipleExpr, bool, ( const char* patterns, const char* str, bool caseSensitive ), ( false ), "Match a multiple patterns against a single string.\n" "@param patterns A tab-separated list of patterns. Each pattern can include charaters, '*' to match " "any number of characters and '?' to match a single character. Each of the patterns is tried in turn.\n" @@ -796,7 +796,7 @@ DefineConsoleFunction( strIsMatchMultipleExpr, bool, ( const char* patterns, con //----------------------------------------------------------------------------- -DefineConsoleFunction( getTrailingNumber, S32, ( const char* str ),, +DefineEngineFunction( getTrailingNumber, S32, ( const char* str ),, "Get the numeric suffix of the given input string.\n" "@param str The string from which to read out the numeric suffix.\n" "@return The numeric value of the number suffix of @a str or -1 if @a str has no such suffix.\n\n" @@ -813,7 +813,7 @@ DefineConsoleFunction( getTrailingNumber, S32, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( stripTrailingNumber, String, ( const char* str ),, +DefineEngineFunction( stripTrailingNumber, String, ( const char* str ),, "Strip a numeric suffix from the given string.\n" "@param str The string from which to strip its numeric suffix.\n" "@return The string @a str without its number suffix or the original string @a str if it has no such suffix.\n\n" @@ -829,7 +829,7 @@ DefineConsoleFunction( stripTrailingNumber, String, ( const char* str ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( getFirstNumber, String, ( const char* str ),, +DefineEngineFunction( getFirstNumber, String, ( const char* str ),, "Get the first occuring number from @a str.\n" "@param str The string from which to read out the first number.\n" "@return String representation of the number or "" if no number.\n\n") @@ -841,7 +841,7 @@ DefineConsoleFunction( getFirstNumber, String, ( const char* str ),, //---------------------------------------------------------------- -DefineConsoleFunction( isspace, bool, ( const char* str, S32 index ),, +DefineEngineFunction( isspace, bool, ( const char* str, S32 index ),, "Test whether the character at the given position is a whitespace character.\n" "Characters such as tab, space, or newline are considered whitespace.\n" "@param str The string to test.\n" @@ -858,7 +858,7 @@ DefineConsoleFunction( isspace, bool, ( const char* str, S32 index ),, //---------------------------------------------------------------- -DefineConsoleFunction( isalnum, bool, ( const char* str, S32 index ),, +DefineEngineFunction( isalnum, bool, ( const char* str, S32 index ),, "Test whether the character at the given position is an alpha-numeric character.\n" "Alpha-numeric characters are characters that are either alphabetic (a-z, A-Z) or numbers (0-9).\n" "@param str The string to test.\n" @@ -875,7 +875,7 @@ DefineConsoleFunction( isalnum, bool, ( const char* str, S32 index ),, //---------------------------------------------------------------- -DefineConsoleFunction( startsWith, bool, ( const char* str, const char* prefix, bool caseSensitive ), ( false ), +DefineEngineFunction( startsWith, bool, ( const char* str, const char* prefix, bool caseSensitive ), ( false ), "Test whether the given string begins with the given prefix.\n" "@param str The string to test.\n" "@param prefix The potential prefix of @a str.\n" @@ -924,7 +924,7 @@ DefineConsoleFunction( startsWith, bool, ( const char* str, const char* prefix, //---------------------------------------------------------------- -DefineConsoleFunction( endsWith, bool, ( const char* str, const char* suffix, bool caseSensitive ), ( false ), +DefineEngineFunction( endsWith, bool, ( const char* str, const char* suffix, bool caseSensitive ), ( false ), "@brief Test whether the given string ends with the given suffix.\n\n" "@param str The string to test.\n" "@param suffix The potential suffix of @a str.\n" @@ -978,7 +978,7 @@ DefineConsoleFunction( endsWith, bool, ( const char* str, const char* suffix, bo //---------------------------------------------------------------- -DefineConsoleFunction( strchrpos, S32, ( const char* str, const char* chr, S32 start ), ( 0 ), +DefineEngineFunction( strchrpos, S32, ( const char* str, const char* chr, S32 start ), ( 0 ), "Find the first occurrence of the given character in the given string.\n" "@param str The string to search.\n" "@param chr The character to look for. Only the first character of this string will be searched for.\n" @@ -998,7 +998,7 @@ DefineConsoleFunction( strchrpos, S32, ( const char* str, const char* chr, S32 s //---------------------------------------------------------------- -DefineConsoleFunction( strrchrpos, S32, ( const char* str, const char* chr, S32 start ), ( 0 ), +DefineEngineFunction( strrchrpos, S32, ( const char* str, const char* chr, S32 start ), ( 0 ), "Find the last occurrence of the given character in the given string.\n" "@param str The string to search.\n" "@param chr The character to look for. Only the first character of this string will be searched for.\n" @@ -1025,7 +1025,7 @@ DefineConsoleFunction( strrchrpos, S32, ( const char* str, const char* chr, S32 //---------------------------------------------------------------- -DefineConsoleFunction(ColorFloatToInt, ColorI, (LinearColorF color), , +DefineEngineFunction(ColorFloatToInt, ColorI, (LinearColorF color), , "Convert from a float color to an integer color (0.0 - 1.0 to 0 to 255).\n" "@param color Float color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha.\n" "@return Converted color value (0 - 255)\n\n" @@ -1037,7 +1037,7 @@ DefineConsoleFunction(ColorFloatToInt, ColorI, (LinearColorF color), , return color.toColorI(); } -DefineConsoleFunction(ColorIntToFloat, LinearColorF, (ColorI color), , +DefineEngineFunction(ColorIntToFloat, LinearColorF, (ColorI color), , "Convert from a integer color to an float color (0 to 255 to 0.0 - 1.0).\n" "@param color Integer color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha.\n" "@return Converted color value (0.0 - 1.0)\n\n" @@ -1049,7 +1049,7 @@ DefineConsoleFunction(ColorIntToFloat, LinearColorF, (ColorI color), , return LinearColorF(color); } -DefineConsoleFunction(ColorRGBToHEX, const char*, (ColorI color), , +DefineEngineFunction(ColorRGBToHEX, const char*, (ColorI color), , "Convert from a integer RGB (red, green, blue) color to hex color value (0 to 255 to 00 - FF).\n" "@param color Integer color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha. It excepts an alpha, but keep in mind this will not be converted.\n" "@return Hex color value (#000000 - #FFFFFF), alpha isn't handled/converted so it is only the RGB value\n\n" @@ -1061,7 +1061,7 @@ DefineConsoleFunction(ColorRGBToHEX, const char*, (ColorI color), , return Con::getReturnBuffer(color.getHex()); } -DefineConsoleFunction(ColorRGBToHSB, const char*, (ColorI color), , +DefineEngineFunction(ColorRGBToHSB, const char*, (ColorI color), , "Convert from a integer RGB (red, green, blue) color to HSB (hue, saturation, brightness). HSB is also know as HSL or HSV as well, with the last letter standing for lightness or value.\n" "@param color Integer color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha. It excepts an alpha, but keep in mind this will not be converted.\n" "@return HSB color value, alpha isn't handled/converted so it is only the RGB value\n\n" @@ -1075,7 +1075,7 @@ DefineConsoleFunction(ColorRGBToHSB, const char*, (ColorI color), , return Con::getReturnBuffer(s); } -DefineConsoleFunction(ColorHEXToRGB, ColorI, (const char* hex), , +DefineEngineFunction(ColorHEXToRGB, ColorI, (const char* hex), , "Convert from a hex color value to an integer RGB (red, green, blue) color (00 - FF to 0 to 255).\n" "@param hex Hex color value (#000000 - #FFFFFF) to be converted to an RGB (red, green, blue) value.\n" "@return Integer color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha. Alpha isn't handled/converted so only pay attention to the RGB value\n\n" @@ -1089,7 +1089,7 @@ DefineConsoleFunction(ColorHEXToRGB, ColorI, (const char* hex), , return color; } -DefineConsoleFunction(ColorHSBToRGB, ColorI, (Point3I hsb), , +DefineEngineFunction(ColorHSBToRGB, ColorI, (Point3I hsb), , "Convert from a HSB (hue, saturation, brightness) to an integer RGB (red, green, blue) color. HSB is also know as HSL or HSV as well, with the last letter standing for lightness or value.\n" "@param hsb HSB (hue, saturation, brightness) value to be converted.\n" "@return Integer color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha. Alpha isn't handled/converted so only pay attention to the RGB value\n\n" @@ -1105,7 +1105,7 @@ DefineConsoleFunction(ColorHSBToRGB, ColorI, (Point3I hsb), , //---------------------------------------------------------------- -DefineConsoleFunction( strToggleCaseToWords, const char*, ( const char* str ),, +DefineEngineFunction( strToggleCaseToWords, const char*, ( const char* str ),, "Parse a Toggle Case word into separate words.\n" "@param str The string to parse.\n" "@return new string space separated.\n\n" @@ -1130,7 +1130,7 @@ DefineConsoleFunction( strToggleCaseToWords, const char*, ( const char* str ),, //---------------------------------------------------------------- // Warning: isInt and isFloat are very 'strict' and might need to be adjusted to allow other values. //seanmc -DefineConsoleFunction( isInt, bool, ( const char* str),, +DefineEngineFunction( isInt, bool, ( const char* str),, "Returns true if the string is an integer.\n" "@param str The string to test.\n" "@return true if @a str is an integer and false if not\n\n" @@ -1144,7 +1144,7 @@ DefineConsoleFunction( isInt, bool, ( const char* str),, //---------------------------------------------------------------- -DefineConsoleFunction( isFloat, bool, ( const char* str, bool sciOk), (false), +DefineEngineFunction( isFloat, bool, ( const char* str, bool sciOk), (false), "Returns true if the string is a float.\n" "@param str The string to test.\n" "@param sciOk Test for correct scientific notation and accept it (ex. 1.2e+14)" @@ -1159,7 +1159,7 @@ DefineConsoleFunction( isFloat, bool, ( const char* str, bool sciOk), (false), //---------------------------------------------------------------- -DefineConsoleFunction( isValidPort, bool, ( const char* str),, +DefineEngineFunction( isValidPort, bool, ( const char* str),, "Returns true if the string is a valid port number.\n" "@param str The string to test.\n" "@return true if @a str is a port and false if not\n\n" @@ -1179,7 +1179,7 @@ DefineConsoleFunction( isValidPort, bool, ( const char* str),, //---------------------------------------------------------------- -DefineConsoleFunction( isValidIP, bool, ( const char* str),, +DefineEngineFunction( isValidIP, bool, ( const char* str),, "Returns true if the string is a valid ip address, excepts localhost.\n" "@param str The string to test.\n" "@return true if @a str is a valid ip address and false if not\n\n" @@ -1200,7 +1200,7 @@ DefineConsoleFunction( isValidIP, bool, ( const char* str),, // Torque won't normally add another string if it already exists with another casing, // so this forces the addition. It should be called once near the start, such as in main.cs. -ConsoleFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]" +DefineEngineStringlyVariadicFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]" "Adds case sensitive strings to the StringTable.") { for(int i = 1; i < argc; i++) @@ -1214,7 +1214,7 @@ ConsoleFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]" //----------------------------------------------------------------------------- -DefineConsoleFunction( getWord, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( getWord, const char*, ( const char* text, S32 index ),, "Extract the word at the given @a index in the whitespace-separated list in @a text.\n" "Words in @a text must be separated by newlines, spaces, and/or tabs.\n" "@param text A whitespace-separated list of words.\n" @@ -1235,7 +1235,7 @@ DefineConsoleFunction( getWord, const char*, ( const char* text, S32 index ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( getWords, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), +DefineEngineFunction( getWords, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), "Extract a range of words from the given @a startIndex onwards thru @a endIndex.\n" "Words in @a text must be separated by newlines, spaces, and/or tabs.\n" "@param text A whitespace-separated list of words.\n" @@ -1262,7 +1262,7 @@ DefineConsoleFunction( getWords, const char*, ( const char* text, S32 startIndex //----------------------------------------------------------------------------- -DefineConsoleFunction( setWord, const char*, ( const char* text, S32 index, const char* replacement ),, +DefineEngineFunction( setWord, const char*, ( const char* text, S32 index, const char* replacement ),, "Replace the word in @a text at the given @a index with @a replacement.\n" "Words in @a text must be separated by newlines, spaces, and/or tabs.\n" "@param text A whitespace-separated list of words.\n" @@ -1284,7 +1284,7 @@ DefineConsoleFunction( setWord, const char*, ( const char* text, S32 index, cons //----------------------------------------------------------------------------- -DefineConsoleFunction( removeWord, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( removeWord, const char*, ( const char* text, S32 index ),, "Remove the word in @a text at the given @a index.\n" "Words in @a text must be separated by newlines, spaces, and/or tabs.\n" "@param text A whitespace-separated list of words.\n" @@ -1304,7 +1304,7 @@ DefineConsoleFunction( removeWord, const char*, ( const char* text, S32 index ), //----------------------------------------------------------------------------- -DefineConsoleFunction( getWordCount, S32, ( const char* text ),, +DefineEngineFunction( getWordCount, S32, ( const char* text ),, "Return the number of whitespace-separated words in @a text.\n" "Words in @a text must be separated by newlines, spaces, and/or tabs.\n" "@param text A whitespace-separated list of words.\n" @@ -1365,7 +1365,7 @@ DefineEngineFunction( weekdayNumToStr, String, ( S32 num, bool abbreviate ), (fa //----------------------------------------------------------------------------- -DefineConsoleFunction( getField, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( getField, const char*, ( const char* text, S32 index ),, "Extract the field at the given @a index in the newline and/or tab separated list in @a text.\n" "Fields in @a text must be separated by newlines and/or tabs.\n" "@param text A list of fields separated by newlines and/or tabs.\n" @@ -1385,7 +1385,7 @@ DefineConsoleFunction( getField, const char*, ( const char* text, S32 index ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( getFields, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), +DefineEngineFunction( getFields, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), "Extract a range of fields from the given @a startIndex onwards thru @a endIndex.\n" "Fields in @a text must be separated by newlines and/or tabs.\n" "@param text A list of fields separated by newlines and/or tabs.\n" @@ -1411,7 +1411,7 @@ DefineConsoleFunction( getFields, const char*, ( const char* text, S32 startInde //----------------------------------------------------------------------------- -DefineConsoleFunction( setField, const char*, ( const char* text, S32 index, const char* replacement ),, +DefineEngineFunction( setField, const char*, ( const char* text, S32 index, const char* replacement ),, "Replace the field in @a text at the given @a index with @a replacement.\n" "Fields in @a text must be separated by newlines and/or tabs.\n" "@param text A list of fields separated by newlines and/or tabs.\n" @@ -1432,7 +1432,7 @@ DefineConsoleFunction( setField, const char*, ( const char* text, S32 index, con //----------------------------------------------------------------------------- -DefineConsoleFunction( removeField, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( removeField, const char*, ( const char* text, S32 index ),, "Remove the field in @a text at the given @a index.\n" "Fields in @a text must be separated by newlines and/or tabs.\n" "@param text A list of fields separated by newlines and/or tabs.\n" @@ -1451,7 +1451,7 @@ DefineConsoleFunction( removeField, const char*, ( const char* text, S32 index ) //----------------------------------------------------------------------------- -DefineConsoleFunction( getFieldCount, S32, ( const char* text ),, +DefineEngineFunction( getFieldCount, S32, ( const char* text ),, "Return the number of newline and/or tab separated fields in @a text.\n" "@param text A list of fields separated by newlines and/or tabs.\n" "@return The number of newline and/or tab sepearated elements in @a text.\n\n" @@ -1467,7 +1467,7 @@ DefineConsoleFunction( getFieldCount, S32, ( const char* text ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( getRecord, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( getRecord, const char*, ( const char* text, S32 index ),, "Extract the record at the given @a index in the newline-separated list in @a text.\n" "Records in @a text must be separated by newlines.\n" "@param text A list of records separated by newlines.\n" @@ -1487,7 +1487,7 @@ DefineConsoleFunction( getRecord, const char*, ( const char* text, S32 index ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( getRecords, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), +DefineEngineFunction( getRecords, const char*, ( const char* text, S32 startIndex, S32 endIndex ), ( -1 ), "Extract a range of records from the given @a startIndex onwards thru @a endIndex.\n" "Records in @a text must be separated by newlines.\n" "@param text A list of records separated by newlines.\n" @@ -1513,7 +1513,7 @@ DefineConsoleFunction( getRecords, const char*, ( const char* text, S32 startInd //----------------------------------------------------------------------------- -DefineConsoleFunction( setRecord, const char*, ( const char* text, S32 index, const char* replacement ),, +DefineEngineFunction( setRecord, const char*, ( const char* text, S32 index, const char* replacement ),, "Replace the record in @a text at the given @a index with @a replacement.\n" "Records in @a text must be separated by newlines.\n" "@param text A list of records separated by newlines.\n" @@ -1534,7 +1534,7 @@ DefineConsoleFunction( setRecord, const char*, ( const char* text, S32 index, co //----------------------------------------------------------------------------- -DefineConsoleFunction( removeRecord, const char*, ( const char* text, S32 index ),, +DefineEngineFunction( removeRecord, const char*, ( const char* text, S32 index ),, "Remove the record in @a text at the given @a index.\n" "Records in @a text must be separated by newlines.\n" "@param text A list of records separated by newlines.\n" @@ -1553,7 +1553,7 @@ DefineConsoleFunction( removeRecord, const char*, ( const char* text, S32 index //----------------------------------------------------------------------------- -DefineConsoleFunction( getRecordCount, S32, ( const char* text ),, +DefineEngineFunction( getRecordCount, S32, ( const char* text ),, "Return the number of newline-separated records in @a text.\n" "@param text A list of records separated by newlines.\n" "@return The number of newline-sepearated elements in @a text.\n\n" @@ -1569,7 +1569,7 @@ DefineConsoleFunction( getRecordCount, S32, ( const char* text ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( firstWord, const char*, ( const char* text ),, +DefineEngineFunction( firstWord, const char*, ( const char* text ),, "Return the first word in @a text.\n" "@param text A list of words separated by newlines, spaces, and/or tabs.\n" "@return The word at index 0 in @a text or \"\" if @a text is empty.\n\n" @@ -1585,7 +1585,7 @@ DefineConsoleFunction( firstWord, const char*, ( const char* text ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( restWords, const char*, ( const char* text ),, +DefineEngineFunction( restWords, const char*, ( const char* text ),, "Return all but the first word in @a text.\n" "@param text A list of words separated by newlines, spaces, and/or tabs.\n" "@return @a text with the first word removed.\n\n" @@ -1619,7 +1619,7 @@ static bool isInSet(char c, const char *set) return false; } -DefineConsoleFunction( nextToken, const char*, ( const char* str1, const char* token, const char* delim), , "( string str, string token, string delimiters ) " +DefineEngineFunction( nextToken, const char*, ( const char* str1, const char* token, const char* delim), , "( string str, string token, string delimiters ) " "Tokenize a string using a set of delimiting characters.\n" "This function first skips all leading charaters in @a str that are contained in @a delimiters. " "From that position, it then scans for the next character in @a str that is contained in @a delimiters and stores all characters " @@ -1688,7 +1688,7 @@ DefineConsoleFunction( nextToken, const char*, ( const char* str1, const char* t //----------------------------------------------------------------------------- -DefineConsoleFunction( getToken, const char*, ( const char* text, const char* delimiters, S32 index ),, +DefineEngineFunction( getToken, const char*, ( const char* text, const char* delimiters, S32 index ),, "Extract the substring at the given @a index in the @a delimiters separated list in @a text.\n" "@param text A @a delimiters list of substrings.\n" "@param delimiters Character or characters that separate the list of substrings in @a text.\n" @@ -1709,7 +1709,7 @@ DefineConsoleFunction( getToken, const char*, ( const char* text, const char* de //----------------------------------------------------------------------------- -DefineConsoleFunction( getTokens, const char*, ( const char* text, const char* delimiters, S32 startIndex, S32 endIndex ), ( -1 ), +DefineEngineFunction( getTokens, const char*, ( const char* text, const char* delimiters, S32 startIndex, S32 endIndex ), ( -1 ), "Extract a range of substrings separated by @a delimiters at the given @a startIndex onwards thru @a endIndex.\n" "@param text A @a delimiters list of substrings.\n" "@param delimiters Character or characters that separate the list of substrings in @a text.\n" @@ -1736,7 +1736,7 @@ DefineConsoleFunction( getTokens, const char*, ( const char* text, const char* d //----------------------------------------------------------------------------- -DefineConsoleFunction( setToken, const char*, ( const char* text, const char* delimiters, S32 index, const char* replacement ),, +DefineEngineFunction( setToken, const char*, ( const char* text, const char* delimiters, S32 index, const char* replacement ),, "Replace the substring in @a text separated by @a delimiters at the given @a index with @a replacement.\n" "@param text A @a delimiters list of substrings.\n" "@param delimiters Character or characters that separate the list of substrings in @a text.\n" @@ -1758,7 +1758,7 @@ DefineConsoleFunction( setToken, const char*, ( const char* text, const char* de //----------------------------------------------------------------------------- -DefineConsoleFunction( removeToken, const char*, ( const char* text, const char* delimiters, S32 index ),, +DefineEngineFunction( removeToken, const char*, ( const char* text, const char* delimiters, S32 index ),, "Remove the substring in @a text separated by @a delimiters at the given @a index.\n" "@param text A @a delimiters list of substrings.\n" "@param delimiters Character or characters that separate the list of substrings in @a text.\n" @@ -1778,7 +1778,7 @@ DefineConsoleFunction( removeToken, const char*, ( const char* text, const char* //----------------------------------------------------------------------------- -DefineConsoleFunction( getTokenCount, S32, ( const char* text, const char* delimiters),, +DefineEngineFunction( getTokenCount, S32, ( const char* text, const char* delimiters),, "Return the number of @a delimiters substrings in @a text.\n" "@param text A @a delimiters list of substrings.\n" "@param delimiters Character or characters that separate the list of substrings in @a text.\n" @@ -1837,7 +1837,7 @@ DefineEngineFunction( detag, const char*, ( const char* str ),, return str; } -DefineConsoleFunction( getTag, const char*, ( const char* textTagString ), , "( string textTagString ) " +DefineEngineFunction( getTag, const char*, ( const char* textTagString ), , "( string textTagString ) " "@brief Extracts the tag from a tagged string\n\n" "Should only be used within the context of a function that receives a tagged " @@ -1879,7 +1879,7 @@ DefineConsoleFunction( getTag, const char*, ( const char* textTagString ), , "( //----------------------------------------------------------------------------- -ConsoleFunction( echo, void, 2, 0, "( string message... ) " +DefineEngineStringlyVariadicFunction( echo, void, 2, 0, "( string message... ) " "@brief Logs a message to the console.\n\n" "Concatenates all given arguments to a single string and prints the string to the console. " "A newline is added automatically after the text.\n\n" @@ -1902,7 +1902,7 @@ ConsoleFunction( echo, void, 2, 0, "( string message... ) " //----------------------------------------------------------------------------- -ConsoleFunction( warn, void, 2, 0, "( string message... ) " +DefineEngineStringlyVariadicFunction( warn, void, 2, 0, "( string message... ) " "@brief Logs a warning message to the console.\n\n" "Concatenates all given arguments to a single string and prints the string to the console as a warning " "message (in the in-game console, these will show up using a turquoise font by default). " @@ -1926,7 +1926,7 @@ ConsoleFunction( warn, void, 2, 0, "( string message... ) " //----------------------------------------------------------------------------- -ConsoleFunction( error, void, 2, 0, "( string message... ) " +DefineEngineStringlyVariadicFunction( error, void, 2, 0, "( string message... ) " "@brief Logs an error message to the console.\n\n" "Concatenates all given arguments to a single string and prints the string to the console as an error " "message (in the in-game console, these will show up using a red font by default). " @@ -1968,7 +1968,7 @@ DefineEngineFunction( debugv, void, ( const char* variableName ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( expandEscape, const char*, ( const char* text ),, +DefineEngineFunction( expandEscape, const char*, ( const char* text ),, "@brief Replace all characters in @a text that need to be escaped for the string to be a valid string literal with their " "respective escape sequences.\n\n" "All characters in @a text that cannot appear in a string literal will be replaced by an escape sequence (\\\\n, \\\\t, etc).\n\n" @@ -1990,7 +1990,7 @@ DefineConsoleFunction( expandEscape, const char*, ( const char* text ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( collapseEscape, const char*, ( const char* text ),, +DefineEngineFunction( collapseEscape, const char*, ( const char* text ),, "Replace all escape sequences in @a text with their respective character codes.\n\n" "This function replaces all escape sequences (\\\\n, \\\\t, etc) in the given string " "with the respective characters they represent.\n\n" @@ -2046,7 +2046,7 @@ DefineEngineFunction( setLogMode, void, ( S32 mode ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( quit, void, ( ),, +DefineEngineFunction( quit, void, ( ),, "Shut down the engine and exit its process.\n" "This function cleanly uninitializes the engine and then exits back to the system with a process " "exit status indicating a clean exit.\n\n" @@ -2059,7 +2059,7 @@ DefineConsoleFunction( quit, void, ( ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( realQuit, void, (), , "") +DefineEngineFunction( realQuit, void, (), , "") { Platform::postQuitMessage(0); } @@ -2067,7 +2067,7 @@ DefineConsoleFunction( realQuit, void, (), , "") //----------------------------------------------------------------------------- -DefineConsoleFunction( quitWithErrorMessage, void, ( const char* message, S32 status ), (0), +DefineEngineFunction( quitWithErrorMessage, void, ( const char* message, S32 status ), (0), "Display an error message box showing the given @a message and then shut down the engine and exit its process.\n" "This function cleanly uninitialized the engine and then exits back to the system with a process " "exit status indicating an error.\n\n" @@ -2088,7 +2088,7 @@ DefineConsoleFunction( quitWithErrorMessage, void, ( const char* message, S32 st //----------------------------------------------------------------------------- -DefineConsoleFunction( quitWithStatus, void, ( S32 status ), (0), +DefineEngineFunction( quitWithStatus, void, ( S32 status ), (0), "Shut down the engine and exit its process.\n" "This function cleanly uninitializes the engine and then exits back to the system with a given " "return status code.\n\n" @@ -2236,7 +2236,7 @@ DefineEngineFunction( generateUUID, Torque::UUID, (),, //----------------------------------------------------------------------------- -ConsoleFunction( call, const char *, 2, 0, "( string functionName, string args... ) " +DefineEngineStringlyVariadicFunction( call, const char *, 2, 0, "( string functionName, string args... ) " "Apply the given arguments to the specified global function and return the result of the call.\n\n" "@param functionName The name of the function to call. This function must be in the global namespace, i.e. " "you cannot call a function in a namespace through #call. Use eval() for that.\n" @@ -2259,7 +2259,7 @@ ConsoleFunction( call, const char *, 2, 0, "( string functionName, string args.. static U32 execDepth = 0; static U32 journalDepth = 1; -DefineConsoleFunction( getDSOPath, const char*, ( const char* scriptFileName ),, +DefineEngineFunction( getDSOPath, const char*, ( const char* scriptFileName ),, "Get the absolute path to the file in which the compiled code for the given script file will be stored.\n" "@param scriptFileName %Path to the .cs script file.\n" "@return The absolute path to the .dso file for the given script file.\n\n" @@ -2373,12 +2373,12 @@ DefineEngineFunction( exec, bool, ( const char* fileName, bool noCalls, bool jou return Con::executeFile(fileName, noCalls, journalScript); } -DefineConsoleFunction( eval, const char*, ( const char* consoleString ), , "eval(consoleString)" ) +DefineEngineFunction( eval, const char*, ( const char* consoleString ), , "eval(consoleString)" ) { return Con::evaluate(consoleString, false, NULL); } -DefineConsoleFunction( getVariable, const char*, ( const char* varName ), , "(string varName)\n" +DefineEngineFunction( getVariable, const char*, ( const char* varName ), , "(string varName)\n" "@brief Returns the value of the named variable or an empty string if not found.\n\n" "@varName Name of the variable to search for\n" "@return Value contained by varName, \"\" if the variable does not exist\n" @@ -2387,7 +2387,7 @@ DefineConsoleFunction( getVariable, const char*, ( const char* varName ), , "(st return Con::getVariable(varName); } -DefineConsoleFunction( setVariable, void, ( const char* varName, const char* value ), , "(string varName, string value)\n" +DefineEngineFunction( setVariable, void, ( const char* varName, const char* value ), , "(string varName, string value)\n" "@brief Sets the value of the named variable.\n\n" "@param varName Name of the variable to locate\n" "@param value New value of the variable\n" @@ -2397,7 +2397,7 @@ DefineConsoleFunction( setVariable, void, ( const char* varName, const char* val return Con::setVariable(varName, value); } -DefineConsoleFunction( isFunction, bool, ( const char* funcName ), , "(string funcName)" +DefineEngineFunction( isFunction, bool, ( const char* funcName ), , "(string funcName)" "@brief Determines if a function exists or not\n\n" "@param funcName String containing name of the function\n" "@return True if the function exists, false if not\n" @@ -2406,7 +2406,7 @@ DefineConsoleFunction( isFunction, bool, ( const char* funcName ), , "(string fu return Con::isFunction(funcName); } -DefineConsoleFunction( getFunctionPackage, const char*, ( const char* funcName ), , "(string funcName)" +DefineEngineFunction( getFunctionPackage, const char*, ( const char* funcName ), , "(string funcName)" "@brief Provides the name of the package the function belongs to\n\n" "@param funcName String containing name of the function\n" "@return The name of the function's package\n" @@ -2419,7 +2419,7 @@ DefineConsoleFunction( getFunctionPackage, const char*, ( const char* funcName ) return nse->mPackage; } -DefineConsoleFunction( isMethod, bool, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" +DefineEngineFunction( isMethod, bool, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" "@brief Determines if a class/namespace method exists\n\n" "@param namespace Class or namespace, such as Player\n" "@param method Name of the function to search for\n" @@ -2434,7 +2434,7 @@ DefineConsoleFunction( isMethod, bool, ( const char* nameSpace, const char* meth return true; } -DefineConsoleFunction( getMethodPackage, const char*, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" +DefineEngineFunction( getMethodPackage, const char*, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" "@brief Provides the name of the package the method belongs to\n\n" "@param namespace Class or namespace, such as Player\n" "@param method Name of the funciton to search for\n" @@ -2452,7 +2452,7 @@ DefineConsoleFunction( getMethodPackage, const char*, ( const char* nameSpace, c return nse->mPackage; } -DefineConsoleFunction( isDefined, bool, ( const char* varName, const char* varValue ), ("") , "(string varName)" +DefineEngineFunction( isDefined, bool, ( const char* varName, const char* varValue ), ("") , "(string varName)" "@brief Determines if a variable exists and contains a value\n" "@param varName Name of the variable to search for\n" "@return True if the variable was defined in script, false if not\n" @@ -2590,14 +2590,14 @@ DefineConsoleFunction( isDefined, bool, ( const char* varName, const char* varVa //----------------------------------------------------------------------------- -DefineConsoleFunction( isCurrentScriptToolScript, bool, (), , "()" +DefineEngineFunction( isCurrentScriptToolScript, bool, (), , "()" "Returns true if the calling script is a tools script.\n" "@hide") { return Con::isCurrentScriptToolScript(); } -DefineConsoleFunction( getModNameFromPath, const char *, ( const char* path ), , "(string path)" +DefineEngineFunction( getModNameFromPath, const char *, ( const char* path ), , "(string path)" "@brief Attempts to extract a mod directory from path. Returns empty string on failure.\n\n" "@param File path of mod folder\n" "@note This is no longer relevant in Torque 3D (which does not use mod folders), should be deprecated\n" @@ -2609,7 +2609,7 @@ DefineConsoleFunction( getModNameFromPath, const char *, ( const char* path ), , //----------------------------------------------------------------------------- -DefineConsoleFunction( pushInstantGroup, void, ( String group ),("") , "([group])" +DefineEngineFunction( pushInstantGroup, void, ( String group ),("") , "([group])" "@brief Pushes the current $instantGroup on a stack " "and sets it to the given value (or clears it).\n\n" "@note Currently only used for editors\n" @@ -2622,7 +2622,7 @@ DefineConsoleFunction( pushInstantGroup, void, ( String group ),("") , "([group] Con::pushInstantGroup(); } -DefineConsoleFunction( popInstantGroup, void, (), , "()" +DefineEngineFunction( popInstantGroup, void, (), , "()" "@brief Pop and restore the last setting of $instantGroup off the stack.\n\n" "@note Currently only used for editors\n\n" "@ingroup Editors\n" @@ -2633,7 +2633,7 @@ DefineConsoleFunction( popInstantGroup, void, (), , "()" //----------------------------------------------------------------------------- -DefineConsoleFunction( getPrefsPath, const char *, ( const char* relativeFileName ), (""), "([relativeFileName])" +DefineEngineFunction( getPrefsPath, const char *, ( const char* relativeFileName ), (""), "([relativeFileName])" "@note Appears to be useless in Torque 3D, should be deprecated\n" "@internal") { @@ -2646,31 +2646,28 @@ DefineConsoleFunction( getPrefsPath, const char *, ( const char* relativeFileNam //----------------------------------------------------------------------------- -ConsoleFunction( execPrefs, bool, 2, 4, "( string relativeFileName, bool noCalls=false, bool journalScript=false )" - "@brief Manually execute a special script file that contains game or editor preferences\n\n" - "@param relativeFileName Name and path to file from project folder\n" - "@param noCalls Deprecated\n" - "@param journalScript Deprecated\n" - "@return True if script was successfully executed\n" - "@note Appears to be useless in Torque 3D, should be deprecated\n" - "@ingroup Scripting") +DefineEngineFunction(execPrefs, bool, (const char* relativeFileName, bool noCalls, bool journalScript),(false, false), + "@brief Manually execute a special script file that contains game or editor preferences\n\n" + "@param relativeFileName Name and path to file from project folder\n" + "@param noCalls Deprecated\n" + "@param journalScript Deprecated\n" + "@return True if script was successfully executed\n" + "@note Appears to be useless in Torque 3D, should be deprecated\n" + "@ingroup Scripting") { - const char *filename = Platform::getPrefsPath(argv[1]); - if(filename == NULL || *filename == 0) + if (relativeFileName == NULL || *relativeFileName == 0) return false; // Scripts do this a lot, so we may as well help them out - if(! Platform::isFile(filename) && ! Torque::FS::IsFile(filename)) + if (!Platform::isFile(relativeFileName) && !Torque::FS::IsFile(relativeFileName)) return true; - argv[0] = "exec"; - argv[1] = filename; - return dAtob(Con::execute(argc, argv)); + return Con::executeFile(relativeFileName, noCalls, journalScript); } //----------------------------------------------------------------------------- -DefineConsoleFunction( export, void, ( const char* pattern, const char* filename, bool append ), ( "", false ), +DefineEngineFunction( export, void, ( const char* pattern, const char* filename, bool append ), ( "", false ), "Write out the definitions of all global variables matching the given name @a pattern.\n" "If @a fileName is not \"\", the variable definitions are written to the specified file. Otherwise the " "definitions will be printed to the console.\n\n" @@ -2723,7 +2720,7 @@ DefineEngineFunction( deleteVariables, void, ( const char* pattern ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( trace, void, ( bool enable ), ( true ), +DefineEngineFunction( trace, void, ( bool enable ), ( true ), "Enable or disable tracing in the script code VM.\n\n" "When enabled, the script code runtime will trace the invocation and returns " "from all functions that are called and log them to the console. This is helpful in " @@ -2739,7 +2736,7 @@ DefineConsoleFunction( trace, void, ( bool enable ), ( true ), #if defined(TORQUE_DEBUG) || !defined(TORQUE_SHIPPING) -DefineConsoleFunction( debug, void, (),, +DefineEngineFunction( debug, void, (),, "Drops the engine into the native C++ debugger.\n\n" "This function triggers a debug break and drops the process into the IDE's debugger. If the process is not " "running with a debugger attached it will generate a runtime error on most platforms.\n\n" diff --git a/Engine/source/console/consoleLogger.cpp b/Engine/source/console/consoleLogger.cpp index 84347a332..fc2095eae 100644 --- a/Engine/source/console/consoleLogger.cpp +++ b/Engine/source/console/consoleLogger.cpp @@ -225,7 +225,7 @@ void ConsoleLogger::log( const char *consoleLine ) //----------------------------------------------------------------------------- -DefineConsoleMethod( ConsoleLogger, attach, bool, (), , "() Attaches the logger to the console and begins writing to file" +DefineEngineMethod( ConsoleLogger, attach, bool, (), , "() Attaches the logger to the console and begins writing to file" "@tsexample\n" "// Create the logger\n" "// Will automatically start writing to testLogging.txt with normal priority\n" @@ -247,7 +247,7 @@ DefineConsoleMethod( ConsoleLogger, attach, bool, (), , "() Attaches the logger //----------------------------------------------------------------------------- -DefineConsoleMethod( ConsoleLogger, detach, bool, (), , "() Detaches the logger from the console and stops writing to file" +DefineEngineMethod( ConsoleLogger, detach, bool, (), , "() Detaches the logger from the console and stops writing to file" "@tsexample\n" "// Create the logger\n" "// Will automatically start writing to testLogging.txt with normal priority\n" diff --git a/Engine/source/console/consoleObject.h b/Engine/source/console/consoleObject.h index 7eea3144e..b15cd88ab 100644 --- a/Engine/source/console/consoleObject.h +++ b/Engine/source/console/consoleObject.h @@ -662,6 +662,29 @@ public: // Finally, do any class specific initialization... T::initPersistFields(); T::consoleInit(); + + EnginePropertyTable::Property* props = new EnginePropertyTable::Property[sg_tempFieldList.size()]; + + for (int i = 0; i < sg_tempFieldList.size(); ++i) + { + EnginePropertyTable::Property prop; + prop.mDocString = sg_tempFieldList[i].pFieldDocs; + prop.mName = sg_tempFieldList[i].pFieldname; + prop.mNumElements = sg_tempFieldList[i].elementCount; + prop.mFlags = 0; + if (sg_tempFieldList[i].type == StartGroupFieldType) + prop.mFlags |= EnginePropertyGroupBegin; + if (sg_tempFieldList[i].type == EndGroupFieldType) + prop.mFlags |= EnginePropertyGroupEnd; + prop.mType = sg_tempFieldList[i].type; + + props[i] = prop; + } + + _smPropertyTable = EnginePropertyTable(sg_tempFieldList.size(), props); + smPropertyTable = _smPropertyTable; + + const_cast(mTypeInfo)->mPropertyTable = &_smPropertyTable; // Let the base finish up. AbstractClassRep::init(); diff --git a/Engine/source/console/consoleXMLExport.cpp b/Engine/source/console/consoleXMLExport.cpp index 79e302595..e3431acdf 100644 --- a/Engine/source/console/consoleXMLExport.cpp +++ b/Engine/source/console/consoleXMLExport.cpp @@ -314,7 +314,7 @@ namespace Con { }; // namespace Con -DefineConsoleFunction( consoleExportXML, const char*, (), ,"Exports console definition XML representation" ) +DefineEngineFunction( consoleExportXML, const char*, (), ,"Exports console definition XML representation" ) { Con::XMLExport xmlExport; String xml; diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 049cce54d..5fa20a82c 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -26,6 +26,10 @@ #include #include +#ifndef _FIXEDTUPLE_H_ +#include "fixedTuple.h" +#endif + #ifndef _CONSOLETYPES_H_ #include "console/consoleTypes.h" #endif @@ -347,6 +351,8 @@ struct _EngineTrampoline< R( ArgTs ... ) > { typedef std::tuple Args; std::tuple argT; + typedef fixed_tuple FixedArgs; + fixed_tuple fixedArgT; }; template< typename T > @@ -365,6 +371,7 @@ struct _EngineFunctionTrampoline< R(ArgTs...) > : public _EngineFunctionTrampoli private: using Super = _EngineFunctionTrampolineBase< R(ArgTs...) >; using ArgsType = typename Super::Args; + using FixedArgsType = typename Super::FixedArgs; template struct Seq {}; template struct Gens : Gens {}; @@ -374,6 +381,11 @@ private: static R dispatchHelper(typename Super::FunctionType fn, const ArgsType& args, Seq) { return R( fn(std::get(args) ...) ); } + + template + static R dispatchHelper(typename Super::FunctionType fn, const FixedArgsType& args, Seq) { + return R( fn(fixed_tuple_accessor::get(args) ...) ); + } using SeqType = typename Gens::type; public: @@ -381,6 +393,11 @@ public: { return dispatchHelper(fn, args, SeqType()); } + + static R jmp(typename Super::FunctionType fn, const FixedArgsType& args ) + { + return dispatchHelper(fn, args, SeqType()); + } }; // Trampolines for engine methods @@ -398,6 +415,7 @@ struct _EngineMethodTrampoline< Frame, R(ArgTs ...) > : public _EngineMethodTram private: using Super = _EngineMethodTrampolineBase< R(ArgTs ...) >; using ArgsType = typename _EngineFunctionTrampolineBase< R(ArgTs ...) >::Args; + using FixedArgsType = typename Super::FixedArgs; template struct Seq {}; template struct Gens : Gens {}; @@ -408,6 +426,11 @@ private: return R( f._exec(std::get(args) ...) ); } + template + static R dispatchHelper(Frame f, const FixedArgsType& args, Seq) { + return R( f._exec(fixed_tuple_accessor::get(args) ...) ); + } + using SeqType = typename Gens::type; public: static R jmp( typename Frame::ObjectType* object, const ArgsType& args ) @@ -417,6 +440,14 @@ public: f.object = object; return dispatchHelper(f, args, SeqType()); } + + static R jmp( typename Frame::ObjectType* object, const FixedArgsType& args ) + { + + Frame f; + f.object = object; + return dispatchHelper(f, args, SeqType()); + } }; /// @} @@ -683,7 +714,7 @@ public: #define DefineEngineFunction( name, returnType, args, defaultArgs, usage ) \ static inline returnType _fn ## name ## impl args; \ TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## name \ - ( _EngineFunctionTrampoline< returnType args >::Args a ) \ + ( _EngineFunctionTrampoline< returnType args >::FixedArgs a ) \ { \ _CHECK_ENGINE_INITIALIZED( name, returnType ); \ return EngineTypeTraits< returnType >::ReturnValue( \ @@ -702,7 +733,7 @@ public: ( void* ) &fn ## name, \ 0 \ ); \ - static _EngineConsoleThunkType< returnType >::ReturnType _ ## name ## caster( SimObject*, S32 argc, ConsoleValueRef *argv ) \ + static _EngineConsoleThunkType< returnType >::ReturnType _ ## name ## caster( SimObject*, S32 argc, ConsoleValueRef *argv ) \ { \ return _EngineConsoleThunkType< returnType >::ReturnType( _EngineConsoleThunk< 1, returnType args >::thunk( \ argc, argv, &_fn ## name ## impl, _fn ## name ## DefaultArgs \ @@ -737,7 +768,7 @@ public: #define _DefineMethodTrampoline( className, name, returnType, args ) \ TORQUE_API EngineTypeTraits< returnType >::ReturnValueType \ - fn ## className ## _ ## name ( className* object, _EngineMethodTrampoline< _ ## className ## name ## frame, returnType args >::Args a ) \ + fn ## className ## _ ## name ( className* object, _EngineMethodTrampoline< _ ## className ## name ## frame, returnType args >::FixedArgs a )\ { \ _CHECK_ENGINE_INITIALIZED( className::name, returnType ); \ return EngineTypeTraits< returnType >::ReturnValue( \ @@ -820,7 +851,7 @@ public: #define DefineEngineStaticMethod( className, name, returnType, args, defaultArgs, usage ) \ static inline returnType _fn ## className ## name ## impl args; \ TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## className ## _ ## name \ - ( _EngineFunctionTrampoline< returnType args >::Args a ) \ + ( _EngineFunctionTrampoline< returnType args >::FixedArgs a ) \ { \ _CHECK_ENGINE_INITIALIZED( className::name, returnType ); \ return EngineTypeTraits< returnType >::ReturnValue( \ @@ -855,76 +886,62 @@ public: ); \ static inline returnType _fn ## className ## name ## impl args - -// Convenience macros to allow defining functions that use the new marshalling features -// while being only visible in the console interop. When we drop the console system, -// these macros can be removed and all definitions that make use of them can be removed -// as well. -#define DefineConsoleFunction( name, returnType, args, defaultArgs, usage ) \ - static inline returnType _fn ## name ## impl args; \ - static _EngineFunctionDefaultArguments< void args > _fn ## name ## DefaultArgs defaultArgs; \ - static _EngineConsoleThunkType< returnType >::ReturnType _ ## name ## caster( SimObject*, S32 argc, ConsoleValueRef *argv ) \ +# define DefineEngineStringlyVariadicFunction(name,returnType,minArgs,maxArgs,usage) \ + static inline returnType _fn ## name ## impl (SimObject *, S32 argc, ConsoleValueRef *argv); \ + TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## name \ + (S32 argc, const char** argv) \ { \ - return _EngineConsoleThunkType< returnType >::ReturnType( _EngineConsoleThunk< 1, returnType args >::thunk( \ - argc, argv, &_fn ## name ## impl, _fn ## name ## DefaultArgs \ - ) ); \ - } \ - static ConsoleFunctionHeader _ ## name ## header \ - ( #returnType, #args, #defaultArgs ); \ - static ConsoleConstructor \ - _ ## name ## obj( NULL, #name, _EngineConsoleThunkType< returnType >::CallbackType( _ ## name ## caster ), usage, \ - _EngineConsoleThunk< 1, returnType args >::NUM_ARGS - _EngineConsoleThunkCountArgs() defaultArgs, \ - _EngineConsoleThunk< 1, returnType args >::NUM_ARGS, \ - false, &_ ## name ## header \ + _CHECK_ENGINE_INITIALIZED( name, returnType ); \ + StringStackConsoleWrapper args(argc, argv); \ + return EngineTypeTraits< returnType >::ReturnValue( \ + _fn ## name ## impl(NULL, args.count(), args) \ ); \ - static inline returnType _fn ## name ## impl args + } \ + static _EngineFunctionDefaultArguments< void (S32 argc, const char** argv) > _fn ## name ## DefaultArgs; \ + static EngineFunctionInfo _fn ## name ## FunctionInfo( \ + #name, \ + &_SCOPE<>()(), \ + usage, \ + #returnType " " #name "(S32 argc, const char** argv)", \ + "fn" #name, \ + TYPE< returnType (S32 argc, const char** argv) >(), \ + &_fn ## name ## DefaultArgs, \ + ( void* ) &fn ## name, \ + 0 \ + ); \ + ConsoleConstructor cc_##name##_obj(NULL,#name,_fn ## name ## impl,usage,minArgs,maxArgs); \ + returnType _fn ## name ## impl(SimObject *, S32 argc, ConsoleValueRef *argv) -#define DefineConsoleMethod( className, name, returnType, args, defaultArgs, usage ) \ - struct _ ## className ## name ## frame \ - { \ - typedef className ObjectType; \ - className* object; \ - inline returnType _exec args const; \ - }; \ - static _EngineFunctionDefaultArguments< _EngineMethodTrampoline< _ ## className ## name ## frame, void args >::FunctionType > \ - _fn ## className ## name ## DefaultArgs defaultArgs; \ - static _EngineConsoleThunkType< returnType >::ReturnType _ ## className ## name ## caster( SimObject* object, S32 argc, ConsoleValueRef *argv ) \ - { \ - _ ## className ## name ## frame frame; \ - frame.object = static_cast< className* >( object ); \ - return _EngineConsoleThunkType< returnType >::ReturnType( _EngineConsoleThunk< 2, returnType args >::thunk( \ - argc, argv, &_ ## className ## name ## frame::_exec, &frame, _fn ## className ## name ## DefaultArgs \ - ) ); \ - } \ - static ConsoleFunctionHeader _ ## className ## name ## header \ - ( #returnType, #args, #defaultArgs ); \ - static ConsoleConstructor \ - className ## name ## obj( #className, #name, \ - _EngineConsoleThunkType< returnType >::CallbackType( _ ## className ## name ## caster ), usage, \ - _EngineConsoleThunk< 2, returnType args >::NUM_ARGS - _EngineConsoleThunkCountArgs() defaultArgs, \ - _EngineConsoleThunk< 2, returnType args >::NUM_ARGS, \ - false, &_ ## className ## name ## header \ - ); \ - returnType _ ## className ## name ## frame::_exec args const +# define DefineEngineStringlyVariadicMethod(className, name,returnType,minArgs,maxArgs,usage) \ + static inline returnType _fn ## className ## _ ## name ## impl (className* object, S32 argc, ConsoleValueRef* argv); \ + TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## className ## _ ## name \ + (className* object, S32 argc, const char** argv) \ + { \ + _CHECK_ENGINE_INITIALIZED( name, returnType ); \ + StringStackConsoleWrapper args(argc, argv); \ + return EngineTypeTraits< returnType >::ReturnValue( \ + _fn ## className ## _ ## name ## impl(object, args.count(), args) \ + ); \ + } \ + static _EngineFunctionDefaultArguments< void (className* object, S32 argc, const char** argv) > _fn ## className ## _ ## name ## DefaultArgs; \ + static EngineFunctionInfo _fn ## className ## _ ## name ## FunctionInfo( \ + #name, \ + &_SCOPE<>()(), \ + usage, \ + #returnType " " #name "(SimObject* object, S32 argc, const char** argv)", \ + "fn" #className "_" #name, \ + TYPE< returnType (SimObject* object, S32 argc, const char** argv) >(), \ + &_fn ## className ## _ ## name ## DefaultArgs, \ + ( void* ) &fn ## className ## _ ## name, \ + 0 \ + ); \ + returnType cm_##className##_##name##_caster(SimObject* object, S32 argc, ConsoleValueRef* argv) { \ + AssertFatal( dynamic_cast( object ), "Object passed to " #name " is not a " #className "!" ); \ + conmethod_return_##returnType ) _fn ## className ## _ ## name ## impl(static_cast(object),argc,argv); \ + }; \ + ConsoleConstructor cc_##className##_##name##_obj(#className,#name,cm_##className##_##name##_caster,usage,minArgs,maxArgs); \ + static inline returnType _fn ## className ## _ ## name ## impl(className *object, S32 argc, ConsoleValueRef *argv) -#define DefineConsoleStaticMethod( className, name, returnType, args, defaultArgs, usage ) \ - static inline returnType _fn ## className ## name ## impl args; \ - static _EngineFunctionDefaultArguments< void args > _fn ## className ## name ## DefaultArgs defaultArgs; \ - static _EngineConsoleThunkType< returnType >::ReturnType _ ## className ## name ## caster( SimObject*, S32 argc, ConsoleValueRef *argv )\ - { \ - return _EngineConsoleThunkType< returnType >::ReturnType( _EngineConsoleThunk< 1, returnType args >::thunk( \ - argc, argv, &_fn ## className ## name ## impl, _fn ## className ## name ## DefaultArgs \ - ) ); \ - } \ - static ConsoleFunctionHeader _ ## className ## name ## header \ - ( #returnType, #args, #defaultArgs, true ); \ - static ConsoleConstructor \ - _ ## className ## name ## obj( #className, #name, _EngineConsoleThunkType< returnType >::CallbackType( _ ## className ## name ## caster ), usage, \ - _EngineConsoleThunk< 1, returnType args >::NUM_ARGS - _EngineConsoleThunkCountArgs() defaultArgs, \ - _EngineConsoleThunk< 1, returnType args >::NUM_ARGS, \ - false, &_ ## className ## name ## header \ - ); \ - static inline returnType _fn ## className ## name ## impl args // The following three macros are only temporary. They allow to define engineAPI functions using the framework @@ -934,7 +951,7 @@ public: #define DefineNewEngineFunction( name, returnType, args, defaultArgs, usage ) \ static inline returnType _fn ## name ## impl args; \ TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## name \ - ( _EngineFunctionTrampoline< returnType args >::Args a ) \ + ( _EngineFunctionTrampoline< returnType args >::FixedArgs a ) \ { \ _CHECK_ENGINE_INITIALIZED( name, returnType ); \ return EngineTypeTraits< returnType >::ReturnValue( \ @@ -981,7 +998,7 @@ public: #define DefineNewEngineStaticMethod( className, name, returnType, args, defaultArgs, usage ) \ static inline returnType _fn ## className ## name ## impl args; \ TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## className ## _ ## name \ - ( _EngineFunctionTrampoline< returnType args >::Args a ) \ + ( _EngineFunctionTrampoline< returnType args >::FixedArgs a ) \ { \ _CHECK_ENGINE_INITIALIZED( className::name, returnType ); \ return EngineTypeTraits< returnType >::ReturnValue( \ diff --git a/Engine/source/console/engineFunctions.h b/Engine/source/console/engineFunctions.h index 0f2a3f45d..eb935d995 100644 --- a/Engine/source/console/engineFunctions.h +++ b/Engine/source/console/engineFunctions.h @@ -25,6 +25,10 @@ #include +#ifndef _FIXEDTUPLE_H_ +#include "fixedTuple.h" +#endif + #ifndef _ENGINEEXPORTS_H_ #include "console/engineExports.h" #endif @@ -94,6 +98,7 @@ template struct _EngineFunctionDefaultArguments< void(ArgTs...) > : public EngineFunctionDefaultArguments { template using DefVST = typename EngineTypeTraits::DefaultArgumentValueStoreType; + fixed_tuple ...> mFixedArgs; std::tuple ...> mArgs; private: using SelfType = _EngineFunctionDefaultArguments< void(ArgTs...) >; @@ -130,7 +135,9 @@ private: public: template _EngineFunctionDefaultArguments(TailTs ...tail) : EngineFunctionDefaultArguments({sizeof...(TailTs)}), mArgs(SelfType::tailInit(tail...)) - {} + { + fixed_tuple_mutator...), void(DefVST...)>::copy(mArgs, mFixedArgs); + } }; #pragma pack( pop ) diff --git a/Engine/source/console/engineTypeInfo.h b/Engine/source/console/engineTypeInfo.h index 7a9f7122c..9f9c0d12f 100644 --- a/Engine/source/console/engineTypeInfo.h +++ b/Engine/source/console/engineTypeInfo.h @@ -231,6 +231,9 @@ class EnginePropertyTable /// Combination of EnginePropertyFlags. U32 mFlags; + + /// Type-id of the property + U32 mType; /// Return the name of the property. const char* getName() const { return mName; } @@ -255,6 +258,9 @@ class EnginePropertyTable /// bool hideInInspectors() const { return ( mFlags & EnginePropertyHideInInspectors ); } + + /// Return the type-id of the property. + U32 getType() const { return mType; } }; protected: diff --git a/Engine/source/console/engineTypes.h b/Engine/source/console/engineTypes.h index 2217ee770..51d2ef84d 100644 --- a/Engine/source/console/engineTypes.h +++ b/Engine/source/console/engineTypes.h @@ -236,16 +236,16 @@ template< typename T > struct _EngineStructTypeTraits { typedef T Type; - typedef const T& ValueType; + typedef const T ValueType; typedef void SuperType; // Structs get passed in as pointers and passed out as full copies. - typedef T* ArgumentValueType; + typedef T ArgumentValueType; typedef T ReturnValueType; typedef T DefaultArgumentValueStoreType; typedef ReturnValueType ReturnValue; - static ValueType ArgumentToValue( ArgumentValueType val ) { return *val; } + static ValueType ArgumentToValue( ArgumentValueType val ) { return val; } static const EngineTypeInfo* const TYPEINFO; }; diff --git a/Engine/source/console/engineXMLExport.cpp b/Engine/source/console/engineXMLExport.cpp index ce12121e8..ae1b182bb 100644 --- a/Engine/source/console/engineXMLExport.cpp +++ b/Engine/source/console/engineXMLExport.cpp @@ -35,32 +35,32 @@ /// actually having to access them directly in the DLL as native entities. -static void exportScope( const EngineExportScope* scope, SimXMLDocument* xml, bool addNode = false ); +static void exportScope(const EngineExportScope* scope, SimXMLDocument* xml, bool addNode = false); -static String getTypeName( const EngineTypeInfo* type ) +static String getTypeName(const EngineTypeInfo* type) { - if( !type ) + if (!type) { - static String sVoid( "void" ); + static String sVoid("void"); return sVoid; } - + return type->getFullyQualifiedExportName(); } -static const char* getDocString( const EngineExport* exportInfo ) +static const char* getDocString(const EngineExport* exportInfo) { - if( !exportInfo->getDocString() ) + if (!exportInfo->getDocString()) return ""; - + return exportInfo->getDocString(); } template< typename T > -inline T getArgValue( const EngineFunctionDefaultArguments* defaultArgs, U32 offset ) +inline T getArgValue(const EngineFunctionDefaultArguments* defaultArgs, U32 offset) { - return *reinterpret_cast< const T* >( defaultArgs->getArgs() + offset ); + return *reinterpret_cast< const T* >(defaultArgs->getArgs() + offset); } @@ -71,14 +71,14 @@ static const char* sExportFilterList[] = "Console", // Console namespace }; -static bool isExportFiltered( const EngineExport* exportInfo ) +static bool isExportFiltered(const EngineExport* exportInfo) { String qualifiedName = exportInfo->getFullyQualifiedExportName(); - - for( U32 i = 0; i < ( sizeof( sExportFilterList ) / sizeof( sExportFilterList[ 0 ] ) ); ++ i ) - if( qualifiedName.compare( sExportFilterList[ i ] ) == 0 ) + + for (U32 i = 0; i < (sizeof(sExportFilterList) / sizeof(sExportFilterList[0])); ++i) + if (qualifiedName.compare(sExportFilterList[i]) == 0) return true; - + return false; } @@ -90,248 +90,248 @@ static bool isExportFiltered( const EngineExport* exportInfo ) //----------------------------------------------------------------------------- /// Helper to parse argument names out of a prototype string. -static Vector< String > parseFunctionArgumentNames( const EngineFunctionInfo* function ) +static Vector< String > parseFunctionArgumentNames(const EngineFunctionInfo* function) { Vector< String > argNames; - + const char* prototype = function->getPrototypeString(); - if( !prototype ) + if (!prototype) return argNames; - - const U32 prototypeLength = dStrlen( prototype ); - const char* prototypeEnd = &prototype[ prototypeLength ]; + + const U32 prototypeLength = dStrlen(prototype); + const char* prototypeEnd = &prototype[prototypeLength]; const char* ptr = prototypeEnd - 1; - + // Search for right parenthesis. - while( ptr >= prototype && *ptr != ')' ) - ptr --; - - if( ptr < prototype ) + while (ptr >= prototype && *ptr != ')') + ptr--; + + if (ptr < prototype) return argNames; - ptr --; - - while( ptr >= prototype && *ptr != '(' ) + ptr--; + + while (ptr >= prototype && *ptr != '(') { // Skip back over spaces. - - while( ptr >= prototype && dIsspace( *ptr ) ) - ptr --; - if( ptr < prototype ) + + while (ptr >= prototype && dIsspace(*ptr)) + ptr--; + if (ptr < prototype) return argNames; - + // Parse out name. - + const char* end = ptr + 1; - while( ptr > prototype && dIsalnum( *ptr ) ) - ptr --; + while (ptr > prototype && dIsalnum(*ptr)) + ptr--; const char* start = ptr + 1; - + // Skip back over spaces. - while( ptr >= prototype && dIsspace( *ptr ) ) - ptr --; - + while (ptr >= prototype && dIsspace(*ptr)) + ptr--; + // If we're sure we don't have just a type name without an // argument name, copy out the argument name name. - if( ptr >= prototype && *ptr != ',' && *ptr != '(' && end > start ) - argNames.push_front( String( start, end - start ) ); + if (ptr >= prototype && *ptr != ',' && *ptr != '(' && end > start) + argNames.push_front(String(start, end - start)); else - argNames.push_front( "" ); - + argNames.push_front(""); + // Skip back to comma or opening parenthesis. - + U32 parenNestingCount = 0; - while( ptr >= prototype ) + while (ptr >= prototype) { - if( *ptr == ')' ) - parenNestingCount ++; - else if( *ptr == '(' ) - parenNestingCount --; - else if( *ptr == ',' && parenNestingCount == 0 ) + if (*ptr == ')') + parenNestingCount++; + else if (*ptr == '(') + parenNestingCount--; + else if (*ptr == ',' && parenNestingCount == 0) { - ptr --; + ptr--; break; } - else if( *ptr == '(' && parenNestingCount == 0 ) + else if (*ptr == '(' && parenNestingCount == 0) break; - - ptr --; + + ptr--; } } - + // Add 'this' parameter if this is a method. - - if( dStrncmp( prototype, "virtual ", sizeof( "virtual " ) - 1 ) == 0 ) - argNames.push_front( "this" ); + + if (dStrncmp(prototype, "virtual ", sizeof("virtual ") - 1) == 0) + argNames.push_front("this"); return argNames; } //----------------------------------------------------------------------------- -static String getDefaultArgumentValue( const EngineFunctionInfo* function, const EngineTypeInfo* type, U32 offset ) +static String getDefaultArgumentValue(const EngineFunctionInfo* function, const EngineTypeInfo* type, U32 offset) { String value; const EngineFunctionDefaultArguments* defaultArgs = function->getDefaultArguments(); - - switch( type->getTypeKind() ) + + switch (type->getTypeKind()) { - case EngineTypeKindPrimitive: - { - #define PRIMTYPE( tp ) \ + case EngineTypeKindPrimitive: + { +#define PRIMTYPE( tp ) \ if( TYPE< tp >() == type ) \ { \ tp val = getArgValue< tp >( defaultArgs, offset ); \ value = String::ToString( val ); \ } - - PRIMTYPE( bool ); - PRIMTYPE( S8 ); - PRIMTYPE( U8 ); - PRIMTYPE( S32 ); - PRIMTYPE( U32 ); - PRIMTYPE( F32 ); - PRIMTYPE( F64 ); - - //TODO: for now we store string literals in ASCII; needs to be sorted out - if( TYPE< const char* >() == type ) - { - const char* val = getArgValue< const char* >( defaultArgs, offset ); - value = val; - } - - #undef PRIMTYPE - break; - } - - case EngineTypeKindEnum: + + PRIMTYPE(bool); + PRIMTYPE(S8); + PRIMTYPE(U8); + PRIMTYPE(S32); + PRIMTYPE(U32); + PRIMTYPE(F32); + PRIMTYPE(F64); + + //TODO: for now we store string literals in ASCII; needs to be sorted out + if (TYPE< const char* >() == type) { - S32 val = getArgValue< S32 >( defaultArgs, offset ); - AssertFatal( type->getEnumTable(), "engineXMLExport - Enum type without table!" ); - - const EngineEnumTable& table = *( type->getEnumTable() ); - const U32 numValues = table.getNumValues(); - - for( U32 i = 0; i < numValues; ++ i ) - if( table[ i ].getInt() == val ) - { - value = table[ i ].getName(); - break; - } - - break; + const char* val = reinterpret_cast(defaultArgs->getArgs() + offset); + value = val; } - case EngineTypeKindBitfield: - { - S32 val = getArgValue< S32 >( defaultArgs, offset ); - AssertFatal( type->getEnumTable(), "engineXMLExport - Bitfield type without table!" ); - - const EngineEnumTable& table = *( type->getEnumTable() ); - const U32 numValues = table.getNumValues(); - - bool isFirst = true; - for( U32 i = 0; i < numValues; ++ i ) - if( table[ i ].getInt() & val ) - { - if( !isFirst ) - value += '|'; - - value = table[ i ].getName(); - isFirst = false; - } - - break; - } - - case EngineTypeKindStruct: - { - //TODO: struct type default argument values - break; - } - - case EngineTypeKindClass: - case EngineTypeKindFunction: - { - // For these two kinds, we support "null" as the only valid - // default value. - - const void* ptr = getArgValue< const void* >( defaultArgs, offset ); - if( !ptr ) - value = "null"; - break; - } - - default: - break; +#undef PRIMTYPE + break; } - + + case EngineTypeKindEnum: + { + S32 val = getArgValue< S32 >(defaultArgs, offset); + AssertFatal(type->getEnumTable(), "engineXMLExport - Enum type without table!"); + + const EngineEnumTable& table = *(type->getEnumTable()); + const U32 numValues = table.getNumValues(); + + for (U32 i = 0; i < numValues; ++i) + if (table[i].getInt() == val) + { + value = table[i].getName(); + break; + } + + break; + } + + case EngineTypeKindBitfield: + { + S32 val = getArgValue< S32 >(defaultArgs, offset); + AssertFatal(type->getEnumTable(), "engineXMLExport - Bitfield type without table!"); + + const EngineEnumTable& table = *(type->getEnumTable()); + const U32 numValues = table.getNumValues(); + + bool isFirst = true; + for (U32 i = 0; i < numValues; ++i) + if (table[i].getInt() & val) + { + if (!isFirst) + value += '|'; + + value = table[i].getName(); + isFirst = false; + } + + break; + } + + case EngineTypeKindStruct: + { + //TODO: struct type default argument values + break; + } + + case EngineTypeKindClass: + case EngineTypeKindFunction: + { + // For these two kinds, we support "null" as the only valid + // default value. + + const void* ptr = getArgValue< const void* >(defaultArgs, offset); + if (!ptr) + value = "null"; + break; + } + + default: + break; + } + return value; } //----------------------------------------------------------------------------- -static void exportFunction( const EngineFunctionInfo* function, SimXMLDocument* xml ) +static void exportFunction(const EngineFunctionInfo* function, SimXMLDocument* xml) { - if( isExportFiltered( function ) ) + if (isExportFiltered(function)) return; - - xml->pushNewElement( "EngineFunction" ); - - xml->setAttribute( "name", function->getExportName() ); - xml->setAttribute( "returnType", getTypeName( function->getReturnType() ) ); - xml->setAttribute( "symbol", function->getBindingName() ); - xml->setAttribute( "isCallback", function->isCallout() ? "1" : "0" ); - xml->setAttribute( "isVariadic", function->getFunctionType()->isVariadic() ? "1" : "0" ); - xml->setAttribute( "docs", getDocString( function ) ); - - xml->pushNewElement( "arguments" ); - - const U32 numArguments = function->getNumArguments(); - const U32 numDefaultArguments = ( function->getDefaultArguments() ? function->getDefaultArguments()->mNumDefaultArgs : 0 ); - const U32 firstDefaultArg = numArguments - numDefaultArguments; - - Vector< String > argumentNames = parseFunctionArgumentNames( function ); - const U32 numArgumentNames = argumentNames.size(); - - // Accumulated offset in function argument frame vector. - U32 argFrameOffset = 0; - - for( U32 i = 0; i < numArguments; ++ i ) - { - xml->pushNewElement( "EngineFunctionArgument" ); - const EngineTypeInfo* type = function->getArgumentType( i ); - AssertFatal( type != NULL, "exportFunction - Argument cannot have type void!" ); - - String argName; - if( i < numArgumentNames ) - argName = argumentNames[ i ]; - - xml->setAttribute( "name", argName ); - xml->setAttribute( "type", getTypeName( type ) ); - - if( i >= firstDefaultArg ) - { - String defaultValue = getDefaultArgumentValue( function, type, argFrameOffset ); - xml->setAttribute( "defaultValue", defaultValue ); - } - xml->popElement(); - - if( type->getTypeKind() == EngineTypeKindStruct ) - argFrameOffset += type->getInstanceSize(); - else - argFrameOffset += type->getValueSize(); - - #ifdef _PACK_BUG_WORKAROUNDS - if( argFrameOffset % 4 > 0 ) - argFrameOffset += 4 - ( argFrameOffset % 4 ); - #endif - } - + xml->pushNewElement("EngineFunction"); + + xml->setAttribute("name", function->getExportName()); + xml->setAttribute("returnType", getTypeName(function->getReturnType())); + xml->setAttribute("symbol", function->getBindingName()); + xml->setAttribute("isCallback", function->isCallout() ? "1" : "0"); + xml->setAttribute("isVariadic", function->getFunctionType()->isVariadic() ? "1" : "0"); + xml->setAttribute("docs", getDocString(function)); + + xml->pushNewElement("arguments"); + + const U32 numArguments = function->getNumArguments(); + const U32 numDefaultArguments = (function->getDefaultArguments() ? function->getDefaultArguments()->mNumDefaultArgs : 0); + const U32 firstDefaultArg = numArguments - numDefaultArguments; + + Vector< String > argumentNames = parseFunctionArgumentNames(function); + const U32 numArgumentNames = argumentNames.size(); + + // Accumulated offset in function argument frame vector. + U32 argFrameOffset = 0; + + for (U32 i = 0; i < numArguments; ++i) + { + xml->pushNewElement("EngineFunctionArgument"); + const EngineTypeInfo* type = function->getArgumentType(i); + AssertFatal(type != NULL, "exportFunction - Argument cannot have type void!"); + + String argName; + if (i < numArgumentNames) + argName = argumentNames[i]; + + xml->setAttribute("name", argName); + xml->setAttribute("type", getTypeName(type)); + + if (i >= firstDefaultArg) + { + String defaultValue = getDefaultArgumentValue(function, type, argFrameOffset); + xml->setAttribute("defaultValue", defaultValue); + } + xml->popElement(); - + + if (type->getTypeKind() == EngineTypeKindStruct) + argFrameOffset += type->getInstanceSize(); + else + argFrameOffset += type->getValueSize(); + +#ifdef _PACK_BUG_WORKAROUNDS + if (argFrameOffset % 4 > 0) + argFrameOffset += 4 - (argFrameOffset % 4); +#endif + } + + xml->popElement(); + xml->popElement(); } @@ -343,148 +343,172 @@ static void exportFunction( const EngineFunctionInfo* function, SimXMLDocument* //----------------------------------------------------------------------------- -static void exportType( const EngineTypeInfo* type, SimXMLDocument* xml ) +static void exportType(const EngineTypeInfo* type, SimXMLDocument* xml) { // Don't export anonymous types. - if( !type->getTypeName()[ 0 ] ) + if (!type->getTypeName()[0]) return; - - if( isExportFiltered( type ) ) - return; - - const char* nodeName = NULL; - switch( type->getTypeKind() ) - { - case EngineTypeKindPrimitive: - nodeName = "EnginePrimitiveType"; - break; - - case EngineTypeKindEnum: - nodeName = "EngineEnumType"; - break; - - case EngineTypeKindBitfield: - nodeName = "EngineBitfieldType"; - break; - - case EngineTypeKindStruct: - nodeName = "EngineStructType"; - break; - - case EngineTypeKindClass: - nodeName = "EngineClassType"; - break; - - default: - return; - } - - xml->pushNewElement( nodeName ); - xml->setAttribute( "name", type->getTypeName() ); - xml->setAttribute( "size", String::ToString( type->getInstanceSize() ) ); - xml->setAttribute( "isAbstract", type->isAbstract() ? "1" : "0" ); - xml->setAttribute( "isInstantiable", type->isInstantiable() ? "1" : "0" ); - xml->setAttribute( "isDisposable", type->isDisposable() ? "1" : "0" ); - xml->setAttribute( "isSingleton", type->isSingleton() ? "1" : "0" ); - xml->setAttribute( "docs", getDocString( type ) ); - - if( type->getSuperType() ) - xml->setAttribute( "superType", getTypeName( type->getSuperType() ) ); - - if( type->getEnumTable() ) + if (isExportFiltered(type)) + return; + + const char* nodeName = NULL; + switch (type->getTypeKind()) + { + case EngineTypeKindPrimitive: + nodeName = "EnginePrimitiveType"; + break; + + case EngineTypeKindEnum: + nodeName = "EngineEnumType"; + break; + + case EngineTypeKindBitfield: + nodeName = "EngineBitfieldType"; + break; + + case EngineTypeKindStruct: + nodeName = "EngineStructType"; + break; + + case EngineTypeKindClass: + nodeName = "EngineClassType"; + break; + + default: + return; + } + + xml->pushNewElement(nodeName); + + xml->setAttribute("name", type->getTypeName()); + xml->setAttribute("size", String::ToString(type->getInstanceSize())); + xml->setAttribute("isAbstract", type->isAbstract() ? "1" : "0"); + xml->setAttribute("isInstantiable", type->isInstantiable() ? "1" : "0"); + xml->setAttribute("isDisposable", type->isDisposable() ? "1" : "0"); + xml->setAttribute("isSingleton", type->isSingleton() ? "1" : "0"); + xml->setAttribute("docs", getDocString(type)); + + if (type->getSuperType()) + xml->setAttribute("superType", getTypeName(type->getSuperType())); + + if (type->getEnumTable()) + { + xml->pushNewElement("enums"); + + const EngineEnumTable& table = *(type->getEnumTable()); + const U32 numValues = table.getNumValues(); + + for (U32 i = 0; i < numValues; ++i) { - xml->pushNewElement( "enums" ); - - const EngineEnumTable& table = *( type->getEnumTable() ); - const U32 numValues = table.getNumValues(); - - for( U32 i = 0; i < numValues; ++ i ) - { - xml->pushNewElement( "EngineEnum" ); - - xml->setAttribute( "name", table[ i ].getName() ); - xml->setAttribute( "value", String::ToString( table[ i ].getInt() ) ); - xml->setAttribute( "docs", table[ i ].getDocString() ? table[ i ].getDocString() : "" ); - - xml->popElement(); - } - + xml->pushNewElement("EngineEnum"); + + xml->setAttribute("name", table[i].getName()); + xml->setAttribute("value", String::ToString(table[i].getInt())); + xml->setAttribute("docs", table[i].getDocString() ? table[i].getDocString() : ""); + xml->popElement(); } - else if( type->getFieldTable() ) + + xml->popElement(); + } + else if (type->getFieldTable()) + { + xml->pushNewElement("fields"); + + const EngineFieldTable& table = *(type->getFieldTable()); + const U32 numFields = table.getNumFields(); + + for (U32 i = 0; i < numFields; ++i) { - xml->pushNewElement( "fields" ); - - const EngineFieldTable& table = *( type->getFieldTable() ); - const U32 numFields = table.getNumFields(); - - for( U32 i = 0; i < numFields; ++ i ) - { - const EngineFieldTable::Field& field = table[ i ]; - - xml->pushNewElement( "EngineField" ); - - xml->setAttribute( "name", field.getName() ); - xml->setAttribute( "type", getTypeName( field.getType() ) ); - xml->setAttribute( "offset", String::ToString( field.getOffset() ) ); - xml->setAttribute( "indexedSize", String::ToString( field.getNumElements() ) ); - xml->setAttribute( "docs", field.getDocString() ? field.getDocString() : "" ); - - xml->popElement(); - } - + const EngineFieldTable::Field& field = table[i]; + + xml->pushNewElement("EngineField"); + + xml->setAttribute("name", field.getName()); + xml->setAttribute("type", getTypeName(field.getType())); + xml->setAttribute("offset", String::ToString(field.getOffset())); + xml->setAttribute("indexedSize", String::ToString(field.getNumElements())); + xml->setAttribute("docs", field.getDocString() ? field.getDocString() : ""); + xml->popElement(); } - else if( type->getPropertyTable() ) + + xml->popElement(); + } + else if (type->getPropertyTable()) + { + xml->pushNewElement("properties"); + + const EnginePropertyTable& table = *(type->getPropertyTable()); + const U32 numProperties = table.getNumProperties(); + U32 groupNestingDepth = 0; + + for (U32 i = 0; i < numProperties; ++i) { - xml->pushNewElement( "properties" ); - - const EnginePropertyTable& table = *( type->getPropertyTable() ); - const U32 numProperties = table.getNumProperties(); - U32 groupNestingDepth = 0; - - for( U32 i = 0; i < numProperties; ++ i ) + const EnginePropertyTable::Property& property = table[i]; + + if (property.isGroupBegin()) + { + groupNestingDepth++; + xml->pushNewElement("EnginePropertyGroup"); + + xml->setAttribute("name", property.getName()); + xml->setAttribute("indexedSize", String::ToString(property.getNumElements())); + xml->setAttribute("docs", property.getDocString() ? property.getDocString() : ""); + + xml->pushNewElement("properties"); + } + else if (property.isGroupEnd()) + { + groupNestingDepth--; + xml->popElement(); + xml->popElement(); + } + else + { + if (property.getType() == AbstractClassRep::StartArrayFieldType + || property.getType() == AbstractClassRep::EndArrayFieldType) { + continue; + } + xml->pushNewElement("EngineProperty"); + + xml->setAttribute("name", property.getName()); + xml->setAttribute("indexedSize", String::ToString(property.getNumElements())); + xml->setAttribute("isConstant", property.isConstant() ? "1" : "0"); + xml->setAttribute("isTransient", property.isTransient() ? "1" : "0"); + xml->setAttribute("isVisible", property.hideInInspectors() ? "0" : "1"); + xml->setAttribute("docs", property.getDocString() ? property.getDocString() : ""); + + + const bool isDeprecated = (property.getType() == AbstractClassRep::DeprecatedFieldType); + + if (isDeprecated) { - const EnginePropertyTable::Property& property = table[ i ]; - - if( property.isGroupBegin() ) + xml->setAttribute("type", "deprecated"); + } + else + { + ConsoleBaseType *cbt = ConsoleBaseType::getType(property.getType()); + if (cbt != NULL) { - groupNestingDepth ++; - xml->pushNewElement( "EnginePropertyGroup" ); - - xml->setAttribute( "name", property.getName() ); - xml->setAttribute( "indexedSize", String::ToString( property.getNumElements() ) ); - xml->setAttribute( "docs", property.getDocString() ? property.getDocString() : "" ); - - xml->pushNewElement( "properties" ); - } - else if( property.isGroupEnd() ) - { - groupNestingDepth --; - xml->popElement(); - xml->popElement(); + xml->setAttribute("type", cbt->getTypeClassName()); } else { - xml->pushNewElement( "EngineProperty" ); - - xml->setAttribute( "name", property.getName() ); - xml->setAttribute( "indexedSize", String::ToString( property.getNumElements() ) ); - xml->setAttribute( "isConstant", property.isConstant() ? "1" : "0" ); - xml->setAttribute( "isTransient", property.isTransient() ? "1" : "0" ); - xml->setAttribute( "isVisible", property.hideInInspectors() ? "0" : "1" ); - xml->setAttribute( "docs", property.getDocString() ? property.getDocString() : "" ); - - xml->popElement(); + xml->setAttribute("type", "unknown"); } } - - AssertFatal( !groupNestingDepth, "exportType - Property group nesting mismatch!" ); - xml->popElement(); - } - exportScope( type, xml ); - + + xml->popElement(); + } + } + + AssertFatal(!groupNestingDepth, "exportType - Property group nesting mismatch!"); + xml->popElement(); + } + exportScope(type, xml); + xml->popElement(); } @@ -496,63 +520,63 @@ static void exportType( const EngineTypeInfo* type, SimXMLDocument* xml ) //----------------------------------------------------------------------------- -static void exportScope( const EngineExportScope* scope, SimXMLDocument* xml, bool addNode ) +static void exportScope(const EngineExportScope* scope, SimXMLDocument* xml, bool addNode) { - if( addNode ) + if (addNode) { - if( isExportFiltered( scope ) ) + if (isExportFiltered(scope)) return; - - xml->pushNewElement( "EngineExportScope" ); - - xml->setAttribute( "name", scope->getExportName() ); - xml->setAttribute( "docs", getDocString( scope ) ); + + xml->pushNewElement("EngineExportScope"); + + xml->setAttribute("name", scope->getExportName()); + xml->setAttribute("docs", getDocString(scope)); } // Dump all contained exports. - - xml->pushNewElement( "exports" ); - - for( const EngineExport* exportInfo = scope->getExports(); exportInfo != NULL; exportInfo = exportInfo->getNextExport() ) + + xml->pushNewElement("exports"); + + for (const EngineExport* exportInfo = scope->getExports(); exportInfo != NULL; exportInfo = exportInfo->getNextExport()) + { + switch (exportInfo->getExportKind()) { - switch( exportInfo->getExportKind() ) - { - case EngineExportKindScope: - exportScope( static_cast< const EngineExportScope* >( exportInfo ), xml, true ); - break; - - case EngineExportKindFunction: - exportFunction( static_cast< const EngineFunctionInfo* >( exportInfo ), xml ); - break; - - case EngineExportKindType: - exportType( static_cast< const EngineTypeInfo* >( exportInfo ), xml ); - break; - - default: - break; - } + case EngineExportKindScope: + exportScope(static_cast< const EngineExportScope* >(exportInfo), xml, true); + break; + + case EngineExportKindFunction: + exportFunction(static_cast< const EngineFunctionInfo* >(exportInfo), xml); + break; + + case EngineExportKindType: + exportType(static_cast< const EngineTypeInfo* >(exportInfo), xml); + break; + + default: + break; } - + } + xml->popElement(); - - if( addNode ) + + if (addNode) xml->popElement(); } //----------------------------------------------------------------------------- -DefineEngineFunction( exportEngineAPIToXML, SimXMLDocument*, (),, +DefineEngineFunction(exportEngineAPIToXML, SimXMLDocument*, (), , "Create a XML document containing a dump of the entire exported engine API.\n\n" "@return A SimXMLDocument containing a dump of the engine's export information or NULL if the operation failed.\n\n" - "@ingroup Console" ) + "@ingroup Console") { SimXMLDocument* xml = new SimXMLDocument; xml->registerObject(); - Sim::getRootGroup()->addObject( xml ); + Sim::getRootGroup()->addObject(xml); xml->addHeader(); - - exportScope( EngineExportScope::getGlobalScope(), xml, true ); - + + exportScope(EngineExportScope::getGlobalScope(), xml, true); + return xml; -} +} \ No newline at end of file diff --git a/Engine/source/console/fieldBrushObject.cpp b/Engine/source/console/fieldBrushObject.cpp index 486b5c40a..52e8cc391 100644 --- a/Engine/source/console/fieldBrushObject.cpp +++ b/Engine/source/console/fieldBrushObject.cpp @@ -123,7 +123,7 @@ static char* suppressSpaces(const char* in_pname) //----------------------------------------------------------------------------- // Query Groups. //----------------------------------------------------------------------------- -DefineConsoleMethod(FieldBrushObject, queryGroups, const char*, (const char* simObjName), , "(simObject) Query available static-field groups for selected object./\n" +DefineEngineMethod(FieldBrushObject, queryGroups, const char*, (const char* simObjName), , "(simObject) Query available static-field groups for selected object./\n" "@param simObject Object to query static-field groups on.\n" "@return Space-seperated static-field group list.") { @@ -191,7 +191,7 @@ DefineConsoleMethod(FieldBrushObject, queryGroups, const char*, (const char* sim //----------------------------------------------------------------------------- // Query Fields. //----------------------------------------------------------------------------- -DefineConsoleMethod(FieldBrushObject, queryFields, const char*, (const char* simObjName, const char* groupList), (""), "(simObject, [groupList]) Query available static-fields for selected object./\n" +DefineEngineMethod(FieldBrushObject, queryFields, const char*, (const char* simObjName, const char* groupList), (""), "(simObject, [groupList]) Query available static-fields for selected object./\n" "@param simObject Object to query static-fields on.\n" "@param groupList groups to filter static-fields against.\n" "@return Space-seperated static-field list.") @@ -366,7 +366,7 @@ DefineConsoleMethod(FieldBrushObject, queryFields, const char*, (const char* sim //----------------------------------------------------------------------------- // Copy Fields. //----------------------------------------------------------------------------- -DefineConsoleMethod(FieldBrushObject, copyFields, void, (const char* simObjName, const char* pFieldList), (""), "(simObject, [fieldList]) Copy selected static-fields for selected object./\n" +DefineEngineMethod(FieldBrushObject, copyFields, void, (const char* simObjName, const char* pFieldList), (""), "(simObject, [fieldList]) Copy selected static-fields for selected object./\n" "@param simObject Object to copy static-fields from.\n" "@param fieldList fields to filter static-fields against.\n" "@return No return value.") @@ -500,7 +500,7 @@ void FieldBrushObject::copyFields( SimObject* pSimObject, const char* fieldList //----------------------------------------------------------------------------- // Paste Fields. //----------------------------------------------------------------------------- -DefineConsoleMethod(FieldBrushObject, pasteFields, void, (const char* simObjName), , "(simObject) Paste copied static-fields to selected object./\n" +DefineEngineMethod(FieldBrushObject, pasteFields, void, (const char* simObjName), , "(simObject) Paste copied static-fields to selected object./\n" "@param simObject Object to paste static-fields to.\n" "@return No return value.") { diff --git a/Engine/source/console/fixedTuple.h b/Engine/source/console/fixedTuple.h new file mode 100644 index 000000000..871cd7011 --- /dev/null +++ b/Engine/source/console/fixedTuple.h @@ -0,0 +1,153 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 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 _FIXEDTUPLE_H_ +#define _FIXEDTUPLE_H_ +/// @name Fixed-layout tuple definition +/// These structs and templates serve as a way to pass arguments from external +/// applications and into the T3D console system. +/// They work as std::tuple, but they ensure a standardized fixed memory +/// layout. Allowing for unmanaged calls with these tuples as the parameter +/// lists. +/// +/// The implementation is from a SO solution: +/// https://codereview.stackexchange.com/a/52279 +/// As out use-case is pretty simple, this code could probably be simplified by +/// stripping out a lot of extra functionality. But eh. +/// +/// @{ + +template +struct fixed_tuple; + +template +struct fixed_tuple +{ + T first; + fixed_tuple rest; + + fixed_tuple() = default; + template ::type>::value>::type> + fixed_tuple(U&& u, Us&&...tail) : + first(::std::forward(u)), + rest(::std::forward(tail)...) {} +}; + +template +struct fixed_tuple +{ + T first; + + fixed_tuple() = default; + template ::type>::value>::type> + fixed_tuple(U&& u) : + first(::std::forward(u)) {} +}; + +template <> +struct fixed_tuple<> {}; + + +template < ::std::size_t i, class T> +struct fixed_tuple_element; + +template < ::std::size_t i, class T, class... Ts> +struct fixed_tuple_element > + : fixed_tuple_element > +{}; + +template +struct fixed_tuple_element<0, fixed_tuple > +{ + using type = T; +}; + +template < ::std::size_t i> +struct fixed_tuple_accessor +{ + template + static inline typename fixed_tuple_element >::type & get(fixed_tuple & t) + { + return fixed_tuple_accessor::get(t.rest); + } + + template + static inline const typename fixed_tuple_element >::type & get(const fixed_tuple & t) + { + return fixed_tuple_accessor::get(t.rest); + } +}; + +template <> +struct fixed_tuple_accessor<0> +{ + template + static inline typename fixed_tuple_element<0, fixed_tuple >::type & get(fixed_tuple & t) + { + return t.first; + } + + template + static inline const typename fixed_tuple_element<0, fixed_tuple >::type & get(const fixed_tuple & t) + { + return t.first; + } +}; + +template< typename T1, typename T2 > +struct fixed_tuple_mutator {}; + +template +struct fixed_tuple_mutator +{ + template + static inline typename std::enable_if::type + copy_r_t_l(fixed_tuple& src, fixed_tuple& dest) + { } + + template + static inline typename std::enable_if::type + copy_r_t_l(fixed_tuple& src, fixed_tuple& dest) + { + fixed_tuple_accessor::get(dest) = fixed_tuple_accessor::get(src); + copy_r_t_l(src, dest); + } + + template + static inline typename std::enable_if::type + copy(std::tuple& src, fixed_tuple& dest) + { } + + template + static inline typename std::enable_if::type + copy(std::tuple& src, fixed_tuple& dest) + { + fixed_tuple_accessor::get(dest) = std::get(src); + copy(src, dest); + } +}; + + +/// @} + + +#endif // !_FIXEDTUPLE_H_ \ No newline at end of file diff --git a/Engine/source/console/persistenceManager.cpp b/Engine/source/console/persistenceManager.cpp index 56812cd4b..75f209237 100644 --- a/Engine/source/console/persistenceManager.cpp +++ b/Engine/source/console/persistenceManager.cpp @@ -2190,14 +2190,14 @@ void PersistenceManager::deleteObjectsFromFile(const char* fileName) clearAll(); } -DefineConsoleMethod( PersistenceManager, deleteObjectsFromFile, void, ( const char * fileName ), , "( fileName )" +DefineEngineMethod( PersistenceManager, deleteObjectsFromFile, void, ( const char * fileName ), , "( fileName )" "Delete all of the objects that are created from the given file." ) { // Delete Objects. object->deleteObjectsFromFile( fileName ); } -DefineConsoleMethod( PersistenceManager, setDirty, void, ( const char * objName, const char * fileName ), (""), "(SimObject object, [filename])" +DefineEngineMethod( PersistenceManager, setDirty, void, ( const char * objName, const char * fileName ), (""), "(SimObject object, [filename])" "Mark an existing SimObject as dirty (will be written out when saveDirty() is called).") { SimObject *dirtyObject = NULL; @@ -2226,7 +2226,7 @@ DefineConsoleMethod( PersistenceManager, setDirty, void, ( const char * objName } } -DefineConsoleMethod( PersistenceManager, removeDirty, void, ( const char * objName ), , "(SimObject object)" +DefineEngineMethod( PersistenceManager, removeDirty, void, ( const char * objName ), , "(SimObject object)" "Remove a SimObject from the dirty list.") { SimObject *dirtyObject = NULL; @@ -2243,7 +2243,7 @@ DefineConsoleMethod( PersistenceManager, removeDirty, void, ( const char * objNa object->removeDirty(dirtyObject); } -DefineConsoleMethod( PersistenceManager, isDirty, bool, ( const char * objName ), , "(SimObject object)" +DefineEngineMethod( PersistenceManager, isDirty, bool, ( const char * objName ), , "(SimObject object)" "Returns true if the SimObject is on the dirty list.") { SimObject *dirtyObject = NULL; @@ -2262,19 +2262,19 @@ DefineConsoleMethod( PersistenceManager, isDirty, bool, ( const char * objName ) return false; } -DefineConsoleMethod( PersistenceManager, hasDirty, bool, (), , "()" +DefineEngineMethod( PersistenceManager, hasDirty, bool, (), , "()" "Returns true if the manager has dirty objects to save." ) { return object->hasDirty(); } -DefineConsoleMethod( PersistenceManager, getDirtyObjectCount, S32, (), , "()" +DefineEngineMethod( PersistenceManager, getDirtyObjectCount, S32, (), , "()" "Returns the number of dirty objects." ) { return object->getDirtyList().size(); } -DefineConsoleMethod( PersistenceManager, getDirtyObject, S32, (S32 index), , "( index )" +DefineEngineMethod( PersistenceManager, getDirtyObject, S32, (S32 index), , "( index )" "Returns the ith dirty object." ) { if ( index < 0 || index >= object->getDirtyList().size() ) @@ -2290,7 +2290,7 @@ DefineConsoleMethod( PersistenceManager, getDirtyObject, S32, (S32 index), , "( return ( dirtyObject.getObject() ) ? dirtyObject.getObject()->getId() : 0; } -DefineConsoleMethod( PersistenceManager, listDirty, void, (), , "()" +DefineEngineMethod( PersistenceManager, listDirty, void, (), , "()" "Prints the dirty list to the console.") { const PersistenceManager::DirtyList dirtyList = object->getDirtyList(); @@ -2318,13 +2318,13 @@ DefineConsoleMethod( PersistenceManager, listDirty, void, (), , "()" } } -DefineConsoleMethod( PersistenceManager, saveDirty, bool, (), , "()" +DefineEngineMethod( PersistenceManager, saveDirty, bool, (), , "()" "Saves all of the SimObject's on the dirty list to their respective files.") { return object->saveDirty(); } -DefineConsoleMethod( PersistenceManager, saveDirtyObject, bool, (const char * objName), , "(SimObject object)" +DefineEngineMethod( PersistenceManager, saveDirtyObject, bool, (const char * objName), , "(SimObject object)" "Save a dirty SimObject to it's file.") { SimObject *dirtyObject = NULL; @@ -2342,13 +2342,13 @@ DefineConsoleMethod( PersistenceManager, saveDirtyObject, bool, (const char * ob return false; } -DefineConsoleMethod( PersistenceManager, clearAll, void, (), , "()" +DefineEngineMethod( PersistenceManager, clearAll, void, (), , "()" "Clears all the tracked objects without saving them." ) { object->clearAll(); } -DefineConsoleMethod( PersistenceManager, removeObjectFromFile, void, (const char * objName, const char * filename),("") , "(SimObject object, [filename])" +DefineEngineMethod( PersistenceManager, removeObjectFromFile, void, (const char * objName, const char * filename),("") , "(SimObject object, [filename])" "Remove an existing SimObject from a file (can optionally specify a different file than \ the one it was created in.") { @@ -2371,7 +2371,7 @@ DefineConsoleMethod( PersistenceManager, removeObjectFromFile, void, (const char } } -DefineConsoleMethod( PersistenceManager, removeField, void, (const char * objName, const char * fieldName), , "(SimObject object, string fieldName)" +DefineEngineMethod( PersistenceManager, removeField, void, (const char * objName, const char * fieldName), , "(SimObject object, string fieldName)" "Remove a specific field from an object declaration.") { SimObject *dirtyObject = NULL; diff --git a/Engine/source/console/scriptFilename.cpp b/Engine/source/console/scriptFilename.cpp index 332f01d26..b0cacf2bc 100644 --- a/Engine/source/console/scriptFilename.cpp +++ b/Engine/source/console/scriptFilename.cpp @@ -27,7 +27,7 @@ #include "core/tSimpleHashTable.h" #include "core/strings/stringFunctions.h" #include "core/stringTable.h" -#include "console/console.h" +#include "console/engineAPI.h" #include "console/compiler.h" @@ -342,28 +342,26 @@ bool collapseScriptFilename(char *filename, U32 size, const char *src) // Console Functions //----------------------------------------------------------------------------- -ConsoleFunction(expandFilename, const char*, 2, 2, "(string filename)" - "@brief Grabs the full path of a specified file\n\n" - "@param filename Name of the local file to locate\n" - "@return String containing the full filepath on disk\n" - "@ingroup FileSystem") +DefineEngineFunction(expandFilename, const char*, (const char* filename),, + "@brief Grabs the full path of a specified file\n\n" + "@param filename Name of the local file to locate\n" + "@return String containing the full filepath on disk\n" + "@ingroup FileSystem") { - TORQUE_UNUSED(argc); static const U32 bufSize = 1024; - char* ret = Con::getReturnBuffer( bufSize ); - Con::expandScriptFilename(ret, bufSize, argv[1]); + char* ret = Con::getReturnBuffer(bufSize); + Con::expandScriptFilename(ret, bufSize, filename); return ret; } -ConsoleFunction(expandOldFilename, const char*, 2, 2, "(string filename)" - "@brief Retrofits a filepath that uses old Torque style\n\n" - "@return String containing filepath with new formatting\n" - "@ingroup FileSystem") +DefineEngineFunction(expandOldFilename, const char*, (const char* filename),, + "@brief Retrofits a filepath that uses old Torque style\n\n" + "@return String containing filepath with new formatting\n" + "@ingroup FileSystem") { - TORQUE_UNUSED(argc); static const U32 bufSize = 1024; - char* ret = Con::getReturnBuffer( bufSize ); - Con::expandOldScriptFilename(ret, bufSize, argv[1]); + char* ret = Con::getReturnBuffer(bufSize); + Con::expandOldScriptFilename(ret, bufSize, filename); return ret; } diff --git a/Engine/source/console/sim.cpp b/Engine/source/console/sim.cpp index cb01e8019..1fbcdd748 100644 --- a/Engine/source/console/sim.cpp +++ b/Engine/source/console/sim.cpp @@ -86,7 +86,7 @@ namespace Sim ConsoleFunctionGroupBegin ( SimFunctions, "Functions relating to Sim."); -DefineConsoleFunction( nameToID, S32, (const char * objectName), ,"nameToID(object)") +DefineEngineFunction( nameToID, S32, (const char * objectName), ,"nameToID(object)") { SimObject *obj = Sim::findObject(objectName); if(obj) @@ -95,7 +95,7 @@ DefineConsoleFunction( nameToID, S32, (const char * objectName), ,"nameToID(obje return -1; } -DefineConsoleFunction( isObject, bool, (const char * objectName), ,"isObject(object)") +DefineEngineFunction( isObject, bool, (const char * objectName), ,"isObject(object)") { if (!dStrcmp(objectName, "0") || !dStrcmp(objectName, "")) return false; @@ -133,7 +133,7 @@ ConsoleDocFragment _spawnObject1( "bool spawnObject(class [, dataBlock, name, properties, script]);" ); -DefineConsoleFunction( spawnObject, S32, ( const char * spawnClass +DefineEngineFunction( spawnObject, S32, ( const char * spawnClass , const char * spawnDataBlock , const char * spawnName , const char * spawnProperties @@ -149,39 +149,39 @@ DefineConsoleFunction( spawnObject, S32, ( const char * spawnClass return -1; } -DefineConsoleFunction( cancel, void, (S32 eventId), ,"cancel(eventId)") +DefineEngineFunction( cancel, void, (S32 eventId), ,"cancel(eventId)") { Sim::cancelEvent(eventId); } -DefineConsoleFunction( cancelAll, void, (const char * objectId), ,"cancelAll(objectId): cancel pending events on the specified object. Events will be automatically cancelled if object is deleted.") +DefineEngineFunction( cancelAll, void, (const char * objectId), ,"cancelAll(objectId): cancel pending events on the specified object. Events will be automatically cancelled if object is deleted.") { Sim::cancelPendingEvents(Sim::findObject(objectId)); } -DefineConsoleFunction( isEventPending, bool, (S32 scheduleId), ,"isEventPending(%scheduleId);") +DefineEngineFunction( isEventPending, bool, (S32 scheduleId), ,"isEventPending(%scheduleId);") { return Sim::isEventPending(scheduleId); } -DefineConsoleFunction( getEventTimeLeft, S32, (S32 scheduleId), ,"getEventTimeLeft(scheduleId) Get the time left in ms until this event will trigger.") +DefineEngineFunction( getEventTimeLeft, S32, (S32 scheduleId), ,"getEventTimeLeft(scheduleId) Get the time left in ms until this event will trigger.") { return Sim::getEventTimeLeft(scheduleId); } -DefineConsoleFunction( getScheduleDuration, S32, (S32 scheduleId), ,"getScheduleDuration(%scheduleId);" ) +DefineEngineFunction( getScheduleDuration, S32, (S32 scheduleId), ,"getScheduleDuration(%scheduleId);" ) { S32 ret = Sim::getScheduleDuration(scheduleId); return ret; } -DefineConsoleFunction( getTimeSinceStart, S32, (S32 scheduleId), ,"getTimeSinceStart(%scheduleId);" ) +DefineEngineFunction( getTimeSinceStart, S32, (S32 scheduleId), ,"getTimeSinceStart(%scheduleId);" ) { S32 ret = Sim::getTimeSinceStart(scheduleId); return ret; } -ConsoleFunction(schedule, S32, 4, 0, "schedule(time, refobject|0, command, )") +DefineEngineStringlyVariadicFunction(schedule, S32, 4, 0, "schedule(time, refobject|0, command, )") { U32 timeDelta = U32(dAtof(argv[1])); SimObject *refObject = Sim::findObject(argv[2]); @@ -202,7 +202,7 @@ ConsoleFunction(schedule, S32, 4, 0, "schedule(time, refobject|0, command, dumpClassHierarchy(); @@ -2982,7 +2982,7 @@ DefineConsoleMethod( SimObject, dumpClassHierarchy, void, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, isMemberOfClass, bool, ( const char* className ),, +DefineEngineMethod( SimObject, isMemberOfClass, bool, ( const char* className ),, "Test whether this object is a member of the specified class.\n" "@param className Name of a native C++ class.\n" "@return True if this object is an instance of the given C++ class or any of its super classes." ) @@ -3004,7 +3004,7 @@ DefineConsoleMethod( SimObject, isMemberOfClass, bool, ( const char* className ) //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, isInNamespaceHierarchy, bool, ( const char* name ),, +DefineEngineMethod( SimObject, isInNamespaceHierarchy, bool, ( const char* name ),, "Test whether the namespace of this object is a direct or indirect child to the given namespace.\n" "@param name The name of a namespace.\n" "@return True if the given namespace name is within the namespace hierarchy of this object." ) @@ -3039,7 +3039,7 @@ DefineEngineMethod( SimObject, getGroup, SimGroup*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, delete, void, (),, +DefineEngineMethod( SimObject, delete, void, (),, "Delete and remove the object." ) { object->deleteObject(); @@ -3047,7 +3047,7 @@ DefineConsoleMethod( SimObject, delete, void, (),, //----------------------------------------------------------------------------- -ConsoleMethod( SimObject,schedule, S32, 4, 0, "( float time, string method, string args... ) Delay an invocation of a method.\n" +DefineEngineStringlyVariadicMethod( SimObject,schedule, S32, 4, 0, "( float time, string method, string args... ) Delay an invocation of a method.\n" "@param time The number of milliseconds after which to invoke the method. This is a soft limit.\n" "@param method The method to call.\n" "@param args The arguments with which to call the method.\n" @@ -3067,7 +3067,7 @@ ConsoleMethod( SimObject,schedule, S32, 4, 0, "( float time, string method, stri //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getDynamicFieldCount, S32, (),, +DefineEngineMethod( SimObject, getDynamicFieldCount, S32, (),, "Get the number of dynamic fields defined on the object.\n" "@return The number of dynamic fields defined on the object." ) { @@ -3081,7 +3081,7 @@ DefineConsoleMethod( SimObject, getDynamicFieldCount, S32, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getDynamicField, const char*, ( S32 index ),, +DefineEngineMethod( SimObject, getDynamicField, const char*, ( S32 index ),, "Get a value of a dynamic field by index.\n" "@param index The index of the dynamic field.\n" "@return The value of the dynamic field at the given index or \"\"." ) @@ -3113,7 +3113,7 @@ DefineConsoleMethod( SimObject, getDynamicField, const char*, ( S32 index ),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getFieldCount, S32, (),, +DefineEngineMethod( SimObject, getFieldCount, S32, (),, "Get the number of static fields on the object.\n" "@return The number of static fields defined on the object." ) { @@ -3135,7 +3135,7 @@ DefineConsoleMethod( SimObject, getFieldCount, S32, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimObject, getField, const char*, ( S32 index ),, +DefineEngineMethod( SimObject, getField, const char*, ( S32 index ),, "Retrieve the value of a static field by index.\n" "@param index The index of the static field.\n" "@return The value of the static field with the given index or \"\"." ) diff --git a/Engine/source/console/simObject.h b/Engine/source/console/simObject.h index 741347300..39201966c 100644 --- a/Engine/source/console/simObject.h +++ b/Engine/source/console/simObject.h @@ -455,7 +455,6 @@ class SimObject: public ConsoleObject, public TamlCallbacks { T* object = new T; object->incRefCount(); - object->registerObject(); return object; } diff --git a/Engine/source/console/simPersistSet.cpp b/Engine/source/console/simPersistSet.cpp index 2dea6416e..00840c649 100644 --- a/Engine/source/console/simPersistSet.cpp +++ b/Engine/source/console/simPersistSet.cpp @@ -187,7 +187,7 @@ void SimPersistSet::addObject( SimObject* object ) //----------------------------------------------------------------------------- -DefineConsoleMethod( SimPersistSet, resolvePersistentIds, void, (), , "() - Try to bind unresolved persistent IDs in the set." ) +DefineEngineMethod( SimPersistSet, resolvePersistentIds, void, (), , "() - Try to bind unresolved persistent IDs in the set." ) { object->resolvePIDs(); } diff --git a/Engine/source/console/simSet.cpp b/Engine/source/console/simSet.cpp index 718e5f158..9b9b6ca67 100644 --- a/Engine/source/console/simSet.cpp +++ b/Engine/source/console/simSet.cpp @@ -895,15 +895,7 @@ DefineEngineMethod( SimSet, listObjects, void, (),, //----------------------------------------------------------------------------- -DEFINE_CALLIN( fnSimSet_add, add, SimSet, void, ( SimSet* set, SimObject* object ),,, - "Add the given object to the set.\n" - "@param object An object." ) -{ - if( object ) - set->addObject( object ); -} - -ConsoleMethod( SimSet, add, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, add, void, 3, 0, "( SimObject objects... ) Add the given objects to the set.\n" "@param objects The objects to add to the set." ) { @@ -919,15 +911,7 @@ ConsoleMethod( SimSet, add, void, 3, 0, //----------------------------------------------------------------------------- -DEFINE_CALLIN( fnSimSet_remove, remove, SimSet, void, ( SimSet* set, SimObject* object ),,, - "Remove the given object from the set.\n" - "@param object An object." ) -{ - if( object ) - set->removeObject( object ); -} - -ConsoleMethod( SimSet, remove, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, remove, void, 3, 0, "( SimObject objects... ) Remove the given objects from the set.\n" "@param objects The objects to remove from the set." ) { @@ -954,7 +938,7 @@ DefineEngineMethod( SimSet, clear, void, (),, //----------------------------------------------------------------------------- //UNSAFE; don't want this in the new API -DefineConsoleMethod( SimSet, deleteAllObjects, void, (), , "() Delete all objects in the set." ) +DefineEngineMethod( SimSet, deleteAllObjects, void, (), , "() Delete all objects in the set." ) { object->deleteAllObjects(); } @@ -970,7 +954,7 @@ DefineEngineMethod( SimSet, getRandom, SimObject*, (),, //----------------------------------------------------------------------------- -ConsoleMethod( SimSet, callOnChildren, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, callOnChildren, void, 3, 0, "( string method, string args... ) Call a method on all objects contained in the set.\n\n" "@param method The name of the method to call.\n" "@param args The arguments to the method.\n\n" @@ -982,7 +966,7 @@ ConsoleMethod( SimSet, callOnChildren, void, 3, 0, //----------------------------------------------------------------------------- -ConsoleMethod( SimSet, callOnChildrenNoRecurse, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, callOnChildrenNoRecurse, void, 3, 0, "( string method, string args... ) Call a method on all objects contained in the set.\n\n" "@param method The name of the method to call.\n" "@param args The arguments to the method.\n\n" @@ -1026,7 +1010,7 @@ DEFINE_CALLIN( fnSimSet_getCountRecursive, getCountRecursive, SimSet, U32, ( Sim return set->sizeRecursive(); } -DefineConsoleMethod( SimSet, getFullCount, S32, (), , "() Get the number of direct and indirect child objects contained in the set.\n" +DefineEngineMethod( SimSet, getFullCount, S32, (), , "() Get the number of direct and indirect child objects contained in the set.\n" "@return The number of objects contained in the set as well as in other sets contained directly or indirectly in the set." ) { return object->sizeRecursive(); @@ -1122,7 +1106,7 @@ DefineEngineMethod( SimSet, pushToBack, void, ( SimObject* obj ),, //----------------------------------------------------------------------------- -DefineConsoleMethod( SimSet, sort, void, ( const char * callbackFunction ), , "( string callbackFunction ) Sort the objects in the set using the given comparison function.\n" +DefineEngineMethod( SimSet, sort, void, ( const char * callbackFunction ), , "( string callbackFunction ) Sort the objects in the set using the given comparison function.\n" "@param callbackFunction Name of a function that takes two object arguments A and B and returns -1 if A is less, 1 if B is less, and 0 if both are equal." ) { object->scriptSort( callbackFunction ); diff --git a/Engine/source/console/telnetConsole.cpp b/Engine/source/console/telnetConsole.cpp index 3a2edf92a..620c669bf 100644 --- a/Engine/source/console/telnetConsole.cpp +++ b/Engine/source/console/telnetConsole.cpp @@ -61,7 +61,7 @@ void TelnetConsole::destroy() TelConsole = NULL; } -DefineConsoleFunction( telnetSetParameters, void, ( int port, const char* consolePass, const char* listenPass, bool remoteEcho ), ( false ), +DefineEngineFunction( telnetSetParameters, void, ( int port, const char* consolePass, const char* listenPass, bool remoteEcho ), ( false ), "@brief Initializes and open the telnet console.\n\n" "@param port Port to listen on for console connections (0 will shut down listening).\n" "@param consolePass Password for read/write access to console.\n" diff --git a/Engine/source/console/telnetDebugger.cpp b/Engine/source/console/telnetDebugger.cpp index 7cb39dc83..161ed5695 100644 --- a/Engine/source/console/telnetDebugger.cpp +++ b/Engine/source/console/telnetDebugger.cpp @@ -113,7 +113,7 @@ MODULE_END; // BRKCLR file line - sent when a breakpoint cannot be moved to a breakable line on the client. // -DefineConsoleFunction( dbgSetParameters, void, (S32 port, const char * password, bool waitForClient ), (false), "( int port, string password, bool waitForClient )" +DefineEngineFunction( dbgSetParameters, void, (S32 port, const char * password, bool waitForClient ), (false), "( int port, string password, bool waitForClient )" "Open a debug server port on the specified port, requiring the specified password, " "and optionally waiting for the debug client to connect.\n" "@internal Primarily used for Torsion and other debugging tools") @@ -124,14 +124,14 @@ DefineConsoleFunction( dbgSetParameters, void, (S32 port, const char * password, } } -DefineConsoleFunction( dbgIsConnected, bool, (), , "()" +DefineEngineFunction( dbgIsConnected, bool, (), , "()" "Returns true if a script debugging client is connected else return false.\n" "@internal Primarily used for Torsion and other debugging tools") { return TelDebugger && TelDebugger->isConnected(); } -DefineConsoleFunction( dbgDisconnect, void, (), , "()" +DefineEngineFunction( dbgDisconnect, void, (), , "()" "Forcibly disconnects any attached script debugging client.\n" "@internal Primarily used for Torsion and other debugging tools") { diff --git a/Engine/source/core/color.cpp b/Engine/source/core/color.cpp index 273a2a658..1fea8cfec 100644 --- a/Engine/source/core/color.cpp +++ b/Engine/source/core/color.cpp @@ -536,80 +536,67 @@ float LinearColorF::sSrgbToLinear[256] = #endif //----------------------------------------------------------------------------- -ConsoleFunction( getStockColorCount, S32, 1, 1, "() - Gets a count of available stock colors.\n" - "@return A count of available stock colors." ) +DefineEngineFunction(getStockColorCount, S32, (),, + "@brief 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" +DefineEngineFunction(getStockColorName, const char*, (S32 stockColorIndex),, + "@brief 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." ) + "@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 ); + 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" +DefineEngineFunction(isStockColor, bool, (const char* stockColorName),, + "@brief 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" ) + "@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 ); + return StockColor::isColor(stockColorName); } //----------------------------------------------------------------------------- -ConsoleFunction( getStockColorF, const char*, 2, 2, "(stockColorName) - Gets a floating-point-based stock color by name.\n" +DefineEngineFunction(getStockColorF, LinearColorF, (const char* stockColorName),, + "@brief 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" ) + "@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 ) ) + if (!StockColor::isColor(stockColorName)) return StringTable->EmptyString(); // Fetch stock color. - const LinearColorF& color = StockColor::colorF( pStockColorName ); + const LinearColorF& color = StockColor::colorF(stockColorName); - // 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); + return color; } //----------------------------------------------------------------------------- -ConsoleFunction( getStockColorI, const char*, 2, 2, "(stockColorName) - Gets a byte-based stock color by name.\n" +DefineEngineFunction(getStockColorI, ColorI, (const char* stockColorName),, + "@brief 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" ) + "@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 ) ) + if (!StockColor::isColor(stockColorName)) return StringTable->EmptyString(); // Fetch stock color. - const ColorI& color = StockColor::colorI( pStockColorName ); + const ColorI& color = StockColor::colorI(stockColorName); - // 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); + return color; } \ No newline at end of file diff --git a/Engine/source/core/dnet.cpp b/Engine/source/core/dnet.cpp index a5fe53f6c..e7d1b6ae0 100644 --- a/Engine/source/core/dnet.cpp +++ b/Engine/source/core/dnet.cpp @@ -50,7 +50,7 @@ static const char *packetTypeNames[] = //----------------------------------------------------------------- //----------------------------------------------------------------- //----------------------------------------------------------------- -DefineConsoleFunction( DNetSetLogging, void, (bool enabled), , "(bool enabled)" +DefineEngineFunction( DNetSetLogging, void, (bool enabled), , "(bool enabled)" "@brief Enables logging of the connection protocols\n\n" "When enabled a lot of network debugging information is sent to the console.\n" "@param enabled True to enable, false to disable\n" diff --git a/Engine/source/core/fileObject.cpp b/Engine/source/core/fileObject.cpp index e872d7838..c0f9b17ae 100644 --- a/Engine/source/core/fileObject.cpp +++ b/Engine/source/core/fileObject.cpp @@ -484,7 +484,7 @@ static ConsoleDocFragment _FileObjectwriteObject2( "FileObject", "void writeObject( SimObject* object, string prepend);"); -DefineConsoleMethod( FileObject, writeObject, void, (const char * simName, const char * objName), (""), "FileObject.writeObject(SimObject, object prepend)" +DefineEngineMethod( FileObject, writeObject, void, (const char * simName, const char * objName), (""), "FileObject.writeObject(SimObject, object prepend)" "@hide") { SimObject* obj = Sim::findObject( simName ); diff --git a/Engine/source/core/frameAllocator.cpp b/Engine/source/core/frameAllocator.cpp index 846328290..5c9530271 100644 --- a/Engine/source/core/frameAllocator.cpp +++ b/Engine/source/core/frameAllocator.cpp @@ -21,7 +21,7 @@ //----------------------------------------------------------------------------- #include "core/frameAllocator.h" -#include "console/console.h" +#include "console/engineAPI.h" U8* FrameAllocator::smBuffer = NULL; U32 FrameAllocator::smWaterMark = 0; @@ -30,7 +30,7 @@ U32 FrameAllocator::smHighWaterMark = 0; #ifdef TORQUE_DEBUG U32 FrameAllocator::smMaxFrameAllocation = 0; -ConsoleFunction(getMaxFrameAllocation, S32, 1,1, "getMaxFrameAllocation();") +DefineEngineFunction(getMaxFrameAllocation, S32, (),,"") { return FrameAllocator::getMaxFrameAllocation(); } diff --git a/Engine/source/core/resourceManager.cpp b/Engine/source/core/resourceManager.cpp index 09b889f95..c5b6e0fa6 100644 --- a/Engine/source/core/resourceManager.cpp +++ b/Engine/source/core/resourceManager.cpp @@ -222,18 +222,17 @@ ResourceBase ResourceManager::nextResource() ConsoleFunctionGroupBegin(ResourceManagerFunctions, "Resource management functions."); -ConsoleFunction(resourceDump, void, 1, 1, "()" - "@brief List the currently managed resources\n\n" - "Currently used by editors only, internal\n" - "@ingroup Editors\n" - "@internal") +DefineEngineFunction(resourceDump, void, (),, + "@brief List the currently managed resources\n\n" + "Currently used by editors only, internal\n" + "@ingroup Editors\n" + "@internal") { #ifdef TORQUE_DEBUG ResourceManager::get().dumpToConsole(); #endif } - DefineEngineFunction( reloadResource, void, ( const char* path ),, "Force the resource at specified input path to be reloaded\n" "@param path Path to the resource to be reloaded\n\n" diff --git a/Engine/source/core/stream/bitStream.cpp b/Engine/source/core/stream/bitStream.cpp index 1a5ab3202..68dbd6a3b 100644 --- a/Engine/source/core/stream/bitStream.cpp +++ b/Engine/source/core/stream/bitStream.cpp @@ -140,7 +140,7 @@ class HuffmanProcessor static HuffmanProcessor g_huffProcessor; - bool readHuffBuffer(BitStream* pStream, char* out_pBuffer); + bool readHuffBuffer(BitStream* pStream, char* out_pBuffer, S32 maxLen); bool writeHuffBuffer(BitStream* pStream, const char* out_pBuffer, S32 maxLen); }; @@ -488,24 +488,51 @@ void BitStream::readAffineTransform(MatrixF* matrix) void BitStream::writeQuat( const QuatF& quat, U32 bitCount ) { - writeSignedFloat( quat.x, bitCount ); - writeSignedFloat( quat.y, bitCount ); - writeSignedFloat( quat.z, bitCount ); - writeFlag( quat.w < 0.0f ); + F32 quatVals[4] = { quat.x, quat.y, quat.z, quat.w }; + bool flipQuat = (quatVals[0] < 0); + F32 maxVal = mFabs(quatVals[0]); + S32 idxMax = 0; + + for (S32 i = 1; i < 4; ++i) + { + if (mFabs(quatVals[i]) > maxVal) + { + idxMax = i; + maxVal = mFabs(quatVals[i]); + flipQuat = (quatVals[i] < 0); + } + } + writeInt(idxMax, 2); + + for (S32 i = 0; i < 4; ++i) + { + if (i == idxMax) + continue; + F32 curValue = (flipQuat ? -quatVals[i] : quatVals[i]) * (F32) M_SQRT2; + writeSignedFloat( curValue, bitCount ); + } } void BitStream::readQuat( QuatF *outQuat, U32 bitCount ) { - outQuat->x = readSignedFloat( bitCount ); - outQuat->y = readSignedFloat( bitCount ); - outQuat->z = readSignedFloat( bitCount ); + F32 quatVals[4]; + F32 sum = 0.0f; - outQuat->w = mSqrt( 1.0 - getMin( mSquared( outQuat->x ) + - mSquared( outQuat->y ) + - mSquared( outQuat->z ), - 1.0f ) ); - if ( readFlag() ) - outQuat->w = -outQuat->w; + S32 idxMax = readInt( 2 ); + for (S32 i = 0; i < 4; ++i) + { + if (i == idxMax) + continue; + quatVals[i] = readSignedFloat( bitCount ) * M_SQRTHALF_F; + sum += quatVals[i] * quatVals[i]; + } + + if (sum > 1.0f) + quatVals[idxMax] = 1.0f; + else + quatVals[idxMax] = mSqrt(1.0f - sum); + + outQuat->set(quatVals[0], quatVals[1], quatVals[2], quatVals[3]); } void BitStream::writeBits( const BitVector &bitvec ) @@ -667,12 +694,12 @@ void BitStream::readString(char buf[256]) if(readFlag()) { S32 offset = readInt(8); - HuffmanProcessor::g_huffProcessor.readHuffBuffer(this, stringBuffer + offset); + HuffmanProcessor::g_huffProcessor.readHuffBuffer(this, stringBuffer + offset, 256 - offset); dStrcpy(buf, stringBuffer, 256); return; } } - HuffmanProcessor::g_huffProcessor.readHuffBuffer(this, buf); + HuffmanProcessor::g_huffProcessor.readHuffBuffer(this, buf, 256); if(stringBuffer) dStrcpy(stringBuffer, buf, 256); } @@ -812,13 +839,16 @@ S16 HuffmanProcessor::determineIndex(HuffWrap& rWrap) } } -bool HuffmanProcessor::readHuffBuffer(BitStream* pStream, char* out_pBuffer) +bool HuffmanProcessor::readHuffBuffer(BitStream* pStream, char* out_pBuffer, S32 maxLen=256) { if (m_tablesBuilt == false) buildTables(); if (pStream->readFlag()) { S32 len = pStream->readInt(8); + if (len >= maxLen) { + len = maxLen; + } for (S32 i = 0; i < len; i++) { S32 index = 0; while (true) { @@ -839,6 +869,9 @@ bool HuffmanProcessor::readHuffBuffer(BitStream* pStream, char* out_pBuffer) } else { // Uncompressed string... U32 len = pStream->readInt(8); + if (len >= maxLen) { + len = maxLen; + } pStream->read(len, out_pBuffer); out_pBuffer[len] = '\0'; return true; diff --git a/Engine/source/core/stream/bitStream.h b/Engine/source/core/stream/bitStream.h index b0bb2f22a..bd81f3b1b 100644 --- a/Engine/source/core/stream/bitStream.h +++ b/Engine/source/core/stream/bitStream.h @@ -207,18 +207,18 @@ public: void readAffineTransform(MatrixF*); /// Writes a quaternion in a lossy compressed format that - /// is ( bitCount * 3 ) + 1 bits in size. + /// is ( bitCount * 3 ) + 2 bits in size. /// /// @param quat The normalized quaternion to write. - /// @param bitCount The the storage space for the xyz component of + /// @param bitCount The the storage space for the packed components of /// the quaternion. /// void writeQuat( const QuatF& quat, U32 bitCount = 9 ); /// Reads a quaternion written with writeQuat. /// - /// @param quat The normalized quaternion to write. - /// @param bitCount The the storage space for the xyz component of + /// @param quat The quaternion that was read. + /// @param bitCount The the storage space for the packed components of /// the quaternion. Must match the bitCount at write. /// @see writeQuat /// diff --git a/Engine/source/core/stringBuffer.cpp b/Engine/source/core/stringBuffer.cpp index 3d15a6183..a55446885 100644 --- a/Engine/source/core/stringBuffer.cpp +++ b/Engine/source/core/stringBuffer.cpp @@ -48,12 +48,12 @@ void dumpAllStrings(); }; - DefineConsoleFunction( sbmDumpStats, void, (), , "()") + DefineEngineFunction( sbmDumpStats, void, (), , "()") { StringBufferManager::getManager().dumpStats(); } - DefineConsoleFunction( sbmDumpStrings, void, (), , "()") + DefineEngineFunction( sbmDumpStrings, void, (), , "()") { StringBufferManager::getManager().dumpAllStrings(); } diff --git a/Engine/source/core/util/str.cpp b/Engine/source/core/util/str.cpp index 63580e2b4..1a15b8b85 100644 --- a/Engine/source/core/util/str.cpp +++ b/Engine/source/core/util/str.cpp @@ -480,7 +480,7 @@ static U32 sgStringInstances; #endif -DefineConsoleFunction( dumpStringMemStats, void, (), , "()" +DefineEngineFunction( dumpStringMemStats, void, (), , "()" "@brief Dumps information about String memory usage\n\n" "@ingroup Debugging\n" "@ingroup Strings\n") diff --git a/Engine/source/environment/VolumetricFogRTManager.cpp b/Engine/source/environment/VolumetricFogRTManager.cpp index 7b7b00d50..9eca811f9 100644 --- a/Engine/source/environment/VolumetricFogRTManager.cpp +++ b/Engine/source/environment/VolumetricFogRTManager.cpp @@ -283,7 +283,7 @@ VolumetricFogRTManager* VolumetricFogRTManager::get() return gVolumetricFogRTManager; } -DefineConsoleFunction(SetFogVolumeQuality, S32, (U32 new_quality), , +DefineEngineFunction(SetFogVolumeQuality, S32, (U32 new_quality), , "@brief Resizes the rendertargets of the Volumetric Fog object.\n" "@params new_quality new quality for the rendertargets 1 = full size, 2 = halfsize, 3 = 1/3, 4 = 1/4 ...") { diff --git a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp index d36fb5cd9..bb78ba61e 100644 --- a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp @@ -1185,67 +1185,67 @@ void GuiMeshRoadEditorCtrl::matchTerrainToRoad() // with the terrain underneath it. } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, deleteNode, void, (), , "deleteNode()" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, deleteNode, void, (), , "deleteNode()" ) { object->deleteSelectedNode(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getMode, const char*, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getMode, const char*, (), , "" ) { return object->getMode(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setMode, void, (const char * mode), , "setMode( String mode )" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setMode, void, (const char * mode), , "setMode( String mode )" ) { String newMode = ( mode ); object->setMode( newMode ); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getNodeWidth, F32, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getNodeWidth, F32, (), , "" ) { return object->getNodeWidth(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) { object->setNodeWidth( width ); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getNodeDepth, F32, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getNodeDepth, F32, (), , "" ) { return object->getNodeDepth(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setNodeDepth, void, ( F32 depth ), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setNodeDepth, void, ( F32 depth ), , "" ) { object->setNodeDepth( depth ); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getNodePosition, Point3F, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getNodePosition, Point3F, (), , "" ) { return object->getNodePosition(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setNodePosition, void, (Point3F pos), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setNodePosition, void, (Point3F pos), , "" ) { object->setNodePosition( pos ); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getNodeNormal, Point3F, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getNodeNormal, Point3F, (), , "" ) { return object->getNodeNormal(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setNodeNormal, void, (Point3F normal), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setNodeNormal, void, (Point3F normal), , "" ) { object->setNodeNormal( normal ); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, setSelectedRoad, void, (const char * objName), (""), "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, setSelectedRoad, void, (const char * objName), (""), "" ) { if ( String::isEmpty(objName) ) object->setSelectedRoad(NULL); @@ -1257,7 +1257,7 @@ DefineConsoleMethod( GuiMeshRoadEditorCtrl, setSelectedRoad, void, (const char * } } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) { MeshRoad *road = object->getSelectedRoad(); if ( !road ) @@ -1266,14 +1266,14 @@ DefineConsoleMethod( GuiMeshRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) return road->getId(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, regenerate, void, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, regenerate, void, (), , "" ) { MeshRoad *road = object->getSelectedRoad(); if ( road ) road->regenerate(); } -DefineConsoleMethod( GuiMeshRoadEditorCtrl, matchTerrainToRoad, void, (), , "" ) +DefineEngineMethod( GuiMeshRoadEditorCtrl, matchTerrainToRoad, void, (), , "" ) { object->matchTerrainToRoad(); } diff --git a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp index 103d6e380..50abb45df 100644 --- a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp @@ -1393,66 +1393,66 @@ void GuiRiverEditorCtrl::_renderSelectedRiver( ObjectRenderInst *ri, SceneRender } } -DefineConsoleMethod( GuiRiverEditorCtrl, deleteNode, void, (), , "deleteNode()" ) +DefineEngineMethod( GuiRiverEditorCtrl, deleteNode, void, (), , "deleteNode()" ) { object->deleteSelectedNode(); } -DefineConsoleMethod( GuiRiverEditorCtrl, getMode, const char*, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getMode, const char*, (), , "" ) { return object->getMode(); } -DefineConsoleMethod( GuiRiverEditorCtrl, setMode, void, ( const char * mode ), , "setMode( String mode )" ) +DefineEngineMethod( GuiRiverEditorCtrl, setMode, void, ( const char * mode ), , "setMode( String mode )" ) { String newMode = ( mode ); object->setMode( newMode ); } -DefineConsoleMethod( GuiRiverEditorCtrl, getNodeWidth, F32, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getNodeWidth, F32, (), , "" ) { return object->getNodeWidth(); } -DefineConsoleMethod( GuiRiverEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) { object->setNodeWidth( width ); } -DefineConsoleMethod( GuiRiverEditorCtrl, getNodeDepth, F32, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getNodeDepth, F32, (), , "" ) { return object->getNodeDepth(); } -DefineConsoleMethod( GuiRiverEditorCtrl, setNodeDepth, void, ( F32 depth ), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, setNodeDepth, void, ( F32 depth ), , "" ) { object->setNodeDepth( depth ); } -DefineConsoleMethod( GuiRiverEditorCtrl, getNodePosition, Point3F, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getNodePosition, Point3F, (), , "" ) { return object->getNodePosition(); } -DefineConsoleMethod( GuiRiverEditorCtrl, setNodePosition, void, (Point3F pos), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, setNodePosition, void, (Point3F pos), , "" ) { object->setNodePosition( pos ); } -DefineConsoleMethod( GuiRiverEditorCtrl, getNodeNormal, Point3F, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getNodeNormal, Point3F, (), , "" ) { return object->getNodeNormal(); } -DefineConsoleMethod( GuiRiverEditorCtrl, setNodeNormal, void, (Point3F normal), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, setNodeNormal, void, (Point3F normal), , "" ) { object->setNodeNormal( normal ); } -DefineConsoleMethod( GuiRiverEditorCtrl, setSelectedRiver, void, (const char * objName), (""), "" ) +DefineEngineMethod( GuiRiverEditorCtrl, setSelectedRiver, void, (const char * objName), (""), "" ) { if (dStrcmp( objName,"" )==0) object->setSelectedRiver(NULL); @@ -1464,7 +1464,7 @@ DefineConsoleMethod( GuiRiverEditorCtrl, setSelectedRiver, void, (const char * o } } -DefineConsoleMethod( GuiRiverEditorCtrl, getSelectedRiver, S32, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, getSelectedRiver, S32, (), , "" ) { River *river = object->getSelectedRiver(); if ( !river ) @@ -1473,7 +1473,7 @@ DefineConsoleMethod( GuiRiverEditorCtrl, getSelectedRiver, S32, (), , "" ) return river->getId(); } -DefineConsoleMethod( GuiRiverEditorCtrl, regenerate, void, (), , "" ) +DefineEngineMethod( GuiRiverEditorCtrl, regenerate, void, (), , "" ) { River *river = object->getSelectedRiver(); if ( river ) diff --git a/Engine/source/environment/editors/guiRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiRoadEditorCtrl.cpp index 167a5db45..7a2ec8a96 100644 --- a/Engine/source/environment/editors/guiRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRoadEditorCtrl.cpp @@ -1037,45 +1037,45 @@ void GuiRoadEditorCtrl::submitUndo( const UTF8 *name ) undoMan->addAction( action ); } -DefineConsoleMethod( GuiRoadEditorCtrl, deleteNode, void, (), , "deleteNode()" ) +DefineEngineMethod( GuiRoadEditorCtrl, deleteNode, void, (), , "deleteNode()" ) { object->deleteSelectedNode(); } -DefineConsoleMethod( GuiRoadEditorCtrl, getMode, const char*, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, getMode, const char*, (), , "" ) { return object->getMode(); } -DefineConsoleMethod( GuiRoadEditorCtrl, setMode, void, ( const char * mode ), , "setMode( String mode )" ) +DefineEngineMethod( GuiRoadEditorCtrl, setMode, void, ( const char * mode ), , "setMode( String mode )" ) { String newMode = ( mode ); object->setMode( newMode ); } -DefineConsoleMethod( GuiRoadEditorCtrl, getNodeWidth, F32, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, getNodeWidth, F32, (), , "" ) { return object->getNodeWidth(); } -DefineConsoleMethod( GuiRoadEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, setNodeWidth, void, ( F32 width ), , "" ) { object->setNodeWidth( width ); } -DefineConsoleMethod( GuiRoadEditorCtrl, getNodePosition, Point3F, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, getNodePosition, Point3F, (), , "" ) { return object->getNodePosition(); } -DefineConsoleMethod( GuiRoadEditorCtrl, setNodePosition, void, ( Point3F pos ), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, setNodePosition, void, ( Point3F pos ), , "" ) { object->setNodePosition( pos ); } -DefineConsoleMethod( GuiRoadEditorCtrl, setSelectedRoad, void, ( const char * pathRoad ), (""), "" ) +DefineEngineMethod( GuiRoadEditorCtrl, setSelectedRoad, void, ( const char * pathRoad ), (""), "" ) { if (dStrcmp( pathRoad,"")==0 ) object->setSelectedRoad(NULL); @@ -1087,7 +1087,7 @@ DefineConsoleMethod( GuiRoadEditorCtrl, setSelectedRoad, void, ( const char * pa } } -DefineConsoleMethod( GuiRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) { DecalRoad *road = object->getSelectedRoad(); if ( road ) @@ -1096,12 +1096,12 @@ DefineConsoleMethod( GuiRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) return NULL; } -DefineConsoleMethod( GuiRoadEditorCtrl, getSelectedNode, S32, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, getSelectedNode, S32, (), , "" ) { return object->getSelectedNode(); } -DefineConsoleMethod( GuiRoadEditorCtrl, deleteRoad, void, (), , "" ) +DefineEngineMethod( GuiRoadEditorCtrl, deleteRoad, void, (), , "" ) { object->deleteSelectedRoad(); } diff --git a/Engine/source/environment/skyBox.cpp b/Engine/source/environment/skyBox.cpp index 913d37168..23ceaf722 100644 --- a/Engine/source/environment/skyBox.cpp +++ b/Engine/source/environment/skyBox.cpp @@ -641,7 +641,7 @@ BaseMatInstance* SkyBox::_getMaterialInstance() return mMatInstance; } -DefineConsoleMethod( SkyBox, postApply, void, (), , "") +DefineEngineMethod( SkyBox, postApply, void, (), , "") { object->inspectPostApply(); } \ No newline at end of file diff --git a/Engine/source/environment/sun.cpp b/Engine/source/environment/sun.cpp index d83d7078b..7063e1a27 100644 --- a/Engine/source/environment/sun.cpp +++ b/Engine/source/environment/sun.cpp @@ -558,12 +558,12 @@ void Sun::_onUnselected() Parent::_onUnselected(); } -DefineConsoleMethod(Sun, apply, void, (), , "") +DefineEngineMethod(Sun, apply, void, (), , "") { object->inspectPostApply(); } -DefineConsoleMethod(Sun, animate, void, ( F32 duration, F32 startAzimuth, F32 endAzimuth, F32 startElevation, F32 endElevation ), , "animate( F32 duration, F32 startAzimuth, F32 endAzimuth, F32 startElevation, F32 endElevation )") +DefineEngineMethod(Sun, animate, void, ( F32 duration, F32 startAzimuth, F32 endAzimuth, F32 startElevation, F32 endElevation ), , "animate( F32 duration, F32 startAzimuth, F32 endAzimuth, F32 startElevation, F32 endElevation )") { object->animate(duration, startAzimuth, endAzimuth, startElevation, endElevation); diff --git a/Engine/source/forest/editor/forestBrushElement.cpp b/Engine/source/forest/editor/forestBrushElement.cpp index bfdedd2b8..86e89e3d6 100644 --- a/Engine/source/forest/editor/forestBrushElement.cpp +++ b/Engine/source/forest/editor/forestBrushElement.cpp @@ -187,7 +187,7 @@ bool ForestBrush::containsItemData( const ForestItemData *inData ) return false; } -DefineConsoleMethod( ForestBrush, containsItemData, bool, ( const char * obj ), , "( ForestItemData obj )" ) +DefineEngineMethod( ForestBrush, containsItemData, bool, ( const char * obj ), , "( ForestItemData obj )" ) { ForestItemData *data = NULL; if ( !Sim::findObject( obj, data ) ) diff --git a/Engine/source/forest/editor/forestBrushTool.cpp b/Engine/source/forest/editor/forestBrushTool.cpp index ae71951b5..d0d64d517 100644 --- a/Engine/source/forest/editor/forestBrushTool.cpp +++ b/Engine/source/forest/editor/forestBrushTool.cpp @@ -682,7 +682,7 @@ bool ForestBrushTool::getGroundAt( const Point3F &worldPt, F32 *zValueOut, Vecto return true; } -DefineConsoleMethod( ForestBrushTool, collectElements, void, (), , "" ) +DefineEngineMethod( ForestBrushTool, collectElements, void, (), , "" ) { object->collectElements(); } \ No newline at end of file diff --git a/Engine/source/forest/editor/forestEditorCtrl.cpp b/Engine/source/forest/editor/forestEditorCtrl.cpp index d8b54ba9c..db8a58f3c 100644 --- a/Engine/source/forest/editor/forestEditorCtrl.cpp +++ b/Engine/source/forest/editor/forestEditorCtrl.cpp @@ -370,24 +370,24 @@ bool ForestEditorCtrl::isDirty() return foundDirty; } -DefineConsoleMethod( ForestEditorCtrl, updateActiveForest, void, (), , "()" ) +DefineEngineMethod( ForestEditorCtrl, updateActiveForest, void, (), , "()" ) { object->updateActiveForest( true ); } -DefineConsoleMethod( ForestEditorCtrl, setActiveTool, void, ( const char * toolName ), , "( ForestTool tool )" ) +DefineEngineMethod( ForestEditorCtrl, setActiveTool, void, ( const char * toolName ), , "( ForestTool tool )" ) { ForestTool *tool = dynamic_cast( Sim::findObject( toolName ) ); object->setActiveTool( tool ); } -DefineConsoleMethod( ForestEditorCtrl, getActiveTool, S32, (), , "()" ) +DefineEngineMethod( ForestEditorCtrl, getActiveTool, S32, (), , "()" ) { ForestTool *tool = object->getActiveTool(); return tool ? tool->getId() : 0; } -DefineConsoleMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj ), , "( ForestItemData obj )" ) +DefineEngineMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj ), , "( ForestItemData obj )" ) { ForestItemData *db; if ( !Sim::findObject( obj, db ) ) @@ -396,12 +396,12 @@ DefineConsoleMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj object->deleteMeshSafe( db ); } -DefineConsoleMethod( ForestEditorCtrl, isDirty, bool, (), , "" ) +DefineEngineMethod( ForestEditorCtrl, isDirty, bool, (), , "" ) { return object->isDirty(); } -DefineConsoleMethod(ForestEditorCtrl, setActiveForest, void, (const char * obj), , "( Forest obj )") +DefineEngineMethod(ForestEditorCtrl, setActiveForest, void, (const char * obj), , "( Forest obj )") { Forest *forestObject; if (!Sim::findObject(obj, forestObject)) diff --git a/Engine/source/forest/editor/forestSelectionTool.cpp b/Engine/source/forest/editor/forestSelectionTool.cpp index a453f4e99..f6689c9b8 100644 --- a/Engine/source/forest/editor/forestSelectionTool.cpp +++ b/Engine/source/forest/editor/forestSelectionTool.cpp @@ -563,32 +563,32 @@ void ForestSelectionTool::onUndoAction() mBounds.intersect( mSelection[i].getWorldBox() ); } -DefineConsoleMethod( ForestSelectionTool, getSelectionCount, S32, (), , "" ) +DefineEngineMethod( ForestSelectionTool, getSelectionCount, S32, (), , "" ) { return object->getSelectionCount(); } -DefineConsoleMethod( ForestSelectionTool, deleteSelection, void, (), , "" ) +DefineEngineMethod( ForestSelectionTool, deleteSelection, void, (), , "" ) { object->deleteSelection(); } -DefineConsoleMethod( ForestSelectionTool, clearSelection, void, (), , "" ) +DefineEngineMethod( ForestSelectionTool, clearSelection, void, (), , "" ) { object->clearSelection(); } -DefineConsoleMethod( ForestSelectionTool, cutSelection, void, (), , "" ) +DefineEngineMethod( ForestSelectionTool, cutSelection, void, (), , "" ) { object->cutSelection(); } -DefineConsoleMethod( ForestSelectionTool, copySelection, void, (), , "" ) +DefineEngineMethod( ForestSelectionTool, copySelection, void, (), , "" ) { object->copySelection(); } -DefineConsoleMethod( ForestSelectionTool, pasteSelection, void, (), , "" ) +DefineEngineMethod( ForestSelectionTool, pasteSelection, void, (), , "" ) { object->pasteSelection(); } diff --git a/Engine/source/forest/forest.cpp b/Engine/source/forest/forest.cpp index e6b2fd8bd..985f34151 100644 --- a/Engine/source/forest/forest.cpp +++ b/Engine/source/forest/forest.cpp @@ -361,22 +361,22 @@ void Forest::saveDataFile( const char *path ) mData->write( mDataFileName ); } -DefineConsoleMethod( Forest, saveDataFile, void, (const char * path), (""), "saveDataFile( [path] )" ) +DefineEngineMethod( Forest, saveDataFile, void, (const char * path), (""), "saveDataFile( [path] )" ) { object->saveDataFile( path ); } -DefineConsoleMethod(Forest, isDirty, bool, (), , "()") +DefineEngineMethod(Forest, isDirty, bool, (), , "()") { return object->getData() && object->getData()->isDirty(); } -DefineConsoleMethod(Forest, regenCells, void, (), , "()") +DefineEngineMethod(Forest, regenCells, void, (), , "()") { object->getData()->regenCells(); } -DefineConsoleMethod(Forest, clear, void, (), , "()" ) +DefineEngineMethod(Forest, clear, void, (), , "()" ) { object->clear(); } diff --git a/Engine/source/gfx/gfxDevice.cpp b/Engine/source/gfx/gfxDevice.cpp index 64bf96cc9..d8e79eeff 100644 --- a/Engine/source/gfx/gfxDevice.cpp +++ b/Engine/source/gfx/gfxDevice.cpp @@ -1385,7 +1385,7 @@ DefineEngineFunction( getBestHDRFormat, GFXFormat, (),, return format; } -DefineConsoleFunction(ResetGFX, void, (), , "forces the gbuffer to be reinitialized in cases of improper/lack of buffer clears.") +DefineEngineFunction(ResetGFX, void, (), , "forces the gbuffer to be reinitialized in cases of improper/lack of buffer clears.") { GFX->beginReset(); } \ No newline at end of file diff --git a/Engine/source/gfx/gfxInit.cpp b/Engine/source/gfx/gfxInit.cpp index 1c7f1f42a..b5d67206d 100644 --- a/Engine/source/gfx/gfxInit.cpp +++ b/Engine/source/gfx/gfxInit.cpp @@ -523,7 +523,7 @@ DefineEngineStaticMethod( GFXInit, getAdapterModeCount, S32, ( S32 index ),, return adapters[index]->mAvailableModes.size(); } -DefineConsoleStaticMethod( GFXInit, getAdapterMode, String, ( S32 index, S32 modeIndex ),, +DefineEngineStaticMethod( GFXInit, getAdapterMode, String, ( S32 index, S32 modeIndex ),, "Gets the details of the specified adapter mode.\n\n" "@param index Index of the adapter to query.\n" "@param modeIndex Index of the mode to get data from.\n" diff --git a/Engine/source/gfx/gl/gfxGLDevice.cpp b/Engine/source/gfx/gl/gfxGLDevice.cpp index d135ee06a..eb1d1a677 100644 --- a/Engine/source/gfx/gl/gfxGLDevice.cpp +++ b/Engine/source/gfx/gl/gfxGLDevice.cpp @@ -998,7 +998,7 @@ public: static GFXGLRegisterDevice pGLRegisterDevice; -ConsoleFunction(cycleResources, void, 1, 1, "") +DefineEngineFunction(cycleResources, void, (),, "") { static_cast(GFX)->zombify(); static_cast(GFX)->resurrect(); diff --git a/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp b/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp index 254141b71..02155a4f1 100644 --- a/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp +++ b/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp @@ -86,7 +86,7 @@ protected: GFXProfiler gfxProfiler; -DefineConsoleFunction(printGFXGLTimers, void,(), ,"") +DefineEngineFunction(printGFXGLTimers, void,(), ,"") { gfxProfiler.printTimes(); } diff --git a/Engine/source/gfx/video/theoraTextureObject.cpp b/Engine/source/gfx/video/theoraTextureObject.cpp index 13e73402b..e83314870 100644 --- a/Engine/source/gfx/video/theoraTextureObject.cpp +++ b/Engine/source/gfx/video/theoraTextureObject.cpp @@ -191,7 +191,7 @@ void TheoraTextureObject::play() //----------------------------------------------------------------------------- -DefineConsoleMethod( TheoraTextureObject, play, void, (),, +DefineEngineMethod( TheoraTextureObject, play, void, (),, "Start playback of the video." ) { object->play(); @@ -199,7 +199,7 @@ DefineConsoleMethod( TheoraTextureObject, play, void, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( TheoraTextureObject, stop, void, (),, +DefineEngineMethod( TheoraTextureObject, stop, void, (),, "Stop playback of the video." ) { object->stop(); @@ -207,7 +207,7 @@ DefineConsoleMethod( TheoraTextureObject, stop, void, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( TheoraTextureObject, pause, void, (),, +DefineEngineMethod( TheoraTextureObject, pause, void, (),, "Pause playback of the video." ) { object->pause(); diff --git a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp index fb2b9a5f9..c3e7cf8a2 100644 --- a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp @@ -92,17 +92,17 @@ void GuiToolboxButtonCtrl::onSleep() //------------------------------------- -DefineConsoleMethod( GuiToolboxButtonCtrl, setNormalBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is active") +DefineEngineMethod( GuiToolboxButtonCtrl, setNormalBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is active") { object->setNormalBitmap(name); } -DefineConsoleMethod( GuiToolboxButtonCtrl, setLoweredBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is disabled") +DefineEngineMethod( GuiToolboxButtonCtrl, setLoweredBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is disabled") { object->setLoweredBitmap(name); } -DefineConsoleMethod( GuiToolboxButtonCtrl, setHoverBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is disabled") +DefineEngineMethod( GuiToolboxButtonCtrl, setHoverBitmap, void, ( const char * name ), , "( filepath name ) sets the bitmap that shows when the button is disabled") { object->setHoverBitmap(name); } diff --git a/Engine/source/gui/controls/guiBitmapCtrl.cpp b/Engine/source/gui/controls/guiBitmapCtrl.cpp index 769445dc3..855b78900 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.cpp +++ b/Engine/source/gui/controls/guiBitmapCtrl.cpp @@ -261,7 +261,7 @@ static ConsoleDocFragment _sGuiBitmapCtrlSetBitmap2( //"Set the bitmap displayed in the control. Note that it is limited in size, to 256x256." -DefineConsoleMethod( GuiBitmapCtrl, setBitmap, void, ( const char * fileRoot, bool resize), ( false), +DefineEngineMethod( GuiBitmapCtrl, setBitmap, void, ( const char * fileRoot, bool resize), ( false), "( String filename | String filename, bool resize ) Assign an image to the control.\n\n" "@hide" ) { diff --git a/Engine/source/gui/controls/guiColorPicker.cpp b/Engine/source/gui/controls/guiColorPicker.cpp index 98f9620b3..d0e3034b6 100644 --- a/Engine/source/gui/controls/guiColorPicker.cpp +++ b/Engine/source/gui/controls/guiColorPicker.cpp @@ -658,17 +658,17 @@ void GuiColorPickerCtrl::setScriptValue(const char *value) setValue(newValue); } -DefineConsoleMethod(GuiColorPickerCtrl, getSelectorPos, Point2I, (), , "Gets the current position of the selector") +DefineEngineMethod(GuiColorPickerCtrl, getSelectorPos, Point2I, (), , "Gets the current position of the selector") { return object->getSelectorPos(); } -DefineConsoleMethod(GuiColorPickerCtrl, setSelectorPos, void, (Point2I newPos), , "Sets the current position of the selector") +DefineEngineMethod(GuiColorPickerCtrl, setSelectorPos, void, (Point2I newPos), , "Sets the current position of the selector") { object->setSelectorPos(newPos); } -DefineConsoleMethod(GuiColorPickerCtrl, updateColor, void, (), , "Forces update of pick color") +DefineEngineMethod(GuiColorPickerCtrl, updateColor, void, (), , "Forces update of pick color") { object->updateColor(); } diff --git a/Engine/source/gui/controls/guiFileTreeCtrl.cpp b/Engine/source/gui/controls/guiFileTreeCtrl.cpp index b6531fbaa..8513fb82b 100644 --- a/Engine/source/gui/controls/guiFileTreeCtrl.cpp +++ b/Engine/source/gui/controls/guiFileTreeCtrl.cpp @@ -379,18 +379,18 @@ void GuiFileTreeCtrl::recurseInsert( Item* parent, StringTableEntry path ) } -DefineConsoleMethod( GuiFileTreeCtrl, getSelectedPath, const char*, (), , "getSelectedPath() - returns the currently selected path in the tree") +DefineEngineMethod( GuiFileTreeCtrl, getSelectedPath, const char*, (), , "getSelectedPath() - returns the currently selected path in the tree") { const String& path = object->getSelectedPath(); return Con::getStringArg( path ); } -DefineConsoleMethod( GuiFileTreeCtrl, setSelectedPath, bool, (const char * path), , "setSelectedPath(path) - expands the tree to the specified path") +DefineEngineMethod( GuiFileTreeCtrl, setSelectedPath, bool, (const char * path), , "setSelectedPath(path) - expands the tree to the specified path") { return object->setSelectedPath( path ); } -DefineConsoleMethod( GuiFileTreeCtrl, reload, void, (), , "() - Reread the directory tree hierarchy." ) +DefineEngineMethod( GuiFileTreeCtrl, reload, void, (), , "() - Reread the directory tree hierarchy." ) { object->updateTree(); } diff --git a/Engine/source/gui/controls/guiGradientCtrl.cpp b/Engine/source/gui/controls/guiGradientCtrl.cpp index 20454b73d..112f3859d 100644 --- a/Engine/source/gui/controls/guiGradientCtrl.cpp +++ b/Engine/source/gui/controls/guiGradientCtrl.cpp @@ -601,7 +601,7 @@ void GuiGradientCtrl::sortColorRange() dQsort( mAlphaRange.address(), mAlphaRange.size(), sizeof(ColorRange), _numIncreasing); } -DefineConsoleMethod(GuiGradientCtrl, getColorCount, S32, (), , "Get color count") +DefineEngineMethod(GuiGradientCtrl, getColorCount, S32, (), , "Get color count") { if( object->getDisplayMode() == GuiGradientCtrl::pHorizColorRange ) return object->mColorRange.size(); @@ -611,7 +611,7 @@ DefineConsoleMethod(GuiGradientCtrl, getColorCount, S32, (), , "Get color count" return 0; } -DefineConsoleMethod(GuiGradientCtrl, getColor, LinearColorF, (S32 idx), , "Get color value") +DefineEngineMethod(GuiGradientCtrl, getColor, LinearColorF, (S32 idx), , "Get color value") { if( object->getDisplayMode() == GuiGradientCtrl::pHorizColorRange ) diff --git a/Engine/source/gui/controls/guiMaterialCtrl.cpp b/Engine/source/gui/controls/guiMaterialCtrl.cpp index edfb12e76..d6e5cf833 100644 --- a/Engine/source/gui/controls/guiMaterialCtrl.cpp +++ b/Engine/source/gui/controls/guiMaterialCtrl.cpp @@ -167,7 +167,7 @@ void GuiMaterialCtrl::onRender( Point2I offset, const RectI &updateRect ) GFX->setTexture( 0, NULL ); } -DefineConsoleMethod( GuiMaterialCtrl, setMaterial, bool, ( const char * materialName ), , "( string materialName )" +DefineEngineMethod( GuiMaterialCtrl, setMaterial, bool, ( const char * materialName ), , "( string materialName )" "Set the material to be displayed in the control." ) { return object->setMaterial( materialName ); diff --git a/Engine/source/gui/controls/guiPopUpCtrl.cpp b/Engine/source/gui/controls/guiPopUpCtrl.cpp index c1454f206..418f1a0de 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrl.cpp @@ -300,82 +300,82 @@ void GuiPopUpMenuCtrl::initPersistFields(void) } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrl, add, void, (const char * name, S32 idNum, U32 scheme), ("", -1, 0), "(string name, int idNum, int scheme=0)") +DefineEngineMethod( GuiPopUpMenuCtrl, add, void, (const char * name, S32 idNum, U32 scheme), ("", -1, 0), "(string name, int idNum, int scheme=0)") { object->addEntry(name, idNum, scheme); } -DefineConsoleMethod( GuiPopUpMenuCtrl, addScheme, void, (U32 id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL), , +DefineEngineMethod( GuiPopUpMenuCtrl, addScheme, void, (U32 id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL), , "(int id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL)") { object->addScheme( id, fontColor, fontColorHL, fontColorSEL ); } -DefineConsoleMethod( GuiPopUpMenuCtrl, getText, const char*, (), , "") +DefineEngineMethod( GuiPopUpMenuCtrl, getText, const char*, (), , "") { return object->getText(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, clear, void, (), , "Clear the popup list.") +DefineEngineMethod( GuiPopUpMenuCtrl, clear, void, (), , "Clear the popup list.") { object->clear(); } //FIXME: clashes with SimSet.sort -DefineConsoleMethod(GuiPopUpMenuCtrl, sort, void, (), , "Sort the list alphabetically.") +DefineEngineMethod(GuiPopUpMenuCtrl, sort, void, (), , "Sort the list alphabetically.") { object->sort(); } // Added to sort the entries by ID -DefineConsoleMethod(GuiPopUpMenuCtrl, sortID, void, (), , "Sort the list by ID.") +DefineEngineMethod(GuiPopUpMenuCtrl, sortID, void, (), , "Sort the list by ID.") { object->sortID(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, forceOnAction, void, (), , "") +DefineEngineMethod( GuiPopUpMenuCtrl, forceOnAction, void, (), , "") { object->onAction(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, forceClose, void, (), , "") +DefineEngineMethod( GuiPopUpMenuCtrl, forceClose, void, (), , "") { object->closePopUp(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, getSelected, S32, (), , "Gets the selected index") +DefineEngineMethod( GuiPopUpMenuCtrl, getSelected, S32, (), , "Gets the selected index") { return object->getSelected(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, setSelected, void, (S32 id, bool scriptCallback), (true), "(int id, [scriptCallback=true])") +DefineEngineMethod( GuiPopUpMenuCtrl, setSelected, void, (S32 id, bool scriptCallback), (true), "(int id, [scriptCallback=true])") { object->setSelected( id, scriptCallback ); } -DefineConsoleMethod( GuiPopUpMenuCtrl, setFirstSelected, void, (bool scriptCallback), (true), "([scriptCallback=true])") +DefineEngineMethod( GuiPopUpMenuCtrl, setFirstSelected, void, (bool scriptCallback), (true), "([scriptCallback=true])") { object->setFirstSelected( scriptCallback ); } -DefineConsoleMethod( GuiPopUpMenuCtrl, setNoneSelected, void, (), , "") +DefineEngineMethod( GuiPopUpMenuCtrl, setNoneSelected, void, (), , "") { object->setNoneSelected(); } -DefineConsoleMethod( GuiPopUpMenuCtrl, getTextById, const char*, (S32 id), , "(int id)") +DefineEngineMethod( GuiPopUpMenuCtrl, getTextById, const char*, (S32 id), , "(int id)") { return(object->getTextById(id)); } -DefineConsoleMethod( GuiPopUpMenuCtrl, changeTextById, void, ( S32 id, const char * text ), , "( int id, string text )" ) +DefineEngineMethod( GuiPopUpMenuCtrl, changeTextById, void, ( S32 id, const char * text ), , "( int id, string text )" ) { object->setEntryText( id, text ); } -DefineConsoleMethod( GuiPopUpMenuCtrl, setEnumContent, void, (const char * className, const char * enumName), , "(string class, string enum)" +DefineEngineMethod( GuiPopUpMenuCtrl, setEnumContent, void, (const char * className, const char * enumName), , "(string class, string enum)" "This fills the popup with a classrep's field enumeration type info.\n\n" "More of a helper function than anything. If console access to the field list is added, " "at least for the enumerated types, then this should go away..") @@ -429,20 +429,20 @@ DefineConsoleMethod( GuiPopUpMenuCtrl, setEnumContent, void, (const char * class } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrl, findText, S32, (const char * text), , "(string text)" +DefineEngineMethod( GuiPopUpMenuCtrl, findText, S32, (const char * text), , "(string text)" "Returns the position of the first entry containing the specified text or -1 if not found.") { return( object->findText( text ) ); } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrl, size, S32, (), , "Get the size of the menu - the number of entries in it.") +DefineEngineMethod( GuiPopUpMenuCtrl, size, S32, (), , "Get the size of the menu - the number of entries in it.") { return( object->getNumEntries() ); } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrl, replaceText, void, (bool doReplaceText), , "(bool doReplaceText)") +DefineEngineMethod( GuiPopUpMenuCtrl, replaceText, void, (bool doReplaceText), , "(bool doReplaceText)") { object->replaceText(S32(doReplaceText)); } @@ -532,7 +532,7 @@ void GuiPopUpMenuCtrl::clearEntry( S32 entry ) } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrl, clearEntry, void, (S32 entry), , "(S32 entry)") +DefineEngineMethod( GuiPopUpMenuCtrl, clearEntry, void, (S32 entry), , "(S32 entry)") { object->clearEntry(entry); } diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp index dbd5356b5..bec481163 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp @@ -364,7 +364,7 @@ ConsoleDocFragment _GuiPopUpMenuCtrlExAdd( "void add(string name, S32 idNum, S32 scheme=0);" ); -DefineConsoleMethod( GuiPopUpMenuCtrlEx, add, void, (const char * name, S32 idNum, U32 scheme), ("", -1, 0), "(string name, int idNum, int scheme=0)") +DefineEngineMethod( GuiPopUpMenuCtrlEx, add, void, (const char * name, S32 idNum, U32 scheme), ("", -1, 0), "(string name, int idNum, int scheme=0)") { object->addEntry(name, idNum, scheme); } @@ -525,7 +525,7 @@ ConsoleDocFragment _GuiPopUpMenuCtrlExsetSelected( "setSelected(int id, bool scriptCallback=true);" ); -DefineConsoleMethod( GuiPopUpMenuCtrlEx, setSelected, void, (S32 id, bool scriptCallback), (true), "(int id, [scriptCallback=true])" +DefineEngineMethod( GuiPopUpMenuCtrlEx, setSelected, void, (S32 id, bool scriptCallback), (true), "(int id, [scriptCallback=true])" "@hide") { object->setSelected( id, scriptCallback ); @@ -539,7 +539,7 @@ ConsoleDocFragment _GuiPopUpMenuCtrlExsetFirstSelected( ); -DefineConsoleMethod( GuiPopUpMenuCtrlEx, setFirstSelected, void, (bool scriptCallback), (true), "([scriptCallback=true])" +DefineEngineMethod( GuiPopUpMenuCtrlEx, setFirstSelected, void, (bool scriptCallback), (true), "([scriptCallback=true])" "@hide") { object->setFirstSelected( scriptCallback ); @@ -561,7 +561,7 @@ DefineEngineMethod( GuiPopUpMenuCtrlEx, getTextById, const char*, (S32 id),, } -DefineConsoleMethod( GuiPopUpMenuCtrlEx, getColorById, ColorI, (S32 id), , +DefineEngineMethod( GuiPopUpMenuCtrlEx, getColorById, ColorI, (S32 id), , "@brief Get color of an entry's box\n\n" "@param id ID number of entry to query\n\n" "@return ColorI in the format of \"Red Green Blue Alpha\", each of with is a value between 0 - 255") @@ -572,7 +572,7 @@ DefineConsoleMethod( GuiPopUpMenuCtrlEx, getColorById, ColorI, (S32 id), , } -DefineConsoleMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, ( const char * className, const char * enumName ), , +DefineEngineMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, ( const char * className, const char * enumName ), , "@brief This fills the popup with a classrep's field enumeration type info.\n\n" "More of a helper function than anything. If console access to the field list is added, " "at least for the enumerated types, then this should go away.\n\n" @@ -628,7 +628,7 @@ DefineConsoleMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, ( const char * cl } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrlEx, findText, S32, (const char * text), , "(string text)" +DefineEngineMethod( GuiPopUpMenuCtrlEx, findText, S32, (const char * text), , "(string text)" "Returns the id of the first entry containing the specified text or -1 if not found." "@param text String value used for the query\n\n" "@return Numerical ID of entry containing the text.") @@ -637,7 +637,7 @@ DefineConsoleMethod( GuiPopUpMenuCtrlEx, findText, S32, (const char * text), , " } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrlEx, size, S32, (), , +DefineEngineMethod( GuiPopUpMenuCtrlEx, size, S32, (), , "@brief Get the size of the menu\n\n" "@return Number of entries in the menu\n") { @@ -645,7 +645,7 @@ DefineConsoleMethod( GuiPopUpMenuCtrlEx, size, S32, (), , } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrlEx, replaceText, void, (S32 boolVal), , +DefineEngineMethod( GuiPopUpMenuCtrlEx, replaceText, void, (S32 boolVal), , "@brief Flag that causes each new text addition to replace the current entry\n\n" "@param True to turn on replacing, false to disable it") { @@ -737,7 +737,7 @@ void GuiPopUpMenuCtrlEx::clearEntry( S32 entry ) } //------------------------------------------------------------------------------ -DefineConsoleMethod( GuiPopUpMenuCtrlEx, clearEntry, void, (S32 entry), , "(S32 entry)") +DefineEngineMethod( GuiPopUpMenuCtrlEx, clearEntry, void, (S32 entry), , "(S32 entry)") { object->clearEntry(entry); } diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index 7961c4f89..7e8d95190 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -2139,7 +2139,7 @@ ConsoleDocFragment _pushDialog( "void pushDialog( GuiControl ctrl, int layer=0, bool center=false);" ); -DefineConsoleMethod( GuiCanvas, pushDialog, void, (const char * ctrlName, S32 layer, bool center), ( 0, false), "(GuiControl ctrl, int layer=0, bool center=false)" +DefineEngineMethod( GuiCanvas, pushDialog, void, (const char * ctrlName, S32 layer, bool center), ( 0, false), "(GuiControl ctrl, int layer=0, bool center=false)" "@hide") { GuiControl *gui; @@ -2176,7 +2176,7 @@ ConsoleDocFragment _popDialog2( "void popDialog();" ); -DefineConsoleMethod( GuiCanvas, popDialog, void, (GuiControl * gui), (nullAsType()), "(GuiControl ctrl=NULL)" +DefineEngineMethod( GuiCanvas, popDialog, void, (GuiControl * gui), (nullAsType()), "(GuiControl ctrl=NULL)" "@hide") { if (gui) @@ -2204,7 +2204,7 @@ ConsoleDocFragment _popLayer2( "void popLayer(S32 layer);" ); -DefineConsoleMethod( GuiCanvas, popLayer, void, (S32 layer), (0), "(int layer)" +DefineEngineMethod( GuiCanvas, popLayer, void, (S32 layer), (0), "(int layer)" "@hide") { @@ -2362,7 +2362,7 @@ ConsoleDocFragment _setCursorPos2( "bool setCursorPos( F32 posX, F32 posY);" ); -DefineConsoleMethod( GuiCanvas, setCursorPos, void, (Point2I pos), , "(Point2I pos)" +DefineEngineMethod( GuiCanvas, setCursorPos, void, (Point2I pos), , "(Point2I pos)" "@hide") { @@ -2647,7 +2647,7 @@ DefineEngineMethod( GuiCanvas, setWindowPosition, void, ( Point2I position ),, object->getPlatformWindow()->setPosition( position ); } -DefineConsoleMethod( GuiCanvas, isFullscreen, bool, (), , "() - Is this canvas currently fullscreen?" ) +DefineEngineMethod( GuiCanvas, isFullscreen, bool, (), , "() - Is this canvas currently fullscreen?" ) { if (Platform::getWebDeployment()) return false; @@ -2658,14 +2658,14 @@ DefineConsoleMethod( GuiCanvas, isFullscreen, bool, (), , "() - Is this canvas c return object->getPlatformWindow()->getVideoMode().fullScreen; } -DefineConsoleMethod( GuiCanvas, minimizeWindow, void, (), , "() - minimize this canvas' window." ) +DefineEngineMethod( GuiCanvas, minimizeWindow, void, (), , "() - minimize this canvas' window." ) { PlatformWindow* window = object->getPlatformWindow(); if ( window ) window->minimize(); } -DefineConsoleMethod( GuiCanvas, isMinimized, bool, (), , "()" ) +DefineEngineMethod( GuiCanvas, isMinimized, bool, (), , "()" ) { PlatformWindow* window = object->getPlatformWindow(); if ( window ) @@ -2674,7 +2674,7 @@ DefineConsoleMethod( GuiCanvas, isMinimized, bool, (), , "()" ) return false; } -DefineConsoleMethod( GuiCanvas, isMaximized, bool, (), , "()" ) +DefineEngineMethod( GuiCanvas, isMaximized, bool, (), , "()" ) { PlatformWindow* window = object->getPlatformWindow(); if ( window ) @@ -2683,21 +2683,21 @@ DefineConsoleMethod( GuiCanvas, isMaximized, bool, (), , "()" ) return false; } -DefineConsoleMethod( GuiCanvas, maximizeWindow, void, (), , "() - maximize this canvas' window." ) +DefineEngineMethod( GuiCanvas, maximizeWindow, void, (), , "() - maximize this canvas' window." ) { PlatformWindow* window = object->getPlatformWindow(); if ( window ) window->maximize(); } -DefineConsoleMethod( GuiCanvas, restoreWindow, void, (), , "() - restore this canvas' window." ) +DefineEngineMethod( GuiCanvas, restoreWindow, void, (), , "() - restore this canvas' window." ) { PlatformWindow* window = object->getPlatformWindow(); if( window ) window->restore(); } -DefineConsoleMethod( GuiCanvas, setFocus, void, (), , "() - Claim OS input focus for this canvas' window.") +DefineEngineMethod( GuiCanvas, setFocus, void, (), , "() - Claim OS input focus for this canvas' window.") { PlatformWindow* window = object->getPlatformWindow(); if( window ) @@ -2712,7 +2712,7 @@ DefineEngineMethod( GuiCanvas, setMenuBar, void, ( GuiControl* menu ),, return object->setMenuBar( menu ); } -DefineConsoleMethod( GuiCanvas, setVideoMode, void, +DefineEngineMethod( GuiCanvas, setVideoMode, void, (U32 width, U32 height, bool fullscreen, U32 bitDepth, U32 refreshRate, U32 antialiasLevel), ( false, 0, 0, 0), "(int width, int height, bool fullscreen, [int bitDepth], [int refreshRate], [int antialiasLevel] )\n" @@ -2812,7 +2812,7 @@ DefineConsoleMethod( GuiCanvas, setVideoMode, void, Con::setVariable( "$pref::Video::mode", vm.toString() ); } -ConsoleMethod( GuiCanvas, showWindow, void, 2, 2, "" ) +DefineEngineMethod(GuiCanvas, showWindow, void, (),, "") { if (!object->getPlatformWindow()) return; @@ -2822,7 +2822,7 @@ ConsoleMethod( GuiCanvas, showWindow, void, 2, 2, "" ) object->getPlatformWindow()->setDisplayWindow(true); } -ConsoleMethod( GuiCanvas, hideWindow, void, 2, 2, "" ) +DefineEngineMethod(GuiCanvas, hideWindow, void, (),, "") { if (!object->getPlatformWindow()) return; @@ -2832,30 +2832,29 @@ ConsoleMethod( GuiCanvas, hideWindow, void, 2, 2, "" ) object->getPlatformWindow()->setDisplayWindow(false); } -ConsoleMethod( GuiCanvas, cursorClick, void, 4, 4, "button, isDown" ) +DefineEngineMethod(GuiCanvas, cursorClick, void, (S32 buttonId, bool isDown), , "") { - const S32 buttonId = dAtoi(argv[2]); - const bool isDown = dAtob(argv[3]); - object->cursorClick(buttonId, isDown); } -ConsoleMethod( GuiCanvas, cursorNudge, void, 4, 4, "x, y" ) +DefineEngineMethod(GuiCanvas, cursorNudge, void, (F32 x, F32 y), , "") { - object->cursorNudge(dAtof(argv[2]), dAtof(argv[3])); + object->cursorNudge(x, y); } + // This function allows resetting of the video-mode from script. It was motivated by // the need to temporarily disable vsync during datablock cache load to avoid a // significant slowdown. bool AFX_forceVideoReset = false; -ConsoleMethod( GuiCanvas, resetVideoMode, void, 2,2, "()") + +DefineEngineMethod(GuiCanvas, resetVideoMode, void, (), , "") { PlatformWindow* window = object->getPlatformWindow(); - if( window ) + if (window) { - GFXWindowTarget* gfx_target = window->getGFXTarget(); - if ( gfx_target ) + GFXWindowTarget* gfx_target = window->getGFXTarget(); + if (gfx_target) { AFX_forceVideoReset = true; gfx_target->resetMode(); diff --git a/Engine/source/gui/core/guiControl.cpp b/Engine/source/gui/core/guiControl.cpp index 6fded2e92..5526c2cc6 100644 --- a/Engine/source/gui/core/guiControl.cpp +++ b/Engine/source/gui/core/guiControl.cpp @@ -2898,7 +2898,7 @@ static ConsoleDocFragment _sGuiControlSetExtent2( "GuiControl", // The class to place the method in; use NULL for functions. "void setExtent( Point2I p );" ); // The definition string. -DefineConsoleMethod( GuiControl, setExtent, void, ( const char* extOrX, const char* y ), (""), +DefineEngineMethod( GuiControl, setExtent, void, ( const char* extOrX, const char* y ), (""), "( Point2I p | int x, int y ) Set the width and height of the control.\n\n" "@hide" ) { diff --git a/Engine/source/gui/editor/guiDebugger.cpp b/Engine/source/gui/editor/guiDebugger.cpp index fb888538a..7c60d4359 100644 --- a/Engine/source/gui/editor/guiDebugger.cpp +++ b/Engine/source/gui/editor/guiDebugger.cpp @@ -66,13 +66,13 @@ DbgFileView::DbgFileView() mSize.set(1, 0); } -DefineConsoleMethod(DbgFileView, setCurrentLine, void, (S32 line, bool selected), , "(int line, bool selected)" +DefineEngineMethod(DbgFileView, setCurrentLine, void, (S32 line, bool selected), , "(int line, bool selected)" "Set the current highlighted line.") { object->setCurrentLine(line, selected); } -DefineConsoleMethod(DbgFileView, getCurrentLine, const char *, (), , "()" +DefineEngineMethod(DbgFileView, getCurrentLine, const char *, (), , "()" "Get the currently executing file and line, if any.\n\n" "@returns A string containing the file, a tab, and then the line number." " Use getField() with this.") @@ -84,38 +84,38 @@ DefineConsoleMethod(DbgFileView, getCurrentLine, const char *, (), , "()" return ret; } -DefineConsoleMethod(DbgFileView, open, bool, (const char * filename), , "(string filename)" +DefineEngineMethod(DbgFileView, open, bool, (const char * filename), , "(string filename)" "Open a file for viewing.\n\n" "@note This loads the file from the local system.") { return object->openFile(filename); } -DefineConsoleMethod(DbgFileView, clearBreakPositions, void, (), , "()" +DefineEngineMethod(DbgFileView, clearBreakPositions, void, (), , "()" "Clear all break points in the current file.") { object->clearBreakPositions(); } -DefineConsoleMethod(DbgFileView, setBreakPosition, void, (U32 line), , "(int line)" +DefineEngineMethod(DbgFileView, setBreakPosition, void, (U32 line), , "(int line)" "Set a breakpoint at the specified line.") { object->setBreakPosition(line); } -DefineConsoleMethod(DbgFileView, setBreak, void, (U32 line), , "(int line)" +DefineEngineMethod(DbgFileView, setBreak, void, (U32 line), , "(int line)" "Set a breakpoint at the specified line.") { object->setBreakPointStatus(line, true); } -DefineConsoleMethod(DbgFileView, removeBreak, void, (U32 line), , "(int line)" +DefineEngineMethod(DbgFileView, removeBreak, void, (U32 line), , "(int line)" "Remove a breakpoint from the specified line.") { object->setBreakPointStatus(line, false); } -DefineConsoleMethod(DbgFileView, findString, bool, (const char * findThis), , "(string findThis)" +DefineEngineMethod(DbgFileView, findString, bool, (const char * findThis), , "(string findThis)" "Find the specified string in the currently viewed file and " "scroll it into view.") { diff --git a/Engine/source/gui/editor/guiEditCtrl.cpp b/Engine/source/gui/editor/guiEditCtrl.cpp index 7e8ce57d0..208c9b4fc 100644 --- a/Engine/source/gui/editor/guiEditCtrl.cpp +++ b/Engine/source/gui/editor/guiEditCtrl.cpp @@ -2468,7 +2468,7 @@ void GuiEditCtrl::startMouseGuideDrag( guideAxis axis, U32 guideIndex, bool lock //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, getContentControl, S32, (), , "() - Return the toplevel control edited inside the GUI editor." ) +DefineEngineMethod( GuiEditCtrl, getContentControl, S32, (), , "() - Return the toplevel control edited inside the GUI editor." ) { GuiControl* ctrl = object->getContentControl(); if( ctrl ) @@ -2479,7 +2479,7 @@ DefineConsoleMethod( GuiEditCtrl, getContentControl, S32, (), , "() - Return the //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, setContentControl, void, (GuiControl *ctrl ), , "( GuiControl ctrl ) - Set the toplevel control to edit in the GUI editor." ) +DefineEngineMethod( GuiEditCtrl, setContentControl, void, (GuiControl *ctrl ), , "( GuiControl ctrl ) - Set the toplevel control to edit in the GUI editor." ) { if (ctrl) object->setContentControl(ctrl); @@ -2487,7 +2487,7 @@ DefineConsoleMethod( GuiEditCtrl, setContentControl, void, (GuiControl *ctrl ), //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, addNewCtrl, void, (GuiControl *ctrl), , "(GuiControl ctrl)") +DefineEngineMethod( GuiEditCtrl, addNewCtrl, void, (GuiControl *ctrl), , "(GuiControl ctrl)") { if (ctrl) object->addNewControl(ctrl); @@ -2495,28 +2495,28 @@ DefineConsoleMethod( GuiEditCtrl, addNewCtrl, void, (GuiControl *ctrl), , "(GuiC //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, addSelection, void, (S32 id), , "selects a control.") +DefineEngineMethod( GuiEditCtrl, addSelection, void, (S32 id), , "selects a control.") { object->addSelection(id); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, removeSelection, void, (S32 id), , "deselects a control.") +DefineEngineMethod( GuiEditCtrl, removeSelection, void, (S32 id), , "deselects a control.") { object->removeSelection(id); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, clearSelection, void, (), , "Clear selected controls list.") +DefineEngineMethod( GuiEditCtrl, clearSelection, void, (), , "Clear selected controls list.") { object->clearSelection(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, select, void, (GuiControl *ctrl), , "(GuiControl ctrl)") +DefineEngineMethod( GuiEditCtrl, select, void, (GuiControl *ctrl), , "(GuiControl ctrl)") { if (ctrl) object->setSelection(ctrl, false); @@ -2524,7 +2524,7 @@ DefineConsoleMethod( GuiEditCtrl, select, void, (GuiControl *ctrl), , "(GuiContr //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, setCurrentAddSet, void, (GuiControl *addSet), , "(GuiControl ctrl)") +DefineEngineMethod( GuiEditCtrl, setCurrentAddSet, void, (GuiControl *addSet), , "(GuiControl ctrl)") { if (addSet) object->setCurrentAddSet(addSet); @@ -2532,7 +2532,7 @@ DefineConsoleMethod( GuiEditCtrl, setCurrentAddSet, void, (GuiControl *addSet), //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, getCurrentAddSet, S32, (), , "Returns the set to which new controls will be added") +DefineEngineMethod( GuiEditCtrl, getCurrentAddSet, S32, (), , "Returns the set to which new controls will be added") { const GuiControl* add = object->getCurrentAddSet(); return add ? add->getId() : 0; @@ -2540,49 +2540,49 @@ DefineConsoleMethod( GuiEditCtrl, getCurrentAddSet, S32, (), , "Returns the set //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, toggle, void, (), , "Toggle activation.") +DefineEngineMethod( GuiEditCtrl, toggle, void, (), , "Toggle activation.") { object->setEditMode( !object->isActive() ); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, justify, void, (U32 mode), , "(int mode)" ) +DefineEngineMethod( GuiEditCtrl, justify, void, (U32 mode), , "(int mode)" ) { object->justifySelection( (GuiEditCtrl::Justification)mode ); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, bringToFront, void, (), , "") +DefineEngineMethod( GuiEditCtrl, bringToFront, void, (), , "") { object->bringToFront(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, pushToBack, void, (), , "") +DefineEngineMethod( GuiEditCtrl, pushToBack, void, (), , "") { object->pushToBack(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, deleteSelection, void, (), , "() - Delete the selected controls.") +DefineEngineMethod( GuiEditCtrl, deleteSelection, void, (), , "() - Delete the selected controls.") { object->deleteSelection(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, moveSelection, void, (S32 dx, S32 dy), , "Move all controls in the selection by (dx,dy) pixels.") +DefineEngineMethod( GuiEditCtrl, moveSelection, void, (S32 dx, S32 dy), , "Move all controls in the selection by (dx,dy) pixels.") { object->moveAndSnapSelection(Point2I(dx, dy)); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, saveSelection, void, (const char * filename), (nullAsType()), "( string fileName=null ) - Save selection to file or clipboard.") +DefineEngineMethod( GuiEditCtrl, saveSelection, void, (const char * filename), (nullAsType()), "( string fileName=null ) - Save selection to file or clipboard.") { object->saveSelection( filename ); @@ -2590,7 +2590,7 @@ DefineConsoleMethod( GuiEditCtrl, saveSelection, void, (const char * filename), //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, loadSelection, void, (const char * filename), (nullAsType()), "( string fileName=null ) - Load selection from file or clipboard.") +DefineEngineMethod( GuiEditCtrl, loadSelection, void, (const char * filename), (nullAsType()), "( string fileName=null ) - Load selection from file or clipboard.") { object->loadSelection( filename ); @@ -2598,7 +2598,7 @@ DefineConsoleMethod( GuiEditCtrl, loadSelection, void, (const char * filename), //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, selectAll, void, (), , "()") +DefineEngineMethod( GuiEditCtrl, selectAll, void, (), , "()") { object->selectAll(); } @@ -2613,14 +2613,14 @@ DefineEngineMethod( GuiEditCtrl, getSelection, SimSet*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, getNumSelected, S32, (), , "() - Return the number of controls currently selected." ) +DefineEngineMethod( GuiEditCtrl, getNumSelected, S32, (), , "() - Return the number of controls currently selected." ) { return object->getNumSelected(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, getSelectionGlobalBounds, const char*, (), , "() - Returns global bounds of current selection as vector 'x y width height'." ) +DefineEngineMethod( GuiEditCtrl, getSelectionGlobalBounds, const char*, (), , "() - Returns global bounds of current selection as vector 'x y width height'." ) { RectI bounds = object->getSelectionGlobalBounds(); String str = String::ToString( "%i %i %i %i", bounds.point.x, bounds.point.y, bounds.extent.x, bounds.extent.y ); @@ -2633,7 +2633,7 @@ DefineConsoleMethod( GuiEditCtrl, getSelectionGlobalBounds, const char*, (), , " //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, selectParents, void, ( bool addToSelection ), (false), "( bool addToSelection=false ) - Select parents of currently selected controls." ) +DefineEngineMethod( GuiEditCtrl, selectParents, void, ( bool addToSelection ), (false), "( bool addToSelection=false ) - Select parents of currently selected controls." ) { object->selectParents( addToSelection ); @@ -2641,7 +2641,7 @@ DefineConsoleMethod( GuiEditCtrl, selectParents, void, ( bool addToSelection ), //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, selectChildren, void, ( bool addToSelection ), (false), "( bool addToSelection=false ) - Select children of currently selected controls." ) +DefineEngineMethod( GuiEditCtrl, selectChildren, void, ( bool addToSelection ), (false), "( bool addToSelection=false ) - Select children of currently selected controls." ) { object->selectChildren( addToSelection ); @@ -2657,14 +2657,14 @@ DefineEngineMethod( GuiEditCtrl, getTrash, SimGroup*, (),, //----------------------------------------------------------------------------- -DefineConsoleMethod(GuiEditCtrl, setSnapToGrid, void, (U32 gridsize), , "GuiEditCtrl.setSnapToGrid(gridsize)") +DefineEngineMethod(GuiEditCtrl, setSnapToGrid, void, (U32 gridsize), , "GuiEditCtrl.setSnapToGrid(gridsize)") { object->setSnapToGrid(gridsize); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, readGuides, void, ( GuiControl* ctrl, S32 axis ), (-1), "( GuiControl ctrl [, int axis ] ) - Read the guides from the given control." ) +DefineEngineMethod( GuiEditCtrl, readGuides, void, ( GuiControl* ctrl, S32 axis ), (-1), "( GuiControl ctrl [, int axis ] ) - Read the guides from the given control." ) { // Find the control. @@ -2694,7 +2694,7 @@ DefineConsoleMethod( GuiEditCtrl, readGuides, void, ( GuiControl* ctrl, S32 axis //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, writeGuides, void, ( GuiControl* ctrl, S32 axis ), ( -1), "( GuiControl ctrl [, int axis ] ) - Write the guides to the given control." ) +DefineEngineMethod( GuiEditCtrl, writeGuides, void, ( GuiControl* ctrl, S32 axis ), ( -1), "( GuiControl ctrl [, int axis ] ) - Write the guides to the given control." ) { // Find the control. @@ -2724,7 +2724,7 @@ DefineConsoleMethod( GuiEditCtrl, writeGuides, void, ( GuiControl* ctrl, S32 axi //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, clearGuides, void, ( S32 axis ), (-1), "( [ int axis ] ) - Clear all currently set guide lines." ) +DefineEngineMethod( GuiEditCtrl, clearGuides, void, ( S32 axis ), (-1), "( [ int axis ] ) - Clear all currently set guide lines." ) { if( axis != -1 ) { @@ -2745,7 +2745,7 @@ DefineConsoleMethod( GuiEditCtrl, clearGuides, void, ( S32 axis ), (-1), "( [ in //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, fitIntoParents, void, (bool width, bool height), (true, true), "( bool width=true, bool height=true ) - Fit selected controls into their parents." ) +DefineEngineMethod( GuiEditCtrl, fitIntoParents, void, (bool width, bool height), (true, true), "( bool width=true, bool height=true ) - Fit selected controls into their parents." ) { object->fitIntoParents( width, height ); @@ -2753,7 +2753,7 @@ DefineConsoleMethod( GuiEditCtrl, fitIntoParents, void, (bool width, bool height //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiEditCtrl, getMouseMode, const char*, (), , "() - Return the current mouse mode." ) +DefineEngineMethod( GuiEditCtrl, getMouseMode, const char*, (), , "() - Return the current mouse mode." ) { switch( object->getMouseMode() ) { diff --git a/Engine/source/gui/editor/guiFilterCtrl.cpp b/Engine/source/gui/editor/guiFilterCtrl.cpp index 3ac67238a..03c0c8a9c 100644 --- a/Engine/source/gui/editor/guiFilterCtrl.cpp +++ b/Engine/source/gui/editor/guiFilterCtrl.cpp @@ -60,7 +60,7 @@ void GuiFilterCtrl::initPersistFields() Parent::initPersistFields(); } -DefineConsoleMethod( GuiFilterCtrl, getValue, const char*, (), , "Return a tuple containing all the values in the filter." +DefineEngineMethod( GuiFilterCtrl, getValue, const char*, (), , "Return a tuple containing all the values in the filter." "@internal") { static char buffer[512]; @@ -77,7 +77,7 @@ DefineConsoleMethod( GuiFilterCtrl, getValue, const char*, (), , "Return a tuple return buffer; } -ConsoleMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, f2, ...)" +DefineEngineStringlyVariadicMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, f2, ...)" "Reset the filter to use the specified points, spread equidistantly across the domain." "@internal") { @@ -89,7 +89,7 @@ ConsoleMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, f2, ...)" object->set(filter); } -DefineConsoleMethod( GuiFilterCtrl, identity, void, (), , "Reset the filtering." +DefineEngineMethod( GuiFilterCtrl, identity, void, (), , "Reset the filtering." "@internal") { object->identity(); diff --git a/Engine/source/gui/editor/guiGraphCtrl.cpp b/Engine/source/gui/editor/guiGraphCtrl.cpp index 41e4d0d14..bc2a43542 100644 --- a/Engine/source/gui/editor/guiGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiGraphCtrl.cpp @@ -407,7 +407,7 @@ DefineEngineMethod( GuiGraphCtrl, setGraphType, void, ( S32 plotId, GuiGraphType //----------------------------------------------------------------------------- -ConsoleMethod( GuiGraphCtrl, matchScale, void, 3, GuiGraphCtrl::MaxPlots + 2, "( int plotID1, int plotID2, ... ) " +DefineEngineStringlyVariadicMethod( GuiGraphCtrl, matchScale, void, 3, GuiGraphCtrl::MaxPlots + 2, "( int plotID1, int plotID2, ... ) " "Set the scale of all specified plots to the maximum scale among them.\n\n" "@param plotID1 Index of plotting curve.\n" "@param plotID2 Index of plotting curve." ) diff --git a/Engine/source/gui/editor/guiInspectorTypes.cpp b/Engine/source/gui/editor/guiInspectorTypes.cpp index a90da6587..0e8f341a4 100644 --- a/Engine/source/gui/editor/guiInspectorTypes.cpp +++ b/Engine/source/gui/editor/guiInspectorTypes.cpp @@ -601,13 +601,12 @@ void GuiInspectorTypeFileName::updateValue() } } -ConsoleMethod( GuiInspectorTypeFileName, apply, void, 3,3, "apply(newValue);" ) +DefineEngineMethod(GuiInspectorTypeFileName, apply, void, (String path), , "") { - String path( (const char*)argv[2] ); - if ( path.isNotEmpty() ) - path = Platform::makeRelativePathName( path, Platform::getMainDotCsDir() ); - - object->setData( path.c_str() ); + if (path.isNotEmpty()) + path = Platform::makeRelativePathName(path, Platform::getMainDotCsDir()); + + object->setData(path.c_str()); } @@ -1501,7 +1500,7 @@ void GuiInspectorTypeBitMask32::updateData() setData( data ); } -ConsoleMethod( GuiInspectorTypeBitMask32, applyBit, void, 2,2, "apply();" ) +DefineEngineMethod( GuiInspectorTypeBitMask32, applyBit, void, (),, "" ) { object->updateData(); } diff --git a/Engine/source/gui/editor/guiMenuBar.cpp b/Engine/source/gui/editor/guiMenuBar.cpp index 89958fa5b..7a0f10ce3 100644 --- a/Engine/source/gui/editor/guiMenuBar.cpp +++ b/Engine/source/gui/editor/guiMenuBar.cpp @@ -1486,7 +1486,7 @@ PopupMenu* GuiMenuBar::findMenu(StringTableEntry barTitle) //----------------------------------------------------------------------------- // Console Methods //----------------------------------------------------------------------------- -DefineConsoleMethod(GuiMenuBar, attachToCanvas, void, (const char *canvas, S32 pos), , "(GuiCanvas, pos)") +DefineEngineMethod(GuiMenuBar, attachToCanvas, void, (const char *canvas, S32 pos), , "(GuiCanvas, pos)") { GuiCanvas* canv = dynamic_cast(Sim::findObject(canvas)); if (canv) @@ -1495,7 +1495,7 @@ DefineConsoleMethod(GuiMenuBar, attachToCanvas, void, (const char *canvas, S32 p } } -DefineConsoleMethod(GuiMenuBar, removeFromCanvas, void, (), , "()") +DefineEngineMethod(GuiMenuBar, removeFromCanvas, void, (), , "()") { GuiCanvas* canvas = object->getRoot(); @@ -1503,23 +1503,23 @@ DefineConsoleMethod(GuiMenuBar, removeFromCanvas, void, (), , "()") canvas->setMenuBar(nullptr); } -DefineConsoleMethod(GuiMenuBar, getMenuCount, S32, (), , "()") +DefineEngineMethod(GuiMenuBar, getMenuCount, S32, (), , "()") { return object->getMenuListCount(); } -DefineConsoleMethod(GuiMenuBar, getMenu, S32, (S32 index), (0), "(Index)") +DefineEngineMethod(GuiMenuBar, getMenu, S32, (S32 index), (0), "(Index)") { return object->getMenu(index)->getId(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(GuiMenuBar, insert, void, (SimObject* pObject, S32 pos), (nullAsType(), -1), "(object, pos) insert object at position") +DefineEngineMethod(GuiMenuBar, insert, void, (SimObject* pObject, S32 pos), (nullAsType(), -1), "(object, pos) insert object at position") { object->insert(pObject, pos); } -DefineConsoleMethod(GuiMenuBar, findMenu, S32, (const char* barTitle), (""), "(barTitle)") +DefineEngineMethod(GuiMenuBar, findMenu, S32, (const char* barTitle), (""), "(barTitle)") { StringTableEntry barTitleStr = StringTable->insert(barTitle); PopupMenu* menu = object->findMenu(barTitleStr); diff --git a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp index 342646fb1..4b71a1518 100644 --- a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp @@ -1004,7 +1004,7 @@ bool GuiParticleGraphCtrl::renderGraphTooltip(Point2I cursorPos, StringTableEntr return true; } -DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPoint, void, (S32 point), , "(int point)" +DefineEngineMethod(GuiParticleGraphCtrl, setSelectedPoint, void, (S32 point), , "(int point)" "Set the selected point on the graph.\n" "@return No return value") { @@ -1016,7 +1016,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPoint, void, (S32 point), , object->setSelectedPoint( point ); } -DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPlot, void, (S32 plotID), , "(int plotID)" +DefineEngineMethod(GuiParticleGraphCtrl, setSelectedPlot, void, (S32 plotID), , "(int plotID)" "Set the selected plot (a.k.a. graph)." "@return No return value" ) { @@ -1028,7 +1028,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPlot, void, (S32 plotID), , object->setSelectedPlot( plotID ); } -DefineConsoleMethod(GuiParticleGraphCtrl, clearGraph, void, (S32 plotID), , "(int plotID)" +DefineEngineMethod(GuiParticleGraphCtrl, clearGraph, void, (S32 plotID), , "(int plotID)" "Clear the graph of the given plot." "@return No return value") { @@ -1040,14 +1040,14 @@ DefineConsoleMethod(GuiParticleGraphCtrl, clearGraph, void, (S32 plotID), , "(in object->clearGraph( plotID ); } -DefineConsoleMethod(GuiParticleGraphCtrl, clearAllGraphs, void, (), , "()" +DefineEngineMethod(GuiParticleGraphCtrl, clearAllGraphs, void, (), , "()" "Clear all of the graphs." "@return No return value") { object->clearAllGraphs(); } -DefineConsoleMethod(GuiParticleGraphCtrl, addPlotPoint, S32, (S32 plotID, F32 x, F32 y, bool setAdded), (true), "(int plotID, float x, float y, bool setAdded = true;)" +DefineEngineMethod(GuiParticleGraphCtrl, addPlotPoint, S32, (S32 plotID, F32 x, F32 y, bool setAdded), (true), "(int plotID, float x, float y, bool setAdded = true;)" "Add a data point to the given plot." "@return") { @@ -1060,7 +1060,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, addPlotPoint, S32, (S32 plotID, F32 x, return object->addPlotPoint( plotID, Point2F(x, y), setAdded); } -DefineConsoleMethod(GuiParticleGraphCtrl, insertPlotPoint, void, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)\n" +DefineEngineMethod(GuiParticleGraphCtrl, insertPlotPoint, void, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)\n" "Insert a data point to the given plot and plot position.\n" "@param plotID The plot you want to access\n" "@param i The data point.\n" @@ -1075,7 +1075,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, insertPlotPoint, void, (S32 plotID, S3 object->insertPlotPoint( plotID, i, Point2F(x, y)); } -DefineConsoleMethod(GuiParticleGraphCtrl, changePlotPoint, S32, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)" +DefineEngineMethod(GuiParticleGraphCtrl, changePlotPoint, S32, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)" "Change a data point to the given plot and plot position.\n" "@param plotID The plot you want to access\n" "@param i The data point.\n" @@ -1090,21 +1090,21 @@ DefineConsoleMethod(GuiParticleGraphCtrl, changePlotPoint, S32, (S32 plotID, S32 return object->changePlotPoint( plotID, i, Point2F(x, y)); } -DefineConsoleMethod(GuiParticleGraphCtrl, getSelectedPlot, S32, (), , "() " +DefineEngineMethod(GuiParticleGraphCtrl, getSelectedPlot, S32, (), , "() " "Gets the selected Plot (a.k.a. graph).\n" "@return The plot's ID.") { return object->getSelectedPlot(); } -DefineConsoleMethod(GuiParticleGraphCtrl, getSelectedPoint, S32, (), , "()" +DefineEngineMethod(GuiParticleGraphCtrl, getSelectedPoint, S32, (), , "()" "Gets the selected Point on the Plot (a.k.a. graph)." "@return The last selected point ID") { return object->getSelectedPoint(); } -DefineConsoleMethod(GuiParticleGraphCtrl, isExistingPoint, bool, (S32 plotID, S32 samples), , "(int plotID, int samples)" +DefineEngineMethod(GuiParticleGraphCtrl, isExistingPoint, bool, (S32 plotID, S32 samples), , "(int plotID, int samples)" "@return Returns true or false whether or not the point in the plot passed is an existing point.") { @@ -1119,7 +1119,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, isExistingPoint, bool, (S32 plotID, S3 return object->isExistingPoint(plotID, samples); } -DefineConsoleMethod(GuiParticleGraphCtrl, getPlotPoint, Point2F, (S32 plotID, S32 samples), , "(int plotID, int samples)" +DefineEngineMethod(GuiParticleGraphCtrl, getPlotPoint, Point2F, (S32 plotID, S32 samples), , "(int plotID, int samples)" "Get a data point from the plot specified, samples from the start of the graph." "@return The data point ID") { @@ -1137,7 +1137,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getPlotPoint, Point2F, (S32 plotID, S3 return object->getPlotPoint(plotID, samples); } -DefineConsoleMethod(GuiParticleGraphCtrl, getPlotIndex, S32, (S32 plotID, F32 x, F32 y), , "(int plotID, float x, float y)\n" +DefineEngineMethod(GuiParticleGraphCtrl, getPlotIndex, S32, (S32 plotID, F32 x, F32 y), , "(int plotID, float x, float y)\n" "Gets the index of the point passed on the plotID passed (graph ID).\n" "@param plotID The plot you wish to check.\n" "@param x,y The coordinates of the point to get.\n" @@ -1151,7 +1151,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getPlotIndex, S32, (S32 plotID, F32 x, return object->getPlotIndex(plotID, x, y); } -DefineConsoleMethod(GuiParticleGraphCtrl, getGraphColor, LinearColorF, (S32 plotID), , "(int plotID)" +DefineEngineMethod(GuiParticleGraphCtrl, getGraphColor, LinearColorF, (S32 plotID), , "(int plotID)" "Get the color of the graph passed." "@return Returns the color of the graph as a string of RGB values formatted as \"R G B\"") { @@ -1165,7 +1165,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphColor, LinearColorF, (S32 plot } -DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMin, Point2F, (S32 plotID), , "(int plotID) " +DefineEngineMethod(GuiParticleGraphCtrl, getGraphMin, Point2F, (S32 plotID), , "(int plotID) " "Get the minimum values of the graph ranges.\n" "@return Returns the minimum of the range formatted as \"x-min y-min\"") { @@ -1177,7 +1177,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMin, Point2F, (S32 plotID), , return object->getGraphMin(plotID); } -DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMax, Point2F, (S32 plotID), , "(int plotID) " +DefineEngineMethod(GuiParticleGraphCtrl, getGraphMax, Point2F, (S32 plotID), , "(int plotID) " "Get the maximum values of the graph ranges.\n" "@return Returns the maximum of the range formatted as \"x-max y-max\"") { @@ -1190,7 +1190,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMax, Point2F, (S32 plotID), , } -DefineConsoleMethod(GuiParticleGraphCtrl, getGraphName, const char*, (S32 plotID), , "(int plotID) " +DefineEngineMethod(GuiParticleGraphCtrl, getGraphName, const char*, (S32 plotID), , "(int plotID) " "Get the name of the graph passed.\n" "@return Returns the name of the plot") { @@ -1207,7 +1207,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphName, const char*, (S32 plotID return retBuffer; } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMin, void, (S32 plotID, F32 minX, F32 minY), , "(int plotID, float minX, float minY) " +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMin, void, (S32 plotID, F32 minX, F32 minY), , "(int plotID, float minX, float minY) " "Set the min values of the graph of plotID.\n" "@param plotID The plot to modify\n" "@param minX,minY The minimum bound of the value range.\n" @@ -1223,7 +1223,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMin, void, (S32 plotID, F32 mi object->setGraphMin(plotID, Point2F(minX, minY)); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinX, void, (S32 plotID, F32 minX), , "(int plotID, float minX) " +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMinX, void, (S32 plotID, F32 minX), , "(int plotID, float minX) " "Set the min X value of the graph of plotID.\n" "@param plotID The plot to modify.\n" "@param minX The minimum x value.\n" @@ -1239,7 +1239,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinX, void, (S32 plotID, F32 m object->setGraphMinX(plotID, minX); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinY, void, (S32 plotID, F32 minX), , "(int plotID, float minY) " +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMinY, void, (S32 plotID, F32 minX), , "(int plotID, float minY) " "Set the min Y value of the graph of plotID." "@param plotID The plot to modify.\n" "@param minY The minimum y value.\n" @@ -1255,7 +1255,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinY, void, (S32 plotID, F32 m object->setGraphMinY(plotID, minX); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMax, void, (S32 plotID, F32 maxX, F32 maxY), , "(int plotID, float maxX, float maxY) " +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMax, void, (S32 plotID, F32 maxX, F32 maxY), , "(int plotID, float maxX, float maxY) " "Set the max values of the graph of plotID." "@param plotID The plot to modify\n" "@param maxX,maxY The maximum bound of the value range.\n" @@ -1271,7 +1271,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMax, void, (S32 plotID, F32 ma object->setGraphMax(plotID, Point2F(maxX, maxY)); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxX, void, (S32 plotID, F32 maxX), , "(int plotID, float maxX)" +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMaxX, void, (S32 plotID, F32 maxX), , "(int plotID, float maxX)" "Set the max X value of the graph of plotID." "@param plotID The plot to modify.\n" "@param maxX The maximum x value.\n" @@ -1287,7 +1287,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxX, void, (S32 plotID, F32 m object->setGraphMaxX(plotID, maxX); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxY, void, (S32 plotID, F32 maxX), , "(int plotID, float maxY)" +DefineEngineMethod(GuiParticleGraphCtrl, setGraphMaxY, void, (S32 plotID, F32 maxX), , "(int plotID, float maxY)" "Set the max Y value of the graph of plotID." "@param plotID The plot to modify.\n" "@param maxY The maximum y value.\n" @@ -1303,7 +1303,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxY, void, (S32 plotID, F32 m object->setGraphMaxY(plotID, maxX); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphHidden, void, (S32 plotID, bool isHidden), , "(int plotID, bool isHidden)" +DefineEngineMethod(GuiParticleGraphCtrl, setGraphHidden, void, (S32 plotID, bool isHidden), , "(int plotID, bool isHidden)" "Set whether the graph number passed is hidden or not." "@return No return value.") { @@ -1317,7 +1317,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphHidden, void, (S32 plotID, boo object->setGraphHidden(plotID, isHidden); } -DefineConsoleMethod(GuiParticleGraphCtrl, setAutoGraphMax, void, (bool autoMax), , "(bool autoMax) " +DefineEngineMethod(GuiParticleGraphCtrl, setAutoGraphMax, void, (bool autoMax), , "(bool autoMax) " "Set whether the max will automatically be set when adding points " "(ie if you add a value over the current max, the max is increased to that value).\n" "@return No return value.") @@ -1325,35 +1325,35 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setAutoGraphMax, void, (bool autoMax), object->setAutoGraphMax(autoMax); } -DefineConsoleMethod(GuiParticleGraphCtrl, setAutoRemove, void, (bool autoRemove), , "(bool autoRemove) " +DefineEngineMethod(GuiParticleGraphCtrl, setAutoRemove, void, (bool autoRemove), , "(bool autoRemove) " "Set whether or not a point should be deleted when you drag another one over it." "@return No return value.") { object->setAutoRemove(autoRemove); } -DefineConsoleMethod(GuiParticleGraphCtrl, setRenderAll, void, (bool autoRemove), , "(bool renderAll)" +DefineEngineMethod(GuiParticleGraphCtrl, setRenderAll, void, (bool autoRemove), , "(bool renderAll)" "Set whether or not a position should be rendered on every point or just the last selected." "@return No return value.") { object->setRenderAll(autoRemove); } -DefineConsoleMethod(GuiParticleGraphCtrl, setPointXMovementClamped, void, (bool autoRemove), , "(bool clamped)" +DefineEngineMethod(GuiParticleGraphCtrl, setPointXMovementClamped, void, (bool autoRemove), , "(bool clamped)" "Set whether the x position of the selected graph point should be clamped" "@return No return value.") { object->setPointXMovementClamped(autoRemove); } -DefineConsoleMethod(GuiParticleGraphCtrl, setRenderGraphTooltip, void, (bool autoRemove), , "(bool renderGraphTooltip)" +DefineEngineMethod(GuiParticleGraphCtrl, setRenderGraphTooltip, void, (bool autoRemove), , "(bool renderGraphTooltip)" "Set whether or not to render the graph tooltip." "@return No return value.") { object->setRenderGraphTooltip(autoRemove); } -DefineConsoleMethod(GuiParticleGraphCtrl, setGraphName, void, (S32 plotID, const char * graphName), , "(int plotID, string graphName) " +DefineEngineMethod(GuiParticleGraphCtrl, setGraphName, void, (S32 plotID, const char * graphName), , "(int plotID, string graphName) " "Set the name of the given plot.\n" "@param plotID The plot to modify.\n" "@param graphName The name to set on the plot.\n" @@ -1369,7 +1369,7 @@ DefineConsoleMethod(GuiParticleGraphCtrl, setGraphName, void, (S32 plotID, const object->setGraphName(plotID, graphName); } -DefineConsoleMethod(GuiParticleGraphCtrl, resetSelectedPoint, void, (), , "()" +DefineEngineMethod(GuiParticleGraphCtrl, resetSelectedPoint, void, (), , "()" "This will reset the currently selected point to nothing." "@return No return value.") { diff --git a/Engine/source/gui/editor/inspector/componentGroup.cpp b/Engine/source/gui/editor/inspector/componentGroup.cpp index 6e16db173..e81eec63d 100644 --- a/Engine/source/gui/editor/inspector/componentGroup.cpp +++ b/Engine/source/gui/editor/inspector/componentGroup.cpp @@ -469,7 +469,7 @@ void GuiInspectorComponentGroup::onRightMouseUp(const GuiEvent &event) Con::executef(this, "onRightMouseUp", event.mousePoint); } -ConsoleMethod(GuiInspectorComponentGroup, inspectGroup, bool, 2, 2, "Refreshes the dynamic fields in the inspector.") +DefineEngineMethod(GuiInspectorComponentGroup, inspectGroup, bool, (),, "Refreshes the dynamic fields in the inspector.") { return object->inspectGroup(); } @@ -515,16 +515,17 @@ AbstractClassRep::Field* GuiInspectorComponentGroup::findObjectBehaviorField(Com } return NULL; } -ConsoleMethod(GuiInspectorComponentGroup, addDynamicField, void, 2, 2, "obj.addDynamicField();") + +DefineEngineMethod(GuiInspectorComponentGroup, addDynamicField, void, (), , "obj.addDynamicField();") { object->addDynamicField(); } -ConsoleMethod(GuiInspectorComponentGroup, removeDynamicField, void, 3, 3, "") +DefineEngineMethod(GuiInspectorComponentGroup, removeDynamicField, void, (), , "") { } -DefineConsoleMethod(GuiInspectorComponentGroup, getComponent, S32, (), ,"") +DefineEngineMethod(GuiInspectorComponentGroup, getComponent, S32, (), , "") { return object->getComponent()->getId(); } diff --git a/Engine/source/gui/editor/inspector/dynamicField.cpp b/Engine/source/gui/editor/inspector/dynamicField.cpp index d028a6c7a..092af36f4 100644 --- a/Engine/source/gui/editor/inspector/dynamicField.cpp +++ b/Engine/source/gui/editor/inspector/dynamicField.cpp @@ -316,7 +316,7 @@ void GuiInspectorDynamicField::_executeSelectedCallback() Con::executef( mInspector, "onFieldSelected", mDynField->slotName, "TypeDynamicField" ); } -DefineConsoleMethod( GuiInspectorDynamicField, renameField, void, (const char* newDynamicFieldName),, "field.renameField(newDynamicFieldName);" ) +DefineEngineMethod( GuiInspectorDynamicField, renameField, void, (const char* newDynamicFieldName),, "field.renameField(newDynamicFieldName);" ) { object->renameField( newDynamicFieldName ); } diff --git a/Engine/source/gui/editor/inspector/dynamicGroup.cpp b/Engine/source/gui/editor/inspector/dynamicGroup.cpp index 3d9879919..931a00836 100644 --- a/Engine/source/gui/editor/inspector/dynamicGroup.cpp +++ b/Engine/source/gui/editor/inspector/dynamicGroup.cpp @@ -188,7 +188,7 @@ void GuiInspectorDynamicGroup::updateAllFields() inspectGroup(); } -DefineConsoleMethod(GuiInspectorDynamicGroup, inspectGroup, bool, (), , "Refreshes the dynamic fields in the inspector.") +DefineEngineMethod(GuiInspectorDynamicGroup, inspectGroup, bool, (), , "Refreshes the dynamic fields in the inspector.") { return object->inspectGroup(); } @@ -263,11 +263,11 @@ void GuiInspectorDynamicGroup::addDynamicField() instantExpand(); } -DefineConsoleMethod( GuiInspectorDynamicGroup, addDynamicField, void, (), , "obj.addDynamicField();" ) +DefineEngineMethod( GuiInspectorDynamicGroup, addDynamicField, void, (), , "obj.addDynamicField();" ) { object->addDynamicField(); } -DefineConsoleMethod( GuiInspectorDynamicGroup, removeDynamicField, void, (), , "" ) +DefineEngineMethod( GuiInspectorDynamicGroup, removeDynamicField, void, (), , "" ) { } diff --git a/Engine/source/gui/editor/inspector/entityGroup.cpp b/Engine/source/gui/editor/inspector/entityGroup.cpp index 7b7559833..de4897165 100644 --- a/Engine/source/gui/editor/inspector/entityGroup.cpp +++ b/Engine/source/gui/editor/inspector/entityGroup.cpp @@ -87,7 +87,8 @@ void GuiInspectorEntityGroup::onMouseMove(const GuiEvent &event) { //mParent->mOverDivider = false; } -ConsoleMethod(GuiInspectorEntityGroup, inspectGroup, bool, 2, 2, "Refreshes the dynamic fields in the inspector.") + +DefineEngineMethod(GuiInspectorEntityGroup, inspectGroup, bool, (),, "Refreshes the dynamic fields in the inspector.") { return object->inspectGroup(); } @@ -128,11 +129,12 @@ AbstractClassRep::Field* GuiInspectorEntityGroup::findObjectBehaviorField(Compon } return NULL; } -ConsoleMethod(GuiInspectorEntityGroup, addDynamicField, void, 2, 2, "obj.addDynamicField();") + +DefineEngineMethod(GuiInspectorEntityGroup, addDynamicField, void, (), , "obj.addDynamicField();") { object->addDynamicField(); } -ConsoleMethod(GuiInspectorEntityGroup, removeDynamicField, void, 3, 3, "") +DefineEngineMethod(GuiInspectorEntityGroup, removeDynamicField, void, (), , "") { } diff --git a/Engine/source/gui/editor/inspector/field.cpp b/Engine/source/gui/editor/inspector/field.cpp index f8efaca02..2808ee140 100644 --- a/Engine/source/gui/editor/inspector/field.cpp +++ b/Engine/source/gui/editor/inspector/field.cpp @@ -688,59 +688,59 @@ void GuiInspectorField::_setFieldDocs( StringTableEntry docs ) //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, getInspector, S32, (), , "() - Return the GuiInspector to which this field belongs." ) +DefineEngineMethod( GuiInspectorField, getInspector, S32, (), , "() - Return the GuiInspector to which this field belongs." ) { return object->getInspector()->getId(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, getInspectedFieldName, const char*, (), , "() - Return the name of the field edited by this inspector field." ) +DefineEngineMethod( GuiInspectorField, getInspectedFieldName, const char*, (), , "() - Return the name of the field edited by this inspector field." ) { return object->getFieldName(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, getInspectedFieldType, const char*, (), , "() - Return the type of the field edited by this inspector field." ) +DefineEngineMethod( GuiInspectorField, getInspectedFieldType, const char*, (), , "() - Return the type of the field edited by this inspector field." ) { return object->getFieldType(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, apply, void, ( const char * newValue, bool callbacks ), (true), "( string newValue, bool callbacks=true ) - Set the field's value. Suppress callbacks for undo if callbacks=false." ) +DefineEngineMethod( GuiInspectorField, apply, void, ( const char * newValue, bool callbacks ), (true), "( string newValue, bool callbacks=true ) - Set the field's value. Suppress callbacks for undo if callbacks=false." ) { object->setData( newValue, callbacks ); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, applyWithoutUndo, void, (const char * data), , "() - Set field value without recording undo (same as 'apply( value, false )')." ) +DefineEngineMethod( GuiInspectorField, applyWithoutUndo, void, (const char * data), , "() - Set field value without recording undo (same as 'apply( value, false )')." ) { object->setData( data, false ); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, getData, const char*, (), , "() - Return the value currently displayed on the field." ) +DefineEngineMethod( GuiInspectorField, getData, const char*, (), , "() - Return the value currently displayed on the field." ) { return object->getData(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( GuiInspectorField, reset, void, (), , "() - Reset to default value." ) +DefineEngineMethod( GuiInspectorField, reset, void, (), , "() - Reset to default value." ) { object->resetData(); } -DefineConsoleMethod(GuiInspectorField, setCaption, void, (String newCaption),, "() - Reset to default value.") +DefineEngineMethod(GuiInspectorField, setCaption, void, (String newCaption),, "() - Reset to default value.") { object->setCaption(StringTable->insert(newCaption.c_str())); } -DefineConsoleMethod(GuiInspectorField, setEditControl, void, (GuiControl* editCtrl), (nullAsType()), "() - Reset to default value.") +DefineEngineMethod(GuiInspectorField, setEditControl, void, (GuiControl* editCtrl), (nullAsType()), "() - Reset to default value.") { object->setEditControl(editCtrl); } diff --git a/Engine/source/gui/editor/inspector/mountingGroup.cpp b/Engine/source/gui/editor/inspector/mountingGroup.cpp index 7afa53105..759139658 100644 --- a/Engine/source/gui/editor/inspector/mountingGroup.cpp +++ b/Engine/source/gui/editor/inspector/mountingGroup.cpp @@ -242,7 +242,8 @@ void GuiInspectorMountingGroup::onMouseMove(const GuiEvent &event) //mParent->mOverDivider = false; bool test = false; } -ConsoleMethod(GuiInspectorMountingGroup, inspectGroup, bool, 2, 2, "Refreshes the dynamic fields in the inspector.") + +DefineEngineMethod(GuiInspectorMountingGroup, inspectGroup, bool, (),, "Refreshes the dynamic fields in the inspector.") { return object->inspectGroup(); } @@ -319,12 +320,13 @@ AbstractClassRep::Field* GuiInspectorMountingGroup::findObjectComponentField(Com } return NULL; } -ConsoleMethod( GuiInspectorMountingGroup, addDynamicField, void, 2, 2, "obj.addDynamicField();" ) + +DefineEngineMethod(GuiInspectorMountingGroup, addDynamicField, void, (), , "obj.addDynamicField();") { object->addDynamicField(); } -ConsoleMethod( GuiInspectorMountingGroup, removeDynamicField, void, 3, 3, "" ) +DefineEngineMethod(GuiInspectorMountingGroup, removeDynamicField, void, (), , "") { } diff --git a/Engine/source/gui/editor/inspector/variableGroup.cpp b/Engine/source/gui/editor/inspector/variableGroup.cpp index 83e4f3c32..cb23d9c6e 100644 --- a/Engine/source/gui/editor/inspector/variableGroup.cpp +++ b/Engine/source/gui/editor/inspector/variableGroup.cpp @@ -250,12 +250,12 @@ GuiInspectorField* GuiInspectorVariableGroup::createInspectorField() return NULL; } -DefineConsoleMethod(GuiInspectorVariableGroup, createInspectorField, GuiInspectorField*, (),, "createInspectorField()") +DefineEngineMethod(GuiInspectorVariableGroup, createInspectorField, GuiInspectorField*, (),, "createInspectorField()") { return object->createInspectorField(); } -DefineConsoleMethod(GuiInspectorVariableGroup, addInspectorField, void, (GuiInspectorField* field), (nullAsType()), "addInspectorField( GuiInspectorFieldObject )") +DefineEngineMethod(GuiInspectorVariableGroup, addInspectorField, void, (GuiInspectorField* field), (nullAsType()), "addInspectorField( GuiInspectorFieldObject )") { object->addInspectorField(field); } \ No newline at end of file diff --git a/Engine/source/gui/editor/inspector/variableInspector.cpp b/Engine/source/gui/editor/inspector/variableInspector.cpp index 115e48b83..10d640fc9 100644 --- a/Engine/source/gui/editor/inspector/variableInspector.cpp +++ b/Engine/source/gui/editor/inspector/variableInspector.cpp @@ -216,17 +216,17 @@ void GuiVariableInspector::setFieldEnabled(const char* name, bool enabled) } } -DefineConsoleMethod(GuiVariableInspector, startGroup, void, (const char* name),, "startGroup( groupName )") +DefineEngineMethod(GuiVariableInspector, startGroup, void, (const char* name),, "startGroup( groupName )") { object->startGroup(name); } -DefineConsoleMethod(GuiVariableInspector, endGroup, void, (),, "endGroup()") +DefineEngineMethod(GuiVariableInspector, endGroup, void, (),, "endGroup()") { object->endGroup(); } -DefineConsoleMethod(GuiVariableInspector, addField, void, (const char* name, const char* label, const char* typeName, +DefineEngineMethod(GuiVariableInspector, addField, void, (const char* name, const char* label, const char* typeName, const char* description, const char* defaultValue, const char* dataValues, SimObject* ownerObj), ("","","","","", "", nullAsType()), "addField( fieldName/varName, fieldLabel, fieldTypeName, description, defaultValue, defaultValues, ownerObject )") { @@ -236,7 +236,7 @@ DefineConsoleMethod(GuiVariableInspector, addField, void, (const char* name, con object->addField(name, label, typeName, description, defaultValue, dataValues, ownerObj); } -DefineConsoleMethod(GuiVariableInspector, addCallbackField, void, (const char* name, const char* label, const char* typeName, +DefineEngineMethod(GuiVariableInspector, addCallbackField, void, (const char* name, const char* label, const char* typeName, const char* description, const char* defaultValue, const char* dataValues, const char* callbackName, SimObject* ownerObj), ("", "", "", "", "", "", nullAsType()), "addField( fieldName/varName, fieldLabel, fieldTypeName, description, defaultValue, defaultValues, callbackName, ownerObject )") { @@ -246,22 +246,22 @@ DefineConsoleMethod(GuiVariableInspector, addCallbackField, void, (const char* n object->addCallbackField(name, label, typeName, description, defaultValue, dataValues, callbackName, ownerObj); } -DefineConsoleMethod(GuiVariableInspector, update, void, (), , "update()") +DefineEngineMethod(GuiVariableInspector, update, void, (), , "update()") { object->update(); } -DefineConsoleMethod(GuiVariableInspector, clearFields, void, (), , "clearFields()") +DefineEngineMethod(GuiVariableInspector, clearFields, void, (), , "clearFields()") { object->clearFields(); } -DefineConsoleMethod(GuiVariableInspector, setFieldEnabled, void, (const char* fieldName, bool isEnabled), (true), "setFieldEnabled( fieldName, isEnabled )") +DefineEngineMethod(GuiVariableInspector, setFieldEnabled, void, (const char* fieldName, bool isEnabled), (true), "setFieldEnabled( fieldName, isEnabled )") { object->setFieldEnabled(fieldName, isEnabled); } -DefineConsoleMethod( GuiVariableInspector, loadVars, void, ( const char * searchString ), , "loadVars( searchString )" ) +DefineEngineMethod( GuiVariableInspector, loadVars, void, ( const char * searchString ), , "loadVars( searchString )" ) { object->loadVars( searchString ); } \ No newline at end of file diff --git a/Engine/source/gui/editor/popupMenu.cpp b/Engine/source/gui/editor/popupMenu.cpp index 3a885ef67..308fb4e67 100644 --- a/Engine/source/gui/editor/popupMenu.cpp +++ b/Engine/source/gui/editor/popupMenu.cpp @@ -456,17 +456,17 @@ void PopupMenu::hidePopupSubmenus() //----------------------------------------------------------------------------- // Console Methods //----------------------------------------------------------------------------- -DefineConsoleMethod(PopupMenu, insertItem, S32, (S32 pos, const char * title, const char * accelerator, const char* cmd), ("", "", ""), "(pos[, title][, accelerator][, cmd])") +DefineEngineMethod(PopupMenu, insertItem, S32, (S32 pos, const char * title, const char * accelerator, const char* cmd), ("", "", ""), "(pos[, title][, accelerator][, cmd])") { return object->insertItem(pos, title, accelerator, cmd); } -DefineConsoleMethod(PopupMenu, removeItem, void, (S32 pos), , "(pos)") +DefineEngineMethod(PopupMenu, removeItem, void, (S32 pos), , "(pos)") { object->removeItem(pos); } -DefineConsoleMethod(PopupMenu, insertSubMenu, S32, (S32 pos, String title, String subMenu), , "(pos, title, subMenu)") +DefineEngineMethod(PopupMenu, insertSubMenu, S32, (S32 pos, String title, String subMenu), , "(pos, title, subMenu)") { PopupMenu *mnu = dynamic_cast(Sim::findObject(subMenu)); if(mnu == NULL) @@ -477,45 +477,45 @@ DefineConsoleMethod(PopupMenu, insertSubMenu, S32, (S32 pos, String title, Strin return object->insertSubMenu(pos, title, mnu); } -DefineConsoleMethod(PopupMenu, setItem, bool, (S32 pos, const char * title, const char * accelerator, const char *cmd), (""), "(pos, title[, accelerator][, cmd])") +DefineEngineMethod(PopupMenu, setItem, bool, (S32 pos, const char * title, const char * accelerator, const char *cmd), (""), "(pos, title[, accelerator][, cmd])") { return object->setItem(pos, title, accelerator, cmd); } //----------------------------------------------------------------------------- -DefineConsoleMethod(PopupMenu, enableItem, void, (S32 pos, bool enabled), , "(pos, enabled)") +DefineEngineMethod(PopupMenu, enableItem, void, (S32 pos, bool enabled), , "(pos, enabled)") { object->enableItem(pos, enabled); } -DefineConsoleMethod(PopupMenu, checkItem, void, (S32 pos, bool checked), , "(pos, checked)") +DefineEngineMethod(PopupMenu, checkItem, void, (S32 pos, bool checked), , "(pos, checked)") { object->checkItem(pos, checked); } -DefineConsoleMethod(PopupMenu, checkRadioItem, void, (S32 firstPos, S32 lastPos, S32 checkPos), , "(firstPos, lastPos, checkPos)") +DefineEngineMethod(PopupMenu, checkRadioItem, void, (S32 firstPos, S32 lastPos, S32 checkPos), , "(firstPos, lastPos, checkPos)") { object->checkRadioItem(firstPos, lastPos, checkPos); } -DefineConsoleMethod(PopupMenu, isItemChecked, bool, (S32 pos), , "(pos)") +DefineEngineMethod(PopupMenu, isItemChecked, bool, (S32 pos), , "(pos)") { return object->isItemChecked(pos); } -DefineConsoleMethod(PopupMenu, getItemCount, S32, (), , "()") +DefineEngineMethod(PopupMenu, getItemCount, S32, (), , "()") { return object->getItemCount(); } -DefineConsoleMethod(PopupMenu, clearItems, void, (), , "()") +DefineEngineMethod(PopupMenu, clearItems, void, (), , "()") { return object->clearItems(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(PopupMenu, showPopup, void, (const char * canvasName, S32 x, S32 y), ( -1, -1), "(Canvas,[x, y])") +DefineEngineMethod(PopupMenu, showPopup, void, (const char * canvasName, S32 x, S32 y), ( -1, -1), "(Canvas,[x, y])") { GuiCanvas *pCanvas = dynamic_cast(Sim::findObject(canvasName)); object->showPopup(pCanvas, x, y); diff --git a/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp b/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp index 17cc97548..e53d70486 100644 --- a/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp @@ -177,13 +177,13 @@ ConsoleDocClass( GuiIdleCamFadeBitmapCtrl, "This is going to be deprecated, and any useful code ported to FadeinBitmap\n\n" "@internal"); -DefineConsoleMethod(GuiIdleCamFadeBitmapCtrl, fadeIn, void, (), , "()" +DefineEngineMethod(GuiIdleCamFadeBitmapCtrl, fadeIn, void, (), , "()" "@internal") { object->fadeIn(); } -DefineConsoleMethod(GuiIdleCamFadeBitmapCtrl, fadeOut, void, (), , "()" +DefineEngineMethod(GuiIdleCamFadeBitmapCtrl, fadeOut, void, (), , "()" "@internal") { object->fadeOut(); diff --git a/Engine/source/gui/shiny/guiTickCtrl.cpp b/Engine/source/gui/shiny/guiTickCtrl.cpp index fa788ea7b..02eca4599 100644 --- a/Engine/source/gui/shiny/guiTickCtrl.cpp +++ b/Engine/source/gui/shiny/guiTickCtrl.cpp @@ -59,7 +59,7 @@ static ConsoleDocFragment _setProcessTicks( "void setProcessTicks( bool tick )" ); -DefineConsoleMethod( GuiTickCtrl, setProcessTicks, void, (bool tick), (true), "( [tick = true] ) - This will set this object to either be processing ticks or not" ) +DefineEngineMethod( GuiTickCtrl, setProcessTicks, void, (bool tick), (true), "( [tick = true] ) - This will set this object to either be processing ticks or not" ) { object->setProcessTicks(tick); } \ No newline at end of file diff --git a/Engine/source/gui/utility/messageVector.cpp b/Engine/source/gui/utility/messageVector.cpp index 19255e38b..97fd33382 100644 --- a/Engine/source/gui/utility/messageVector.cpp +++ b/Engine/source/gui/utility/messageVector.cpp @@ -258,7 +258,7 @@ static ConsoleDocFragment _MessageVectordump2( "MessageVector", "void dump( string filename, string header);"); -DefineConsoleMethod( MessageVector, dump, void, (const char * filename, const char * header), (""), "(string filename, string header=NULL)" +DefineEngineMethod( MessageVector, dump, void, (const char * filename, const char * header), (""), "(string filename, string header=NULL)" "Dump the message vector to a file, optionally prefixing a header." "@hide") { diff --git a/Engine/source/gui/worldEditor/creator.cpp b/Engine/source/gui/worldEditor/creator.cpp index 28fc15e84..99264f4ba 100644 --- a/Engine/source/gui/worldEditor/creator.cpp +++ b/Engine/source/gui/worldEditor/creator.cpp @@ -219,7 +219,7 @@ void CreatorTree::sort() } //------------------------------------------------------------------------------ -DefineConsoleMethod( CreatorTree, addGroup, S32, (S32 group, const char * name, const char * value), , "(string group, string name, string value)") +DefineEngineMethod( CreatorTree, addGroup, S32, (S32 group, const char * name, const char * value), , "(string group, string name, string value)") { CreatorTree::Node * grp = object->findNode(group); @@ -236,7 +236,7 @@ DefineConsoleMethod( CreatorTree, addGroup, S32, (S32 group, const char * name, return(node ? node->getId() : -1); } -DefineConsoleMethod( CreatorTree, addItem, S32, (S32 group, const char * name, const char * value), , "(Node group, string name, string value)") +DefineEngineMethod( CreatorTree, addItem, S32, (S32 group, const char * name, const char * value), , "(Node group, string name, string value)") { CreatorTree::Node * grp = object->findNode(group); @@ -249,7 +249,7 @@ DefineConsoleMethod( CreatorTree, addItem, S32, (S32 group, const char * name, c } //------------------------------------------------------------------------------ -DefineConsoleMethod( CreatorTree, fileNameMatch, bool, (const char * world, const char * type, const char * filename), , "(string world, string type, string filename)") +DefineEngineMethod( CreatorTree, fileNameMatch, bool, (const char * world, const char * type, const char * filename), , "(string world, string type, string filename)") { // argv[2] - world short // argv[3] - type short @@ -269,12 +269,12 @@ DefineConsoleMethod( CreatorTree, fileNameMatch, bool, (const char * world, cons return(!dStrnicmp(filename+1, type, typeLen)); } -DefineConsoleMethod( CreatorTree, getSelected, S32, (), , "Return a handle to the currently selected item.") +DefineEngineMethod( CreatorTree, getSelected, S32, (), , "Return a handle to the currently selected item.") { return(object->getSelected()); } -DefineConsoleMethod( CreatorTree, isGroup, bool, (const char * group), , "(Group g)") +DefineEngineMethod( CreatorTree, isGroup, bool, (const char * group), , "(Group g)") { CreatorTree::Node * node = object->findNode(dAtoi(group)); if(node && node->isGroup()) @@ -282,24 +282,24 @@ DefineConsoleMethod( CreatorTree, isGroup, bool, (const char * group), , "(Group return(false); } -DefineConsoleMethod( CreatorTree, getName, const char*, (const char * item), , "(Node item)") +DefineEngineMethod( CreatorTree, getName, const char*, (const char * item), , "(Node item)") { CreatorTree::Node * node = object->findNode(dAtoi(item)); return(node ? node->mName : 0); } -DefineConsoleMethod( CreatorTree, getValue, const char*, (S32 nodeValue), , "(Node n)") +DefineEngineMethod( CreatorTree, getValue, const char*, (S32 nodeValue), , "(Node n)") { CreatorTree::Node * node = object->findNode(nodeValue); return(node ? node->mValue : 0); } -DefineConsoleMethod( CreatorTree, clear, void, (), , "Clear the tree.") +DefineEngineMethod( CreatorTree, clear, void, (), , "Clear the tree.") { object->clear(); } -DefineConsoleMethod( CreatorTree, getParent, S32, (S32 nodeValue), , "(Node n)") +DefineEngineMethod( CreatorTree, getParent, S32, (S32 nodeValue), , "(Node n)") { CreatorTree::Node * node = object->findNode(nodeValue); if(node && node->mParent) diff --git a/Engine/source/gui/worldEditor/editTSCtrl.cpp b/Engine/source/gui/worldEditor/editTSCtrl.cpp index 4518ef3ed..4b5104cc9 100644 --- a/Engine/source/gui/worldEditor/editTSCtrl.cpp +++ b/Engine/source/gui/worldEditor/editTSCtrl.cpp @@ -702,12 +702,12 @@ void EditTSCtrl::calcOrthoCamOffset(F32 mousex, F32 mousey, U8 modifier) break; case DisplayTypeFront: - mOrthoCamTrans.x += mousex * mOrthoFOV * camScale; + mOrthoCamTrans.x -= mousex * mOrthoFOV * camScale; mOrthoCamTrans.z += mousey * mOrthoFOV * camScale; break; case DisplayTypeBack: - mOrthoCamTrans.x -= mousex * mOrthoFOV * camScale; + mOrthoCamTrans.x += mousex * mOrthoFOV * camScale; mOrthoCamTrans.z += mousey * mOrthoFOV * camScale; break; @@ -1125,17 +1125,17 @@ bool EditTSCtrl::processCameraQuery(CameraQuery * query) break; case DisplayTypeFront: - camRot.setColumn(0, Point3F(-1.0, 0.0, 0.0)); - camRot.setColumn(1, Point3F( 0.0, -1.0, 0.0)); - camRot.setColumn(2, Point3F( 0.0, 0.0, 1.0)); - camPos.y = getMax(camPos.y + smMinSceneBounds.y, sceneBounds.maxExtents.y + camBuffer); + camRot.setColumn(0, Point3F(1.0, 0.0, 0.0)); + camRot.setColumn(1, Point3F(0.0, 1.0, 0.0)); + camRot.setColumn(2, Point3F(0.0, 0.0, 1.0)); + camPos.y = getMin(camPos.y - smMinSceneBounds.y, sceneBounds.minExtents.y - camBuffer); break; case DisplayTypeBack: - camRot.setColumn(0, Point3F(1.0, 0.0, 0.0)); - camRot.setColumn(1, Point3F(0.0, 1.0, 0.0)); - camRot.setColumn(2, Point3F(0.0, 0.0, 1.0)); - camPos.y = getMin(camPos.y - smMinSceneBounds.y, sceneBounds.minExtents.y - camBuffer); + camRot.setColumn(0, Point3F(-1.0, 0.0, 0.0)); + camRot.setColumn(1, Point3F(0.0, -1.0, 0.0)); + camRot.setColumn(2, Point3F(0.0, 0.0, 1.0)); + camPos.y = getMax(camPos.y + smMinSceneBounds.y, sceneBounds.maxExtents.y + camBuffer); break; case DisplayTypeLeft: diff --git a/Engine/source/gui/worldEditor/editor.cpp b/Engine/source/gui/worldEditor/editor.cpp index 2f05c96ad..c60127540 100644 --- a/Engine/source/gui/worldEditor/editor.cpp +++ b/Engine/source/gui/worldEditor/editor.cpp @@ -128,7 +128,7 @@ static GameBase * getControlObj() return(control); } -DefineConsoleMethod( EditManager, setBookmark, void, (S32 val), , "(int slot)") +DefineEngineMethod( EditManager, setBookmark, void, (S32 val), , "(int slot)") { if(val < 0 || val > 9) return; @@ -138,7 +138,7 @@ DefineConsoleMethod( EditManager, setBookmark, void, (S32 val), , "(int slot)") object->mBookmarks[val] = control->getTransform(); } -DefineConsoleMethod( EditManager, gotoBookmark, void, (S32 val), , "(int slot)") +DefineEngineMethod( EditManager, gotoBookmark, void, (S32 val), , "(int slot)") { if(val < 0 || val > 9) return; @@ -148,17 +148,17 @@ DefineConsoleMethod( EditManager, gotoBookmark, void, (S32 val), , "(int slot)") control->setTransform(object->mBookmarks[val]); } -DefineConsoleMethod( EditManager, editorEnabled, void, (), , "Perform the onEditorEnabled callback on all SimObjects and set gEditingMission true" ) +DefineEngineMethod( EditManager, editorEnabled, void, (), , "Perform the onEditorEnabled callback on all SimObjects and set gEditingMission true" ) { object->editorEnabled(); } -DefineConsoleMethod( EditManager, editorDisabled, void, (), , "Perform the onEditorDisabled callback on all SimObjects and set gEditingMission false" ) +DefineEngineMethod( EditManager, editorDisabled, void, (), , "Perform the onEditorDisabled callback on all SimObjects and set gEditingMission false" ) { object->editorDisabled(); } -DefineConsoleMethod( EditManager, isEditorEnabled, bool, (), , "Return the value of gEditingMission." ) +DefineEngineMethod( EditManager, isEditorEnabled, bool, (), , "Return the value of gEditingMission." ) { return gEditingMission; } \ No newline at end of file diff --git a/Engine/source/gui/worldEditor/editorIconRegistry.cpp b/Engine/source/gui/worldEditor/editorIconRegistry.cpp index 8507d2ad2..b75a28335 100644 --- a/Engine/source/gui/worldEditor/editorIconRegistry.cpp +++ b/Engine/source/gui/worldEditor/editorIconRegistry.cpp @@ -23,7 +23,7 @@ #include "platform/platform.h" #include "gui/worldEditor/editorIconRegistry.h" -#include "console/console.h" +#include "console/engineAPI.h" #include "console/simBase.h" @@ -36,6 +36,8 @@ ConsoleDoc( "@internal" ); +IMPLEMENT_STATIC_CLASS(EditorIconRegistry,, ""); + EditorIconRegistry::EditorIconRegistry() { } @@ -168,51 +170,42 @@ void EditorIconRegistry::clear() mDefaultIcon.free(); } -ConsoleStaticMethod( EditorIconRegistry, add, void, 3, 4, "( String className, String imageFile [, bool overwrite = true] )" +DefineEngineStaticMethod( EditorIconRegistry, add, void, (String className, String imageFile, bool overwrite), (true), "@internal") { - bool overwrite = true; - if ( argc > 3 ) - overwrite = dAtob( argv[3] ); - - gEditorIcons.add( argv[1], argv[2], overwrite ); + gEditorIcons.add( className, imageFile, overwrite ); } -ConsoleStaticMethod( EditorIconRegistry, loadFromPath, void, 2, 3, "( String imagePath [, bool overwrite = true] )" +DefineEngineStaticMethod( EditorIconRegistry, loadFromPath, void, (String imagePath, bool overwrite), (true), "@internal") { - bool overwrite = true; - if ( argc > 2 ) - overwrite = dAtob( argv[2] ); - - gEditorIcons.loadFromPath( argv[1], overwrite ); + gEditorIcons.loadFromPath( imagePath, overwrite ); } -ConsoleStaticMethod( EditorIconRegistry, clear, void, 1, 1, "" +DefineEngineStaticMethod( EditorIconRegistry, clear, void, (),, "@internal") { gEditorIcons.clear(); } -ConsoleStaticMethod( EditorIconRegistry, findIconByClassName, const char*, 2, 2, "( String className )\n" - "Returns the file path to the icon file if found." +DefineEngineStaticMethod( EditorIconRegistry, findIconByClassName, const char*, (String className),, + "@brief Returns the file path to the icon file if found." "@internal") { - GFXTexHandle icon = gEditorIcons.findIcon( argv[1] ); + GFXTexHandle icon = gEditorIcons.findIcon( className ); if ( icon.isNull() ) return NULL; return icon->mPath; } -ConsoleStaticMethod( EditorIconRegistry, findIconBySimObject, const char*, 2, 2, "( SimObject )\n" +DefineEngineStaticMethod( EditorIconRegistry, findIconBySimObject, const char*, (SimObject* obj),, "Returns the file path to the icon file if found." "@internal") { - SimObject *obj = NULL; - if ( !Sim::findObject( argv[1], obj ) ) + if ( !obj ) { - Con::warnf( "EditorIconRegistry::findIcon, parameter %d was not a SimObject!", (const char*)argv[1] ); + Con::warnf( "EditorIconRegistry::findIcon, parameter was not a SimObject!"); return NULL; } diff --git a/Engine/source/gui/worldEditor/editorIconRegistry.h b/Engine/source/gui/worldEditor/editorIconRegistry.h index 35580d74c..a058b7ae7 100644 --- a/Engine/source/gui/worldEditor/editorIconRegistry.h +++ b/Engine/source/gui/worldEditor/editorIconRegistry.h @@ -30,6 +30,8 @@ #include "core/util/tDictionary.h" #endif +#include "console/engineAPI.h" + class SimObject; class AbstractClassRep; @@ -40,6 +42,7 @@ class AbstractClassRep; class EditorIconRegistry { public: + DECLARE_STATIC_CLASS(EditorIconRegistry); EditorIconRegistry(); ~EditorIconRegistry(); diff --git a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp index 6bc043d09..ecae9f76d 100644 --- a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp +++ b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp @@ -46,6 +46,10 @@ #include "core/volume.h" #include "gui/worldEditor/worldEditor.h" #include "T3D/prefab.h" +#include "T3D/trigger.h" +#include "T3D/zone.h" +#include "T3D/portal.h" +#include "math/mPolyhedron.impl.h" IMPLEMENT_CONOBJECT( GuiConvexEditorCtrl ); @@ -161,6 +165,35 @@ void GuiConvexEditorCtrl::setVisible( bool val ) mGizmoProfile->flags = mSavedGizmoFlags; mSavedGizmoFlags = -1; } + + SimGroup* misGroup; + if (Sim::findObject("MissionGroup", misGroup)) + { + //Make our proxy objects "real" again + for (U32 i = 0; i < mProxyObjects.size(); ++i) + { + if (!mProxyObjects[i].shapeProxy || !mProxyObjects[i].targetObject) + continue; + + AbstractClassRep* classRep = AbstractClassRep::findClassRep(mProxyObjects[i].targetObjectClass); + if (!classRep) + { + Con::errorf("WorldEditor::createPolyhedralObject - No such class: %s", mProxyObjects[i].targetObjectClass); + continue; + } + + SceneObject* polyObj = createPolyhedralObject(mProxyObjects[i].targetObjectClass.c_str(), mProxyObjects[i].shapeProxy); + + misGroup->addObject(polyObj); + + //Now, remove the convex proxy + mProxyObjects[i].shapeProxy->deleteObject(); + mProxyObjects[i].targetObject->deleteObject(); + mProxyObjects.erase(i); + --i; + } + + } } else { @@ -188,6 +221,60 @@ void GuiConvexEditorCtrl::setVisible( bool val ) } updateGizmoPos(); mSavedGizmoFlags = mGizmoProfile->flags; + + SimGroup* misGroup; + if (Sim::findObject("MissionGroup", misGroup)) + { + for (U32 c = 0; c < misGroup->size(); ++c) + { + bool isTrigger = (misGroup->at(c)->getClassName() == StringTable->insert("Trigger")); + bool isZone = (misGroup->at(c)->getClassName() == StringTable->insert("Zone")); + bool isPortal = (misGroup->at(c)->getClassName() == StringTable->insert("Portal")); + bool isOccluder = (misGroup->at(c)->getClassName() == StringTable->insert("OcclusionVolume")); + + if (isZone || isPortal || isOccluder) + { + SceneObject* sceneObj = static_cast(misGroup->at(c)); + if (!sceneObj) + { + Con::errorf("WorldEditor::createConvexShapeFrom - Invalid object"); + continue; + } + + ConvexShape* proxyShape = createConvexShapeFrom(sceneObj); + + //Set the texture to a representatory one so we know what's what + if (isTrigger) + proxyShape->mMaterialName = "TriggerProxyMaterial"; + else if (isPortal) + proxyShape->mMaterialName = "PortalProxyMaterial"; + else if (isZone) + proxyShape->mMaterialName = "ZoneProxyMaterial"; + else if (isOccluder) + proxyShape->mMaterialName = "OccluderProxyMaterial"; + + proxyShape->_updateMaterial(); + + sceneObj->setHidden(true); + + //set up the proxy object + ConvexShapeProxy newProxy; + newProxy.shapeProxy = proxyShape; + newProxy.targetObject = sceneObj; + + if (isTrigger) + newProxy.targetObjectClass = "Trigger"; + else if (isPortal) + newProxy.targetObjectClass = "Portal"; + else if (isZone) + newProxy.targetObjectClass = "Zone"; + else + newProxy.targetObjectClass = "OcclusionVolume"; + + mProxyObjects.push_back(newProxy); + } + } + } } } @@ -438,6 +525,8 @@ void GuiConvexEditorCtrl::on3DMouseDragged(const Gui3DMouseEvent & event) setupShape( newShape ); + newShape->setField("material", mConvexSEL->getMaterialName()); + submitUndo( CreateShape, newShape ); setSelection( newShape, -1 ); @@ -2033,7 +2122,8 @@ ConvexShape* ConvexEditorCreateTool::extrudeShapeFromFace( ConvexShape *inShape, surf.mulL( worldToShape ); } - newShape->setField( "material", Parent::mEditor->mMaterialName ); + //newShape->setField( "material", Parent::mEditor->mMaterialName ); + newShape->setField("material", inShape->getMaterialName()); newShape->registerObject(); mEditor->updateShape( newShape ); @@ -2179,43 +2269,248 @@ void GuiConvexEditorCtrl::splitSelectedFace() updateGizmoPos(); } -DefineConsoleMethod( GuiConvexEditorCtrl, hollowSelection, void, (), , "" ) +SceneObject* GuiConvexEditorCtrl::createPolyhedralObject(const char* className, SceneObject* geometryProvider) +{ + if (!geometryProvider) + { + Con::errorf("WorldEditor::createPolyhedralObject - Invalid geometry provider!"); + return NULL; + } + + if (!className || !className[0]) + { + Con::errorf("WorldEditor::createPolyhedralObject - Invalid class name"); + return NULL; + } + + AbstractClassRep* classRep = AbstractClassRep::findClassRep(className); + if (!classRep) + { + Con::errorf("WorldEditor::createPolyhedralObject - No such class: %s", className); + return NULL; + } + + // We don't want the extracted poly list to be affected by the object's + // current transform and scale so temporarily reset them. + + MatrixF savedTransform = geometryProvider->getTransform(); + Point3F savedScale = geometryProvider->getScale(); + + geometryProvider->setTransform(MatrixF::Identity); + geometryProvider->setScale(Point3F(1.f, 1.f, 1.f)); + + // Extract the geometry. Use the object-space bounding volumes + // as we have moved the object to the origin for the moment. + + OptimizedPolyList polyList; + if (!geometryProvider->buildPolyList(PLC_Export, &polyList, geometryProvider->getObjBox(), geometryProvider->getObjBox().getBoundingSphere())) + { + Con::errorf("WorldEditor::createPolyhedralObject - Failed to extract geometry!"); + return NULL; + } + + // Restore the object's original transform. + + geometryProvider->setTransform(savedTransform); + geometryProvider->setScale(savedScale); + + // Create the object. + + SceneObject* object = dynamic_cast< SceneObject* >(classRep->create()); + if (!Object) + { + Con::errorf("WorldEditor::createPolyhedralObject - Could not create SceneObject with class '%s'", className); + return NULL; + } + + // Convert the polylist to a polyhedron. + + Polyhedron polyhedron = polyList.toPolyhedron(); + + // Add the vertex data. + + const U32 numPoints = polyhedron.getNumPoints(); + const Point3F* points = polyhedron.getPoints(); + + for (U32 i = 0; i < numPoints; ++i) + { + static StringTableEntry sPoint = StringTable->insert("point"); + object->setDataField(sPoint, NULL, EngineMarshallData(points[i])); + } + + // Add the plane data. + + const U32 numPlanes = polyhedron.getNumPlanes(); + const PlaneF* planes = polyhedron.getPlanes(); + + for (U32 i = 0; i < numPlanes; ++i) + { + static StringTableEntry sPlane = StringTable->insert("plane"); + const PlaneF& plane = planes[i]; + + char buffer[1024]; + dSprintf(buffer, sizeof(buffer), "%g %g %g %g", plane.x, plane.y, plane.z, plane.d); + + object->setDataField(sPlane, NULL, buffer); + } + + // Add the edge data. + + const U32 numEdges = polyhedron.getNumEdges(); + const Polyhedron::Edge* edges = polyhedron.getEdges(); + + for (U32 i = 0; i < numEdges; ++i) + { + static StringTableEntry sEdge = StringTable->insert("edge"); + const Polyhedron::Edge& edge = edges[i]; + + char buffer[1024]; + dSprintf(buffer, sizeof(buffer), "%i %i %i %i ", + edge.face[0], edge.face[1], + edge.vertex[0], edge.vertex[1] + ); + + object->setDataField(sEdge, NULL, buffer); + } + + // Set the transform. + + object->setTransform(savedTransform); + object->setScale(savedScale); + + // Register and return the object. + + if (!object->registerObject()) + { + Con::errorf("WorldEditor::createPolyhedralObject - Failed to register object!"); + delete object; + return NULL; + } + + return object; +} + +ConvexShape* GuiConvexEditorCtrl::createConvexShapeFrom(SceneObject* polyObject) +{ + if (!polyObject) + { + Con::errorf("WorldEditor::createConvexShapeFrom - Invalid object"); + return NULL; + } + + IScenePolyhedralObject* iPoly = dynamic_cast< IScenePolyhedralObject* >(polyObject); + if (!iPoly) + { + Con::errorf("WorldEditor::createConvexShapeFrom - Not a polyhedral object!"); + return NULL; + } + + // Get polyhedron. + + AnyPolyhedron polyhedron = iPoly->ToAnyPolyhedron(); + const U32 numPlanes = polyhedron.getNumPlanes(); + if (!numPlanes) + { + Con::errorf("WorldEditor::createConvexShapeFrom - Object returned no valid polyhedron"); + return NULL; + } + + // Create a ConvexShape. + + ConvexShape* shape = new ConvexShape(); + + // Add all planes. + + for (U32 i = 0; i < numPlanes; ++i) + { + const PlaneF& plane = polyhedron.getPlanes()[i]; + + // Polyhedron planes are facing inwards so we need to + // invert the normal here. + + Point3F normal = plane.getNormal(); + normal.neg(); + + // Turn the orientation of the plane into a quaternion. + // The normal is our up vector (that's what's expected + // by ConvexShape for the surface orientation). + + MatrixF orientation(true); + MathUtils::getMatrixFromUpVector(normal, &orientation); + const QuatF quat(orientation); + + // Get the plane position. + + const Point3F position = plane.getPosition(); + + // Turn everything into a "surface" property for the ConvexShape. + + char buffer[1024]; + dSprintf(buffer, sizeof(buffer), "%g %g %g %g %g %g %g", + quat.x, quat.y, quat.z, quat.w, + position.x, position.y, position.z + ); + + // Add the surface. + + static StringTableEntry sSurface = StringTable->insert("surface"); + shape->setDataField(sSurface, NULL, buffer); + } + + // Copy the transform. + + shape->setTransform(polyObject->getTransform()); + shape->setScale(polyObject->getScale()); + + // Register the shape. + + if (!shape->registerObject()) + { + Con::errorf("WorldEditor::createConvexShapeFrom - Could not register ConvexShape!"); + delete shape; + return NULL; + } + + return shape; +} + +DefineEngineMethod( GuiConvexEditorCtrl, hollowSelection, void, (), , "" ) { object->hollowSelection(); } -DefineConsoleMethod( GuiConvexEditorCtrl, recenterSelection, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, recenterSelection, void, (), , "" ) { object->recenterSelection(); } -DefineConsoleMethod( GuiConvexEditorCtrl, hasSelection, S32, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, hasSelection, S32, (), , "" ) { return object->hasSelection(); } -DefineConsoleMethod( GuiConvexEditorCtrl, handleDelete, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, handleDelete, void, (), , "" ) { object->handleDelete(); } -DefineConsoleMethod( GuiConvexEditorCtrl, handleDeselect, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, handleDeselect, void, (), , "" ) { object->handleDeselect(); } -DefineConsoleMethod( GuiConvexEditorCtrl, dropSelectionAtScreenCenter, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, dropSelectionAtScreenCenter, void, (), , "" ) { object->dropSelectionAtScreenCenter(); } -DefineConsoleMethod( GuiConvexEditorCtrl, selectConvex, void, (ConvexShape *convex), , "( ConvexShape )" ) +DefineEngineMethod( GuiConvexEditorCtrl, selectConvex, void, (ConvexShape *convex), , "( ConvexShape )" ) { if (convex) object->setSelection( convex, -1 ); } -DefineConsoleMethod( GuiConvexEditorCtrl, splitSelectedFace, void, (), , "" ) +DefineEngineMethod( GuiConvexEditorCtrl, splitSelectedFace, void, (), , "" ) { object->splitSelectedFace(); } \ No newline at end of file diff --git a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h index 0bb00c32f..dbf8f267f 100644 --- a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h +++ b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h @@ -114,6 +114,8 @@ public: void dropSelectionAtScreenCenter(); void splitSelectedFace(); + SceneObject* createPolyhedralObject(const char* className, SceneObject* geometryProvider); + ConvexShape* createConvexShapeFrom(SceneObject* polyObject); /// Interface with Tools. /// @{ @@ -192,6 +194,16 @@ protected: UndoAction *mLastUndo; UndoManager *mUndoManager; + struct ConvexShapeProxy + { + ConvexShape* shapeProxy; + SceneObject* targetObject; + String targetObjectClass; + bool dirty; + }; + + Vector mProxyObjects; + ConvexEditorTool *mActiveTool; ConvexEditorCreateTool *mCreateTool; }; diff --git a/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp b/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp index 6712d7762..1d76d3d30 100644 --- a/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp +++ b/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp @@ -784,12 +784,12 @@ void GuiDecalEditorCtrl::setMode( String mode, bool sourceShortcut = false ) Con::executef( this, "paletteSync", mMode ); } -DefineConsoleMethod( GuiDecalEditorCtrl, deleteSelectedDecal, void, (), , "deleteSelectedDecal()" ) +DefineEngineMethod( GuiDecalEditorCtrl, deleteSelectedDecal, void, (), , "deleteSelectedDecal()" ) { object->deleteSelectedDecal(); } -DefineConsoleMethod( GuiDecalEditorCtrl, deleteDecalDatablock, void, ( const char * datablock ), , "deleteSelectedDecalDatablock( String datablock )" ) +DefineEngineMethod( GuiDecalEditorCtrl, deleteDecalDatablock, void, ( const char * datablock ), , "deleteSelectedDecalDatablock( String datablock )" ) { String lookupName( datablock ); if( lookupName == String::EmptyString ) @@ -798,22 +798,22 @@ DefineConsoleMethod( GuiDecalEditorCtrl, deleteDecalDatablock, void, ( const cha object->deleteDecalDatablock( lookupName ); } -DefineConsoleMethod( GuiDecalEditorCtrl, setMode, void, ( String newMode ), , "setMode( String mode )()" ) +DefineEngineMethod( GuiDecalEditorCtrl, setMode, void, ( String newMode ), , "setMode( String mode )()" ) { object->setMode( newMode ); } -DefineConsoleMethod( GuiDecalEditorCtrl, getMode, const char*, (), , "getMode()" ) +DefineEngineMethod( GuiDecalEditorCtrl, getMode, const char*, (), , "getMode()" ) { return object->mMode; } -DefineConsoleMethod( GuiDecalEditorCtrl, getDecalCount, S32, (), , "getDecalCount()" ) +DefineEngineMethod( GuiDecalEditorCtrl, getDecalCount, S32, (), , "getDecalCount()" ) { return gDecalManager->mDecalInstanceVec.size(); } -DefineConsoleMethod( GuiDecalEditorCtrl, getDecalTransform, const char*, ( U32 id ), , "getDecalTransform()" ) +DefineEngineMethod( GuiDecalEditorCtrl, getDecalTransform, const char*, ( U32 id ), , "getDecalTransform()" ) { DecalInstance *decalInstance = gDecalManager->mDecalInstanceVec[id]; @@ -835,7 +835,7 @@ DefineConsoleMethod( GuiDecalEditorCtrl, getDecalTransform, const char*, ( U32 i return returnBuffer; } -DefineConsoleMethod( GuiDecalEditorCtrl, getDecalLookupName, const char*, ( U32 id ), , "getDecalLookupName( S32 )()" ) +DefineEngineMethod( GuiDecalEditorCtrl, getDecalLookupName, const char*, ( U32 id ), , "getDecalLookupName( S32 )()" ) { DecalInstance *decalInstance = gDecalManager->mDecalInstanceVec[id]; if( decalInstance == NULL ) @@ -844,7 +844,7 @@ DefineConsoleMethod( GuiDecalEditorCtrl, getDecalLookupName, const char*, ( U32 return decalInstance->mDataBlock->lookupName; } -DefineConsoleMethod( GuiDecalEditorCtrl, selectDecal, void, ( U32 id ), , "selectDecal( S32 )()" ) +DefineEngineMethod( GuiDecalEditorCtrl, selectDecal, void, ( U32 id ), , "selectDecal( S32 )()" ) { DecalInstance *decalInstance = gDecalManager->mDecalInstanceVec[id]; if( decalInstance == NULL ) @@ -853,7 +853,7 @@ DefineConsoleMethod( GuiDecalEditorCtrl, selectDecal, void, ( U32 id ), , "selec object->selectDecal( decalInstance ); } -DefineConsoleMethod( GuiDecalEditorCtrl, editDecalDetails, void, ( U32 id, Point3F pos, Point3F tan,F32 size ), , "editDecalDetails( S32 )()" ) +DefineEngineMethod( GuiDecalEditorCtrl, editDecalDetails, void, ( U32 id, Point3F pos, Point3F tan,F32 size ), , "editDecalDetails( S32 )()" ) { DecalInstance *decalInstance = gDecalManager->mDecalInstanceVec[id]; if( decalInstance == NULL ) @@ -872,14 +872,14 @@ DefineConsoleMethod( GuiDecalEditorCtrl, editDecalDetails, void, ( U32 id, Point gDecalManager->notifyDecalModified( decalInstance ); } -DefineConsoleMethod( GuiDecalEditorCtrl, getSelectionCount, S32, (), , "" ) +DefineEngineMethod( GuiDecalEditorCtrl, getSelectionCount, S32, (), , "" ) { if ( object->mSELDecal != NULL ) return 1; return 0; } -DefineConsoleMethod( GuiDecalEditorCtrl, retargetDecalDatablock, void, ( const char * dbFrom, const char * dbTo ), , "" ) +DefineEngineMethod( GuiDecalEditorCtrl, retargetDecalDatablock, void, ( const char * dbFrom, const char * dbTo ), , "" ) { if( dStrcmp( dbFrom, "" ) != 0 && dStrcmp( dbTo, "" ) != 0 ) object->retargetDecalDatablock( dbFrom, dbTo ); diff --git a/Engine/source/gui/worldEditor/guiMissionAreaEditor.cpp b/Engine/source/gui/worldEditor/guiMissionAreaEditor.cpp index 411fd074a..839d39017 100644 --- a/Engine/source/gui/worldEditor/guiMissionAreaEditor.cpp +++ b/Engine/source/gui/worldEditor/guiMissionAreaEditor.cpp @@ -95,7 +95,7 @@ void GuiMissionAreaEditorCtrl::setSelectedMissionArea( MissionArea *missionArea Con::executef( this, "onMissionAreaSelected" ); } -DefineConsoleMethod( GuiMissionAreaEditorCtrl, setSelectedMissionArea, void, (const char * missionAreaName), (""), "" ) +DefineEngineMethod( GuiMissionAreaEditorCtrl, setSelectedMissionArea, void, (const char * missionAreaName), (""), "" ) { if ( dStrcmp( missionAreaName, "" )==0 ) object->setSelectedMissionArea(NULL); @@ -107,7 +107,7 @@ DefineConsoleMethod( GuiMissionAreaEditorCtrl, setSelectedMissionArea, void, (co } } -DefineConsoleMethod( GuiMissionAreaEditorCtrl, getSelectedMissionArea, const char*, (), , "" ) +DefineEngineMethod( GuiMissionAreaEditorCtrl, getSelectedMissionArea, const char*, (), , "" ) { MissionArea *missionArea = object->getSelectedMissionArea(); if ( !missionArea ) diff --git a/Engine/source/gui/worldEditor/guiTerrPreviewCtrl.cpp b/Engine/source/gui/worldEditor/guiTerrPreviewCtrl.cpp index 18db8de5f..0d3c988bf 100644 --- a/Engine/source/gui/worldEditor/guiTerrPreviewCtrl.cpp +++ b/Engine/source/gui/worldEditor/guiTerrPreviewCtrl.cpp @@ -88,35 +88,35 @@ void GuiTerrPreviewCtrl::initPersistFields() } -DefineConsoleMethod( GuiTerrPreviewCtrl, reset, void, (), , "Reset the view of the terrain.") +DefineEngineMethod( GuiTerrPreviewCtrl, reset, void, (), , "Reset the view of the terrain.") { object->reset(); } -DefineConsoleMethod( GuiTerrPreviewCtrl, setRoot, void, (), , "Add the origin to the root and reset the origin.") +DefineEngineMethod( GuiTerrPreviewCtrl, setRoot, void, (), , "Add the origin to the root and reset the origin.") { object->setRoot(); } -DefineConsoleMethod( GuiTerrPreviewCtrl, getRoot, Point2F, (), , "Return a Point2F representing the position of the root.") +DefineEngineMethod( GuiTerrPreviewCtrl, getRoot, Point2F, (), , "Return a Point2F representing the position of the root.") { return object->getRoot(); } -DefineConsoleMethod( GuiTerrPreviewCtrl, setOrigin, void, (Point2F pos), , "(float x, float y)" +DefineEngineMethod( GuiTerrPreviewCtrl, setOrigin, void, (Point2F pos), , "(float x, float y)" "Set the origin of the view.") { object->setOrigin( pos ); } -DefineConsoleMethod( GuiTerrPreviewCtrl, getOrigin, Point2F, (), , "Return a Point2F containing the position of the origin.") +DefineEngineMethod( GuiTerrPreviewCtrl, getOrigin, Point2F, (), , "Return a Point2F containing the position of the origin.") { return object->getOrigin(); } -DefineConsoleMethod( GuiTerrPreviewCtrl, getValue, const char*, (), , "Returns a 4-tuple containing: root_x root_y origin_x origin_y") +DefineEngineMethod( GuiTerrPreviewCtrl, getValue, const char*, (), , "Returns a 4-tuple containing: root_x root_y origin_x origin_y") { Point2F r = object->getRoot(); Point2F o = object->getOrigin(); @@ -126,7 +126,7 @@ DefineConsoleMethod( GuiTerrPreviewCtrl, getValue, const char*, (), , "Returns a return valuebuf; } -DefineConsoleMethod( GuiTerrPreviewCtrl, setValue, void, (const char * tuple), , "Accepts a 4-tuple in the same form as getValue returns.\n\n" +DefineEngineMethod( GuiTerrPreviewCtrl, setValue, void, (const char * tuple), , "Accepts a 4-tuple in the same form as getValue returns.\n\n" "@see GuiTerrPreviewCtrl::getValue()") { Point2F r,o; diff --git a/Engine/source/gui/worldEditor/terrainActions.cpp b/Engine/source/gui/worldEditor/terrainActions.cpp index 11360f82d..b64cade26 100644 --- a/Engine/source/gui/worldEditor/terrainActions.cpp +++ b/Engine/source/gui/worldEditor/terrainActions.cpp @@ -795,7 +795,7 @@ void TerrainSmoothAction::smooth( TerrainBlock *terrain, F32 factor, U32 steps ) redo(); } -DefineConsoleMethod( TerrainSmoothAction, smooth, void, ( TerrainBlock *terrain, F32 factor, U32 steps ), , "( TerrainBlock obj, F32 factor, U32 steps )") +DefineEngineMethod( TerrainSmoothAction, smooth, void, ( TerrainBlock *terrain, F32 factor, U32 steps ), , "( TerrainBlock obj, F32 factor, U32 steps )") { if (terrain) object->smooth( terrain, factor, mClamp( steps, 1, 13 ) ); diff --git a/Engine/source/gui/worldEditor/terrainEditor.cpp b/Engine/source/gui/worldEditor/terrainEditor.cpp index 8e81d84e3..f1bf5fd58 100644 --- a/Engine/source/gui/worldEditor/terrainEditor.cpp +++ b/Engine/source/gui/worldEditor/terrainEditor.cpp @@ -2403,7 +2403,7 @@ void TerrainEditor::reorderMaterial( S32 index, S32 orderPos ) //------------------------------------------------------------------------------ -DefineConsoleMethod( TerrainEditor, attachTerrain, void, (const char * terrain), (""), "(TerrainBlock terrain)") +DefineEngineMethod( TerrainEditor, attachTerrain, void, (const char * terrain), (""), "(TerrainBlock terrain)") { SimSet * missionGroup = dynamic_cast(Sim::findObject("MissionGroup")); if (!missionGroup) @@ -2459,12 +2459,12 @@ DefineConsoleMethod( TerrainEditor, attachTerrain, void, (const char * terrain), } } -DefineConsoleMethod( TerrainEditor, getTerrainBlockCount, S32, (), , "()") +DefineEngineMethod( TerrainEditor, getTerrainBlockCount, S32, (), , "()") { return object->getTerrainBlockCount(); } -DefineConsoleMethod( TerrainEditor, getTerrainBlock, S32, (S32 index), , "(S32 index)") +DefineEngineMethod( TerrainEditor, getTerrainBlock, S32, (S32 index), , "(S32 index)") { TerrainBlock* tb = object->getTerrainBlock(index); if(!tb) @@ -2473,7 +2473,7 @@ DefineConsoleMethod( TerrainEditor, getTerrainBlock, S32, (S32 index), , "(S32 i return tb->getId(); } -DefineConsoleMethod(TerrainEditor, getTerrainBlocksMaterialList, const char *, (), , "() gets the list of current terrain materials for all terrain blocks.") +DefineEngineMethod(TerrainEditor, getTerrainBlocksMaterialList, const char *, (), , "() gets the list of current terrain materials for all terrain blocks.") { Vector list; object->getTerrainBlocksMaterialList(list); @@ -2502,23 +2502,23 @@ DefineConsoleMethod(TerrainEditor, getTerrainBlocksMaterialList, const char *, ( return ret; } -DefineConsoleMethod( TerrainEditor, setBrushType, void, (String type), , "(string type)" +DefineEngineMethod( TerrainEditor, setBrushType, void, (String type), , "(string type)" "One of box, ellipse, selection.") { object->setBrushType(type); } -DefineConsoleMethod( TerrainEditor, getBrushType, const char*, (), , "()") +DefineEngineMethod( TerrainEditor, getBrushType, const char*, (), , "()") { return object->getBrushType(); } -DefineConsoleMethod( TerrainEditor, setBrushSize, void, ( S32 w, S32 h), (0), "(int w [, int h])") +DefineEngineMethod( TerrainEditor, setBrushSize, void, ( S32 w, S32 h), (0), "(int w [, int h])") { object->setBrushSize( w, h==0?w:h ); } -DefineConsoleMethod( TerrainEditor, getBrushSize, const char*, (), , "()") +DefineEngineMethod( TerrainEditor, getBrushSize, const char*, (), , "()") { Point2I size = object->getBrushSize(); @@ -2528,74 +2528,74 @@ DefineConsoleMethod( TerrainEditor, getBrushSize, const char*, (), , "()") return ret; } -DefineConsoleMethod( TerrainEditor, setBrushPressure, void, (F32 pressure), , "(float pressure)") +DefineEngineMethod( TerrainEditor, setBrushPressure, void, (F32 pressure), , "(float pressure)") { object->setBrushPressure( pressure ); } -DefineConsoleMethod( TerrainEditor, getBrushPressure, F32, (), , "()") +DefineEngineMethod( TerrainEditor, getBrushPressure, F32, (), , "()") { return object->getBrushPressure(); } -DefineConsoleMethod( TerrainEditor, setBrushSoftness, void, (F32 softness), , "(float softness)") +DefineEngineMethod( TerrainEditor, setBrushSoftness, void, (F32 softness), , "(float softness)") { object->setBrushSoftness( softness ); } -DefineConsoleMethod( TerrainEditor, getBrushSoftness, F32, (), , "()") +DefineEngineMethod( TerrainEditor, getBrushSoftness, F32, (), , "()") { return object->getBrushSoftness(); } -DefineConsoleMethod( TerrainEditor, getBrushPos, const char*, (), , "Returns a Point2I.") +DefineEngineMethod( TerrainEditor, getBrushPos, const char*, (), , "Returns a Point2I.") { return object->getBrushPos(); } -DefineConsoleMethod( TerrainEditor, setBrushPos, void, (Point2I pos), , "Location") +DefineEngineMethod( TerrainEditor, setBrushPos, void, (Point2I pos), , "Location") { object->setBrushPos(pos); } -DefineConsoleMethod( TerrainEditor, setAction, void, (const char * action_name), , "(string action_name)") +DefineEngineMethod( TerrainEditor, setAction, void, (const char * action_name), , "(string action_name)") { object->setAction(action_name); } -DefineConsoleMethod( TerrainEditor, getActionName, const char*, (U32 index), , "(int num)") +DefineEngineMethod( TerrainEditor, getActionName, const char*, (U32 index), , "(int num)") { return (object->getActionName(index)); } -DefineConsoleMethod( TerrainEditor, getNumActions, S32, (), , "") +DefineEngineMethod( TerrainEditor, getNumActions, S32, (), , "") { return(object->getNumActions()); } -DefineConsoleMethod( TerrainEditor, getCurrentAction, const char*, (), , "") +DefineEngineMethod( TerrainEditor, getCurrentAction, const char*, (), , "") { return object->getCurrentAction(); } -DefineConsoleMethod( TerrainEditor, resetSelWeights, void, (bool clear), , "(bool clear)") +DefineEngineMethod( TerrainEditor, resetSelWeights, void, (bool clear), , "(bool clear)") { object->resetSelWeights(clear); } -DefineConsoleMethod( TerrainEditor, clearSelection, void, (), , "") +DefineEngineMethod( TerrainEditor, clearSelection, void, (), , "") { object->clearSelection(); } -DefineConsoleMethod( TerrainEditor, processAction, void, (String action), (""), "(string action=NULL)") +DefineEngineMethod( TerrainEditor, processAction, void, (String action), (""), "(string action=NULL)") { object->processAction(action); } -DefineConsoleMethod( TerrainEditor, getActiveTerrain, S32, (), , "") +DefineEngineMethod( TerrainEditor, getActiveTerrain, S32, (), , "") { S32 ret = 0; @@ -2607,27 +2607,27 @@ DefineConsoleMethod( TerrainEditor, getActiveTerrain, S32, (), , "") return ret; } -DefineConsoleMethod( TerrainEditor, getNumTextures, S32, (), , "") +DefineEngineMethod( TerrainEditor, getNumTextures, S32, (), , "") { return object->getNumTextures(); } -DefineConsoleMethod( TerrainEditor, markEmptySquares, void, (), , "") +DefineEngineMethod( TerrainEditor, markEmptySquares, void, (), , "") { object->markEmptySquares(); } -DefineConsoleMethod( TerrainEditor, mirrorTerrain, void, (S32 mirrorIndex), , "") +DefineEngineMethod( TerrainEditor, mirrorTerrain, void, (S32 mirrorIndex), , "") { object->mirrorTerrain(mirrorIndex); } -DefineConsoleMethod(TerrainEditor, setTerraformOverlay, void, (bool overlayEnable), , "(bool overlayEnable) - sets the terraformer current heightmap to draw as an overlay over the current terrain.") +DefineEngineMethod(TerrainEditor, setTerraformOverlay, void, (bool overlayEnable), , "(bool overlayEnable) - sets the terraformer current heightmap to draw as an overlay over the current terrain.") { // XA: This one needs to be implemented :) } -DefineConsoleMethod(TerrainEditor, updateMaterial, bool, ( U32 index, String matName ), , +DefineEngineMethod(TerrainEditor, updateMaterial, bool, ( U32 index, String matName ), , "( int index, string matName )\n" "Changes the material name at the index." ) { @@ -2645,7 +2645,7 @@ DefineConsoleMethod(TerrainEditor, updateMaterial, bool, ( U32 index, String mat return true; } -DefineConsoleMethod(TerrainEditor, addMaterial, S32, ( String matName ), , +DefineEngineMethod(TerrainEditor, addMaterial, S32, ( String matName ), , "( string matName )\n" "Adds a new material." ) { @@ -2660,7 +2660,7 @@ DefineConsoleMethod(TerrainEditor, addMaterial, S32, ( String matName ), , return true; } -DefineConsoleMethod( TerrainEditor, removeMaterial, void, ( S32 index ), , "( int index ) - Remove the material at the given index." ) +DefineEngineMethod( TerrainEditor, removeMaterial, void, ( S32 index ), , "( int index ) - Remove the material at the given index." ) { TerrainBlock *terr = object->getClientTerrain(); if ( !terr ) @@ -2689,7 +2689,7 @@ DefineConsoleMethod( TerrainEditor, removeMaterial, void, ( S32 index ), , "( in object->setGridUpdateMinMax(); } -DefineConsoleMethod(TerrainEditor, getMaterialCount, S32, (), , +DefineEngineMethod(TerrainEditor, getMaterialCount, S32, (), , "Returns the current material count." ) { TerrainBlock *terr = object->getClientTerrain(); @@ -2699,7 +2699,7 @@ DefineConsoleMethod(TerrainEditor, getMaterialCount, S32, (), , return 0; } -DefineConsoleMethod(TerrainEditor, getMaterials, const char *, (), , "() gets the list of current terrain materials.") +DefineEngineMethod(TerrainEditor, getMaterials, const char *, (), , "() gets the list of current terrain materials.") { TerrainBlock *terr = object->getClientTerrain(); if ( !terr ) @@ -2716,7 +2716,7 @@ DefineConsoleMethod(TerrainEditor, getMaterials, const char *, (), , "() gets th return ret; } -DefineConsoleMethod( TerrainEditor, getMaterialName, const char*, (S32 index), , "( int index ) - Returns the name of the material at the given index." ) +DefineEngineMethod( TerrainEditor, getMaterialName, const char*, (S32 index), , "( int index ) - Returns the name of the material at the given index." ) { TerrainBlock *terr = object->getClientTerrain(); if ( !terr ) @@ -2732,7 +2732,7 @@ DefineConsoleMethod( TerrainEditor, getMaterialName, const char*, (S32 index), , return Con::getReturnBuffer( name ); } -DefineConsoleMethod( TerrainEditor, getMaterialIndex, S32, ( String name ), , "( string name ) - Returns the index of the material with the given name or -1." ) +DefineEngineMethod( TerrainEditor, getMaterialIndex, S32, ( String name ), , "( string name ) - Returns the index of the material with the given name or -1." ) { TerrainBlock *terr = object->getClientTerrain(); if ( !terr ) @@ -2747,13 +2747,13 @@ DefineConsoleMethod( TerrainEditor, getMaterialIndex, S32, ( String name ), , "( return -1; } -DefineConsoleMethod( TerrainEditor, reorderMaterial, void, ( S32 index, S32 orderPos ), , "( int index, int order ) " +DefineEngineMethod( TerrainEditor, reorderMaterial, void, ( S32 index, S32 orderPos ), , "( int index, int order ) " "- Reorder material at the given index to the new position, changing the order in which it is rendered / blended." ) { object->reorderMaterial( index, orderPos ); } -DefineConsoleMethod(TerrainEditor, getTerrainUnderWorldPoint, S32, (const char * ptOrX, const char * Y, const char * Z), ("", "", ""), +DefineEngineMethod(TerrainEditor, getTerrainUnderWorldPoint, S32, (const char * ptOrX, const char * Y, const char * Z), ("", "", ""), "(x/y/z) Gets the terrain block that is located under the given world point.\n" "@param x/y/z The world coordinates (floating point values) you wish to query at. " "These can be formatted as either a string (\"x y z\") or separately as (x, y, z)\n" @@ -2822,12 +2822,12 @@ void TerrainEditor::initPersistFields() Parent::initPersistFields(); } -DefineConsoleMethod( TerrainEditor, getSlopeLimitMinAngle, F32, (), , "") +DefineEngineMethod( TerrainEditor, getSlopeLimitMinAngle, F32, (), , "") { return object->mSlopeMinAngle; } -DefineConsoleMethod( TerrainEditor, setSlopeLimitMinAngle, F32, (F32 angle), , "") +DefineEngineMethod( TerrainEditor, setSlopeLimitMinAngle, F32, (F32 angle), , "") { if ( angle < 0.0f ) angle = 0.0f; @@ -2838,12 +2838,12 @@ DefineConsoleMethod( TerrainEditor, setSlopeLimitMinAngle, F32, (F32 angle), , " return angle; } -DefineConsoleMethod( TerrainEditor, getSlopeLimitMaxAngle, F32, (), , "") +DefineEngineMethod( TerrainEditor, getSlopeLimitMaxAngle, F32, (), , "") { return object->mSlopeMaxAngle; } -DefineConsoleMethod( TerrainEditor, setSlopeLimitMaxAngle, F32, (F32 angle), , "") +DefineEngineMethod( TerrainEditor, setSlopeLimitMaxAngle, F32, (F32 angle), , "") { if ( angle > 90.0f ) angle = 90.0f; diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index 651ef4ded..27c9dc473 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -3225,7 +3225,7 @@ void WorldEditor::setEditorTool(EditorTool* newTool) //------------------------------------------------------------------------------ -ConsoleMethod( WorldEditor, ignoreObjClass, void, 3, 0, "(string class_name, ...)") +DefineEngineStringlyVariadicMethod( WorldEditor, ignoreObjClass, void, 3, 0, "(string class_name, ...)") { object->ignoreObjClass(argc, argv); } @@ -3252,7 +3252,7 @@ DefineEngineMethod( WorldEditor, getActiveSelection, S32, (),, return object->getActiveSelectionSet()->getId(); } -DefineConsoleMethod( WorldEditor, setActiveSelection, void, ( WorldEditorSelection* selection), , +DefineEngineMethod( WorldEditor, setActiveSelection, void, ( WorldEditorSelection* selection), , "Set the currently active WorldEditorSelection object.\n" "@param selection A WorldEditorSelectionSet object to use for the selection container.") { diff --git a/Engine/source/gui/worldEditor/worldEditorSelection.cpp b/Engine/source/gui/worldEditor/worldEditorSelection.cpp index 00311adea..472ac46ef 100644 --- a/Engine/source/gui/worldEditor/worldEditorSelection.cpp +++ b/Engine/source/gui/worldEditor/worldEditorSelection.cpp @@ -657,58 +657,42 @@ void WorldEditorSelection::setSize(const VectorF & newsize) //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, containsGlobalBounds, bool, 2, 2, "() - True if an object with global bounds is contained in the selection." ) +DefineEngineMethod( WorldEditorSelection, containsGlobalBounds, bool, (),, "True if an object with global bounds is contained in the selection." ) { return object->containsGlobalBounds(); } //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, getCentroid, const char*, 2, 2, "() - Return the median of all object positions in the selection." ) +DefineEngineMethod( WorldEditorSelection, getCentroid, Point3F, (),, "Return the median of all object positions in the selection." ) { - static const U32 bufSize = 256; - char* buffer = Con::getReturnBuffer( bufSize ); const Point3F& centroid = object->getCentroid(); - - dSprintf( buffer, bufSize, "%g %g %g", centroid.x, centroid.y, centroid.z ); - return buffer; + return centroid; } //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, getBoxCentroid, const char*, 2, 2, "() - Return the center of the bounding box around the selection." ) +DefineEngineMethod( WorldEditorSelection, getBoxCentroid, Point3F, (),, "Return the center of the bounding box around the selection." ) { - static const U32 bufSize = 256; - char* buffer = Con::getReturnBuffer( bufSize ); const Point3F& boxCentroid = object->getBoxCentroid(); - - dSprintf( buffer, bufSize, "%g %g %g", boxCentroid.x, boxCentroid.y, boxCentroid.z ); - return buffer; + return boxCentroid; } //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, offset, void, 3, 4, "( vector delta, float gridSnap=0 ) - Move all objects in the selection by the given delta." ) -{ - F32 x, y, z; - dSscanf( argv[ 3 ], "%g %g %g", &x, &y, &z ); - - F32 gridSnap = 0.f; - if( argc > 3 ) - gridSnap = dAtof( argv[ 3 ] ); - - object->offset( Point3F( x, y, z ), gridSnap ); +DefineEngineMethod(WorldEditorSelection, offset, void, (Point3F delta, F32 gridSnap), (0.0f), "Move all objects in the selection by the given delta.") +{ + object->offset( delta, gridSnap ); WorldEditor::updateClientTransforms( object ); } //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, union, void, 3, 3, "( SimSet set ) - Add all objects in the given set to this selection." ) +DefineEngineMethod( WorldEditorSelection, union, void, (SimSet* selection),, "Add all objects in the given set to this selection." ) { - SimSet* selection; - if( !Sim::findObject( argv[ 2 ], selection ) ) + if( !selection) { - Con::errorf( "WorldEditorSelection::union - no SimSet '%s'", (const char*)argv[ 2 ] ); + Con::errorf( "WorldEditorSelection::union - no SimSet"); return; } @@ -719,12 +703,11 @@ ConsoleMethod( WorldEditorSelection, union, void, 3, 3, "( SimSet set ) - Add al //----------------------------------------------------------------------------- -ConsoleMethod( WorldEditorSelection, subtract, void, 3, 3, "( SimSet ) - Remove all objects in the given set from this selection." ) +DefineEngineMethod( WorldEditorSelection, subtract, void, (SimSet* selection),, "Remove all objects in the given set from this selection." ) { - SimSet* selection; - if( !Sim::findObject( argv[ 2 ], selection ) ) + if( !selection ) { - Con::errorf( "WorldEditorSelection::subtract - no SimSet '%s'", (const char*)argv[ 2 ] ); + Con::errorf( "WorldEditorSelection::subtract - no SimSet" ); return; } diff --git a/Engine/source/i18n/i18n.cpp b/Engine/source/i18n/i18n.cpp index 359c76fa4..1de738abd 100644 --- a/Engine/source/i18n/i18n.cpp +++ b/Engine/source/i18n/i18n.cpp @@ -58,7 +58,7 @@ const UTF8 *getCoreString(S32 id) //----------------------------------------------------------------------------- -DefineConsoleFunction( getCoreLangTable, S32, (), , "()" +DefineEngineFunction( getCoreLangTable, S32, (), , "()" "@brief Gets the primary LangTable used by the game\n\n" "@return ID of the core LangTable\n" "@ingroup Localization") @@ -69,7 +69,7 @@ DefineConsoleFunction( getCoreLangTable, S32, (), , "()" return 0; } -DefineConsoleFunction( setCoreLangTable, void, (const char * lgTable), , "(string LangTable)" +DefineEngineFunction( setCoreLangTable, void, (const char * lgTable), , "(string LangTable)" "@brief Sets the primary LangTable used by the game\n\n" "@param LangTable ID of the core LangTable\n" "@ingroup Localization") diff --git a/Engine/source/i18n/lang.cpp b/Engine/source/i18n/lang.cpp index 7e1efe4a5..724d88abe 100644 --- a/Engine/source/i18n/lang.cpp +++ b/Engine/source/i18n/lang.cpp @@ -329,7 +329,7 @@ void LangTable::setCurrentLanguage(S32 langid) -DefineConsoleMethod(LangTable, addLanguage, S32, (String filename, String languageName), ("", ""), +DefineEngineMethod(LangTable, addLanguage, S32, (String filename, String languageName), ("", ""), "(string filename, [string languageName])" "@brief Adds a language to the table\n\n" "@param filename Name and path to the language file\n" @@ -343,7 +343,7 @@ DefineConsoleMethod(LangTable, addLanguage, S32, (String filename, String langua return object->addLanguage(scriptFilenameBuffer, (const UTF8*)languageName); } -DefineConsoleMethod(LangTable, getString, const char *, (U32 id), , +DefineEngineMethod(LangTable, getString, const char *, (U32 id), , "(string filename)" "@brief Grabs a string from the specified table\n\n" "If an invalid is passed, the function will attempt to " @@ -363,14 +363,14 @@ DefineConsoleMethod(LangTable, getString, const char *, (U32 id), , return ""; } -DefineConsoleMethod(LangTable, setDefaultLanguage, void, (S32 langId), , "(int language)" +DefineEngineMethod(LangTable, setDefaultLanguage, void, (S32 langId), , "(int language)" "@brief Sets the default language table\n\n" "@param language ID of the table\n") { object->setDefaultLanguage(langId); } -DefineConsoleMethod(LangTable, setCurrentLanguage, void, (S32 langId), , +DefineEngineMethod(LangTable, setCurrentLanguage, void, (S32 langId), , "(int language)" "@brief Sets the current language table for grabbing text\n\n" "@param language ID of the table\n") @@ -378,14 +378,14 @@ DefineConsoleMethod(LangTable, setCurrentLanguage, void, (S32 langId), , object->setCurrentLanguage(langId); } -DefineConsoleMethod(LangTable, getCurrentLanguage, S32, (), , "()" +DefineEngineMethod(LangTable, getCurrentLanguage, S32, (), , "()" "@brief Get the ID of the current language table\n\n" "@return Numerical ID of the current language table") { return object->getCurrentLanguage(); } -DefineConsoleMethod(LangTable, getLangName, const char *, (S32 langId), , "(int language)" +DefineEngineMethod(LangTable, getLangName, const char *, (S32 langId), , "(int language)" "@brief Return the readable name of the language table\n\n" "@param language Numerical ID of the language table to access\n\n" "@return String containing the name of the table, NULL if ID was invalid or name was never specified") @@ -402,7 +402,7 @@ DefineConsoleMethod(LangTable, getLangName, const char *, (S32 langId), , "(int return ""; } -DefineConsoleMethod(LangTable, getNumLang, S32, (), , "()" +DefineEngineMethod(LangTable, getNumLang, S32, (), , "()" "@brief Used to find out how many languages are in the table\n\n" "@return Size of the vector containing the languages, numerical") { @@ -508,14 +508,15 @@ bool compiledFileNeedsUpdate(UTF8* filename) return false; } -ConsoleFunction(CompileLanguage, void, 2, 3, "(string inputFile, [bool createMap]) Compiles a LSO language file." +DefineEngineFunction(CompileLanguage, void, (const char* inputFile, bool createMap), (false), + "@brief Compiles a LSO language file." " if createIndex is true, will also create languageMap.cs with" " the global variables for each string index." " The input file must follow this example layout:" " TXT_HELLO_WORLD = Hello world in english!") { UTF8 scriptFilenameBuffer[1024]; - Con::expandScriptFilename((char*)scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]); + Con::expandScriptFilename((char*)scriptFilenameBuffer, sizeof(scriptFilenameBuffer), inputFile); if (!Torque::FS::IsFile(scriptFilenameBuffer)) { @@ -532,7 +533,6 @@ ConsoleFunction(CompileLanguage, void, 2, 3, "(string inputFile, [bool createMap if (compiledFileNeedsUpdate(scriptFilenameBuffer)) { - bool createMap = argc > 2 ? dAtob(argv[2]) : false; FileStream *mapStream = NULL; if (createMap) { diff --git a/Engine/source/lighting/advanced/advancedLightManager.cpp b/Engine/source/lighting/advanced/advancedLightManager.cpp index 8097b3ef3..7773b7b48 100644 --- a/Engine/source/lighting/advanced/advancedLightManager.cpp +++ b/Engine/source/lighting/advanced/advancedLightManager.cpp @@ -705,7 +705,7 @@ LightShadowMap* AdvancedLightManager::findShadowMapForObject( SimObject *object return sceneLight->getLight()->getExtended()->getShadowMap(); } -DefineConsoleFunction( setShadowVizLight, const char*, (const char* name), (""), "") +DefineEngineFunction( setShadowVizLight, const char*, (const char* name), (""), "") { static const String DebugTargetName( "AL_ShadowVizTexture" ); diff --git a/Engine/source/lighting/shadowManager.cpp b/Engine/source/lighting/shadowManager.cpp index 68a234c70..288ff54c9 100644 --- a/Engine/source/lighting/shadowManager.cpp +++ b/Engine/source/lighting/shadowManager.cpp @@ -54,7 +54,7 @@ SceneManager* ShadowManager::getSceneManager() //------------------------------------------------------------------------------ // Runtime switching of shadow systems. Requires correct world to be pushed at console. -DefineConsoleFunction( setShadowManager, bool, (const char* sShadowSystemName), (""), "string sShadowSystemName") +DefineEngineFunction( setShadowManager, bool, (const char* sShadowSystemName), (""), "string sShadowSystemName") { /* // Make sure this new one exists diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index 1e10eed46..a13c81c13 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -651,25 +651,25 @@ void Material::StageData::getFeatureSet( FeatureSet *outFeatures ) const } } -DefineConsoleMethod( Material, flush, void, (),, +DefineEngineMethod( Material, flush, void, (),, "Flushes all material instances that use this material." ) { object->flush(); } -DefineConsoleMethod( Material, reload, void, (),, +DefineEngineMethod( Material, reload, void, (),, "Reloads all material instances that use this material." ) { object->reload(); } -DefineConsoleMethod( Material, dumpInstances, void, (),, +DefineEngineMethod( Material, dumpInstances, void, (),, "Dumps a formatted list of the currently allocated material instances for this material to the console." ) { MATMGR->dumpMaterialInstances( object ); } -DefineConsoleMethod( Material, getAnimFlags, const char*, (U32 id), , "" ) +DefineEngineMethod( Material, getAnimFlags, const char*, (U32 id), , "" ) { char * animFlags = Con::getReturnBuffer(512); @@ -710,19 +710,19 @@ DefineConsoleMethod( Material, getAnimFlags, const char*, (U32 id), , "" ) return animFlags; } -DefineConsoleMethod(Material, getFilename, const char*, (),, "Get filename of material") +DefineEngineMethod(Material, getFilename, const char*, (),, "Get filename of material") { SimObject *material = static_cast(object); return material->getFilename(); } -DefineConsoleMethod( Material, isAutoGenerated, bool, (),, +DefineEngineMethod( Material, isAutoGenerated, bool, (),, "Returns true if this Material was automatically generated by MaterialList::mapMaterials()" ) { return object->isAutoGenerated(); } -DefineConsoleMethod( Material, setAutoGenerated, void, (bool isAutoGenerated), , +DefineEngineMethod( Material, setAutoGenerated, void, (bool isAutoGenerated), , "setAutoGenerated(bool isAutoGenerated): Set whether or not the Material is autogenerated." ) { object->setAutoGenerated(isAutoGenerated); diff --git a/Engine/source/materials/materialManager.cpp b/Engine/source/materials/materialManager.cpp index 4b28988b7..0f8519bb5 100644 --- a/Engine/source/materials/materialManager.cpp +++ b/Engine/source/materials/materialManager.cpp @@ -454,14 +454,14 @@ bool MaterialManager::_handleGFXEvent( GFXDevice::GFXDeviceEventType event_ ) return true; } -DefineConsoleFunction( reInitMaterials, void, (),, +DefineEngineFunction( reInitMaterials, void, (),, "@brief Flushes all procedural shaders and re-initializes all active material instances.\n\n" "@ingroup Materials") { MATMGR->flushAndReInitInstances(); } -DefineConsoleFunction( addMaterialMapping, void, (const char * texName, const char * matName), , "(string texName, string matName)\n" +DefineEngineFunction( addMaterialMapping, void, (const char * texName, const char * matName), , "(string texName, string matName)\n" "@brief Maps the given texture to the given material.\n\n" "Generates a console warning before overwriting.\n\n" "Material maps are used by terrain and interiors for triggering " @@ -472,7 +472,7 @@ DefineConsoleFunction( addMaterialMapping, void, (const char * texName, const ch MATMGR->mapMaterial(texName, matName); } -DefineConsoleFunction( getMaterialMapping, const char*, (const char * texName), , "(string texName)\n" +DefineEngineFunction( getMaterialMapping, const char*, (const char * texName), , "(string texName)\n" "@brief Returns the name of the material mapped to this texture.\n\n" "If no materials are found, an empty string is returned.\n\n" "@param texName Name of the texture\n\n" @@ -481,14 +481,14 @@ DefineConsoleFunction( getMaterialMapping, const char*, (const char * texName), return MATMGR->getMapEntry(texName).c_str(); } -DefineConsoleFunction( dumpMaterialInstances, void, (), , +DefineEngineFunction( dumpMaterialInstances, void, (), , "@brief Dumps a formatted list of currently allocated material instances to the console.\n\n" "@ingroup Materials") { MATMGR->dumpMaterialInstances(); } -DefineConsoleFunction( getMapEntry, const char*, (const char * texName), , +DefineEngineFunction( getMapEntry, const char*, (const char * texName), , "@hide") { return MATMGR->getMapEntry( String(texName) ); diff --git a/Engine/source/math/mConsoleFunctions.cpp b/Engine/source/math/mConsoleFunctions.cpp index c9a1f4622..0b5541f2f 100644 --- a/Engine/source/math/mConsoleFunctions.cpp +++ b/Engine/source/math/mConsoleFunctions.cpp @@ -31,7 +31,7 @@ #include "console/engineAPI.h" -DefineConsoleFunction( mSolveQuadratic, const char*, ( F32 a, F32 b, F32 c ),, +DefineEngineFunction( mSolveQuadratic, const char*, ( F32 a, F32 b, F32 c ),, "Solve a quadratic equation (2nd degree polynomial) of form a*x^2 + b*x + c = 0.\n" "@param a First Coefficient." "@param b Second Coefficient." @@ -49,7 +49,7 @@ DefineConsoleFunction( mSolveQuadratic, const char*, ( F32 a, F32 b, F32 c ),, return retBuffer; } -DefineConsoleFunction( mSolveCubic, const char*, ( F32 a, F32 b, F32 c, F32 d ),, +DefineEngineFunction( mSolveCubic, const char*, ( F32 a, F32 b, F32 c, F32 d ),, "Solve a cubic equation (3rd degree polynomial) of form a*x^3 + b*x^2 + c*x + d = 0.\n" "@param a First Coefficient." "@param b Second Coefficient." @@ -68,7 +68,7 @@ DefineConsoleFunction( mSolveCubic, const char*, ( F32 a, F32 b, F32 c, F32 d ), return retBuffer; } -DefineConsoleFunction( mSolveQuartic, const char*, ( F32 a, F32 b, F32 c, F32 d, F32 e ),, +DefineEngineFunction( mSolveQuartic, const char*, ( F32 a, F32 b, F32 c, F32 d, F32 e ),, "Solve a quartic equation (4th degree polynomial) of form a*x^4 + b*x^3 + c*x^2 + d*x + e = 0.\n" "@param a First Coefficient." "@param b Second Coefficient." @@ -87,7 +87,7 @@ DefineConsoleFunction( mSolveQuartic, const char*, ( F32 a, F32 b, F32 c, F32 d, return retBuffer; } -DefineConsoleFunction( mFloor, S32, ( F32 v ),, +DefineEngineFunction( mFloor, S32, ( F32 v ),, "Round v down to the nearest integer.\n" "@param v Number to convert to integer." "@returns Number converted to integer." @@ -96,7 +96,7 @@ DefineConsoleFunction( mFloor, S32, ( F32 v ),, return (S32)mFloor( v ); } -DefineConsoleFunction( mRound, S32, ( F32 v ),, +DefineEngineFunction( mRound, S32, ( F32 v ),, "Round v to the nth decimal place or the nearest whole number by default." "@param v Value to roundn" "@return The rounded value as a S32." @@ -105,7 +105,7 @@ DefineConsoleFunction( mRound, S32, ( F32 v ),, return mRound(v); } -DefineConsoleFunction( mRoundColour, F32, ( F32 v, S32 n ), (0), +DefineEngineFunction( mRoundColour, F32, ( F32 v, S32 n ), (0), "Round v to the nth decimal place or the nearest whole number by default." "@param v Value to roundn" "@param n Number of decimal places to round to, 0 by defaultn" @@ -118,7 +118,7 @@ DefineConsoleFunction( mRoundColour, F32, ( F32 v, S32 n ), (0), return mRound(v, n); } -DefineConsoleFunction( mCeil, S32, ( F32 v ),, +DefineEngineFunction( mCeil, S32, ( F32 v ),, "Round v up to the nearest integer.\n" "@param v Number to convert to integer." "@returns Number converted to integer." @@ -127,7 +127,7 @@ DefineConsoleFunction( mCeil, S32, ( F32 v ),, return (S32)mCeil( v ); } -DefineConsoleFunction( mFloatLength, const char*, ( F32 v, U32 precision ),, +DefineEngineFunction( mFloatLength, const char*, ( F32 v, U32 precision ),, "Formats the specified number to the given number of decimal places.\n" "@param v Number to format." "@param precision Number of decimal places to format to (1-9)." @@ -148,7 +148,7 @@ DefineConsoleFunction( mFloatLength, const char*, ( F32 v, U32 precision ),, //------------------------------------------------------------------------------ -DefineConsoleFunction( mAbs, F32, ( F32 v ),, +DefineEngineFunction( mAbs, F32, ( F32 v ),, "Calculate absolute value of specified value.\n" "@param v Input Value." "@returns Absolute value of specified value." @@ -157,7 +157,7 @@ DefineConsoleFunction( mAbs, F32, ( F32 v ),, return mFabs( v ); } -DefineConsoleFunction( mFMod, F32, ( F32 v, F32 d ),, +DefineEngineFunction( mFMod, F32, ( F32 v, F32 d ),, "Calculate the remainder of v/d.\n" "@param v Input Value." "@param d Divisor Value." @@ -167,7 +167,7 @@ DefineConsoleFunction( mFMod, F32, ( F32 v, F32 d ),, return mFmod( v, d ); } -DefineConsoleFunction( mSqrt, F32, ( F32 v ),, +DefineEngineFunction( mSqrt, F32, ( F32 v ),, "Calculate the square-root of v.\n" "@param v Input Value." "@returns The square-root of the input value." @@ -176,7 +176,7 @@ DefineConsoleFunction( mSqrt, F32, ( F32 v ),, return mSqrt (v ); } -DefineConsoleFunction( mPow, F32, ( F32 v, F32 p ),, +DefineEngineFunction( mPow, F32, ( F32 v, F32 p ),, "Calculate b raised to the p-th power.\n" "@param v Input Value." "@param p Power to raise value by." @@ -186,7 +186,7 @@ DefineConsoleFunction( mPow, F32, ( F32 v, F32 p ),, return mPow( v, p ); } -DefineConsoleFunction( mLog, F32, ( F32 v ),, +DefineEngineFunction( mLog, F32, ( F32 v ),, "Calculate the natural logarithm of v.\n" "@param v Input Value." "@returns The natural logarithm of the input value." @@ -195,7 +195,7 @@ DefineConsoleFunction( mLog, F32, ( F32 v ),, return mLog( v ); } -DefineConsoleFunction( mSin, F32, ( F32 v ),, +DefineEngineFunction( mSin, F32, ( F32 v ),, "Calculate the sine of v.\n" "@param v Input Value (in radians)." "@returns The sine of the input value." @@ -204,7 +204,7 @@ DefineConsoleFunction( mSin, F32, ( F32 v ),, return mSin( v ); } -DefineConsoleFunction( mCos, F32, ( F32 v ),, +DefineEngineFunction( mCos, F32, ( F32 v ),, "Calculate the cosine of v.\n" "@param v Input Value (in radians)." "@returns The cosine of the input value." @@ -213,7 +213,7 @@ DefineConsoleFunction( mCos, F32, ( F32 v ),, return mCos( v ); } -DefineConsoleFunction( mTan, F32, ( F32 v ),, +DefineEngineFunction( mTan, F32, ( F32 v ),, "Calculate the tangent of v.\n" "@param v Input Value (in radians)." "@returns The tangent of the input value." @@ -222,7 +222,7 @@ DefineConsoleFunction( mTan, F32, ( F32 v ),, return mTan( v ); } -DefineConsoleFunction( mAsin, F32, ( F32 v ),, +DefineEngineFunction( mAsin, F32, ( F32 v ),, "Calculate the arc-sine of v.\n" "@param v Input Value (in radians)." "@returns The arc-sine of the input value." @@ -231,7 +231,7 @@ DefineConsoleFunction( mAsin, F32, ( F32 v ),, return mAsin( v ); } -DefineConsoleFunction( mAcos, F32, ( F32 v ),, +DefineEngineFunction( mAcos, F32, ( F32 v ),, "Calculate the arc-cosine of v.\n" "@param v Input Value (in radians)." "@returns The arc-cosine of the input value." @@ -240,7 +240,7 @@ DefineConsoleFunction( mAcos, F32, ( F32 v ),, return mAcos( v ); } -DefineConsoleFunction( mAtan, F32, ( F32 rise, F32 run ),, +DefineEngineFunction( mAtan, F32, ( F32 rise, F32 run ),, "Calculate the arc-tangent (slope) of a line defined by rise and run.\n" "@param rise of line." "@param run of line." @@ -250,7 +250,7 @@ DefineConsoleFunction( mAtan, F32, ( F32 rise, F32 run ),, return mAtan2( rise, run ); } -DefineConsoleFunction( mRadToDeg, F32, ( F32 radians ),, +DefineEngineFunction( mRadToDeg, F32, ( F32 radians ),, "Convert specified radians into degrees.\n" "@param radians Input Value (in radians)." "@returns The specified radians value converted to degrees." @@ -259,7 +259,7 @@ DefineConsoleFunction( mRadToDeg, F32, ( F32 radians ),, return mRadToDeg( radians ); } -DefineConsoleFunction( mDegToRad, F32, ( F32 degrees ),, +DefineEngineFunction( mDegToRad, F32, ( F32 degrees ),, "Convert specified degrees into radians.\n" "@param degrees Input Value (in degrees)." "@returns The specified degrees value converted to radians." @@ -268,7 +268,7 @@ DefineConsoleFunction( mDegToRad, F32, ( F32 degrees ),, return mDegToRad( degrees ); } -DefineConsoleFunction( mClamp, F32, ( F32 v, F32 min, F32 max ),, +DefineEngineFunction( mClamp, F32, ( F32 v, F32 min, F32 max ),, "Clamp the specified value between two bounds.\n" "@param v Input value." "@param min Minimum Bound." @@ -279,7 +279,7 @@ DefineConsoleFunction( mClamp, F32, ( F32 v, F32 min, F32 max ),, return mClampF( v, min, max ); } -DefineConsoleFunction( mSaturate, F32, ( F32 v ),, +DefineEngineFunction( mSaturate, F32, ( F32 v ),, "Clamp the specified value between 0 and 1 (inclusive).\n" "@param v Input value." "@returns The specified value clamped between 0 and 1 (inclusive)." @@ -288,7 +288,7 @@ DefineConsoleFunction( mSaturate, F32, ( F32 v ),, return mClampF( v, 0.0f, 1.0f ); } -DefineConsoleFunction(mWrapF, F32, (F32 v, F32 min, F32 max), , +DefineEngineFunction(mWrapF, F32, (F32 v, F32 min, F32 max), , "Wrap the specified value between two bounds.\n" "@param v Input value." "@param min Minimum Bound." @@ -299,7 +299,7 @@ DefineConsoleFunction(mWrapF, F32, (F32 v, F32 min, F32 max), , return mWrapF(v, min, max); } -DefineConsoleFunction(mWrap, S32, (S32 v, S32 min, S32 max), , +DefineEngineFunction(mWrap, S32, (S32 v, S32 min, S32 max), , "Wrap the specified value between two bounds.\n" "@param v Input value." "@param min Minimum Bound." @@ -311,7 +311,7 @@ DefineConsoleFunction(mWrap, S32, (S32 v, S32 min, S32 max), , } -DefineConsoleFunction( getMax, F32, ( F32 v1, F32 v2 ),, +DefineEngineFunction( getMax, F32, ( F32 v1, F32 v2 ),, "Calculate the greater of two specified numbers.\n" "@param v1 Input value." "@param v2 Input value." @@ -321,7 +321,7 @@ DefineConsoleFunction( getMax, F32, ( F32 v1, F32 v2 ),, return getMax( v1, v2 ); } -DefineConsoleFunction( getMin, F32, ( F32 v1, F32 v2 ),, +DefineEngineFunction( getMin, F32, ( F32 v1, F32 v2 ),, "Calculate the lesser of two specified numbers.\n" "@param v1 Input value." "@param v2 Input value." @@ -331,7 +331,7 @@ DefineConsoleFunction( getMin, F32, ( F32 v1, F32 v2 ),, return getMin( v1, v2 ); } -DefineConsoleFunction( mLerp, F32, ( F32 v1, F32 v2, F32 time ),, +DefineEngineFunction( mLerp, F32, ( F32 v1, F32 v2, F32 time ),, "Calculate linearly interpolated value between two specified numbers using specified normalized time.\n" "@param v1 Interpolate From Input value." "@param v2 Interpolate To Input value." @@ -342,7 +342,7 @@ DefineConsoleFunction( mLerp, F32, ( F32 v1, F32 v2, F32 time ),, return mLerp( v1, v2, time ); } -DefineConsoleFunction( mPi, F32, (),, +DefineEngineFunction( mPi, F32, (),, "Return the value of PI (half-circle in radians).\n" "@returns The value of PI." "@ingroup Math" ) @@ -350,7 +350,7 @@ DefineConsoleFunction( mPi, F32, (),, return M_PI_F; } -DefineConsoleFunction( m2Pi, F32, (),, +DefineEngineFunction( m2Pi, F32, (),, "Return the value of 2*PI (full-circle in radians).\n" "@returns The value of 2*PI." "@ingroup Math" ) @@ -358,7 +358,7 @@ DefineConsoleFunction( m2Pi, F32, (),, return M_2PI_F; } -DefineConsoleFunction( mIsPow2, bool, ( S32 v ),, +DefineEngineFunction( mIsPow2, bool, ( S32 v ),, "Returns whether the value is an exact power of two.\n" "@param v Input value." "@returns Whether the specified value is an exact power of two." @@ -367,7 +367,7 @@ DefineConsoleFunction( mIsPow2, bool, ( S32 v ),, return isPow2( v ); } -DefineConsoleFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 angleMax),, +DefineEngineFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 angleMax),, "Returns a randomized direction based on a starting axis and the min/max angles.\n" "@param axis Main axis to deviate the direction from." "@param angleMin minimum amount of deviation from the axis." @@ -378,7 +378,7 @@ DefineConsoleFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 ang return MathUtils::randomDir(axis, angleMin, angleMax); } -DefineConsoleFunction( mRandomPointInSphere, Point3F, (F32 radius), , +DefineEngineFunction( mRandomPointInSphere, Point3F, (F32 radius), , "Returns a randomized point inside a sphere of a given radius.\n" "@param radius The radius of the sphere to find a point in." "@returns Randomized point inside a sphere." @@ -387,7 +387,7 @@ DefineConsoleFunction( mRandomPointInSphere, Point3F, (F32 radius), , return MathUtils::randomPointInSphere(radius); } -DefineConsoleFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB), , +DefineEngineFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB), , "Returns angle between two vectors.\n" "@param vecA First input vector." "@param vecB Second input vector." @@ -397,7 +397,7 @@ DefineConsoleFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB return MathUtils::getAngleBetweenVectors(vecA, vecB); } -DefineConsoleFunction(mGetSignedAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB, VectorF norm), (VectorF::Zero, VectorF::Zero, VectorF::Zero), +DefineEngineFunction(mGetSignedAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB, VectorF norm), (VectorF::Zero, VectorF::Zero, VectorF::Zero), "Returns signed angle between two vectors, using a normal for orientation.\n" "@param vecA First input vector." "@param vecB Second input vector." diff --git a/Engine/source/math/mQuat.h b/Engine/source/math/mQuat.h index ca6ed5d82..261b66a88 100644 --- a/Engine/source/math/mQuat.h +++ b/Engine/source/math/mQuat.h @@ -222,7 +222,7 @@ inline QuatF& QuatF::neg() inline F32 QuatF::dot( const QuatF &q ) const { - return (w*q.w + x*q.x + y*q.y + z*q.z); + return mClampF(w*q.w + x*q.x + y*q.y + z*q.z, -1.0f, 1.0f); } inline F32 QuatF::angleBetween( const QuatF & q ) diff --git a/Engine/source/math/mRotation.cpp b/Engine/source/math/mRotation.cpp index 6d9bc3b35..43b696d4a 100644 --- a/Engine/source/math/mRotation.cpp +++ b/Engine/source/math/mRotation.cpp @@ -325,7 +325,7 @@ TEST(Maths, RotationF_Calculations) }; #endif -DefineConsoleFunction(AddRotation, RotationF, (RotationF a, RotationF b), , +DefineEngineFunction(AddRotation, RotationF, (RotationF a, RotationF b), , "Adds two rotations together.\n" "@param a Rotation one." "@param b Rotation two." @@ -335,7 +335,7 @@ DefineConsoleFunction(AddRotation, RotationF, (RotationF a, RotationF b), , return a + b; } -DefineConsoleFunction(SubtractRotation, RotationF, (RotationF a, RotationF b), , +DefineEngineFunction(SubtractRotation, RotationF, (RotationF a, RotationF b), , "Subtracts two rotations.\n" "@param a Rotation one." "@param b Rotation two." @@ -345,7 +345,7 @@ DefineConsoleFunction(SubtractRotation, RotationF, (RotationF a, RotationF b), , return a - b; } -DefineConsoleFunction(InterpolateRotation, RotationF, (RotationF a, RotationF b, F32 factor), , +DefineEngineFunction(InterpolateRotation, RotationF, (RotationF a, RotationF b, F32 factor), , "Interpolates between two rotations.\n" "@param a Rotation one." "@param b Rotation two." @@ -358,7 +358,7 @@ DefineConsoleFunction(InterpolateRotation, RotationF, (RotationF a, RotationF b, return result; } -DefineConsoleFunction(RotationLookAt, RotationF, (Point3F origin, Point3F target, Point3F up), +DefineEngineFunction(RotationLookAt, RotationF, (Point3F origin, Point3F target, Point3F up), (Point3F(0, 0, 0), Point3F(0, 0, 0), Point3F(0, 0, 1)), "Provides a rotation orientation to look at a target from a given position.\n" "@param origin Position of the object doing the looking." @@ -372,7 +372,7 @@ DefineConsoleFunction(RotationLookAt, RotationF, (Point3F origin, Point3F target return result; } -DefineConsoleFunction(setRotationRightVector, RotationF, (RotationF rot, VectorF rightVec), , +DefineEngineFunction(setRotationRightVector, RotationF, (RotationF rot, VectorF rightVec), , "Sets the right vector of the rotation.\n" "@param Starting rotation." "@param New up vector." @@ -383,7 +383,7 @@ DefineConsoleFunction(setRotationRightVector, RotationF, (RotationF rot, VectorF return rot; } -DefineConsoleFunction(setRotationUpVector, RotationF, (RotationF rot, VectorF upVec), , +DefineEngineFunction(setRotationUpVector, RotationF, (RotationF rot, VectorF upVec), , "Sets the up vector of the rotation.\n" "@param Starting rotation." "@param New up vector." @@ -394,14 +394,14 @@ DefineConsoleFunction(setRotationUpVector, RotationF, (RotationF rot, VectorF up return rot; } -DefineConsoleFunction(getRotationForwardVector, VectorF, (RotationF rot), , +DefineEngineFunction(getRotationForwardVector, VectorF, (RotationF rot), , "Get the forward vector of a rotation.\n" "@ingroup Math") { return rot.asMatrixF().getForwardVector(); } -DefineConsoleFunction(getRotationRightVector, VectorF, (RotationF rot), , +DefineEngineFunction(getRotationRightVector, VectorF, (RotationF rot), , "Gets the right vector of a rotation.\n" "@param Our rotation." "@ingroup Math") @@ -409,7 +409,7 @@ DefineConsoleFunction(getRotationRightVector, VectorF, (RotationF rot), , return rot.asMatrixF().getRightVector(); } -DefineConsoleFunction(getRotationUpVector, VectorF, (RotationF rot), , +DefineEngineFunction(getRotationUpVector, VectorF, (RotationF rot), , "Gets the up vector of a rotation.\n" "@param Our rotation." "@ingroup Math") @@ -417,7 +417,7 @@ DefineConsoleFunction(getRotationUpVector, VectorF, (RotationF rot), , return rot.asMatrixF().getUpVector(); } -DefineConsoleFunction(getRotationDirection, Point3F, (RotationF rot),, +DefineEngineFunction(getRotationDirection, Point3F, (RotationF rot),, "Gets the direction from the rotation's angles.\n" "@param Our rotation." "@ingroup Math") diff --git a/Engine/source/math/mathTypes.cpp b/Engine/source/math/mathTypes.cpp index 7f3e44225..89be98f18 100644 --- a/Engine/source/math/mathTypes.cpp +++ b/Engine/source/math/mathTypes.cpp @@ -631,7 +631,7 @@ ConsoleSetType(TypeRotationF) //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorAdd, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorAdd, VectorF, ( VectorF a, VectorF b ),, "Add two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -659,7 +659,7 @@ DefineConsoleFunction( VectorAdd, VectorF, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorSub, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorSub, VectorF, ( VectorF a, VectorF b ),, "Subtract two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -689,7 +689,7 @@ DefineConsoleFunction( VectorSub, VectorF, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorScale, VectorF, ( VectorF a, F32 scalar ),, +DefineEngineFunction( VectorScale, VectorF, ( VectorF a, F32 scalar ),, "Scales a vector by a scalar.\n" "@param a The vector to scale.\n" "@param scalar The scale factor.\n" @@ -716,7 +716,7 @@ DefineConsoleFunction( VectorScale, VectorF, ( VectorF a, F32 scalar ),, { return a * scalar; } -DefineConsoleFunction( VectorMul, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorMul, VectorF, ( VectorF a, VectorF b ),, "Multiplies two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -744,7 +744,7 @@ DefineConsoleFunction( VectorMul, VectorF, ( VectorF a, VectorF b ),, return a * b; } -DefineConsoleFunction( VectorDiv, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorDiv, VectorF, ( VectorF a, VectorF b ),, "Divide two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -779,7 +779,7 @@ DefineConsoleFunction( VectorDiv, VectorF, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorNormalize, VectorF, ( VectorF v ),, +DefineEngineFunction( VectorNormalize, VectorF, ( VectorF v ),, "Brings a vector into its unit form, i.e. such that it has the magnitute 1.\n" "@param v The vector to normalize.\n" "@return The vector @a v scaled to length 1.\n\n" @@ -811,7 +811,7 @@ DefineConsoleFunction( VectorNormalize, VectorF, ( VectorF v ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorDot, F32, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorDot, F32, ( VectorF a, VectorF b ),, "Compute the dot product of two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -841,7 +841,7 @@ DefineConsoleFunction( VectorDot, F32, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorCross, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorCross, VectorF, ( VectorF a, VectorF b ),, "Calculcate the cross product of two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -873,7 +873,7 @@ DefineConsoleFunction( VectorCross, VectorF, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorDist, F32, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorDist, F32, ( VectorF a, VectorF b ),, "Compute the distance between two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -906,7 +906,7 @@ DefineConsoleFunction( VectorDist, F32, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorMidPoint, VectorF, ( VectorF a, VectorF b ),, +DefineEngineFunction( VectorMidPoint, VectorF, ( VectorF a, VectorF b ),, "Gets the midpoint between the two vectors.\n" "@param a The first vector.\n" "@param b The second vector.\n" @@ -934,7 +934,7 @@ DefineConsoleFunction( VectorMidPoint, VectorF, ( VectorF a, VectorF b ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorLen, F32, ( VectorF v ),, +DefineEngineFunction( VectorLen, F32, ( VectorF v ),, "Calculate the magnitude of the given vector.\n" "@param v A vector.\n" "@return The length of vector @a v.\n\n" @@ -963,7 +963,7 @@ DefineConsoleFunction( VectorLen, F32, ( VectorF v ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( VectorOrthoBasis, MatrixF, ( AngAxisF aa ),, +DefineEngineFunction( VectorOrthoBasis, MatrixF, ( AngAxisF aa ),, "Create an orthogonal basis from the given vector.\n" "@param aaf The vector to create the orthogonal basis from.\n" "@return A matrix representing the orthogonal basis.\n" @@ -977,7 +977,7 @@ DefineConsoleFunction( VectorOrthoBasis, MatrixF, ( AngAxisF aa ),, //----------------------------------------------------------------------------- //ConsoleFunction(VectorRot, const char*, 3, 3, "(Vector3F, float) rotate a vector in 2d") -DefineConsoleFunction( VectorRot, const char*, (Point3F v, F32 angle), , "(Vector3F, float) rotate a vector in 2d") +DefineEngineFunction( VectorRot, const char*, (Point3F v, F32 angle), , "(Vector3F, float) rotate a vector in 2d") { //VectorF v(0,0,0); //dSscanf(argv[1],"%g %g %g",&v.x,&v.y,&v.z); @@ -996,7 +996,7 @@ DefineConsoleFunction( VectorRot, const char*, (Point3F v, F32 angle), , "(Vecto return returnBuffer; } -DefineConsoleFunction( VectorLerp, VectorF, ( VectorF a, VectorF b, F32 t ),, +DefineEngineFunction( VectorLerp, VectorF, ( VectorF a, VectorF b, F32 t ),, "Linearly interpolate between two vectors by @a t.\n" "@param a Vector to start interpolation from.\n" "@param b Vector to interpolate to.\n" @@ -1032,7 +1032,7 @@ DefineConsoleFunction( VectorLerp, VectorF, ( VectorF a, VectorF b, F32 t ),, return c; } -DefineConsoleFunction(VectorReflect, VectorF, (VectorF vec, VectorF normal), , +DefineEngineFunction(VectorReflect, VectorF, (VectorF vec, VectorF normal), , "Compute the reflection of a vector based on a normal.\n" "@param a The vector.\n" "@param b The normal.\n" @@ -1046,7 +1046,7 @@ DefineConsoleFunction(VectorReflect, VectorF, (VectorF vec, VectorF normal), , //----------------------------------------------------------------------------- -DefineConsoleFunction( MatrixCreate, TransformF, ( VectorF position, AngAxisF orientation ),, +DefineEngineFunction( MatrixCreate, TransformF, ( VectorF position, AngAxisF orientation ),, "Create a transform from the given translation and orientation.\n" "@param position The translation vector for the transform.\n" "@param orientation The axis and rotation that orients the transform.\n" @@ -1059,7 +1059,7 @@ DefineConsoleFunction( MatrixCreate, TransformF, ( VectorF position, AngAxisF or //----------------------------------------------------------------------------- -DefineConsoleFunction( MatrixCreateFromEuler, TransformF, ( Point3F angles ),, +DefineEngineFunction( MatrixCreateFromEuler, TransformF, ( Point3F angles ),, "@Create a matrix from the given rotations.\n\n" "@param Vector3F X, Y, and Z rotation in *radians*.\n" "@return A transform based on the given orientation.\n" @@ -1074,7 +1074,7 @@ DefineConsoleFunction( MatrixCreateFromEuler, TransformF, ( Point3F angles ),, //----------------------------------------------------------------------------- -DefineConsoleFunction( MatrixMultiply, TransformF, ( TransformF left, TransformF right ),, +DefineEngineFunction( MatrixMultiply, TransformF, ( TransformF left, TransformF right ),, "@brief Multiply the two matrices.\n\n" "@param left First transform.\n" "@param right Right transform.\n" @@ -1091,7 +1091,7 @@ DefineConsoleFunction( MatrixMultiply, TransformF, ( TransformF left, TransformF //----------------------------------------------------------------------------- -DefineConsoleFunction( MatrixMulVector, VectorF, ( TransformF transform, VectorF vector ),, +DefineEngineFunction( MatrixMulVector, VectorF, ( TransformF transform, VectorF vector ),, "@brief Multiply the vector by the transform assuming that w=0.\n\n" "This function will multiply the given vector by the given transform such that translation will " "not affect the vector.\n\n" @@ -1107,7 +1107,7 @@ DefineConsoleFunction( MatrixMulVector, VectorF, ( TransformF transform, VectorF //----------------------------------------------------------------------------- -DefineConsoleFunction( MatrixMulPoint, Point3F, ( TransformF transform, Point3F point ),, +DefineEngineFunction( MatrixMulPoint, Point3F, ( TransformF transform, Point3F point ),, "@brief Multiply the given point by the given transform assuming that w=1.\n\n" "This function will multiply the given vector such that translation with take effect.\n" "@param transform A transform.\n" @@ -1124,7 +1124,7 @@ ConsoleFunctionGroupEnd(MatrixMath); //------------------------------------------------------------------------------ -DefineConsoleFunction( getBoxCenter, Point3F, ( Box3F box ),, +DefineEngineFunction( getBoxCenter, Point3F, ( Box3F box ),, "Get the center point of an axis-aligned box.\n\n" "@param b A Box3F, in string format using \"minExtentX minExtentY minExtentZ maxExtentX maxExtentY maxExtentZ\"\n" "@return Center of the box.\n" @@ -1176,7 +1176,7 @@ F32 mRandF() return gRandGen.randF(); } -DefineConsoleFunction(getRandom, F32, (S32 a, S32 b), (S32_MAX, S32_MAX), +DefineEngineFunction(getRandom, F32, (S32 a, S32 b), (S32_MAX, S32_MAX), "( int a, int b ) " "@brief Returns a random number based on parameters passed in..\n\n" "If no parameters are passed in, getRandom() will return a float between 0.0 and 1.0. If one " diff --git a/Engine/source/math/util/tResponseCurve.cpp b/Engine/source/math/util/tResponseCurve.cpp index 2c1d5c53c..f6c7cfb74 100644 --- a/Engine/source/math/util/tResponseCurve.cpp +++ b/Engine/source/math/util/tResponseCurve.cpp @@ -64,17 +64,17 @@ void SimResponseCurve::clear() mCurve.clear(); } -DefineConsoleMethod( SimResponseCurve, addPoint, void, ( F32 value, F32 time ), , "addPoint( F32 value, F32 time )" ) +DefineEngineMethod( SimResponseCurve, addPoint, void, ( F32 value, F32 time ), , "addPoint( F32 value, F32 time )" ) { object->addPoint( value, time ); } -DefineConsoleMethod( SimResponseCurve, getValue, F32, ( F32 time ), , "getValue( F32 time )" ) +DefineEngineMethod( SimResponseCurve, getValue, F32, ( F32 time ), , "getValue( F32 time )" ) { return object->getValue( time ); } -DefineConsoleMethod( SimResponseCurve, clear, void, (), , "clear()" ) +DefineEngineMethod( SimResponseCurve, clear, void, (), , "clear()" ) { object->clear(); } \ No newline at end of file diff --git a/Engine/source/module/moduleManager.cpp b/Engine/source/module/moduleManager.cpp index ec45ad918..c5d3b42f6 100644 --- a/Engine/source/module/moduleManager.cpp +++ b/Engine/source/module/moduleManager.cpp @@ -455,6 +455,15 @@ bool ModuleManager::loadModuleGroup( const char* pModuleGroup ) moduleGroup, pLoadReadyModuleDefinition->getModuleId(), pLoadReadyModuleDefinition->getVersionId(), pLoadReadyModuleDefinition->getModuleScriptFilePath() ); } } + else + { + // Is the create method available? + if (pScopeSet->isMethod(pLoadReadyModuleDefinition->getCreateFunction())) + { + // Yes, so call the create method. + Con::executef(pScopeSet, pLoadReadyModuleDefinition->getCreateFunction()); + } + } // Raise notifications. raiseModulePostLoadNotifications( pLoadReadyModuleDefinition ); diff --git a/Engine/source/navigation/guiNavEditorCtrl.cpp b/Engine/source/navigation/guiNavEditorCtrl.cpp index 64ae03b6c..de4d941cd 100644 --- a/Engine/source/navigation/guiNavEditorCtrl.cpp +++ b/Engine/source/navigation/guiNavEditorCtrl.cpp @@ -627,13 +627,12 @@ void GuiNavEditorCtrl::_prepRenderImage(SceneManager* sceneGraph, const SceneRen }*/ } -ConsoleMethod(GuiNavEditorCtrl, getMode, const char*, 2, 2, "") +DefineEngineMethod(GuiNavEditorCtrl, getMode, const char*, (), , "") { return object->getMode(); } -ConsoleMethod(GuiNavEditorCtrl, setMode, void, 3, 3, "setMode(String mode)") +DefineEngineMethod(GuiNavEditorCtrl, setMode, void, (String mode),, "setMode(String mode)") { - String newMode = (argv[2]); - object->setMode(newMode); + object->setMode(mode); } diff --git a/Engine/source/navigation/navMesh.cpp b/Engine/source/navigation/navMesh.cpp index 04283fd1f..20b1bfa2c 100644 --- a/Engine/source/navigation/navMesh.cpp +++ b/Engine/source/navigation/navMesh.cpp @@ -95,13 +95,13 @@ EventManager *NavMesh::getEventManager() return smEventManager; } -DefineConsoleFunction(getNavMeshEventManager, S32, (),, +DefineEngineFunction(getNavMeshEventManager, S32, (),, "@brief Get the EventManager object for all NavMesh updates.") { return NavMesh::getEventManager()->getId(); } -DefineConsoleFunction(NavMeshUpdateAll, void, (S32 objid, bool remove), (0, false), +DefineEngineFunction(NavMeshUpdateAll, void, (S32 objid, bool remove), (0, false), "@brief Update all NavMesh tiles that intersect the given object's world box.") { SceneObject *obj; @@ -123,7 +123,7 @@ DefineConsoleFunction(NavMeshUpdateAll, void, (S32 objid, bool remove), (0, fals obj->enableCollision(); } -DefineConsoleFunction(NavMeshUpdateAroundObject, void, (S32 objid, bool remove), (0, false), +DefineEngineFunction(NavMeshUpdateAroundObject, void, (S32 objid, bool remove), (0, false), "@brief Update all NavMesh tiles that intersect the given object's world box.") { SceneObject *obj; @@ -146,7 +146,7 @@ DefineConsoleFunction(NavMeshUpdateAroundObject, void, (S32 objid, bool remove), } -DefineConsoleFunction(NavMeshIgnore, void, (S32 objid, bool _ignore), (0, true), +DefineEngineFunction(NavMeshIgnore, void, (S32 objid, bool _ignore), (0, true), "@brief Flag this object as not generating a navmesh result.") { SceneObject *obj; @@ -156,7 +156,7 @@ DefineConsoleFunction(NavMeshIgnore, void, (S32 objid, bool _ignore), (0, true), obj->mPathfindingIgnore = _ignore; } -DefineConsoleFunction(NavMeshUpdateOne, void, (S32 meshid, S32 objid, bool remove), (0, 0, false), +DefineEngineFunction(NavMeshUpdateOne, void, (S32 meshid, S32 objid, bool remove), (0, 0, false), "@brief Update all tiles in a given NavMesh that intersect the given object's world box.") { NavMesh *mesh; diff --git a/Engine/source/platform/platformAssert.cpp b/Engine/source/platform/platformAssert.cpp index 5fe428fad..1a4b08694 100644 --- a/Engine/source/platform/platformAssert.cpp +++ b/Engine/source/platform/platformAssert.cpp @@ -23,7 +23,7 @@ #include #include "core/strings/stringFunctions.h" -#include "console/console.h" +#include "console/engineAPI.h" //-------------------------------------- STATIC Declaration @@ -167,8 +167,8 @@ const char* avar(const char *message, ...) //----------------------------------------------------------------------------- -ConsoleFunction( Assert, void, 3, 3, "(condition, message) - Fatal Script Assertion" ) +DefineEngineFunction(Assert, void, (bool condition, const char* message),, "Fatal Script Assertion") { - // Process Assertion. - AssertISV( dAtob(argv[1]), argv[2] ); + // Process Assertion. + AssertISV(condition, message); } diff --git a/Engine/source/platform/platformFileIO.cpp b/Engine/source/platform/platformFileIO.cpp index a9ace740b..58123dbb1 100644 --- a/Engine/source/platform/platformFileIO.cpp +++ b/Engine/source/platform/platformFileIO.cpp @@ -38,7 +38,7 @@ StringTableEntry Platform::getTemporaryDirectory() return path; } -DefineConsoleFunction( getTemporaryDirectory, const char *, (), , +DefineEngineFunction( getTemporaryDirectory, const char *, (), , "@brief Returns the OS temporary directory, \"C:/Users/Mich/AppData/Local/Temp\" for example\n\n" "@note This can be useful to adhering to OS standards and practices, " "but not really used in Torque 3D right now.\n" @@ -66,7 +66,7 @@ StringTableEntry Platform::getTemporaryFileName() return StringTable->insert(buf); } -DefineConsoleFunction( getTemporaryFileName, const char *, (), , +DefineEngineFunction( getTemporaryFileName, const char *, (), , "@brief Creates a name and extension for a potential temporary file\n\n" "This does not create the actual file. It simply creates a random name " "for a file that does not exist.\n\n" @@ -611,12 +611,17 @@ StringTableEntry Platform::getPrefsPath(const char *file /* = NULL */) //----------------------------------------------------------------------------- -DefineConsoleFunction( getUserDataDirectory, const char *, (), , "getUserDataDirectory()") +DefineEngineFunction( getUserDataDirectory, const char *, (), , "getUserDataDirectory()") { return Platform::getUserDataDirectory(); } -DefineConsoleFunction( getUserHomeDirectory, const char *, (), , "getUserHomeDirectory()") +DefineEngineFunction( getUserHomeDirectory, const char *, (), , "getUserHomeDirectory()") { return Platform::getUserHomeDirectory(); } + +DefineEngineFunction(setMainDotCsDir, void, (const char* path), , "setMainDotCsDir()") +{ + Platform::setMainDotCsDir(StringTable->insert(path)); +} \ No newline at end of file diff --git a/Engine/source/platform/platformMemory.cpp b/Engine/source/platform/platformMemory.cpp index 5f7aa926d..f10113308 100644 --- a/Engine/source/platform/platformMemory.cpp +++ b/Engine/source/platform/platformMemory.cpp @@ -885,7 +885,7 @@ void logDumpTraverse(MemDumpLog *sizes, TreeNode *header, U32 depth) } #ifdef TORQUE_DEBUG -DefineConsoleFunction( validateMemory, void, ( ),, +DefineEngineFunction( validateMemory, void, ( ),, "@brief Used to validate memory space for the game.\n\n" "@ingroup Debugging" ) { @@ -893,7 +893,7 @@ DefineConsoleFunction( validateMemory, void, ( ),, } #endif -DefineConsoleFunction( freeMemoryDump, void, ( ),, +DefineEngineFunction( freeMemoryDump, void, ( ),, "@brief Dumps some useful statistics regarding free memory.\n\n" "Dumps an analysis of \'free chunks\' of memory. " "Does not print how much memory is free.\n\n" diff --git a/Engine/source/platform/platformRedBook.cpp b/Engine/source/platform/platformRedBook.cpp index 82b1bae2d..acbc0bc7a 100644 --- a/Engine/source/platform/platformRedBook.cpp +++ b/Engine/source/platform/platformRedBook.cpp @@ -211,7 +211,7 @@ bool RedBook::setVolume(F32 volume) ConsoleFunctionGroupBegin( Redbook, "Control functions for Redbook audio (ie, CD audio)."); -DefineConsoleFunction( redbookOpen, bool, (const char * device), (""), "(string device=NULL)" +DefineEngineFunction( redbookOpen, bool, (const char * device), (""), "(string device=NULL)" "@brief Deprecated\n\n" "@internal") { @@ -221,28 +221,28 @@ DefineConsoleFunction( redbookOpen, bool, (const char * device), (""), "(string return(RedBook::open(device)); } -DefineConsoleFunction( redbookClose, bool, (), , "Close the current Redbook device." +DefineEngineFunction( redbookClose, bool, (), , "Close the current Redbook device." "@brief Deprecated\n\n" "@internal") { return(RedBook::close()); } -DefineConsoleFunction( redbookPlay, bool, (S32 track), , "(int track) Play the selected track." +DefineEngineFunction( redbookPlay, bool, (S32 track), , "(int track) Play the selected track." "@brief Deprecated\n\n" "@internal") { return(RedBook::play(track)); } -DefineConsoleFunction( redbookStop, bool, (), , "Stop playing." +DefineEngineFunction( redbookStop, bool, (), , "Stop playing." "@brief Deprecated\n\n" "@internal") { return(RedBook::stop()); } -DefineConsoleFunction( redbookGetTrackCount, S32, (), , "Return the number of tracks." +DefineEngineFunction( redbookGetTrackCount, S32, (), , "Return the number of tracks." "@brief Deprecated\n\n" "@internal") { @@ -252,7 +252,7 @@ DefineConsoleFunction( redbookGetTrackCount, S32, (), , "Return the number of tr return(trackCount); } -DefineConsoleFunction( redbookGetVolume, F32, (), , "Get the volume." +DefineEngineFunction( redbookGetVolume, F32, (), , "Get the volume." "@brief Deprecated\n\n" "@internal") { @@ -263,28 +263,28 @@ DefineConsoleFunction( redbookGetVolume, F32, (), , "Get the volume." return(vol); } -DefineConsoleFunction( redbookSetVolume, bool, (F32 volume), , "(float volume) Set playback volume." +DefineEngineFunction( redbookSetVolume, bool, (F32 volume), , "(float volume) Set playback volume." "@brief Deprecated\n\n" "@internal") { return(RedBook::setVolume(volume)); } -DefineConsoleFunction( redbookGetDeviceCount, S32, (), , "get the number of redbook devices." +DefineEngineFunction( redbookGetDeviceCount, S32, (), , "get the number of redbook devices." "@brief Deprecated\n\n" "@internal") { return(RedBook::getDeviceCount()); } -DefineConsoleFunction( redbookGetDeviceName, const char *, (S32 index), , "(int index) Get name of specified Redbook device." +DefineEngineFunction( redbookGetDeviceName, const char *, (S32 index), , "(int index) Get name of specified Redbook device." "@brief Deprecated\n\n" "@internal") { return(RedBook::getDeviceName(index)); } -DefineConsoleFunction( redbookGetLastError, const char *, (), , "Get a string explaining the last redbook error." +DefineEngineFunction( redbookGetLastError, const char *, (), , "Get a string explaining the last redbook error." "@brief Deprecated\n\n" "@internal") { diff --git a/Engine/source/platform/platformTimer.cpp b/Engine/source/platform/platformTimer.cpp index 1da010c5a..e3be91fe9 100644 --- a/Engine/source/platform/platformTimer.cpp +++ b/Engine/source/platform/platformTimer.cpp @@ -160,12 +160,12 @@ S32 ScriptTimerMan::stopTimer( S32 id ) ScriptTimerMan gScriptTimerMan; -DefineConsoleFunction( startPrecisionTimer, S32, (), , "startPrecisionTimer() - Create and start a high resolution platform timer. Returns the timer id." ) +DefineEngineFunction( startPrecisionTimer, S32, (), , "startPrecisionTimer() - Create and start a high resolution platform timer. Returns the timer id." ) { return gScriptTimerMan.startTimer(); } -DefineConsoleFunction( stopPrecisionTimer, S32, ( S32 id), , "stopPrecisionTimer( S32 id ) - Stop and destroy timer with the passed id. Returns the elapsed milliseconds." ) +DefineEngineFunction( stopPrecisionTimer, S32, ( S32 id), , "stopPrecisionTimer( S32 id ) - Stop and destroy timer with the passed id. Returns the elapsed milliseconds." ) { return gScriptTimerMan.stopTimer( id ); } \ No newline at end of file diff --git a/Engine/source/platformMac/macFileIO.mm b/Engine/source/platformMac/macFileIO.mm index 767dbca8e..e4d182dc1 100644 --- a/Engine/source/platformMac/macFileIO.mm +++ b/Engine/source/platformMac/macFileIO.mm @@ -37,7 +37,7 @@ #import "core/strings/stringFunctions.h" #import "console/console.h" #import "platform/profiler.h" -#import "cinterface/cinterface.h" +#import "cinterface/c_controlInterface.h" #import "core/volume.h" //TODO: file io still needs some work... diff --git a/Engine/source/platformSDL/sdlInput.cpp b/Engine/source/platformSDL/sdlInput.cpp index 69ef30b20..eb9e3dd8e 100644 --- a/Engine/source/platformSDL/sdlInput.cpp +++ b/Engine/source/platformSDL/sdlInput.cpp @@ -21,7 +21,7 @@ //----------------------------------------------------------------------------- #include "platform/platformInput.h" -#include "console/console.h" +#include "console/engineAPI.h" #include "core/util/journal/process.h" #include "windowManager/platformWindowMgr.h" @@ -97,16 +97,16 @@ void Input::init() } //------------------------------------------------------------------------------ -ConsoleFunction( isJoystickDetected, bool, 1, 1, "isJoystickDetected()" ) +DefineEngineFunction(isJoystickDetected, bool, (),, "") { - return( SDL_NumJoysticks() > 0 ); + return(SDL_NumJoysticks() > 0); } //------------------------------------------------------------------------------ -ConsoleFunction( getJoystickAxes, const char*, 2, 2, "getJoystickAxes( instance )" ) +DefineEngineFunction(getJoystickAxes, const char*, (const char* instance), , "") { // TODO SDL - return( "" ); + return(""); } //------------------------------------------------------------------------------ diff --git a/Engine/source/platformWin32/cardProfile.cpp b/Engine/source/platformWin32/cardProfile.cpp index a4658f98c..dbfad0fe6 100644 --- a/Engine/source/platformWin32/cardProfile.cpp +++ b/Engine/source/platformWin32/cardProfile.cpp @@ -74,7 +74,7 @@ void initDisplayDeviceInfo() Con::setVariable( "$PCI_DEV", dev ); } -DefineConsoleFunction( initDisplayDeviceInfo, void, (), , "()" +DefineEngineFunction( initDisplayDeviceInfo, void, (), , "()" "@brief Initializes variables that track device and vendor information/IDs\n\n" "@ingroup Rendering") { diff --git a/Engine/source/platformWin32/winConsole.cpp b/Engine/source/platformWin32/winConsole.cpp index 93ce3c68e..c22ab735b 100644 --- a/Engine/source/platformWin32/winConsole.cpp +++ b/Engine/source/platformWin32/winConsole.cpp @@ -38,7 +38,7 @@ namespace Con extern bool alwaysUseDebugOutput; } -DefineConsoleFunction( enableWinConsole, void, (bool flag), , "enableWinConsole(bool);") +DefineEngineFunction( enableWinConsole, void, (bool flag), , "enableWinConsole(bool);") { WindowsConsole->enable(flag); } diff --git a/Engine/source/platformWin32/winDirectInput.cpp b/Engine/source/platformWin32/winDirectInput.cpp index 2fd8084ef..fd016496f 100644 --- a/Engine/source/platformWin32/winDirectInput.cpp +++ b/Engine/source/platformWin32/winDirectInput.cpp @@ -769,7 +769,7 @@ void DInputManager::processXInput( void ) mXInputStateReset = false; } } -DefineConsoleFunction( enableJoystick, bool, (), , "()" +DefineEngineFunction( enableJoystick, bool, (), , "()" "@brief Enables use of the joystick.\n\n" "@note DirectInput must be enabled and active to use this function.\n\n" "@ingroup Input") @@ -778,7 +778,7 @@ DefineConsoleFunction( enableJoystick, bool, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( disableJoystick, void, (), , "()" +DefineEngineFunction( disableJoystick, void, (), , "()" "@brief Disables use of the joystick.\n\n" "@note DirectInput must be enabled and active to use this function.\n\n" "@ingroup Input") @@ -787,7 +787,7 @@ DefineConsoleFunction( disableJoystick, void, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( isJoystickEnabled, bool, (), , "()" +DefineEngineFunction( isJoystickEnabled, bool, (), , "()" "@brief Queries input manager to see if a joystick is enabled\n\n" "@return 1 if a joystick exists and is enabled, 0 if it's not.\n" "@ingroup Input") @@ -796,7 +796,7 @@ DefineConsoleFunction( isJoystickEnabled, bool, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( enableXInput, bool, (), , "()" +DefineEngineFunction( enableXInput, bool, (), , "()" "@brief Enables XInput for Xbox 360 controllers.\n\n" "@note XInput is enabled by default. Disable to use an Xbox 360 " "Controller as a joystick device.\n\n" @@ -811,7 +811,7 @@ DefineConsoleFunction( enableXInput, bool, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( disableXInput, void, (), , "()" +DefineEngineFunction( disableXInput, void, (), , "()" "@brief Disables XInput for Xbox 360 controllers.\n\n" "@ingroup Input") { @@ -819,7 +819,7 @@ DefineConsoleFunction( disableXInput, void, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( resetXInput, void, (), , "()" +DefineEngineFunction( resetXInput, void, (), , "()" "@brief Rebuilds the XInput section of the InputManager\n\n" "Requests a full refresh of events for all controllers. Useful when called at the beginning " "of game code after actionMaps are set up to hook up all appropriate events.\n\n" @@ -836,7 +836,7 @@ DefineConsoleFunction( resetXInput, void, (), , "()" } //------------------------------------------------------------------------------ -DefineConsoleFunction( isXInputConnected, bool, (S32 controllerID), , "( int controllerID )" +DefineEngineFunction( isXInputConnected, bool, (S32 controllerID), , "( int controllerID )" "@brief Checks to see if an Xbox 360 controller is connected\n\n" "@param controllerID Zero-based index of the controller to check.\n" "@return 1 if the controller is connected, 0 if it isn't, and 205 if XInput " @@ -849,7 +849,7 @@ DefineConsoleFunction( isXInputConnected, bool, (S32 controllerID), , "( int con } //------------------------------------------------------------------------------ -DefineConsoleFunction( getXInputState, int, (S32 controllerID, const char * properties, bool current), (false), "( int controllerID, string property, bool currentD )" +DefineEngineFunction( getXInputState, int, (S32 controllerID, const char * properties, bool current), (false), "( int controllerID, string property, bool currentD )" "@brief Queries the current state of a connected Xbox 360 controller.\n\n" "XInput Properties:\n\n" " - XI_THUMBLX, XI_THUMBLY - X and Y axes of the left thumbstick. \n" @@ -905,7 +905,7 @@ DefineConsoleFunction( getXInputState, int, (S32 controllerID, const char * prop } //------------------------------------------------------------------------------ -DefineConsoleFunction( echoInputState, void, (), , "()" +DefineEngineFunction( echoInputState, void, (), , "()" "@brief Prints information to the console stating if DirectInput and a Joystick are enabled and active.\n\n" "@ingroup Input") { @@ -921,7 +921,7 @@ DefineConsoleFunction( echoInputState, void, (), , "()" Con::printf( "DirectInput is not enabled." ); } -DefineConsoleFunction( rumble, void, (const char * device, F32 xRumble, F32 yRumble), , "(string device, float xRumble, float yRumble)" +DefineEngineFunction( rumble, void, (const char * device, F32 xRumble, F32 yRumble), , "(string device, float xRumble, float yRumble)" "@brief Activates the vibration motors in the specified controller.\n\n" "The controller will constantly at it's xRumble and yRumble intensities until " "changed or told to stop." diff --git a/Engine/source/platformWin32/winExec.cpp b/Engine/source/platformWin32/winExec.cpp index 6ec218929..3b9ad52b9 100644 --- a/Engine/source/platformWin32/winExec.cpp +++ b/Engine/source/platformWin32/winExec.cpp @@ -136,7 +136,7 @@ void ExecuteThread::run(void *arg /* = 0 */) // Console Functions //----------------------------------------------------------------------------- -DefineConsoleFunction( shellExecute, bool, (const char * executable, const char * args, const char * directory), ("", ""), "(string executable, string args, string directory)" +DefineEngineFunction( shellExecute, bool, (const char * executable, const char * args, const char * directory), ("", ""), "(string executable, string args, string directory)" "@brief Launches an outside executable or batch file\n\n" "@param executable Name of the executable or batch file\n" "@param args Optional list of arguments, in string format, to pass to the executable\n" diff --git a/Engine/source/platformWin32/winInput.cpp b/Engine/source/platformWin32/winInput.cpp index 2424eabdb..77eb38511 100644 --- a/Engine/source/platformWin32/winInput.cpp +++ b/Engine/source/platformWin32/winInput.cpp @@ -157,13 +157,13 @@ void Input::init() } //------------------------------------------------------------------------------ -DefineConsoleFunction( isJoystickDetected, bool, (), , "isJoystickDetected()") +DefineEngineFunction( isJoystickDetected, bool, (), , "isJoystickDetected()") { return( DInputDevice::joystickDetected() ); } //------------------------------------------------------------------------------ -DefineConsoleFunction( getJoystickAxes, const char*, (U32 deviceID), , "getJoystickAxes( instance )") +DefineEngineFunction( getJoystickAxes, const char*, (U32 deviceID), , "getJoystickAxes( instance )") { DInputManager* mgr = dynamic_cast( Input::getManager() ); if ( mgr ) @@ -505,7 +505,7 @@ void Input::log( const char* format, ... ) va_end( argptr ); } -DefineConsoleFunction( inputLog, void, (const char * log), , "inputLog( string )") +DefineEngineFunction( inputLog, void, (const char * log), , "inputLog( string )") { Input::log( "%s\n", log ); } diff --git a/Engine/source/platformWin32/winMath.cpp b/Engine/source/platformWin32/winMath.cpp index 50e5fdbc6..3b6e3ec15 100644 --- a/Engine/source/platformWin32/winMath.cpp +++ b/Engine/source/platformWin32/winMath.cpp @@ -33,7 +33,7 @@ extern void mInstall_AMD_Math(); extern void mInstall_Library_SSE(); //-------------------------------------- -ConsoleFunction( mathInit, void, 1, 10, "( ... )" +DefineEngineStringlyVariadicFunction( mathInit, void, 1, 10, "( ... )" "@brief Install the math library with specified extensions.\n\n" "Possible parameters are:\n\n" " - 'DETECT' Autodetect math lib settings.\n\n" diff --git a/Engine/source/platformWin32/winWindow.cpp b/Engine/source/platformWin32/winWindow.cpp index 63fb5ea54..0ce0f7cba 100644 --- a/Engine/source/platformWin32/winWindow.cpp +++ b/Engine/source/platformWin32/winWindow.cpp @@ -643,7 +643,7 @@ bool Platform::setLoginPassword( const char* password ) // as commentary on Koreans as a nationality. Thank you for your // attention. //-------------------------------------- -DefineConsoleFunction( isKoreanBuild, bool, ( ), , "isKoreanBuild()") +DefineEngineFunction( isKoreanBuild, bool, ( ), , "isKoreanBuild()") { HKEY regKey; bool result = false; diff --git a/Engine/source/postFx/postEffectVis.cpp b/Engine/source/postFx/postEffectVis.cpp index bf507e162..b00ee55ae 100644 --- a/Engine/source/postFx/postEffectVis.cpp +++ b/Engine/source/postFx/postEffectVis.cpp @@ -41,6 +41,8 @@ ConsoleDoc( "@ingroup GFX\n" ); +IMPLEMENT_STATIC_CLASS(PfxVis, , "") + MODULE_BEGIN( PostEffectVis ) MODULE_INIT @@ -374,7 +376,8 @@ static ConsoleDocFragment _PfxVisclear( "PfxVis", "void clear();" ); -ConsoleStaticMethod( PfxVis, clear, void, 1, 1, "()" + +DefineEngineStaticMethod( PfxVis, clear, void, (),, "@hide") { PFXVIS->clear(); @@ -391,16 +394,15 @@ static ConsoleDocFragment _PfxVisopen( "PfxVis", "void open(PostEffect effect, bool clear);" ); -ConsoleStaticMethod( PfxVis, open, void, 2, 3, "( PostEffect, [bool clear = false] )" +DefineEngineStaticMethod( PfxVis, open, void, (PostEffect* pfx, bool clear), (false), "( PostEffect, [bool clear = false] )" "@hide") { - if ( argc == 3 && dAtob( argv[2] ) ) + if ( clear ) PFXVIS->clear(); - PostEffect *pfx; - if ( !Sim::findObject( argv[1], pfx ) ) + if ( !pfx ) { - Con::errorf( "PfxVis::add, argument %s was not a PostEffect", (const char*)argv[1] ); + Con::errorf( "PfxVis::add, argument was not a PostEffect"); return; } @@ -415,7 +417,7 @@ static ConsoleDocFragment _PfxVishide( "PfxVis", "void hide();" ); -ConsoleStaticMethod( PfxVis, hide, void, 1, 1, "()" +DefineEngineStaticMethod( PfxVis, hide, void, (),, "@hide") { PFXVIS->setVisible( false ); @@ -429,7 +431,7 @@ static ConsoleDocFragment _PfxVisshow( "PfxVis", "void show();" ); -ConsoleStaticMethod( PfxVis, show, void, 1, 1, "()" +DefineEngineStaticMethod( PfxVis, show, void, (),, "@hide") { PFXVIS->setVisible( true ); @@ -444,13 +446,12 @@ static ConsoleDocFragment _PfxVisonWindowClosed( "PfxVis", "void onWindowClosed(GuiWindowCtrl *ctrl);" ); -ConsoleStaticMethod( PfxVis, onWindowClosed, void, 2, 2, "( GuiWindowCtrl )" +DefineEngineStaticMethod( PfxVis, onWindowClosed, void, (GuiWindowCtrl* ctrl),, "@hide") { - GuiWindowCtrl *ctrl; - if ( !Sim::findObject( argv[1], ctrl ) ) + if ( !ctrl ) { - Con::errorf( "PfxVis::onWindowClosed, argument %s was not a GuiWindowCtrl", (const char*)argv[1] ); + Con::errorf( "PfxVis::onWindowClosed, argument was not a GuiWindowCtrl"); return; } diff --git a/Engine/source/postFx/postEffectVis.h b/Engine/source/postFx/postEffectVis.h index 972a7ea78..0ef807a58 100644 --- a/Engine/source/postFx/postEffectVis.h +++ b/Engine/source/postFx/postEffectVis.h @@ -104,6 +104,11 @@ public: static const char* getSingletonName() { return "PostEffectVis"; } }; +class PfxVis +{ + DECLARE_STATIC_CLASS(PfxVis) +}; + /// Returns the PostEffectVis singleton. #define PFXVIS ManagedSingleton::instance() diff --git a/Engine/source/scene/pathManager.cpp b/Engine/source/scene/pathManager.cpp index 2f1c423c3..7d9c88140 100644 --- a/Engine/source/scene/pathManager.cpp +++ b/Engine/source/scene/pathManager.cpp @@ -207,12 +207,12 @@ void PathManager::clearPaths() #endif } -DefineConsoleFunction( clearServerPaths, void, ( ), , "") +DefineEngineFunction( clearServerPaths, void, ( ), , "") { gServerPathManager->clearPaths(); } -DefineConsoleFunction( clearClientPaths, void, ( ), , "") +DefineEngineFunction( clearClientPaths, void, ( ), , "") { gClientPathManager->clearPaths(); } diff --git a/Engine/source/scene/sceneManager.cpp b/Engine/source/scene/sceneManager.cpp index 0abd96843..4f3f4c5a8 100644 --- a/Engine/source/scene/sceneManager.cpp +++ b/Engine/source/scene/sceneManager.cpp @@ -720,7 +720,7 @@ RenderPassManager* SceneManager::getDefaultRenderPass() const //----------------------------------------------------------------------------- -DefineConsoleFunction( sceneDumpZoneStates, void, ( bool updateFirst ), ( true ), +DefineEngineFunction( sceneDumpZoneStates, void, ( bool updateFirst ), ( true ), "Dump the current zoning states of all zone spaces in the scene to the console.\n\n" "@param updateFirst If true, zoning states are brought up to date first; if false, the zoning states " "are dumped as is.\n\n" @@ -745,7 +745,7 @@ DefineConsoleFunction( sceneDumpZoneStates, void, ( bool updateFirst ), ( true ) //----------------------------------------------------------------------------- -DefineConsoleFunction( sceneGetZoneOwner, SceneObject*, ( U32 zoneId ),, +DefineEngineFunction( sceneGetZoneOwner, SceneObject*, ( U32 zoneId ),, "Return the SceneObject that contains the given zone.\n\n" "@param zoneId ID of zone.\n" "@return A SceneObject or NULL if the given @a zoneId is invalid.\n\n" diff --git a/Engine/source/scene/sceneObject.cpp b/Engine/source/scene/sceneObject.cpp index a6be00320..ff7b6496c 100644 --- a/Engine/source/scene/sceneObject.cpp +++ b/Engine/source/scene/sceneObject.cpp @@ -1517,7 +1517,7 @@ DefineEngineMethod( SceneObject, isGlobalBounds, bool, (),, return object->isGlobalBounds(); } -DefineConsoleMethod(SceneObject, setForwardVector, void, (VectorF newForward, VectorF upVector), (VectorF(0, 0, 0), VectorF(0, 0, 1)), +DefineEngineMethod(SceneObject, setForwardVector, void, (VectorF newForward, VectorF upVector), (VectorF(0, 0, 0), VectorF(0, 0, 1)), "Sets the forward vector of a scene object, making it face Y+ along the new vector.\n" "@param The new forward vector to set.\n" "@param (Optional) The up vector to use to help orient the rotation.") diff --git a/Engine/source/sfx/sfxSource.cpp b/Engine/source/sfx/sfxSource.cpp index e40dd5073..2beb34634 100644 --- a/Engine/source/sfx/sfxSource.cpp +++ b/Engine/source/sfx/sfxSource.cpp @@ -1569,7 +1569,7 @@ static ConsoleDocFragment _sSetTransform2( "void setTransform( Point3F position, Point3F direction )" ); -DefineConsoleMethod( SFXSource, setTransform, void, ( const char * position, const char * direction ), ( "" ), +DefineEngineMethod( SFXSource, setTransform, void, ( const char * position, const char * direction ), ( "" ), "( vector position [, vector direction ] ) " "Set the position and orientation of a 3D sound source.\n" "@hide" ) diff --git a/Engine/source/sfx/sfxSystem.cpp b/Engine/source/sfx/sfxSystem.cpp index 5cf340cf2..ac292702c 100644 --- a/Engine/source/sfx/sfxSystem.cpp +++ b/Engine/source/sfx/sfxSystem.cpp @@ -1442,7 +1442,7 @@ static ConsoleDocFragment _sfxCreateSource4( NULL, "SFXSound sfxCreateSource( SFXDescription description, string filename, float x, float y, float z );" ); -DefineConsoleFunction( sfxCreateSource, S32, ( const char * sfxType, const char * arg0, const char * arg1, const char * arg2, const char * arg3 ), ("", "", "", ""), +DefineEngineFunction( sfxCreateSource, S32, ( const char * sfxType, const char * arg0, const char * arg1, const char * arg2, const char * arg3 ), ("", "", "", ""), "( SFXTrack track | ( SFXDescription description, string filename ) [, float x, float y, float z ] ) " "Creates a new paused sound source using a profile or a description " "and filename. The return value is the source which must be " @@ -1547,7 +1547,7 @@ static ConsoleDocFragment _sfxPlay3( NULL, "void sfxPlay( SFXTrack track, float x, float y, float z );" ); -DefineConsoleFunction( sfxPlay, S32, ( const char * trackName, const char * pointOrX, const char * y, const char * z ), ( "", "", ""), +DefineEngineFunction( sfxPlay, S32, ( const char * trackName, const char * pointOrX, const char * y, const char * z ), ( "", "", ""), "Start playing the given source or create a new source for the given track and play it.\n" "@hide" ) { @@ -1657,7 +1657,7 @@ static ConsoleDocFragment _sPlayOnce4( "SFXSource sfxPlayOnce( SFXDescription description, string filename, float x, float y, float z, float fadeInTime=-1 );" ); -DefineConsoleFunction( sfxPlayOnce, S32, ( const char * sfxType, const char * arg0, const char * arg1, const char * arg2, const char * arg3, const char* arg4 ), ("", "", "", "", "-1.0f"), +DefineEngineFunction( sfxPlayOnce, S32, ( const char * sfxType, const char * arg0, const char * arg1, const char * arg2, const char * arg3, const char* arg4 ), ("", "", "", "", "-1.0f"), "SFXSource sfxPlayOnce( ( SFXTrack track | SFXDescription description, string filename ) [, float x, float y, float z, float fadeInTime=-1 ] ) " "Create a new play-once source for the given profile or description+filename and start playback of the source.\n" "@hide" ) diff --git a/Engine/source/sim/actionMap.cpp b/Engine/source/sim/actionMap.cpp index ca2932e84..a69ec4bea 100644 --- a/Engine/source/sim/actionMap.cpp +++ b/Engine/source/sim/actionMap.cpp @@ -2077,7 +2077,7 @@ static ConsoleDocFragment _ActionMapbind2( "ActionMap", "bool bind( string device, string action, string flag, string deadZone, string scale, string command );"); -ConsoleMethod( ActionMap, bind, bool, 5, 10, "actionMap.bind( device, action, [modifier, spec, mod...], command )" +DefineEngineStringlyVariadicMethod( ActionMap, bind, bool, 5, 10, "actionMap.bind( device, action, [modifier, spec, mod...], command )" "@hide") { StringStackWrapper args(argc - 2, argv + 2); @@ -2126,7 +2126,7 @@ static ConsoleDocFragment _ActionMapbindObj2( "ActionMap", "bool bindObj( string device, string action, string flag, string deadZone, string scale, string command, SimObjectID object );"); -ConsoleMethod( ActionMap, bindObj, bool, 6, 11, "(device, action, [modifier, spec, mod...], command, object)" +DefineEngineStringlyVariadicMethod( ActionMap, bindObj, bool, 6, 11, "(device, action, [modifier, spec, mod...], command, object)" "@hide") { SimObject* simObject = Sim::findObject(argv[argc - 1]); diff --git a/Engine/source/sim/netInterface.cpp b/Engine/source/sim/netInterface.cpp index 6d312df8a..fd2c51bc4 100644 --- a/Engine/source/sim/netInterface.cpp +++ b/Engine/source/sim/netInterface.cpp @@ -638,7 +638,7 @@ void NetInterface::computeNetMD5(const NetAddress *address, U32 connectSequence, ConsoleFunctionGroupBegin(NetInterface, "Global control functions for the netInterfaces."); -DefineConsoleFunction( allowConnections, void, ( bool allow ), , "allowConnections(bool allow)" +DefineEngineFunction( allowConnections, void, ( bool allow ), , "allowConnections(bool allow)" "@brief Sets whether or not the global NetInterface allows connections from remote hosts.\n\n" "@param allow Set to true to allow remote connections.\n" diff --git a/Engine/source/terrain/terrData.cpp b/Engine/source/terrain/terrData.cpp index 37f523356..78e991b63 100644 --- a/Engine/source/terrain/terrData.cpp +++ b/Engine/source/terrain/terrData.cpp @@ -147,7 +147,7 @@ ConsoleDocFragment _getTerrainUnderWorldPoint2( "bool getTerrainUnderWorldPoint( F32 x, F32 y, F32 z);" ); -DefineConsoleFunction( getTerrainUnderWorldPoint, S32, (const char* ptOrX, const char* y, const char* z), ("", ""), +DefineEngineFunction( getTerrainUnderWorldPoint, S32, (const char* ptOrX, const char* y, const char* z), ("", ""), "(Point3F x/y/z) Gets the terrain block that is located under the given world point.\n" "@param x/y/z The world coordinates (floating point values) you wish to query at. " "These can be formatted as either a string (\"x y z\") or separately as (x, y, z)\n" @@ -1338,7 +1338,7 @@ ConsoleDocFragment _getTerrainHeight2( "bool getTerrainHeight( F32 x, F32 y);" ); -DefineConsoleFunction( getTerrainHeight, F32, (const char* ptOrX, const char* y), (""), "(Point2 pos) - gets the terrain height at the specified position." +DefineEngineFunction( getTerrainHeight, F32, (const char* ptOrX, const char* y), (""), "(Point2 pos) - gets the terrain height at the specified position." "@param pos The world space point, minus the z (height) value\n Can be formatted as either (\"x y\") or (x,y)\n" "@return Returns the terrain height at the given point as an F32 value.\n" "@hide") @@ -1383,7 +1383,7 @@ ConsoleDocFragment _getTerrainHeightBelowPosition2( "bool getTerrainHeightBelowPosition( F32 x, F32 y);" ); -DefineConsoleFunction( getTerrainHeightBelowPosition, F32, (const char* ptOrX, const char* y, const char* z), ("", ""), +DefineEngineFunction( getTerrainHeightBelowPosition, F32, (const char* ptOrX, const char* y, const char* z), ("", ""), "(Point3F pos) - gets the terrain height at the specified position." "@param pos The world space point. Can be formatted as either (\"x y z\") or (x,y,z)\n" "@note This function is useful if you simply want to grab the terrain height underneath an object.\n" diff --git a/Engine/source/terrain/terrExport.cpp b/Engine/source/terrain/terrExport.cpp index 8941c8b26..78b63eeb1 100644 --- a/Engine/source/terrain/terrExport.cpp +++ b/Engine/source/terrain/terrExport.cpp @@ -137,7 +137,7 @@ bool TerrainBlock::exportLayerMaps( const UTF8 *filePrefix, const String &format return true; } -DefineConsoleMethod( TerrainBlock, exportHeightMap, bool, (const char * fileNameStr, const char * format), ( "png"), "(string filename, [string format]) - export the terrain block's heightmap to a bitmap file (default: png)" ) +DefineEngineMethod( TerrainBlock, exportHeightMap, bool, (const char * fileNameStr, const char * format), ( "png"), "(string filename, [string format]) - export the terrain block's heightmap to a bitmap file (default: png)" ) { UTF8 fileName[1024]; Con::expandScriptFilename( fileName, sizeof( fileName ), fileNameStr ); @@ -145,7 +145,7 @@ DefineConsoleMethod( TerrainBlock, exportHeightMap, bool, (const char * fileName return object->exportHeightMap( fileName, format ); } -DefineConsoleMethod( TerrainBlock, exportLayerMaps, bool, (const char * filePrefixStr, const char * format), ( "png"), "(string filePrefix, [string format]) - export the terrain block's layer maps to bitmap files (default: png)" ) +DefineEngineMethod( TerrainBlock, exportLayerMaps, bool, (const char * filePrefixStr, const char * format), ( "png"), "(string filePrefix, [string format]) - export the terrain block's layer maps to bitmap files (default: png)" ) { UTF8 filePrefix[1024]; Con::expandScriptFilename( filePrefix, sizeof( filePrefix ), filePrefixStr ); diff --git a/Engine/source/terrain/terrImport.cpp b/Engine/source/terrain/terrImport.cpp index ad9a8d98b..063a80c93 100644 --- a/Engine/source/terrain/terrImport.cpp +++ b/Engine/source/terrain/terrImport.cpp @@ -33,15 +33,9 @@ using namespace Torque; -ConsoleStaticMethod( TerrainBlock, createNew, S32, 5, 5, - "TerrainBlock.create( String terrainName, U32 resolution, String materialName, bool genNoise )\n" +DefineEngineStaticMethod( TerrainBlock, createNew, S32, (String terrainName, U32 resolution, String materialName, bool genNoise),, "" ) { - const UTF8 *terrainName = argv[1]; - U32 resolution = dAtoi( argv[2] ); - const UTF8 *materialName = argv[3]; - bool genNoise = dAtob( argv[4] ); - Vector materials; materials.push_back( materialName ); @@ -82,17 +76,17 @@ ConsoleStaticMethod( TerrainBlock, createNew, S32, 5, 5, noise.setSeed( 134208587 ); // Set up some defaults. - F32 octaves = 3.0f; - U32 freq = 4; - F32 roughness = 0.0f; + const F32 octaves = 3.0f; + const U32 freq = 4; + const F32 roughness = 0.0f; noise.fBm( &floatHeights, blockSize, freq, 1.0f - roughness, octaves ); F32 height = 0; F32 omax, omin; noise.getMinMax( &floatHeights, &omin, &omax, blockSize ); - - F32 terrscale = 300.0f / (omax - omin); + + const F32 terrscale = 300.0f / (omax - omin); for ( S32 y = 0; y < blockSize; y++ ) { for ( S32 x = 0; x < blockSize; x++ ) @@ -111,7 +105,7 @@ ConsoleStaticMethod( TerrainBlock, createNew, S32, 5, 5, terrain->updateGridMaterials( Point2I::Zero, Point2I( blockSize, blockSize ) ); } - terrain->registerObject( terrainName ); + terrain->registerObject( terrainName.c_str() ); // Add to mission group! SimGroup *missionGroup; @@ -121,21 +115,11 @@ ConsoleStaticMethod( TerrainBlock, createNew, S32, 5, 5, return terrain->getId(); } -ConsoleStaticMethod( TerrainBlock, import, S32, 7, 8, - "( String terrainName, String heightMap, F32 metersPerPixel, F32 heightScale, String materials, String opacityLayers[, bool flipYAxis=true] )\n" +DefineEngineStaticMethod( TerrainBlock, import, S32, (String terrainName, String heightMapFile, F32 metersPerPixel, F32 heightScale, String opacityLayerFiles, String materialsStr, bool flipYAxis), (true), "" ) { - // Get the parameters. - const UTF8 *terrainName = argv[1]; - const UTF8 *hmap = argv[2]; - F32 metersPerPixel = dAtof(argv[3]); - F32 heightScale = dAtof(argv[4]); - const UTF8 *opacityFiles = argv[5]; - const UTF8 *materialsStr = argv[6]; - bool flipYAxis = argc == 8? dAtob(argv[7]) : true; - // First load the height map and validate it. - Resource heightmap = GBitmap::load( hmap ); + Resource heightmap = GBitmap::load(heightMapFile); if ( !heightmap ) { Con::errorf( "Heightmap failed to load!" ); @@ -155,7 +139,7 @@ ConsoleStaticMethod( TerrainBlock, import, S32, 7, 8, return 0; } - U32 fileCount = StringUnit::getUnitCount( opacityFiles, "\n" ); + U32 fileCount = StringUnit::getUnitCount(opacityLayerFiles, "\n" ); Vector layerMap; layerMap.setSize( terrSize * terrSize ); { @@ -163,7 +147,7 @@ ConsoleStaticMethod( TerrainBlock, import, S32, 7, 8, for ( U32 i = 0; i < fileCount; i++ ) { - String fileNameWithChannel = StringUnit::getUnit( opacityFiles, i, "\n" ); + String fileNameWithChannel = StringUnit::getUnit(opacityLayerFiles, i, "\n" ); String fileName = StringUnit::getUnit( fileNameWithChannel, 0, "\t" ); String channel = StringUnit::getUnit( fileNameWithChannel, 1, "\t" ); @@ -251,7 +235,7 @@ ConsoleStaticMethod( TerrainBlock, import, S32, 7, 8, } // Do we have an existing terrain with that name... then update it! - TerrainBlock *terrain = dynamic_cast( Sim::findObject( terrainName ) ); + TerrainBlock *terrain = dynamic_cast( Sim::findObject( terrainName.c_str() ) ); if ( terrain ) terrain->import( (*heightmap), heightScale, metersPerPixel, layerMap, materials, flipYAxis ); else diff --git a/Engine/source/testing/unitTesting.cpp b/Engine/source/testing/unitTesting.cpp index a86a28eb3..5d353f75c 100644 --- a/Engine/source/testing/unitTesting.cpp +++ b/Engine/source/testing/unitTesting.cpp @@ -76,7 +76,7 @@ public: TorqueUnitTestListener( bool verbose ) : mVerbose( verbose ) {} }; -DefineConsoleFunction( runAllUnitTests, int, (const char* testSpecs), (""), +DefineEngineFunction( runAllUnitTests, int, (const char* testSpecs), (""), "Runs engine unit tests. Some tests are marked as 'stress' tests which do not " "necessarily check correctness, just performance or possible nondeterministic " "glitches. There may also be interactive or networking tests which may be " diff --git a/Engine/source/ts/collada/colladaImport.cpp b/Engine/source/ts/collada/colladaImport.cpp index ded830d5c..cab5311ff 100644 --- a/Engine/source/ts/collada/colladaImport.cpp +++ b/Engine/source/ts/collada/colladaImport.cpp @@ -126,7 +126,7 @@ static void processNode(GuiTreeViewCtrl* tree, domNode* node, S32 parentID, Scen } } -DefineConsoleFunction( enumColladaForImport, bool, (const char * shapePath, const char * ctrl), , +DefineEngineFunction( enumColladaForImport, bool, (const char * shapePath, const char * ctrl), , "(string shapePath, GuiTreeViewCtrl ctrl) Collect scene information from " "a COLLADA file and store it in a GuiTreeView control. This function is " "used by the COLLADA import gui to show a preview of the scene contents " diff --git a/Engine/source/ts/collada/colladaLights.cpp b/Engine/source/ts/collada/colladaLights.cpp index bb699e4ff..fcc4bb67d 100644 --- a/Engine/source/ts/collada/colladaLights.cpp +++ b/Engine/source/ts/collada/colladaLights.cpp @@ -139,7 +139,7 @@ static void processNodeLights(AppNode* appNode, const MatrixF& offset, SimGroup* } // Load lights from a collada file and add to the scene. -DefineConsoleFunction( loadColladaLights, bool, (const char * filename, const char * parentGroup, const char * baseObject), ("", ""), +DefineEngineFunction( loadColladaLights, bool, (const char * filename, const char * parentGroup, const char * baseObject), ("", ""), "(string filename, SimGroup parentGroup=MissionGroup, SimObject baseObject=-1)" "Load all light instances from a COLLADA (.dae) file and add to the scene.\n" "@param filename COLLADA filename to load lights from\n" diff --git a/Engine/source/ts/loader/tsShapeLoader.cpp b/Engine/source/ts/loader/tsShapeLoader.cpp index 11779eb6b..581f2a384 100644 --- a/Engine/source/ts/loader/tsShapeLoader.cpp +++ b/Engine/source/ts/loader/tsShapeLoader.cpp @@ -1325,14 +1325,14 @@ String TSShapeLoader::getFormatFilters() return output.end(); } -DefineConsoleFunction( getFormatExtensions, const char*, ( ),, +DefineEngineFunction( getFormatExtensions, const char*, ( ),, "Returns a list of supported shape format extensions separated by tabs." "Example output: *.dsq TAB *.dae TAB") { return Con::getReturnBuffer(TSShapeLoader::getFormatExtensions()); } -DefineConsoleFunction( getFormatFilters, const char*, ( ),, +DefineEngineFunction( getFormatFilters, const char*, ( ),, "Returns a list of supported shape formats in filter form.\n" "Example output: DSQ Files|*.dsq|COLLADA Files|*.dae|") { diff --git a/Engine/source/ts/tsLastDetail.cpp b/Engine/source/ts/tsLastDetail.cpp index 9bc53fd4f..57710833d 100644 --- a/Engine/source/ts/tsLastDetail.cpp +++ b/Engine/source/ts/tsLastDetail.cpp @@ -543,7 +543,7 @@ void TSLastDetail::updateImposterImages( bool forceUpdate ) GFX->endScene(); } -DefineConsoleFunction( tsUpdateImposterImages, void, (bool forceUpdate), (false), "tsUpdateImposterImages( bool forceupdate )") +DefineEngineFunction( tsUpdateImposterImages, void, (bool forceUpdate), (false), "tsUpdateImposterImages( bool forceupdate )") { TSLastDetail::updateImposterImages(forceUpdate); } diff --git a/Engine/source/util/fpsTracker.cpp b/Engine/source/util/fpsTracker.cpp index ebf49b458..4013344e4 100644 --- a/Engine/source/util/fpsTracker.cpp +++ b/Engine/source/util/fpsTracker.cpp @@ -88,7 +88,7 @@ void FPSTracker::update() } } -DefineConsoleFunction( resetFPSTracker, void, (), , "()" +DefineEngineFunction( resetFPSTracker, void, (), , "()" "@brief Reset FPS stats (fps::)\n\n" "@ingroup Game") { diff --git a/Engine/source/util/messaging/dispatcher.cpp b/Engine/source/util/messaging/dispatcher.cpp index 2ae20ba17..d21f0dfdb 100644 --- a/Engine/source/util/messaging/dispatcher.cpp +++ b/Engine/source/util/messaging/dispatcher.cpp @@ -331,7 +331,7 @@ extern void unlockDispatcherMutex() using namespace Dispatcher; -DefineConsoleFunction( isQueueRegistered, bool, (const char * queueName), , "(string queueName)" +DefineEngineFunction( isQueueRegistered, bool, (const char * queueName), , "(string queueName)" "@brief Determines if a dispatcher queue exists\n\n" "@param queueName String containing the name of queue\n" "@ingroup Messaging") @@ -339,7 +339,7 @@ DefineConsoleFunction( isQueueRegistered, bool, (const char * queueName), , "(st return Dispatcher::isQueueRegistered(queueName); } -DefineConsoleFunction( registerMessageQueue, void, (const char *queueName), , "(string queueName)" +DefineEngineFunction( registerMessageQueue, void, (const char *queueName), , "(string queueName)" "@brief Registeres a dispatcher queue\n\n" "@param queueName String containing the name of queue\n" "@ingroup Messaging") @@ -347,7 +347,7 @@ DefineConsoleFunction( registerMessageQueue, void, (const char *queueName), , "( return Dispatcher::registerMessageQueue(queueName); } -DefineConsoleFunction( unregisterMessageQueue, void, (const char *queueName), , "(string queueName)" +DefineEngineFunction( unregisterMessageQueue, void, (const char *queueName), , "(string queueName)" "@brief Unregisters a dispatcher queue\n\n" "@param queueName String containing the name of queue\n" "@ingroup Messaging") @@ -357,7 +357,7 @@ DefineConsoleFunction( unregisterMessageQueue, void, (const char *queueName), , //----------------------------------------------------------------------------- -DefineConsoleFunction( registerMessageListener, bool, (const char *queueName, const char *listenerName), , "(string queueName, string listener)" +DefineEngineFunction( registerMessageListener, bool, (const char *queueName, const char *listenerName), , "(string queueName, string listener)" "@brief Registers an event message\n\n" "@param queueName String containing the name of queue to attach listener to\n" "@param listener Name of event messenger\n" @@ -373,7 +373,7 @@ DefineConsoleFunction( registerMessageListener, bool, (const char *queueName, co return Dispatcher::registerMessageListener(queueName, listener); } -DefineConsoleFunction( unregisterMessageListener, void, (const char *queueName, const char *listenerName), , "(string queueName, string listener)" +DefineEngineFunction( unregisterMessageListener, void, (const char *queueName, const char *listenerName), , "(string queueName, string listener)" "@brief Unregisters an event message\n\n" "@param queueName String containing the name of queue\n" "@param listener Name of event messenger\n" @@ -391,7 +391,7 @@ DefineConsoleFunction( unregisterMessageListener, void, (const char *queueName, //----------------------------------------------------------------------------- -DefineConsoleFunction( dispatchMessage, bool, (const char *queueName, const char *message, const char *data), (""), "(string queueName, string message, string data)" +DefineEngineFunction( dispatchMessage, bool, (const char *queueName, const char *message, const char *data), (""), "(string queueName, string message, string data)" "@brief Dispatch a message to a queue\n\n" "@param queueName Queue to dispatch the message to\n" "@param message Message to dispatch\n" @@ -403,7 +403,7 @@ DefineConsoleFunction( dispatchMessage, bool, (const char *queueName, const char return Dispatcher::dispatchMessage(queueName, message, data); } -DefineConsoleFunction( dispatchMessageObject, bool, (const char *queueName, const char *message), ("", ""), "(string queueName, string message)" +DefineEngineFunction( dispatchMessageObject, bool, (const char *queueName, const char *message), ("", ""), "(string queueName, string message)" "@brief Dispatch a message object to a queue\n\n" "@param queueName Queue to dispatch the message to\n" "@param message Message to dispatch\n" diff --git a/Engine/source/util/messaging/eventManager.cpp b/Engine/source/util/messaging/eventManager.cpp index 0edfa98fc..03b03228e 100644 --- a/Engine/source/util/messaging/eventManager.cpp +++ b/Engine/source/util/messaging/eventManager.cpp @@ -420,7 +420,7 @@ void EventManager::dumpSubscribers() //----------------------------------------------------------------------------- // Console Methods //----------------------------------------------------------------------------- -DefineConsoleMethod( EventManager, registerEvent, bool, ( const char * evt ), , "( String event )\n" +DefineEngineMethod( EventManager, registerEvent, bool, ( const char * evt ), , "( String event )\n" "Register an event with the event manager.\n" "@param event The event to register.\n" "@return Whether or not the event was registered successfully." ) @@ -428,14 +428,14 @@ DefineConsoleMethod( EventManager, registerEvent, bool, ( const char * evt ), , return object->registerEvent( evt ); } -DefineConsoleMethod( EventManager, unregisterEvent, void, ( const char * evt ), , "( String event )\n" +DefineEngineMethod( EventManager, unregisterEvent, void, ( const char * evt ), , "( String event )\n" "Remove an event from the EventManager.\n" "@param event The event to remove.\n" ) { object->unregisterEvent( evt ); } -DefineConsoleMethod( EventManager, isRegisteredEvent, bool, ( const char * evt ), , "( String event )\n" +DefineEngineMethod( EventManager, isRegisteredEvent, bool, ( const char * evt ), , "( String event )\n" "Check if an event is registered or not.\n" "@param event The event to check.\n" "@return Whether or not the event exists." ) @@ -443,7 +443,7 @@ DefineConsoleMethod( EventManager, isRegisteredEvent, bool, ( const char * evt ) return object->isRegisteredEvent( evt ); } -DefineConsoleMethod( EventManager, postEvent, bool, ( const char * evt, const char * data ), (""), "( String event, String data )\n" +DefineEngineMethod( EventManager, postEvent, bool, ( const char * evt, const char * data ), (""), "( String event, String data )\n" "~Trigger an event.\n" "@param event The event to trigger.\n" "@param data The data associated with the event.\n" @@ -458,7 +458,7 @@ DefineConsoleMethod( EventManager, postEvent, bool, ( const char * evt, const ch return object->postEvent( evt, data ); } -DefineConsoleMethod( EventManager, subscribe, bool, ( const char * listenerName, const char * evt, const char * callback ), (""), "( SimObject listener, String event, String callback )\n\n" +DefineEngineMethod( EventManager, subscribe, bool, ( const char * listenerName, const char * evt, const char * callback ), (""), "( SimObject listener, String event, String callback )\n\n" "Subscribe a listener to an event.\n" "@param listener The listener to subscribe.\n" "@param event The event to subscribe to.\n" @@ -476,7 +476,7 @@ DefineConsoleMethod( EventManager, subscribe, bool, ( const char * listenerName, return object->subscribe( cbObj, evt, callback ); } -DefineConsoleMethod( EventManager, remove, void, ( const char * listenerName, const char * evt), , "( SimObject listener, String event )\n\n" +DefineEngineMethod( EventManager, remove, void, ( const char * listenerName, const char * evt), , "( SimObject listener, String event )\n\n" "Remove a listener from an event.\n" "@param listener The listener to remove.\n" "@param event The event to be removed from.\n") @@ -487,7 +487,7 @@ DefineConsoleMethod( EventManager, remove, void, ( const char * listenerName, co object->remove( listener, evt ); } -DefineConsoleMethod( EventManager, removeAll, void, ( const char * listenerName ), , "( SimObject listener )\n\n" +DefineEngineMethod( EventManager, removeAll, void, ( const char * listenerName ), , "( SimObject listener )\n\n" "Remove a listener from all events.\n" "@param listener The listener to remove.\n") { @@ -498,13 +498,13 @@ DefineConsoleMethod( EventManager, removeAll, void, ( const char * listenerName object->removeAll( listener ); } -DefineConsoleMethod( EventManager, dumpEvents, void, (), , "()\n\n" +DefineEngineMethod( EventManager, dumpEvents, void, (), , "()\n\n" "Print all registered events to the console." ) { object->dumpEvents(); } -DefineConsoleMethod( EventManager, dumpSubscribers, void, ( const char * listenerName ), (""), "( String event )\n\n" +DefineEngineMethod( EventManager, dumpSubscribers, void, ( const char * listenerName ), (""), "( String event )\n\n" "Print all subscribers to an event to the console.\n" "@param event The event whose subscribers are to be printed. If this parameter isn't specified, all events will be dumped." ) { diff --git a/Engine/source/util/messaging/message.cpp b/Engine/source/util/messaging/message.cpp index 7e2b7af08..137242c56 100644 --- a/Engine/source/util/messaging/message.cpp +++ b/Engine/source/util/messaging/message.cpp @@ -155,19 +155,19 @@ const char *Message::getType() // Console Methods //----------------------------------------------------------------------------- -DefineConsoleMethod(Message, getType, const char *, (), , "() Get message type (script class name or C++ class name if no script defined class)") +DefineEngineMethod(Message, getType, const char *, (), , "() Get message type (script class name or C++ class name if no script defined class)") { return object->getType(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(Message, addReference, void, (), , "() Increment the reference count for this message") +DefineEngineMethod(Message, addReference, void, (), , "() Increment the reference count for this message") { object->addReference(); } -DefineConsoleMethod(Message, freeReference, void, (), , "() Decrement the reference count for this message") +DefineEngineMethod(Message, freeReference, void, (), , "() Decrement the reference count for this message") { object->freeReference(); } diff --git a/Engine/source/util/sampler.cpp b/Engine/source/util/sampler.cpp index 7e163d004..f4d051e1e 100644 --- a/Engine/source/util/sampler.cpp +++ b/Engine/source/util/sampler.cpp @@ -394,7 +394,7 @@ SAMPLE_FUNC( const char* ); // Console Functions. //-------------------------------------------------------------------------------- -DefineConsoleFunction( beginSampling, void, (const char * location, const char * backend), ("CSV"), "(location, [backend]) -" +DefineEngineFunction( beginSampling, void, (const char * location, const char * backend), ("CSV"), "(location, [backend]) -" "@brief Takes a string informing the backend where to store " "sample data and optionally a name of the specific logging " "backend to use. The default is the CSV backend. In most " @@ -408,14 +408,14 @@ DefineConsoleFunction( beginSampling, void, (const char * location, const char * beginSampling( location, backend ); } -DefineConsoleFunction( stopSampling, void, (), , "()" +DefineEngineFunction( stopSampling, void, (), , "()" "@brief Stops the rendering sampler\n\n" "@ingroup Rendering\n") { stopSampling(); } -DefineConsoleFunction( enableSamples, void, (const char * pattern, bool state), (true), "(pattern, [state]) -" +DefineEngineFunction( enableSamples, void, (const char * pattern, bool state), (true), "(pattern, [state]) -" "@brief Enable sampling for all keys that match the given name " "pattern. Slashes are treated as separators.\n\n" "@ingroup Rendering") diff --git a/Engine/source/util/settings.cpp b/Engine/source/util/settings.cpp index b57b77bb4..96fd2d5c8 100644 --- a/Engine/source/util/settings.cpp +++ b/Engine/source/util/settings.cpp @@ -482,12 +482,12 @@ const char* Settings::findNextValue() } // make sure to replace the strings -DefineConsoleMethod(Settings, findFirstValue, const char*, ( const char* pattern, bool deepSearch, bool includeDefaults ), ("", false, false), "settingObj.findFirstValue();") +DefineEngineMethod(Settings, findFirstValue, const char*, ( const char* pattern, bool deepSearch, bool includeDefaults ), ("", false, false), "settingObj.findFirstValue();") { return object->findFirstValue( pattern, deepSearch, includeDefaults ); } -DefineConsoleMethod(Settings, findNextValue, const char*, (), , "settingObj.findNextValue();") +DefineEngineMethod(Settings, findNextValue, const char*, (), , "settingObj.findNextValue();") { return object->findNextValue(); } @@ -644,7 +644,7 @@ void SettingSaveNode::buildDocument(SimXMLDocument *document, bool skipWrite) document->popElement(); } -DefineConsoleMethod(Settings, setValue, void, (const char * settingName, const char * value), (""), "settingObj.setValue(settingName, value);") +DefineEngineMethod(Settings, setValue, void, (const char * settingName, const char * value), (""), "settingObj.setValue(settingName, value);") { StringTableEntry fieldName = StringTable->insert( settingName ); @@ -654,13 +654,13 @@ DefineConsoleMethod(Settings, setValue, void, (const char * settingName, const c object->setValue( fieldName ); } -DefineConsoleMethod(Settings, setDefaultValue, void, (const char * settingName, const char * value), , "settingObj.setDefaultValue(settingName, value);") +DefineEngineMethod(Settings, setDefaultValue, void, (const char * settingName, const char * value), , "settingObj.setDefaultValue(settingName, value);") { StringTableEntry fieldName = StringTable->insert( settingName ); object->setDefaultValue( fieldName, value ); } -DefineConsoleMethod(Settings, value, const char*, (const char * settingName, const char * defaultValue), (""), "settingObj.value(settingName, defaultValue);") +DefineEngineMethod(Settings, value, const char*, (const char * settingName, const char * defaultValue), (""), "settingObj.value(settingName, defaultValue);") { StringTableEntry fieldName = StringTable->insert( settingName ); @@ -672,7 +672,7 @@ DefineConsoleMethod(Settings, value, const char*, (const char * settingName, con return ""; } -DefineConsoleMethod(Settings, remove, void, (const char * settingName, bool includeDefaults), (false), "settingObj.remove(settingName, includeDefaults = false);") +DefineEngineMethod(Settings, remove, void, (const char * settingName, bool includeDefaults), (false), "settingObj.remove(settingName, includeDefaults = false);") { // there's a problem with some fields not being removed properly, but works if you run it twice, // a temporary solution for now is simply to call the remove twice @@ -681,33 +681,32 @@ DefineConsoleMethod(Settings, remove, void, (const char * settingName, bool incl object->remove( settingName, includeDefaults ); } -ConsoleMethod(Settings, write, bool, 2, 2, "%success = settingObj.write();") +DefineEngineMethod(Settings, write, bool, (),, "%success = settingObj.write();") { - TORQUE_UNUSED(argc); TORQUE_UNUSED(argv); return object->write(); } -DefineConsoleMethod(Settings, read, bool, (), , "%success = settingObj.read();") +DefineEngineMethod(Settings, read, bool, (), , "%success = settingObj.read();") { return object->read(); } -DefineConsoleMethod(Settings, beginGroup, void, (const char * groupName, bool includeDefaults), (false), "settingObj.beginGroup(groupName, fromStart = false);") +DefineEngineMethod(Settings, beginGroup, void, (const char * groupName, bool includeDefaults), (false), "settingObj.beginGroup(groupName, fromStart = false);") { object->beginGroup( groupName, includeDefaults ); } -DefineConsoleMethod(Settings, endGroup, void, (), , "settingObj.endGroup();") +DefineEngineMethod(Settings, endGroup, void, (), , "settingObj.endGroup();") { object->endGroup(); } -DefineConsoleMethod(Settings, clearGroups, void, (), , "settingObj.clearGroups();") +DefineEngineMethod(Settings, clearGroups, void, (), , "settingObj.clearGroups();") { object->clearGroups(); } -DefineConsoleMethod(Settings, getCurrentGroups, const char*, (), , "settingObj.getCurrentGroups();") +DefineEngineMethod(Settings, getCurrentGroups, const char*, (), , "settingObj.getCurrentGroups();") { return object->getCurrentGroups(); } \ No newline at end of file diff --git a/Engine/source/util/undo.cpp b/Engine/source/util/undo.cpp index 7ea0acc8c..ae6163774 100644 --- a/Engine/source/util/undo.cpp +++ b/Engine/source/util/undo.cpp @@ -145,7 +145,7 @@ void CompoundUndoAction::onDeleteNotify( SimObject* object ) Parent::onDeleteNotify( object ); } -DefineConsoleMethod( CompoundUndoAction, addAction, void, (const char * objName), , "addAction( UndoAction )" ) +DefineEngineMethod( CompoundUndoAction, addAction, void, (const char * objName), , "addAction( UndoAction )" ) { UndoAction *action; if ( Sim::findObject( objName, action ) ) @@ -206,7 +206,7 @@ UndoManager& UndoManager::getDefaultManager() return *defaultMan; } -DefineConsoleMethod(UndoManager, clearAll, void, (),, "Clears the undo manager.") +DefineEngineMethod(UndoManager, clearAll, void, (),, "Clears the undo manager.") { object->clearAll(); } @@ -344,7 +344,7 @@ void UndoManager::redo() (*react).redo(); } -DefineConsoleMethod(UndoManager, getUndoCount, S32, (),, "") +DefineEngineMethod(UndoManager, getUndoCount, S32, (),, "") { return object->getUndoCount(); } @@ -354,7 +354,7 @@ S32 UndoManager::getUndoCount() return mUndoStack.size(); } -DefineConsoleMethod(UndoManager, getUndoName, const char*, (S32 index), , "(index)") +DefineEngineMethod(UndoManager, getUndoName, const char*, (S32 index), , "(index)") { return object->getUndoName(index); } @@ -367,7 +367,7 @@ const char* UndoManager::getUndoName(S32 index) return NULL; } -DefineConsoleMethod(UndoManager, getUndoAction, S32, (S32 index), , "(index)") +DefineEngineMethod(UndoManager, getUndoAction, S32, (S32 index), , "(index)") { UndoAction * action = object->getUndoAction(index); if ( !action ) @@ -386,7 +386,7 @@ UndoAction* UndoManager::getUndoAction(S32 index) return NULL; } -DefineConsoleMethod(UndoManager, getRedoCount, S32, (),, "") +DefineEngineMethod(UndoManager, getRedoCount, S32, (),, "") { return object->getRedoCount(); } @@ -396,7 +396,7 @@ S32 UndoManager::getRedoCount() return mRedoStack.size(); } -DefineConsoleMethod(UndoManager, getRedoName, const char*, (S32 index), , "(index)") +DefineEngineMethod(UndoManager, getRedoName, const char*, (S32 index), , "(index)") { return object->getRedoName(index); } @@ -409,7 +409,7 @@ const char* UndoManager::getRedoName(S32 index) return NULL; } -DefineConsoleMethod(UndoManager, getRedoAction, S32, (S32 index), , "(index)") +DefineEngineMethod(UndoManager, getRedoAction, S32, (S32 index), , "(index)") { UndoAction * action = object->getRedoAction(index); @@ -501,7 +501,7 @@ void UndoManager::popCompound( bool discard ) } //----------------------------------------------------------------------------- -DefineConsoleMethod(UndoAction, addToManager, void, (const char * undoManager), (""), "action.addToManager([undoManager])") +DefineEngineMethod(UndoAction, addToManager, void, (const char * undoManager), (""), "action.addToManager([undoManager])") { UndoManager *theMan = NULL; if (!String::isEmpty(undoManager)) @@ -515,32 +515,32 @@ DefineConsoleMethod(UndoAction, addToManager, void, (const char * undoManager), //----------------------------------------------------------------------------- -DefineConsoleMethod( UndoAction, undo, void, (),, "() - Undo action contained in undo." ) +DefineEngineMethod( UndoAction, undo, void, (),, "() - Undo action contained in undo." ) { object->undo(); } //----------------------------------------------------------------------------- -DefineConsoleMethod( UndoAction, redo, void, (),, "() - Reo action contained in undo." ) +DefineEngineMethod( UndoAction, redo, void, (),, "() - Reo action contained in undo." ) { object->redo(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(UndoManager, undo, void, (),, "UndoManager.undo();") +DefineEngineMethod(UndoManager, undo, void, (),, "UndoManager.undo();") { object->undo(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(UndoManager, redo, void, (),, "UndoManager.redo();") +DefineEngineMethod(UndoManager, redo, void, (),, "UndoManager.redo();") { object->redo(); } //----------------------------------------------------------------------------- -DefineConsoleMethod(UndoManager, getNextUndoName, const char *, (),, "UndoManager.getNextUndoName();") +DefineEngineMethod(UndoManager, getNextUndoName, const char *, (),, "UndoManager.getNextUndoName();") { const char *name = object->getNextUndoName(); if(!name) @@ -552,7 +552,7 @@ DefineConsoleMethod(UndoManager, getNextUndoName, const char *, (),, "UndoManage } //----------------------------------------------------------------------------- -DefineConsoleMethod(UndoManager, getNextRedoName, const char *, (),, "UndoManager.getNextRedoName();") +DefineEngineMethod(UndoManager, getNextRedoName, const char *, (),, "UndoManager.getNextRedoName();") { const char *name = object->getNextRedoName(); if(!name) @@ -565,7 +565,7 @@ DefineConsoleMethod(UndoManager, getNextRedoName, const char *, (),, "UndoManage //----------------------------------------------------------------------------- -DefineConsoleMethod( UndoManager, pushCompound, const char*, ( String name ), ("\"\""), "( string name=\"\" ) - Push a CompoundUndoAction onto the compound stack for assembly." ) +DefineEngineMethod( UndoManager, pushCompound, const char*, ( String name ), ("\"\""), "( string name=\"\" ) - Push a CompoundUndoAction onto the compound stack for assembly." ) { CompoundUndoAction* action = object->pushCompound( name ); @@ -580,7 +580,7 @@ DefineConsoleMethod( UndoManager, pushCompound, const char*, ( String name ), (" //----------------------------------------------------------------------------- -DefineConsoleMethod( UndoManager, popCompound, void, ( bool discard ), (false), "( bool discard=false ) - Pop the current CompoundUndoAction off the stack." ) +DefineEngineMethod( UndoManager, popCompound, void, ( bool discard ), (false), "( bool discard=false ) - Pop the current CompoundUndoAction off the stack." ) { if( !object->getCompoundStackDepth() ) { diff --git a/Engine/source/windowManager/sdl/sdlWindow.cpp b/Engine/source/windowManager/sdl/sdlWindow.cpp index 149825b98..ea2b29061 100644 --- a/Engine/source/windowManager/sdl/sdlWindow.cpp +++ b/Engine/source/windowManager/sdl/sdlWindow.cpp @@ -244,7 +244,7 @@ const char * PlatformWindowSDL::getCaption() void PlatformWindowSDL::setFocus() { - SDL_SetWindowGrab( mWindowHandle, SDL_TRUE ); + SDL_SetWindowInputFocus(mWindowHandle); } void PlatformWindowSDL::setClientExtent( const Point2I newExtent ) @@ -577,9 +577,7 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt) case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: { - appEvent.trigger(getWindowId(), GainFocus); _triggerMouseButtonNotify(evt); - break; } @@ -587,6 +585,12 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt) { switch( evt.window.event ) { + case SDL_WINDOWEVENT_FOCUS_GAINED: + appEvent.trigger(getWindowId(), GainFocus); + break; + case SDL_WINDOWEVENT_FOCUS_LOST: + appEvent.trigger(getWindowId(), LoseFocus); + break; case SDL_WINDOWEVENT_MAXIMIZED: case SDL_WINDOWEVENT_RESIZED: { diff --git a/Engine/source/windowManager/sdl/sdlWindowMgr.cpp b/Engine/source/windowManager/sdl/sdlWindowMgr.cpp index 68adf002e..f503c4fb1 100644 --- a/Engine/source/windowManager/sdl/sdlWindowMgr.cpp +++ b/Engine/source/windowManager/sdl/sdlWindowMgr.cpp @@ -61,8 +61,6 @@ PlatformWindowManagerSDL::PlatformWindowManagerSDL() mOffscreenRender = false; mInputState = KeyboardInputState::NONE; - - buildMonitorsList(); } PlatformWindowManagerSDL::~PlatformWindowManagerSDL() @@ -75,9 +73,8 @@ PlatformWindowManagerSDL::~PlatformWindowManagerSDL() RectI PlatformWindowManagerSDL::getPrimaryDesktopArea() { - // TODO SDL - AssertFatal(0, ""); - return RectI(0,0,0,0); + // Primary is monitor 0 + return getMonitorRect(0); } Point2I PlatformWindowManagerSDL::getDesktopResolution() @@ -100,46 +97,60 @@ S32 PlatformWindowManagerSDL::getDesktopBitDepth() return bbp; } -void PlatformWindowManagerSDL::buildMonitorsList() -{ - // TODO SDL -} - S32 PlatformWindowManagerSDL::findFirstMatchingMonitor(const char* name) { - /// TODO SDL - AssertFatal(0, ""); + S32 count = SDL_GetNumVideoDisplays(); + for (U32 index = 0; index < count; ++index) + { + if (dStrstr(name, SDL_GetDisplayName(index)) == name) + return index; + } return 0; } U32 PlatformWindowManagerSDL::getMonitorCount() { - // TODO SDL - AssertFatal(0, ""); - return 1; + S32 monitorCount = SDL_GetNumVideoDisplays(); + if (monitorCount < 0) + { + Con::errorf("SDL_GetNumVideoDisplays() failed: %s", SDL_GetError()); + monitorCount = 0; + } + + return (U32)monitorCount; } const char* PlatformWindowManagerSDL::getMonitorName(U32 index) { - // TODO SDL - AssertFatal(0, ""); + const char* monitorName = SDL_GetDisplayName(index); + if (monitorName == NULL) + Con::errorf("SDL_GetDisplayName() failed: %s", SDL_GetError()); - return "Monitor"; + return monitorName; } RectI PlatformWindowManagerSDL::getMonitorRect(U32 index) { - // TODO SDL - AssertFatal(0, ""); + SDL_Rect sdlRect; + if (0 != SDL_GetDisplayBounds(index, &sdlRect)) + { + Con::errorf("SDL_GetDisplayBounds() failed: %s", SDL_GetError()); + return RectI(0, 0, 0, 0); + } - return RectI(0, 0, 0,0 ); + return RectI(sdlRect.x, sdlRect.y, sdlRect.w, sdlRect.h); } void PlatformWindowManagerSDL::getMonitorRegions(Vector ®ions) { - // TODO SDL - AssertFatal(0, ""); + SDL_Rect sdlRect; + S32 monitorCount = SDL_GetNumVideoDisplays(); + for (S32 index = 0; index < monitorCount; ++index) + { + if (0 == SDL_GetDisplayBounds(index, &sdlRect)) + regions.push_back(RectI(sdlRect.x, sdlRect.y, sdlRect.w, sdlRect.h)); + } } void PlatformWindowManagerSDL::getWindows(VectorPtr &windows) diff --git a/Engine/source/windowManager/sdl/sdlWindowMgr.h b/Engine/source/windowManager/sdl/sdlWindowMgr.h index aacc348f2..fd8a762df 100644 --- a/Engine/source/windowManager/sdl/sdlWindowMgr.h +++ b/Engine/source/windowManager/sdl/sdlWindowMgr.h @@ -105,9 +105,6 @@ public: virtual S32 getDesktopBitDepth(); virtual Point2I getDesktopResolution(); - /// Build out the monitors list. - virtual void buildMonitorsList(); - virtual S32 findFirstMatchingMonitor(const char* name); virtual U32 getMonitorCount(); virtual const char* getMonitorName(U32 index); diff --git a/Templates/BaseGame/game/core/Core.cs b/Templates/BaseGame/game/core/Core.cs new file mode 100644 index 000000000..5559760ae --- /dev/null +++ b/Templates/BaseGame/game/core/Core.cs @@ -0,0 +1,143 @@ + +function CoreModule::onCreate(%this) +{ + + // ---------------------------------------------------------------------------- + // Initialize core sub system functionality such as audio, the Canvas, PostFX, + // rendermanager, light managers, etc. + // + // Note that not all of these need to be initialized before the client, although + // the audio should and the canvas definitely needs to be. I've put things here + // to distinguish between the purpose and functionality of the various client + // scripts. Game specific script isn't needed until we reach the shell menus + // and start a game or connect to a server. We get the various subsystems ready + // to go, and then use initClient() to handle the rest of the startup sequence. + // + // If this is too convoluted we can reduce this complexity after futher testing + // to find exactly which subsystems should be readied before kicking things off. + // ---------------------------------------------------------------------------- + + ModuleDatabase.LoadExplicit( "Core_Rendering" ); + ModuleDatabase.LoadExplicit( "Core_Utility" ); + ModuleDatabase.LoadExplicit( "Core_GUI" ); + ModuleDatabase.LoadExplicit( "CoreModule" ); + ModuleDatabase.LoadExplicit( "Core_Lighting" ); + ModuleDatabase.LoadExplicit( "Core_SFX" ); + ModuleDatabase.LoadExplicit( "Core_PostFX" ); + ModuleDatabase.LoadExplicit( "Core_ClientServer" ); + + %prefPath = getPrefpath(); + if ( isFile( %prefPath @ "/clientPrefs.cs" ) ) + exec( %prefPath @ "/clientPrefs.cs" ); + else + exec("data/defaults.cs"); + + %der = $pref::Video::displayDevice; + + //We need to hook the missing/warn material stuff early, so do it here + /*$Core::MissingTexturePath = "core/images/missingTexture"; + $Core::UnAvailableTexturePath = "core/images/unavailable"; + $Core::WarningTexturePath = "core/images/warnMat"; + $Core::CommonShaderPath = "core/shaders"; + + /*%classList = enumerateConsoleClasses( "Component" ); + + foreach$( %componentClass in %classList ) + { + echo("Native Component of type: " @ %componentClass); + }*/ + + //exec("./helperFunctions.cs"); + + // We need some of the default GUI profiles in order to get the canvas and + // other aspects of the GUI system ready. + //exec("./profiles.cs"); + + //This is a bit of a shortcut, but we'll load the client's default settings to ensure all the prefs get initialized correctly + + + // Initialization of the various subsystems requires some of the preferences + // to be loaded... so do that first. + /*exec("./globals.cs"); + + exec("./canvas.cs"); + exec("./cursor.cs"); + + exec("./renderManager.cs"); + exec("./lighting.cs"); + + exec("./audio.cs"); + exec("./sfx/audioAmbience.cs"); + exec("./sfx/audioData.cs"); + exec("./sfx/audioDescriptions.cs"); + exec("./sfx/audioEnvironments.cs"); + exec("./sfx/audioStates.cs"); + + exec("./parseArgs.cs"); + + // Materials and Shaders for rendering various object types + exec("./gfxData/commonMaterialData.cs"); + exec("./gfxData/shaders.cs"); + exec("./gfxData/terrainBlock.cs"); + exec("./gfxData/water.cs"); + exec("./gfxData/scatterSky.cs"); + exec("./gfxData/clouds.cs"); + + // Initialize all core post effects. + exec("./postFx.cs"); + + //VR stuff + exec("./oculusVR.cs");*/ + + // Seed the random number generator. + setRandomSeed(); + + // Parse the command line arguments + echo("\n--------- Parsing Arguments ---------"); + parseArgs(); + + // The canvas needs to be initialized before any gui scripts are run since + // some of the controls assume that the canvas exists at load time. + createCanvas($appName); + + //load canvas + //exec("./console/main.cs"); + + ModuleDatabase.LoadExplicit( "Core_Console" ); + + // Init the physics plugin. + physicsInit(); + + sfxStartup(); + + // Set up networking. + setNetPort(0); + + // Start processing file change events. + startFileChangeNotifications(); + + // If we have editors, initialize them here as well + if (isToolBuild()) + { + if(isFile("tools/main.cs") && !$isDedicated) + exec("tools/main.cs"); + + ModuleDatabase.scanModules( "tools", false ); + ModuleDatabase.LoadGroup( "Tools" ); + } +} + +function CoreModule::onDestroy(%this) +{ + +} + +//----------------------------------------------------------------------------- +// Called when the engine is shutting down. +function onExit() +{ + // Stop file change events. + stopFileChangeNotifications(); + + ModuleDatabase.UnloadExplicit( "Game" ); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/core/CoreComponents.module b/Templates/BaseGame/game/core/Core.module similarity index 69% rename from Templates/BaseGame/game/core/CoreComponents.module rename to Templates/BaseGame/game/core/Core.module index 0636e3bb5..c7ab7b64b 100644 --- a/Templates/BaseGame/game/core/CoreComponents.module +++ b/Templates/BaseGame/game/core/Core.module @@ -1,11 +1,11 @@ + Group="Core"> + Group="Core"> \ No newline at end of file diff --git a/Templates/BaseGame/game/data/clientServer/scripts/client/client.cs b/Templates/BaseGame/game/core/clientServer/scripts/client/client.cs similarity index 72% rename from Templates/BaseGame/game/data/clientServer/scripts/client/client.cs rename to Templates/BaseGame/game/core/clientServer/scripts/client/client.cs index 0b18d81aa..590119935 100644 --- a/Templates/BaseGame/game/data/clientServer/scripts/client/client.cs +++ b/Templates/BaseGame/game/core/clientServer/scripts/client/client.cs @@ -9,10 +9,10 @@ function initClient() $Client::GameTypeQuery = $appName; $Client::MissionTypeQuery = "Any"; - exec( "data/clientServer/scripts/client/message.cs" ); - exec( "data/clientServer/scripts/client/connectionToServer.cs" ); - exec( "data/clientServer/scripts/client/levelDownload.cs" ); - exec( "data/clientServer/scripts/client/levelLoad.cs" ); + exec( "./message.cs" ); + exec( "./connectionToServer.cs" ); + exec( "./levelDownload.cs" ); + exec( "./levelLoad.cs" ); //load prefs %prefPath = getPrefpath(); diff --git a/Templates/BaseGame/game/data/clientServer/scripts/client/connectionToServer.cs b/Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/client/connectionToServer.cs rename to Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/client/levelDownload.cs b/Templates/BaseGame/game/core/clientServer/scripts/client/levelDownload.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/client/levelDownload.cs rename to Templates/BaseGame/game/core/clientServer/scripts/client/levelDownload.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/client/levelLoad.cs b/Templates/BaseGame/game/core/clientServer/scripts/client/levelLoad.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/client/levelLoad.cs rename to Templates/BaseGame/game/core/clientServer/scripts/client/levelLoad.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/client/message.cs b/Templates/BaseGame/game/core/clientServer/scripts/client/message.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/client/message.cs rename to Templates/BaseGame/game/core/clientServer/scripts/client/message.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/server/audio.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/audio.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/server/audio.cs rename to Templates/BaseGame/game/core/clientServer/scripts/server/audio.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/server/commands.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/commands.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/server/commands.cs rename to Templates/BaseGame/game/core/clientServer/scripts/server/commands.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/server/connectionToClient.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/connectionToClient.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/server/connectionToClient.cs rename to Templates/BaseGame/game/core/clientServer/scripts/server/connectionToClient.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/server/defaults.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/defaults.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/server/defaults.cs rename to Templates/BaseGame/game/core/clientServer/scripts/server/defaults.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/server/kickban.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/kickban.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/server/kickban.cs rename to Templates/BaseGame/game/core/clientServer/scripts/server/kickban.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/server/levelDownload.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/server/levelDownload.cs rename to Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/server/levelInfo.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/server/levelInfo.cs rename to Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/server/levelLoad.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/server/levelLoad.cs rename to Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/server/message.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/message.cs similarity index 100% rename from Templates/BaseGame/game/data/clientServer/scripts/server/message.cs rename to Templates/BaseGame/game/core/clientServer/scripts/server/message.cs diff --git a/Templates/BaseGame/game/data/clientServer/scripts/server/server.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/server.cs similarity index 93% rename from Templates/BaseGame/game/data/clientServer/scripts/server/server.cs rename to Templates/BaseGame/game/core/clientServer/scripts/server/server.cs index 9f30ecf5d..17f127314 100644 --- a/Templates/BaseGame/game/data/clientServer/scripts/server/server.cs +++ b/Templates/BaseGame/game/core/clientServer/scripts/server/server.cs @@ -27,21 +27,21 @@ function initServer() //load prefs //Force-load the defaults just so we don't have any mistakes - exec( "data/clientServer/scripts/server/defaults.cs" ); + exec( "./defaults.cs" ); //Then, if the user has saved preferences, we load those over-top the defaults %prefPath = getPrefpath(); if ( isFile( %prefPath @ "/serverPrefs.cs" ) ) exec( %prefPath @ "/serverPrefs.cs" ); - exec( "data/clientServer/scripts/server/audio.cs" ); - exec( "data/clientServer/scripts/server/commands.cs" ); - exec( "data/clientServer/scripts/server/kickban.cs" ); - exec( "data/clientServer/scripts/server/message.cs" ); - exec( "data/clientServer/scripts/server/levelDownload.cs" ); - exec( "data/clientServer/scripts/server/levelLoad.cs" ); - exec( "data/clientServer/scripts/server/levelInfo.cs" ); - exec( "data/clientServer/scripts/server/connectionToClient.cs" ); + exec( "./audio.cs" ); + exec( "./commands.cs" ); + exec( "./kickban.cs" ); + exec( "./message.cs" ); + exec( "./levelDownload.cs" ); + exec( "./levelLoad.cs" ); + exec( "./levelInfo.cs" ); + exec( "./connectionToClient.cs" ); // Server::Status is returned in the Game Info Query and represents the // current status of the server. This string sould be very short. diff --git a/Templates/BaseGame/game/core/components/Core_Components.cs b/Templates/BaseGame/game/core/components/Core_Components.cs new file mode 100644 index 000000000..0b32d9d6b --- /dev/null +++ b/Templates/BaseGame/game/core/components/Core_Components.cs @@ -0,0 +1,8 @@ + +function Core_Components::onCreate(%this) +{ +} + +function Core_Components::onDestroy(%this) +{ +} \ No newline at end of file diff --git a/Templates/BaseGame/game/core/components/Core_Components.module b/Templates/BaseGame/game/core/components/Core_Components.module new file mode 100644 index 000000000..2c98b8091 --- /dev/null +++ b/Templates/BaseGame/game/core/components/Core_Components.module @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/Templates/BaseGame/game/core/components/collisionComponent.asset.taml b/Templates/BaseGame/game/core/components/collisionComponent.asset.taml deleted file mode 100644 index 1a4f99a0d..000000000 --- a/Templates/BaseGame/game/core/components/collisionComponent.asset.taml +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/Templates/BaseGame/game/core/components/RigidBodyComponent.asset.taml b/Templates/BaseGame/game/core/components/components/RigidBodyComponent.asset.taml similarity index 100% rename from Templates/BaseGame/game/core/components/RigidBodyComponent.asset.taml rename to Templates/BaseGame/game/core/components/components/RigidBodyComponent.asset.taml diff --git a/Templates/BaseGame/game/core/components/animationComponent.asset.taml b/Templates/BaseGame/game/core/components/components/animationComponent.asset.taml similarity index 100% rename from Templates/BaseGame/game/core/components/animationComponent.asset.taml rename to Templates/BaseGame/game/core/components/components/animationComponent.asset.taml diff --git a/Templates/BaseGame/game/core/components/cameraOrbiterComponent.asset.taml b/Templates/BaseGame/game/core/components/components/cameraOrbiterComponent.asset.taml similarity index 100% rename from Templates/BaseGame/game/core/components/cameraOrbiterComponent.asset.taml rename to Templates/BaseGame/game/core/components/components/cameraOrbiterComponent.asset.taml diff --git a/Templates/BaseGame/game/core/components/components/collisionComponent.asset.taml b/Templates/BaseGame/game/core/components/components/collisionComponent.asset.taml new file mode 100644 index 000000000..624bf9583 --- /dev/null +++ b/Templates/BaseGame/game/core/components/components/collisionComponent.asset.taml @@ -0,0 +1,8 @@ + diff --git a/Templates/BaseGame/game/core/components/game/camera.asset.taml b/Templates/BaseGame/game/core/components/components/game/camera.asset.taml similarity index 80% rename from Templates/BaseGame/game/core/components/game/camera.asset.taml rename to Templates/BaseGame/game/core/components/components/game/camera.asset.taml index f59e429e2..ace880f7c 100644 --- a/Templates/BaseGame/game/core/components/game/camera.asset.taml +++ b/Templates/BaseGame/game/core/components/components/game/camera.asset.taml @@ -6,4 +6,4 @@ friendlyName="Camera" componentType="Game" description="Allows the component owner to operate as a camera." - scriptFile="core/components/game/camera.cs" /> + scriptFile="core/components/components/game/camera.cs" /> diff --git a/Templates/BaseGame/game/core/components/game/camera.cs b/Templates/BaseGame/game/core/components/components/game/camera.cs similarity index 100% rename from Templates/BaseGame/game/core/components/game/camera.cs rename to Templates/BaseGame/game/core/components/components/game/camera.cs diff --git a/Templates/BaseGame/game/core/components/game/controlObject.asset.taml b/Templates/BaseGame/game/core/components/components/game/controlObject.asset.taml similarity index 82% rename from Templates/BaseGame/game/core/components/game/controlObject.asset.taml rename to Templates/BaseGame/game/core/components/components/game/controlObject.asset.taml index 19515e833..7efa2d3a2 100644 --- a/Templates/BaseGame/game/core/components/game/controlObject.asset.taml +++ b/Templates/BaseGame/game/core/components/components/game/controlObject.asset.taml @@ -7,4 +7,4 @@ friendlyName="Control Object" componentType="Game" description="Allows the component owner to be controlled by a client." - scriptFile="core/components/game/controlObject.cs" /> + scriptFile="core/components/components/game/controlObject.cs" /> diff --git a/Templates/BaseGame/game/core/components/game/controlObject.cs b/Templates/BaseGame/game/core/components/components/game/controlObject.cs similarity index 100% rename from Templates/BaseGame/game/core/components/game/controlObject.cs rename to Templates/BaseGame/game/core/components/components/game/controlObject.cs diff --git a/Templates/BaseGame/game/core/components/game/itemRotate.asset.taml b/Templates/BaseGame/game/core/components/components/game/itemRotate.asset.taml similarity index 82% rename from Templates/BaseGame/game/core/components/game/itemRotate.asset.taml rename to Templates/BaseGame/game/core/components/components/game/itemRotate.asset.taml index 4c0c1bec4..3509f9153 100644 --- a/Templates/BaseGame/game/core/components/game/itemRotate.asset.taml +++ b/Templates/BaseGame/game/core/components/components/game/itemRotate.asset.taml @@ -7,4 +7,4 @@ friendlyName="Item Rotation" componentType="Game" description="Rotates the entity around an axis, like an item pickup." - scriptFile="core/components/game/itemRotate.cs" /> + scriptFile="core/components/components/game/itemRotate.cs" /> diff --git a/Templates/BaseGame/game/core/components/game/itemRotate.cs b/Templates/BaseGame/game/core/components/components/game/itemRotate.cs similarity index 100% rename from Templates/BaseGame/game/core/components/game/itemRotate.cs rename to Templates/BaseGame/game/core/components/components/game/itemRotate.cs diff --git a/Templates/BaseGame/game/core/components/game/playerSpawner.asset.taml b/Templates/BaseGame/game/core/components/components/game/playerSpawner.asset.taml similarity index 83% rename from Templates/BaseGame/game/core/components/game/playerSpawner.asset.taml rename to Templates/BaseGame/game/core/components/components/game/playerSpawner.asset.taml index 8a597aca4..e0024b8fb 100644 --- a/Templates/BaseGame/game/core/components/game/playerSpawner.asset.taml +++ b/Templates/BaseGame/game/core/components/components/game/playerSpawner.asset.taml @@ -7,4 +7,4 @@ friendlyName="Player Spawner" componentType="Game" description="When a client connects, it spawns a player object for them and attaches them to it." - scriptFile="core/components/game/playerSpawner.cs" /> + scriptFile="core/components/components/game/playerSpawner.cs" /> diff --git a/Templates/BaseGame/game/core/components/game/playerSpawner.cs b/Templates/BaseGame/game/core/components/components/game/playerSpawner.cs similarity index 100% rename from Templates/BaseGame/game/core/components/game/playerSpawner.cs rename to Templates/BaseGame/game/core/components/components/game/playerSpawner.cs diff --git a/Templates/BaseGame/game/core/components/input/fpsControls.asset.taml b/Templates/BaseGame/game/core/components/components/input/fpsControls.asset.taml similarity index 100% rename from Templates/BaseGame/game/core/components/input/fpsControls.asset.taml rename to Templates/BaseGame/game/core/components/components/input/fpsControls.asset.taml diff --git a/Templates/BaseGame/game/core/components/input/fpsControls.cs b/Templates/BaseGame/game/core/components/components/input/fpsControls.cs similarity index 100% rename from Templates/BaseGame/game/core/components/input/fpsControls.cs rename to Templates/BaseGame/game/core/components/components/input/fpsControls.cs diff --git a/Templates/BaseGame/game/core/components/input/inputManager.cs b/Templates/BaseGame/game/core/components/components/input/inputManager.cs similarity index 100% rename from Templates/BaseGame/game/core/components/input/inputManager.cs rename to Templates/BaseGame/game/core/components/components/input/inputManager.cs diff --git a/Templates/BaseGame/game/core/components/meshComponent.asset.taml b/Templates/BaseGame/game/core/components/components/meshComponent.asset.taml similarity index 100% rename from Templates/BaseGame/game/core/components/meshComponent.asset.taml rename to Templates/BaseGame/game/core/components/components/meshComponent.asset.taml diff --git a/Templates/BaseGame/game/core/components/playerControllerComponent.asset.taml b/Templates/BaseGame/game/core/components/components/playerControllerComponent.asset.taml similarity index 100% rename from Templates/BaseGame/game/core/components/playerControllerComponent.asset.taml rename to Templates/BaseGame/game/core/components/components/playerControllerComponent.asset.taml diff --git a/Templates/BaseGame/game/core/components/soundComponent.asset.taml b/Templates/BaseGame/game/core/components/components/soundComponent.asset.taml similarity index 100% rename from Templates/BaseGame/game/core/components/soundComponent.asset.taml rename to Templates/BaseGame/game/core/components/components/soundComponent.asset.taml diff --git a/Templates/BaseGame/game/core/components/stateMachineComponent.asset.taml b/Templates/BaseGame/game/core/components/components/stateMachineComponent.asset.taml similarity index 100% rename from Templates/BaseGame/game/core/components/stateMachineComponent.asset.taml rename to Templates/BaseGame/game/core/components/components/stateMachineComponent.asset.taml diff --git a/Templates/BaseGame/game/core/components/components/triggerComponent.asset.taml b/Templates/BaseGame/game/core/components/components/triggerComponent.asset.taml new file mode 100644 index 000000000..4fabc200c --- /dev/null +++ b/Templates/BaseGame/game/core/components/components/triggerComponent.asset.taml @@ -0,0 +1,8 @@ + diff --git a/Templates/BaseGame/game/core/console/Core_Console.cs b/Templates/BaseGame/game/core/console/Core_Console.cs new file mode 100644 index 000000000..a93b149f4 --- /dev/null +++ b/Templates/BaseGame/game/core/console/Core_Console.cs @@ -0,0 +1,12 @@ + +function Core_Console::onCreate(%this) +{ + exec("./scripts/profiles.cs"); + exec("./scripts/console.cs"); + + exec("./guis/console.gui"); +} + +function Core_Console::onDestroy(%this) +{ +} \ No newline at end of file diff --git a/Templates/BaseGame/game/core/console/Core_Console.module b/Templates/BaseGame/game/core/console/Core_Console.module new file mode 100644 index 000000000..6927ba40e --- /dev/null +++ b/Templates/BaseGame/game/core/console/Core_Console.module @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/Templates/BaseGame/game/core/console/console.gui b/Templates/BaseGame/game/core/console/guis/console.gui similarity index 100% rename from Templates/BaseGame/game/core/console/console.gui rename to Templates/BaseGame/game/core/console/guis/console.gui diff --git a/Templates/BaseGame/game/core/console/main.cs b/Templates/BaseGame/game/core/console/scripts/console.cs similarity index 98% rename from Templates/BaseGame/game/core/console/main.cs rename to Templates/BaseGame/game/core/console/scripts/console.cs index 3d89234b8..201bcfb92 100644 --- a/Templates/BaseGame/game/core/console/main.cs +++ b/Templates/BaseGame/game/core/console/scripts/console.cs @@ -20,9 +20,6 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- -exec("./profiles.cs"); -exec("./console.gui"); - GlobalActionMap.bind("keyboard", "tilde", "toggleConsole"); function ConsoleEntry::eval() diff --git a/Templates/BaseGame/game/core/console/profiles.cs b/Templates/BaseGame/game/core/console/scripts/profiles.cs similarity index 100% rename from Templates/BaseGame/game/core/console/profiles.cs rename to Templates/BaseGame/game/core/console/scripts/profiles.cs diff --git a/Templates/BaseGame/game/core/fonts/Arial 12 (ansi).uft b/Templates/BaseGame/game/core/fonts/Arial 12 (ansi).uft index 67a177016..5592716dd 100644 Binary files a/Templates/BaseGame/game/core/fonts/Arial 12 (ansi).uft and b/Templates/BaseGame/game/core/fonts/Arial 12 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/fonts/Arial Bold 16 (ansi).uft b/Templates/BaseGame/game/core/fonts/Arial Bold 16 (ansi).uft index f1f94acb3..f2140c4c4 100644 Binary files a/Templates/BaseGame/game/core/fonts/Arial Bold 16 (ansi).uft and b/Templates/BaseGame/game/core/fonts/Arial Bold 16 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/fonts/ArialBold 14 (ansi).uft b/Templates/BaseGame/game/core/fonts/ArialBold 14 (ansi).uft index 9b103b3f7..93ea13d02 100644 Binary files a/Templates/BaseGame/game/core/fonts/ArialBold 14 (ansi).uft and b/Templates/BaseGame/game/core/fonts/ArialBold 14 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/fonts/ArialItalic 14 (ansi).uft b/Templates/BaseGame/game/core/fonts/ArialItalic 14 (ansi).uft index ca4a222cf..d4418f692 100644 Binary files a/Templates/BaseGame/game/core/fonts/ArialItalic 14 (ansi).uft and b/Templates/BaseGame/game/core/fonts/ArialItalic 14 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/gui/Core_GUI.cs b/Templates/BaseGame/game/core/gui/Core_GUI.cs new file mode 100644 index 000000000..dd15bf9ca --- /dev/null +++ b/Templates/BaseGame/game/core/gui/Core_GUI.cs @@ -0,0 +1,11 @@ + +function Core_GUI::onCreate(%this) +{ + exec("./scripts/profiles.cs"); + exec("./scripts/canvas.cs"); + exec("./scripts/cursor.cs"); +} + +function Core_GUI::onDestroy(%this) +{ +} \ No newline at end of file diff --git a/Templates/BaseGame/game/core/gui/Core_GUI.module b/Templates/BaseGame/game/core/gui/Core_GUI.module new file mode 100644 index 000000000..323d7cff2 --- /dev/null +++ b/Templates/BaseGame/game/core/gui/Core_GUI.module @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/Templates/BaseGame/game/core/images/button.png b/Templates/BaseGame/game/core/gui/images/button.png similarity index 100% rename from Templates/BaseGame/game/core/images/button.png rename to Templates/BaseGame/game/core/gui/images/button.png diff --git a/Templates/BaseGame/game/core/images/checkbox.png b/Templates/BaseGame/game/core/gui/images/checkbox.png similarity index 100% rename from Templates/BaseGame/game/core/images/checkbox.png rename to Templates/BaseGame/game/core/gui/images/checkbox.png diff --git a/Templates/BaseGame/game/core/images/group-border.png b/Templates/BaseGame/game/core/gui/images/group-border.png similarity index 100% rename from Templates/BaseGame/game/core/images/group-border.png rename to Templates/BaseGame/game/core/gui/images/group-border.png diff --git a/Templates/BaseGame/game/core/images/inactive-overlay.png b/Templates/BaseGame/game/core/gui/images/inactive-overlay.png similarity index 100% rename from Templates/BaseGame/game/core/images/inactive-overlay.png rename to Templates/BaseGame/game/core/gui/images/inactive-overlay.png diff --git a/Templates/BaseGame/game/core/images/loadingbar.png b/Templates/BaseGame/game/core/gui/images/loadingbar.png similarity index 100% rename from Templates/BaseGame/game/core/images/loadingbar.png rename to Templates/BaseGame/game/core/gui/images/loadingbar.png diff --git a/Templates/BaseGame/game/core/images/scrollBar.png b/Templates/BaseGame/game/core/gui/images/scrollBar.png similarity index 100% rename from Templates/BaseGame/game/core/images/scrollBar.png rename to Templates/BaseGame/game/core/gui/images/scrollBar.png diff --git a/Templates/BaseGame/game/core/images/textEdit.png b/Templates/BaseGame/game/core/gui/images/textEdit.png similarity index 100% rename from Templates/BaseGame/game/core/images/textEdit.png rename to Templates/BaseGame/game/core/gui/images/textEdit.png diff --git a/Templates/BaseGame/game/core/images/thumbHighlightButton.png b/Templates/BaseGame/game/core/gui/images/thumbHighlightButton.png similarity index 100% rename from Templates/BaseGame/game/core/images/thumbHighlightButton.png rename to Templates/BaseGame/game/core/gui/images/thumbHighlightButton.png diff --git a/Templates/BaseGame/game/core/images/window.png b/Templates/BaseGame/game/core/gui/images/window.png similarity index 100% rename from Templates/BaseGame/game/core/images/window.png rename to Templates/BaseGame/game/core/gui/images/window.png diff --git a/Templates/BaseGame/game/core/canvas.cs b/Templates/BaseGame/game/core/gui/scripts/canvas.cs similarity index 100% rename from Templates/BaseGame/game/core/canvas.cs rename to Templates/BaseGame/game/core/gui/scripts/canvas.cs diff --git a/Templates/BaseGame/game/core/cursor.cs b/Templates/BaseGame/game/core/gui/scripts/cursor.cs similarity index 100% rename from Templates/BaseGame/game/core/cursor.cs rename to Templates/BaseGame/game/core/gui/scripts/cursor.cs diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 10 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 10 (ansi).uft new file mode 100644 index 000000000..2b5649500 Binary files /dev/null and b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 10 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 12 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 12 (ansi).uft new file mode 100644 index 000000000..67a177016 Binary files /dev/null and b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 12 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 14 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 14 (ansi).uft new file mode 100644 index 000000000..f4f19745f Binary files /dev/null and b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 14 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 16 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 16 (ansi).uft new file mode 100644 index 000000000..ec996019d Binary files /dev/null and b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 16 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 36 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 36 (ansi).uft new file mode 100644 index 000000000..c0aa8165c Binary files /dev/null and b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 36 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 14 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 14 (ansi).uft new file mode 100644 index 000000000..4dbbddede Binary files /dev/null and b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 14 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 16 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 16 (ansi).uft new file mode 100644 index 000000000..fb096776f Binary files /dev/null and b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 16 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 18 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 18 (ansi).uft new file mode 100644 index 000000000..1f8fdedd3 Binary files /dev/null and b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 18 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/ArialItalic 14 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/ArialItalic 14 (ansi).uft new file mode 100644 index 000000000..5bac0316e Binary files /dev/null and b/Templates/BaseGame/game/core/gui/scripts/fonts/ArialItalic 14 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/Lucida Console 12 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/Lucida Console 12 (ansi).uft new file mode 100644 index 000000000..e06fa806c Binary files /dev/null and b/Templates/BaseGame/game/core/gui/scripts/fonts/Lucida Console 12 (ansi).uft differ diff --git a/Templates/BaseGame/game/core/profiles.cs b/Templates/BaseGame/game/core/gui/scripts/profiles.cs similarity index 95% rename from Templates/BaseGame/game/core/profiles.cs rename to Templates/BaseGame/game/core/gui/scripts/profiles.cs index fa9d9b72a..a06ab94da 100644 --- a/Templates/BaseGame/game/core/profiles.cs +++ b/Templates/BaseGame/game/core/gui/scripts/profiles.cs @@ -107,7 +107,7 @@ new GuiControlProfile (GuiWindowProfile) bevelColorHL = "255 255 255"; bevelColorLL = "0 0 0"; text = "untitled"; - bitmap = "./images/window"; + bitmap = "core/gui/images/window"; textOffset = "8 4"; hasBitmapArray = true; justify = "left"; @@ -119,7 +119,7 @@ if(!isObject(GuiTextEditProfile)) new GuiControlProfile(GuiTextEditProfile) { opaque = true; - bitmap = "./images/textEdit"; + bitmap = "core/gui/images/textEdit"; hasBitmapArray = true; border = -2; fillColor = "242 241 240 0"; @@ -145,7 +145,7 @@ new GuiControlProfile(GuiScrollProfile) fontColor = "0 0 0"; fontColorHL = "150 150 150"; border = true; - bitmap = "./images/scrollBar"; + bitmap = "core/gui/images/scrollBar"; hasBitmapArray = true; category = "Core"; }; @@ -173,7 +173,7 @@ new GuiControlProfile(GuiCheckBoxProfile) fontColorNA = "200 200 200"; fixedExtent = true; justify = "left"; - bitmap = "./images/checkbox"; + bitmap = "core/gui/images/checkbox"; hasBitmapArray = true; category = "Tools"; }; @@ -193,7 +193,7 @@ new GuiControlProfile( GuiProgressBitmapProfile ) { border = false; hasBitmapArray = true; - bitmap = "./images/loadingbar"; + bitmap = "core/gui/images/loadingbar"; category = "Core"; }; @@ -220,7 +220,7 @@ new GuiControlProfile( GuiButtonProfile ) fixedExtent = false; justify = "center"; canKeyFocus = false; - bitmap = "./images/button"; + bitmap = "core/gui/images/button"; hasBitmapArray = false; category = "Core"; }; diff --git a/Templates/BaseGame/game/core/lighting/Core_Lighting.cs b/Templates/BaseGame/game/core/lighting/Core_Lighting.cs new file mode 100644 index 000000000..dc5680b84 --- /dev/null +++ b/Templates/BaseGame/game/core/lighting/Core_Lighting.cs @@ -0,0 +1,20 @@ + +function Core_Lighting::onCreate(%this) +{ + exec("./scripts/lighting.cs"); + + //Advanced/Deferred + exec("./scripts/advancedLighting_Shaders.cs"); + exec("./scripts/deferredShading.cs"); + exec("./scripts/advancedLighting_Init.cs"); + + //Basic/Forward + exec("./scripts/basicLighting_shadowFilter.cs"); + exec("./scripts/shadowMaps_Init.cs"); + exec("./scripts/basicLighting_Init.cs"); + +} + +function Core_Lighting::onDestroy(%this) +{ +} \ No newline at end of file diff --git a/Templates/BaseGame/game/core/lighting/Core_Lighting.module b/Templates/BaseGame/game/core/lighting/Core_Lighting.module new file mode 100644 index 000000000..b4619a64a --- /dev/null +++ b/Templates/BaseGame/game/core/lighting/Core_Lighting.module @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/Templates/BaseGame/game/core/lighting/advanced/init.cs b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Init.cs similarity index 97% rename from Templates/BaseGame/game/core/lighting/advanced/init.cs rename to Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Init.cs index db2175278..c7d357bb8 100644 --- a/Templates/BaseGame/game/core/lighting/advanced/init.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Init.cs @@ -39,8 +39,8 @@ $pref::LightManager::sgUseDynamicShadows = "1"; $pref::LightManager::sgUseToneMapping = ""; */ -exec( "./shaders.cs" ); -exec( "./deferredShading.cs" ); +//exec( "./shaders.cs" ); +//exec( "./deferredShading.cs" ); function onActivateAdvancedLM() { diff --git a/Templates/BaseGame/game/core/lighting/advanced/shaders.cs b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs similarity index 100% rename from Templates/BaseGame/game/core/lighting/advanced/shaders.cs rename to Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs diff --git a/Templates/BaseGame/game/core/lighting/basic/init.cs b/Templates/BaseGame/game/core/lighting/scripts/basicLighting_Init.cs similarity index 99% rename from Templates/BaseGame/game/core/lighting/basic/init.cs rename to Templates/BaseGame/game/core/lighting/scripts/basicLighting_Init.cs index f298dfad2..99be20c5c 100644 --- a/Templates/BaseGame/game/core/lighting/basic/init.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/basicLighting_Init.cs @@ -20,7 +20,7 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- -exec( "./shadowFilter.cs" ); +//exec( "./shadowFilter.cs" ); singleton GFXStateBlockData( BL_ProjectedShadowSBData ) { diff --git a/Templates/BaseGame/game/core/lighting/basic/shadowFilter.cs b/Templates/BaseGame/game/core/lighting/scripts/basicLighting_shadowFilter.cs similarity index 100% rename from Templates/BaseGame/game/core/lighting/basic/shadowFilter.cs rename to Templates/BaseGame/game/core/lighting/scripts/basicLighting_shadowFilter.cs diff --git a/Templates/BaseGame/game/core/lighting/advanced/deferredShading.cs b/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs similarity index 100% rename from Templates/BaseGame/game/core/lighting/advanced/deferredShading.cs rename to Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs diff --git a/Templates/BaseGame/game/core/lighting.cs b/Templates/BaseGame/game/core/lighting/scripts/lighting.cs similarity index 96% rename from Templates/BaseGame/game/core/lighting.cs rename to Templates/BaseGame/game/core/lighting/scripts/lighting.cs index 9ece7d1a0..b7d4034ff 100644 --- a/Templates/BaseGame/game/core/lighting.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/lighting.cs @@ -26,12 +26,12 @@ function initLightingSystems(%manager) // First exec the scripts for the different light managers // in the lighting folder. - %pattern = "./lighting/*/init.cs"; + /*%pattern = "./lighting/*//*init.cs"; %file = findFirstFile( %pattern ); if ( %file $= "" ) { // Try for DSOs next. - %pattern = "./lighting/*/init.cs.dso"; + %pattern = "./lighting/*//*init.cs.dso"; %file = findFirstFile( %pattern ); } @@ -39,7 +39,7 @@ function initLightingSystems(%manager) { exec( %file ); %file = findNextFile( %pattern ); - } + }*/ // Try the perfered one first. %success = setLightManager(%manager); diff --git a/Templates/BaseGame/game/core/lighting/shadowMaps/init.cs b/Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs similarity index 100% rename from Templates/BaseGame/game/core/lighting/shadowMaps/init.cs rename to Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs diff --git a/Templates/BaseGame/game/core/main.cs b/Templates/BaseGame/game/core/main.cs deleted file mode 100644 index 8058c1f90..000000000 --- a/Templates/BaseGame/game/core/main.cs +++ /dev/null @@ -1,99 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 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. -//----------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// Initialize core sub system functionality such as audio, the Canvas, PostFX, -// rendermanager, light managers, etc. -// -// Note that not all of these need to be initialized before the client, although -// the audio should and the canvas definitely needs to be. I've put things here -// to distinguish between the purpose and functionality of the various client -// scripts. Game specific script isn't needed until we reach the shell menus -// and start a game or connect to a server. We get the various subsystems ready -// to go, and then use initClient() to handle the rest of the startup sequence. -// -// If this is too convoluted we can reduce this complexity after futher testing -// to find exactly which subsystems should be readied before kicking things off. -// ---------------------------------------------------------------------------- - -//We need to hook the missing/warn material stuff early, so do it here -$Core::MissingTexturePath = "core/images/missingTexture"; -$Core::UnAvailableTexturePath = "core/images/unavailable"; -$Core::WarningTexturePath = "core/images/warnMat"; -$Core::CommonShaderPath = "core/shaders"; - -ModuleDatabase.setModuleExtension("module"); - -//Core components -ModuleDatabase.scanModules( "core", false ); -ModuleDatabase.LoadExplicit( "CoreComponentsModule" ); - -exec("./helperFunctions.cs"); - -// We need some of the default GUI profiles in order to get the canvas and -// other aspects of the GUI system ready. -exec("./profiles.cs"); - -//This is a bit of a shortcut, but we'll load the client's default settings to ensure all the prefs get initialized correctly -%prefPath = getPrefpath(); -if ( isFile( %prefPath @ "/clientPrefs.cs" ) ) - exec( %prefPath @ "/clientPrefs.cs" ); -else - exec("data/defaults.cs"); - -%der = $pref::Video::displayDevice; - -// Initialization of the various subsystems requires some of the preferences -// to be loaded... so do that first. -exec("./globals.cs"); - -exec("./canvas.cs"); -exec("./cursor.cs"); - -exec("./renderManager.cs"); -exec("./lighting.cs"); - -exec("./audio.cs"); -exec("./sfx/audioAmbience.cs"); -exec("./sfx/audioData.cs"); -exec("./sfx/audioDescriptions.cs"); -exec("./sfx/audioEnvironments.cs"); -exec("./sfx/audioStates.cs"); - -exec("./parseArgs.cs"); - -// Materials and Shaders for rendering various object types -exec("./gfxData/commonMaterialData.cs"); -exec("./gfxData/shaders.cs"); -exec("./gfxData/terrainBlock.cs"); -exec("./gfxData/water.cs"); -exec("./gfxData/scatterSky.cs"); -exec("./gfxData/clouds.cs"); - -// Initialize all core post effects. -exec("./postFx.cs"); - -//VR stuff -exec("./oculusVR.cs"); - -// Seed the random number generator. -setRandomSeed(); \ No newline at end of file diff --git a/Templates/BaseGame/game/core/postFX/Core_PostFX.cs b/Templates/BaseGame/game/core/postFX/Core_PostFX.cs new file mode 100644 index 000000000..d36d912ab --- /dev/null +++ b/Templates/BaseGame/game/core/postFX/Core_PostFX.cs @@ -0,0 +1,33 @@ + +function Core_PostFX::onCreate(%this) +{ + // + exec("./scripts/postFx.cs"); + /*exec("./scripts/postFxManager.gui.cs"); + exec("./scripts/postFxManager.gui.settings.cs"); + exec("./scripts/postFxManager.persistance.cs"); + + exec("./scripts/default.postfxpreset.cs"); + + exec("./scripts/caustics.cs"); + exec("./scripts/chromaticLens.cs"); + exec("./scripts/dof.cs"); + exec("./scripts/edgeAA.cs"); + exec("./scripts/flash.cs"); + exec("./scripts/fog.cs"); + exec("./scripts/fxaa.cs"); + exec("./scripts/GammaPostFX.cs"); + exec("./scripts/glow.cs"); + exec("./scripts/hdr.cs"); + exec("./scripts/lightRay.cs"); + exec("./scripts/MLAA.cs"); + exec("./scripts/MotionBlurFx.cs"); + exec("./scripts/ovrBarrelDistortion.cs"); + exec("./scripts/ssao.cs"); + exec("./scripts/turbulence.cs"); + exec("./scripts/vignette.cs");*/ +} + +function Core_PostFX::onDestroy(%this) +{ +} \ No newline at end of file diff --git a/Templates/BaseGame/game/core/postFX/Core_PostFX.module b/Templates/BaseGame/game/core/postFX/Core_PostFX.module new file mode 100644 index 000000000..627a32d94 --- /dev/null +++ b/Templates/BaseGame/game/core/postFX/Core_PostFX.module @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/Templates/BaseGame/game/core/postFX/postFxManager.gui b/Templates/BaseGame/game/core/postFX/guis/postFxManager.gui similarity index 99% rename from Templates/BaseGame/game/core/postFX/postFxManager.gui rename to Templates/BaseGame/game/core/postFX/guis/postFxManager.gui index e74179374..6a704eb65 100644 --- a/Templates/BaseGame/game/core/postFX/postFxManager.gui +++ b/Templates/BaseGame/game/core/postFX/guis/postFxManager.gui @@ -2526,7 +2526,7 @@ sinkAllKeyEvents = "0"; password = "0"; passwordMask = "*"; - text = "core/images/null_color_ramp.png"; + text = "core/postFX/images/null_color_ramp.png"; maxLength = "1024"; margin = "0 0 0 0"; padding = "0 0 0 0"; diff --git a/Templates/BaseGame/game/core/images/AreaMap33.dds b/Templates/BaseGame/game/core/postFX/images/AreaMap33.dds similarity index 100% rename from Templates/BaseGame/game/core/images/AreaMap33.dds rename to Templates/BaseGame/game/core/postFX/images/AreaMap33.dds diff --git a/Templates/BaseGame/game/core/images/caustics_1.png b/Templates/BaseGame/game/core/postFX/images/caustics_1.png similarity index 100% rename from Templates/BaseGame/game/core/images/caustics_1.png rename to Templates/BaseGame/game/core/postFX/images/caustics_1.png diff --git a/Templates/BaseGame/game/core/images/caustics_2.png b/Templates/BaseGame/game/core/postFX/images/caustics_2.png similarity index 100% rename from Templates/BaseGame/game/core/images/caustics_2.png rename to Templates/BaseGame/game/core/postFX/images/caustics_2.png diff --git a/Templates/BaseGame/game/core/postFX/images/inactive-overlay.png b/Templates/BaseGame/game/core/postFX/images/inactive-overlay.png new file mode 100644 index 000000000..feab83209 Binary files /dev/null and b/Templates/BaseGame/game/core/postFX/images/inactive-overlay.png differ diff --git a/Templates/BaseGame/game/core/images/materials.cs b/Templates/BaseGame/game/core/postFX/images/materials.cs similarity index 100% rename from Templates/BaseGame/game/core/images/materials.cs rename to Templates/BaseGame/game/core/postFX/images/materials.cs diff --git a/Templates/BaseGame/game/core/images/missingTexture.png b/Templates/BaseGame/game/core/postFX/images/missingTexture.png similarity index 100% rename from Templates/BaseGame/game/core/images/missingTexture.png rename to Templates/BaseGame/game/core/postFX/images/missingTexture.png diff --git a/Templates/BaseGame/game/core/images/noise.png b/Templates/BaseGame/game/core/postFX/images/noise.png similarity index 100% rename from Templates/BaseGame/game/core/images/noise.png rename to Templates/BaseGame/game/core/postFX/images/noise.png diff --git a/Templates/BaseGame/game/core/images/null_color_ramp.png b/Templates/BaseGame/game/core/postFX/images/null_color_ramp.png similarity index 100% rename from Templates/BaseGame/game/core/images/null_color_ramp.png rename to Templates/BaseGame/game/core/postFX/images/null_color_ramp.png diff --git a/Templates/BaseGame/game/core/images/unavailable.png b/Templates/BaseGame/game/core/postFX/images/unavailable.png similarity index 100% rename from Templates/BaseGame/game/core/images/unavailable.png rename to Templates/BaseGame/game/core/postFX/images/unavailable.png diff --git a/Templates/BaseGame/game/core/images/warnMat.dds b/Templates/BaseGame/game/core/postFX/images/warnMat.dds similarity index 100% rename from Templates/BaseGame/game/core/images/warnMat.dds rename to Templates/BaseGame/game/core/postFX/images/warnMat.dds diff --git a/Templates/BaseGame/game/core/postFX/GammaPostFX.cs b/Templates/BaseGame/game/core/postFX/scripts/GammaPostFX.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/GammaPostFX.cs rename to Templates/BaseGame/game/core/postFX/scripts/GammaPostFX.cs diff --git a/Templates/BaseGame/game/core/postFX/MLAA.cs b/Templates/BaseGame/game/core/postFX/scripts/MLAA.cs similarity index 99% rename from Templates/BaseGame/game/core/postFX/MLAA.cs rename to Templates/BaseGame/game/core/postFX/scripts/MLAA.cs index ee07427ee..491c98e4e 100644 --- a/Templates/BaseGame/game/core/postFX/MLAA.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/MLAA.cs @@ -162,7 +162,7 @@ singleton PostEffect( MLAAFx ) texture[0] = "$inTex"; // Edges mask texture[1] = "$inTex"; // Edges mask - texture[2] = "core/images/AreaMap33.dds"; + texture[2] = "core/postFX/images/AreaMap33.dds"; }; new PostEffect() diff --git a/Templates/BaseGame/game/core/postFX/MotionBlurFx.cs b/Templates/BaseGame/game/core/postFX/scripts/MotionBlurFx.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/MotionBlurFx.cs rename to Templates/BaseGame/game/core/postFX/scripts/MotionBlurFx.cs diff --git a/Templates/BaseGame/game/core/postFX/caustics.cs b/Templates/BaseGame/game/core/postFX/scripts/caustics.cs similarity index 96% rename from Templates/BaseGame/game/core/postFX/caustics.cs rename to Templates/BaseGame/game/core/postFX/scripts/caustics.cs index f391ec67a..7dcea20a5 100644 --- a/Templates/BaseGame/game/core/postFX/caustics.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/caustics.cs @@ -58,7 +58,7 @@ singleton PostEffect( CausticsPFX ) shader = PFX_CausticsShader; stateBlock = PFX_CausticsStateBlock; texture[0] = "#deferred"; - texture[1] = "core/images/caustics_1"; - texture[2] = "core/images/caustics_2"; + texture[1] = "core/postFX/images/caustics_1"; + texture[2] = "core/postFX/images/caustics_2"; target = "$backBuffer"; }; diff --git a/Templates/BaseGame/game/core/postFX/chromaticLens.cs b/Templates/BaseGame/game/core/postFX/scripts/chromaticLens.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/chromaticLens.cs rename to Templates/BaseGame/game/core/postFX/scripts/chromaticLens.cs diff --git a/Templates/BaseGame/game/core/postFX/default.postfxpreset.cs b/Templates/BaseGame/game/core/postFX/scripts/default.postfxpreset.cs similarity index 97% rename from Templates/BaseGame/game/core/postFX/default.postfxpreset.cs rename to Templates/BaseGame/game/core/postFX/scripts/default.postfxpreset.cs index 077908ee8..6054d52ee 100644 --- a/Templates/BaseGame/game/core/postFX/default.postfxpreset.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/default.postfxpreset.cs @@ -69,4 +69,4 @@ $PostFXManager::Settings::SSAO::sNormalPow = "1"; $PostFXManager::Settings::SSAO::sNormalTol = "0"; $PostFXManager::Settings::SSAO::sRadius = "0.1"; $PostFXManager::Settings::SSAO::sStrength = "6"; -$PostFXManager::Settings::ColorCorrectionRamp = "core/images/null_color_ramp.png"; +$PostFXManager::Settings::ColorCorrectionRamp = "core/postFX/images/null_color_ramp.png"; diff --git a/Templates/BaseGame/game/core/postFX/dof.cs b/Templates/BaseGame/game/core/postFX/scripts/dof.cs similarity index 99% rename from Templates/BaseGame/game/core/postFX/dof.cs rename to Templates/BaseGame/game/core/postFX/scripts/dof.cs index 1767a9c86..736c288b2 100644 --- a/Templates/BaseGame/game/core/postFX/dof.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/dof.cs @@ -556,8 +556,8 @@ function DOFPostEffect::autoFocus( %this ) %mask = $TypeMasks::StaticObjectType | $TypeMasks::TerrainObjectType; %control = ServerConnection.getCameraObject(); - %fvec = %control.getEyeVector(); - %start = %control.getEyePoint(); + %fvec = %control.getForwardVector(); + %start = %control.getPosition(); %end = VectorAdd( %start, VectorScale( %fvec, $Param::FarDist ) ); diff --git a/Templates/BaseGame/game/core/postFX/edgeAA.cs b/Templates/BaseGame/game/core/postFX/scripts/edgeAA.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/edgeAA.cs rename to Templates/BaseGame/game/core/postFX/scripts/edgeAA.cs diff --git a/Templates/BaseGame/game/core/postFX/flash.cs b/Templates/BaseGame/game/core/postFX/scripts/flash.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/flash.cs rename to Templates/BaseGame/game/core/postFX/scripts/flash.cs diff --git a/Templates/BaseGame/game/core/postFX/fog.cs b/Templates/BaseGame/game/core/postFX/scripts/fog.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/fog.cs rename to Templates/BaseGame/game/core/postFX/scripts/fog.cs diff --git a/Templates/BaseGame/game/core/postFX/fxaa.cs b/Templates/BaseGame/game/core/postFX/scripts/fxaa.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/fxaa.cs rename to Templates/BaseGame/game/core/postFX/scripts/fxaa.cs diff --git a/Templates/BaseGame/game/core/postFX/glow.cs b/Templates/BaseGame/game/core/postFX/scripts/glow.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/glow.cs rename to Templates/BaseGame/game/core/postFX/scripts/glow.cs diff --git a/Templates/BaseGame/game/core/postFX/hdr.cs b/Templates/BaseGame/game/core/postFX/scripts/hdr.cs similarity index 99% rename from Templates/BaseGame/game/core/postFX/hdr.cs rename to Templates/BaseGame/game/core/postFX/scripts/hdr.cs index 837d8e6c8..3b2de8b7b 100644 --- a/Templates/BaseGame/game/core/postFX/hdr.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/hdr.cs @@ -70,7 +70,7 @@ $HDRPostFX::gaussStdDev = 0.8; /// The 1x255 color correction ramp texture used /// by both the HDR shader and the GammaPostFx shader /// for doing full screen color correction. -$HDRPostFX::colorCorrectionRamp = "core/images/null_color_ramp.png"; +$HDRPostFX::colorCorrectionRamp = "core/postFX/images/null_color_ramp.png"; singleton ShaderData( HDR_BrightPassShader ) diff --git a/Templates/BaseGame/game/core/postFX/lightRay.cs b/Templates/BaseGame/game/core/postFX/scripts/lightRay.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/lightRay.cs rename to Templates/BaseGame/game/core/postFX/scripts/lightRay.cs diff --git a/Templates/BaseGame/game/core/postFX/ovrBarrelDistortion.cs b/Templates/BaseGame/game/core/postFX/scripts/ovrBarrelDistortion.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/ovrBarrelDistortion.cs rename to Templates/BaseGame/game/core/postFX/scripts/ovrBarrelDistortion.cs diff --git a/Templates/BaseGame/game/core/postFx.cs b/Templates/BaseGame/game/core/postFX/scripts/postFx.cs similarity index 97% rename from Templates/BaseGame/game/core/postFx.cs rename to Templates/BaseGame/game/core/postFX/scripts/postFx.cs index aa65262d8..fe931a994 100644 --- a/Templates/BaseGame/game/core/postFx.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/postFx.cs @@ -35,13 +35,13 @@ singleton ShaderData( PFX_PassthruShader ) function postFXInit() { - exec("./postFX/postFxManager.gui"); + exec("core/postFX/guis/postFxManager.gui"); //Load the core postFX files themselves if (!$Server::Dedicated) { //init the postFX - %pattern = "core/postFX/*.cs"; + %pattern = "./*.cs"; %file = findFirstFile( %pattern ); if ( %file $= "" ) { diff --git a/Templates/BaseGame/game/core/postFX/postFxManager.gui.cs b/Templates/BaseGame/game/core/postFX/scripts/postFxManager.gui.cs similarity index 99% rename from Templates/BaseGame/game/core/postFX/postFxManager.gui.cs rename to Templates/BaseGame/game/core/postFX/scripts/postFxManager.gui.cs index 73dbec8b0..a6b0f0f01 100644 --- a/Templates/BaseGame/game/core/postFX/postFxManager.gui.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/postFxManager.gui.cs @@ -437,7 +437,7 @@ function ppColorCorrection_selectFile() function ppColorCorrection_selectFileHandler( %filename ) { if ( %filename $= "" || !isFile( %filename ) ) - %filename = "core/images/null_color_ramp.png"; + %filename = "core/postFX/images/null_color_ramp.png"; else %filename = makeRelativePath( %filename, getMainDotCsDir() ); diff --git a/Templates/BaseGame/game/core/postFX/postFxManager.gui.settings.cs b/Templates/BaseGame/game/core/postFX/scripts/postFxManager.gui.settings.cs similarity index 99% rename from Templates/BaseGame/game/core/postFX/postFxManager.gui.settings.cs rename to Templates/BaseGame/game/core/postFX/scripts/postFxManager.gui.settings.cs index d0ba2c4ea..eefcd9b7e 100644 --- a/Templates/BaseGame/game/core/postFX/postFxManager.gui.settings.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/postFxManager.gui.settings.cs @@ -20,7 +20,7 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- -$PostFXManager::defaultPreset = "core/postFX/default.postfxpreset.cs"; +$PostFXManager::defaultPreset = "./default.postfxpreset.cs"; function PostFXManager::settingsSetEnabled(%this, %bEnablePostFX) { diff --git a/Templates/BaseGame/game/core/postFX/postFxManager.persistance.cs b/Templates/BaseGame/game/core/postFX/scripts/postFxManager.persistance.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/postFxManager.persistance.cs rename to Templates/BaseGame/game/core/postFX/scripts/postFxManager.persistance.cs diff --git a/Templates/BaseGame/game/core/postFX/ssao.cs b/Templates/BaseGame/game/core/postFX/scripts/ssao.cs similarity index 99% rename from Templates/BaseGame/game/core/postFX/ssao.cs rename to Templates/BaseGame/game/core/postFX/scripts/ssao.cs index 3165b263d..5fe405a82 100644 --- a/Templates/BaseGame/game/core/postFX/ssao.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/ssao.cs @@ -200,7 +200,7 @@ singleton PostEffect( SSAOPostFx ) stateBlock = SSAOStateBlock; texture[0] = "#deferred"; - texture[1] = "core/images/noise.png"; + texture[1] = "core/postFX/images/noise.png"; texture[2] = "#ssao_pow_table"; target = "$outTex"; diff --git a/Templates/BaseGame/game/core/postFX/turbulence.cs b/Templates/BaseGame/game/core/postFX/scripts/turbulence.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/turbulence.cs rename to Templates/BaseGame/game/core/postFX/scripts/turbulence.cs diff --git a/Templates/BaseGame/game/core/postFX/vignette.cs b/Templates/BaseGame/game/core/postFX/scripts/vignette.cs similarity index 100% rename from Templates/BaseGame/game/core/postFX/vignette.cs rename to Templates/BaseGame/game/core/postFX/scripts/vignette.cs diff --git a/Templates/BaseGame/game/core/rendering/Core_Rendering.cs b/Templates/BaseGame/game/core/rendering/Core_Rendering.cs new file mode 100644 index 000000000..d09e0cbe3 --- /dev/null +++ b/Templates/BaseGame/game/core/rendering/Core_Rendering.cs @@ -0,0 +1,20 @@ + +function Core_Rendering::onCreate(%this) +{ + $Core::MissingTexturePath = "core/rendering/images/missingTexture"; + $Core::UnAvailableTexturePath = "core/rendering/images/unavailable"; + $Core::WarningTexturePath = "core/rendering/images/warnMat"; + $Core::CommonShaderPath = "core/rendering/shaders"; + + exec("./scripts/renderManager.cs"); + exec("./scripts/gfxData/clouds.cs"); + exec("./scripts/gfxData/commonMaterialData.cs"); + exec("./scripts/gfxData/scatterSky.cs"); + exec("./scripts/gfxData/shaders.cs"); + exec("./scripts/gfxData/terrainBlock.cs"); + exec("./scripts/gfxData/water.cs"); +} + +function Core_Rendering::onDestroy(%this) +{ +} \ No newline at end of file diff --git a/Templates/BaseGame/game/core/rendering/Core_Rendering.module b/Templates/BaseGame/game/core/rendering/Core_Rendering.module new file mode 100644 index 000000000..9dbbfc33a --- /dev/null +++ b/Templates/BaseGame/game/core/rendering/Core_Rendering.module @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/Templates/BaseGame/game/core/rendering/images/materials.cs b/Templates/BaseGame/game/core/rendering/images/materials.cs new file mode 100644 index 000000000..a13c751b3 --- /dev/null +++ b/Templates/BaseGame/game/core/rendering/images/materials.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 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. +//----------------------------------------------------------------------------- + +singleton Material( Empty ) +{ +}; + +singleton Material(WarningMaterial) { + detailMap[0] = "missingTexture"; + diffuseColor[0] = "25 16 0"; + emissive[0] = false; + translucent = false; +}; diff --git a/Templates/BaseGame/game/core/rendering/images/missingTexture.png b/Templates/BaseGame/game/core/rendering/images/missingTexture.png new file mode 100644 index 000000000..80a7874da Binary files /dev/null and b/Templates/BaseGame/game/core/rendering/images/missingTexture.png differ diff --git a/Templates/BaseGame/game/core/rendering/images/unavailable.png b/Templates/BaseGame/game/core/rendering/images/unavailable.png new file mode 100644 index 000000000..9d818a376 Binary files /dev/null and b/Templates/BaseGame/game/core/rendering/images/unavailable.png differ diff --git a/Templates/BaseGame/game/core/rendering/images/warnMat.dds b/Templates/BaseGame/game/core/rendering/images/warnMat.dds new file mode 100644 index 000000000..ea99dcbd7 Binary files /dev/null and b/Templates/BaseGame/game/core/rendering/images/warnMat.dds differ diff --git a/Templates/BaseGame/game/core/gfxData/clouds.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/clouds.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxData/clouds.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxData/clouds.cs diff --git a/Templates/BaseGame/game/core/gfxData/commonMaterialData.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/commonMaterialData.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxData/commonMaterialData.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxData/commonMaterialData.cs diff --git a/Templates/BaseGame/game/core/gfxData/scatterSky.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/scatterSky.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxData/scatterSky.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxData/scatterSky.cs diff --git a/Templates/BaseGame/game/core/gfxData/shaders.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/shaders.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxData/shaders.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxData/shaders.cs diff --git a/Templates/BaseGame/game/core/gfxData/terrainBlock.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/terrainBlock.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxData/terrainBlock.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxData/terrainBlock.cs diff --git a/Templates/BaseGame/game/core/gfxData/water.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/water.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxData/water.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxData/water.cs diff --git a/Templates/BaseGame/game/core/gfxprofile/D3D9.ATITechnologiesInc.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxprofile/D3D9.ATITechnologiesInc.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxprofile/D3D9.ATITechnologiesInc.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxprofile/D3D9.ATITechnologiesInc.cs diff --git a/Templates/BaseGame/game/core/gfxprofile/D3D9.NVIDIA.GeForce8600.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxprofile/D3D9.NVIDIA.GeForce8600.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxprofile/D3D9.NVIDIA.GeForce8600.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxprofile/D3D9.NVIDIA.GeForce8600.cs diff --git a/Templates/BaseGame/game/core/gfxprofile/D3D9.NVIDIA.QuadroFXGo1000.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxprofile/D3D9.NVIDIA.QuadroFXGo1000.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxprofile/D3D9.NVIDIA.QuadroFXGo1000.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxprofile/D3D9.NVIDIA.QuadroFXGo1000.cs diff --git a/Templates/BaseGame/game/core/gfxprofile/D3D9.NVIDIA.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxprofile/D3D9.NVIDIA.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxprofile/D3D9.NVIDIA.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxprofile/D3D9.NVIDIA.cs diff --git a/Templates/BaseGame/game/core/gfxprofile/D3D9.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxprofile/D3D9.cs similarity index 100% rename from Templates/BaseGame/game/core/gfxprofile/D3D9.cs rename to Templates/BaseGame/game/core/rendering/scripts/gfxprofile/D3D9.cs diff --git a/Templates/BaseGame/game/core/renderManager.cs b/Templates/BaseGame/game/core/rendering/scripts/renderManager.cs similarity index 88% rename from Templates/BaseGame/game/core/renderManager.cs rename to Templates/BaseGame/game/core/rendering/scripts/renderManager.cs index e9644c1ea..4a80a45b1 100644 --- a/Templates/BaseGame/game/core/renderManager.cs +++ b/Templates/BaseGame/game/core/rendering/scripts/renderManager.cs @@ -88,16 +88,6 @@ function initRenderManager() // Resolve format change token last. DiffuseRenderPassManager.addManager( new RenderPassStateBin(FinalBin) { renderOrder = 1.7; stateToken = AL_FormatToken; } ); - - // AFX CODE BLOCK (interior-zodiacs)(polysoup-zodiacs) << - if(isObject(afxZodiacTerrainRenderer)) - { - DiffuseRenderPassManager.addManager( new afxZodiacTerrainRenderer() { bintype = "TerrainZodiac"; renderOrder = 1.41; processAddOrder = 1.41; } ); - DiffuseRenderPassManager.addManager( new afxZodiacPolysoupRenderer() { bintype = "PolysoupZodiac"; renderOrder = 1.42; processAddOrder = 1.42; } ); - DiffuseRenderPassManager.addManager( new afxZodiacGroundPlaneRenderer() { bintype = "GroundPlaneZodiac"; renderOrder = 1.43; processAddOrder = 1.43; } ); - DiffuseRenderPassManager.addManager( new afxZodiacMeshRoadRenderer() { bintype = "MeshRoadZodiac"; renderOrder = 1.44; processAddOrder = 1.44; } ); - DiffuseRenderPassManager.addManager( new afxRenderHighlightMgr() { renderOrder = 1.55; processAddOrder = 1.55; } ); // for selection-highlighting - } } /// This is the Default PostFX state block. Put here to prevent any missing object diff --git a/Templates/BaseGame/game/core/shaders/VolumetricFog/VFogP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/VFogP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/VolumetricFog/VFogP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/VFogP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/VolumetricFog/VFogPreP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/VFogPreP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/VolumetricFog/VFogPreP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/VFogPreP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/VolumetricFog/VFogPreV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/VFogPreV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/VolumetricFog/VFogPreV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/VFogPreV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/VolumetricFog/VFogRefl.hlsl b/Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/VFogRefl.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/VolumetricFog/VFogRefl.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/VFogRefl.hlsl diff --git a/Templates/BaseGame/game/core/shaders/VolumetricFog/VFogV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/VFogV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/VolumetricFog/VFogV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/VFogV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/VolumetricFog/gl/VFogP.glsl b/Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/gl/VFogP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/VolumetricFog/gl/VFogP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/gl/VFogP.glsl diff --git a/Templates/BaseGame/game/core/shaders/VolumetricFog/gl/VFogPreP.glsl b/Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/gl/VFogPreP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/VolumetricFog/gl/VFogPreP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/gl/VFogPreP.glsl diff --git a/Templates/BaseGame/game/core/shaders/VolumetricFog/gl/VFogPreV.glsl b/Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/gl/VFogPreV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/VolumetricFog/gl/VFogPreV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/gl/VFogPreV.glsl diff --git a/Templates/BaseGame/game/core/shaders/VolumetricFog/gl/VFogRefl.glsl b/Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/gl/VFogRefl.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/VolumetricFog/gl/VFogRefl.glsl rename to Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/gl/VFogRefl.glsl diff --git a/Templates/BaseGame/game/core/shaders/VolumetricFog/gl/VFogV.glsl b/Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/gl/VFogV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/VolumetricFog/gl/VFogV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/VolumetricFog/gl/VFogV.glsl diff --git a/Templates/BaseGame/game/core/shaders/basicCloudsP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/basicCloudsP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/basicCloudsP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/basicCloudsP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/basicCloudsV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/basicCloudsV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/basicCloudsV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/basicCloudsV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/cloudLayerP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/cloudLayerP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/cloudLayerP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/cloudLayerP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/cloudLayerV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/cloudLayerV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/cloudLayerV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/cloudLayerV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/addColorTextureP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/addColorTextureP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/addColorTextureP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/addColorTextureP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/addColorTextureV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/addColorTextureV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/addColorTextureV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/addColorTextureV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/colorP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/colorP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/colorP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/colorP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/colorV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/colorV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/colorV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/colorV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/gl/addColorTextureP.glsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/addColorTextureP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/gl/addColorTextureP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/addColorTextureP.glsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/gl/addColorTextureV.glsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/addColorTextureV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/gl/addColorTextureV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/addColorTextureV.glsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/gl/colorP.glsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/colorP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/gl/colorP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/colorP.glsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/gl/colorV.glsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/colorV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/gl/colorV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/colorV.glsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/gl/modColorTextureP.glsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/modColorTextureP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/gl/modColorTextureP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/modColorTextureP.glsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/gl/modColorTextureV.glsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/modColorTextureV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/gl/modColorTextureV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/modColorTextureV.glsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/gl/targetRestoreP.glsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/targetRestoreP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/gl/targetRestoreP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/targetRestoreP.glsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/gl/targetRestoreV.glsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/targetRestoreV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/gl/targetRestoreV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/targetRestoreV.glsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/gl/textureP.glsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/textureP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/gl/textureP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/textureP.glsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/gl/textureV.glsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/textureV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/gl/textureV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/gl/textureV.glsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/modColorTextureP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/modColorTextureP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/modColorTextureP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/modColorTextureP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/modColorTextureV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/modColorTextureV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/modColorTextureV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/modColorTextureV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/targetRestoreP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/targetRestoreP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/targetRestoreP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/targetRestoreP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/targetRestoreV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/targetRestoreV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/targetRestoreV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/targetRestoreV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/textureP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/textureP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/textureP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/textureP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fixedFunction/textureV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fixedFunction/textureV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fixedFunction/textureV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fixedFunction/textureV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/foliage.hlsl b/Templates/BaseGame/game/core/rendering/shaders/foliage.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/foliage.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/foliage.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fxFoliageReplicatorP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fxFoliageReplicatorP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fxFoliageReplicatorP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fxFoliageReplicatorP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/fxFoliageReplicatorV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/fxFoliageReplicatorV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/fxFoliageReplicatorV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/fxFoliageReplicatorV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/gl/basicCloudsP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/basicCloudsP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/basicCloudsP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/basicCloudsP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/basicCloudsV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/basicCloudsV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/basicCloudsV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/basicCloudsV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/blurP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/blurP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/blurP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/blurP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/blurV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/blurV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/blurV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/blurV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/cloudLayerP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/cloudLayerP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/cloudLayerP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/cloudLayerP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/cloudLayerV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/cloudLayerV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/cloudLayerV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/cloudLayerV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/foliage.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/foliage.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/foliage.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/foliage.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/fxFoliageReplicatorP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/fxFoliageReplicatorP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/fxFoliageReplicatorP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/fxFoliageReplicatorP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/fxFoliageReplicatorV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/fxFoliageReplicatorV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/fxFoliageReplicatorV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/fxFoliageReplicatorV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/guiMaterialV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/guiMaterialV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/guiMaterialV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/guiMaterialV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/hlslCompat.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/hlslCompat.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/hlslCompat.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/hlslCompat.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/imposter.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/imposter.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/imposter.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/imposter.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/lighting.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/lighting.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/particleCompositeP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/particleCompositeP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/particleCompositeP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/particleCompositeP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/particleCompositeV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/particleCompositeV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/particleCompositeV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/particleCompositeV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/particlesP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/particlesP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/particlesP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/particlesP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/particlesV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/particlesV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/particlesV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/particlesV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/planarReflectBumpP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/planarReflectBumpP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/planarReflectBumpP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/planarReflectBumpP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/planarReflectBumpV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/planarReflectBumpV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/planarReflectBumpV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/planarReflectBumpV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/planarReflectP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/planarReflectP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/planarReflectP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/planarReflectP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/planarReflectV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/planarReflectV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/planarReflectV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/planarReflectV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/precipP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/precipP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/precipP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/precipP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/precipV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/precipV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/precipV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/precipV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/projectedShadowP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/projectedShadowP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/projectedShadowP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/projectedShadowP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/projectedShadowV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/projectedShadowV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/projectedShadowV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/projectedShadowV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/scatterSkyP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/scatterSkyP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/scatterSkyP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/scatterSkyP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/scatterSkyV.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/scatterSkyV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/scatterSkyV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/scatterSkyV.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/torque.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/torque.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/torque.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/torque.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/wavesP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/wavesP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/wavesP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/wavesP.glsl diff --git a/Templates/BaseGame/game/core/shaders/gl/wind.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/wind.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/gl/wind.glsl rename to Templates/BaseGame/game/core/rendering/shaders/gl/wind.glsl diff --git a/Templates/BaseGame/game/core/shaders/guiMaterialV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/guiMaterialV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/guiMaterialV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/guiMaterialV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/hlslStructs.h b/Templates/BaseGame/game/core/rendering/shaders/hlslStructs.h similarity index 100% rename from Templates/BaseGame/game/core/shaders/hlslStructs.h rename to Templates/BaseGame/game/core/rendering/shaders/hlslStructs.h diff --git a/Templates/BaseGame/game/core/shaders/hlslStructs.hlsl b/Templates/BaseGame/game/core/rendering/shaders/hlslStructs.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/hlslStructs.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/hlslStructs.hlsl diff --git a/Templates/BaseGame/game/core/shaders/imposter.hlsl b/Templates/BaseGame/game/core/rendering/shaders/imposter.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/imposter.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/imposter.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/convexGeometryV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/convexGeometryV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/convexGeometryV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/convexGeometryV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/deferredClearGBufferP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/deferredClearGBufferP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/deferredClearGBufferP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/deferredClearGBufferP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/deferredClearGBufferV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/deferredClearGBufferV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/deferredClearGBufferV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/deferredClearGBufferV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/deferredColorShaderP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/deferredColorShaderP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/deferredColorShaderP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/deferredColorShaderP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/deferredShadingP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/deferredShadingP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/deferredShadingP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/deferredShadingP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/farFrustumQuad.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/farFrustumQuad.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/farFrustumQuad.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/farFrustumQuad.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/farFrustumQuadV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/farFrustumQuadV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/farFrustumQuadV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/farFrustumQuadV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/convexGeometryV.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/convexGeometryV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/convexGeometryV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/convexGeometryV.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/deferredClearGBufferP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/deferredClearGBufferP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/deferredClearGBufferP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/deferredClearGBufferP.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/deferredColorShaderP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/deferredColorShaderP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/deferredColorShaderP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/deferredColorShaderP.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/deferredShadingP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/deferredShadingP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/deferredShadingP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/deferredShadingP.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/farFrustumQuad.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/farFrustumQuad.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/farFrustumQuad.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/farFrustumQuad.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/farFrustumQuadV.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/farFrustumQuadV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/farFrustumQuadV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/farFrustumQuadV.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/lightingUtils.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/lightingUtils.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/lightingUtils.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/lightingUtils.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/pointLightP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/pointLightP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/pointLightP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/pointLightP.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/softShadow.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/softShadow.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/softShadow.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/softShadow.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/spotLightP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/spotLightP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/spotLightP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/spotLightP.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/gl/vectorLightP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/vectorLightP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/gl/vectorLightP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/vectorLightP.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/lightingUtils.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/lightingUtils.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/lightingUtils.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/lightingUtils.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/particlePointLightP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/particlePointLightP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/particlePointLightP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/particlePointLightP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/particlePointLightV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/particlePointLightV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/particlePointLightV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/particlePointLightV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/pointLightP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/pointLightP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/pointLightP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/pointLightP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/softShadow.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/softShadow.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/softShadow.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/softShadow.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/spotLightP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/spotLightP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/advanced/vectorLightP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/vectorLightP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/advanced/vectorLightP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/vectorLightP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/basic/gl/shadowFilterP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/basic/gl/shadowFilterP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/basic/gl/shadowFilterP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/basic/gl/shadowFilterP.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/basic/gl/shadowFilterV.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/basic/gl/shadowFilterV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/basic/gl/shadowFilterV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/basic/gl/shadowFilterV.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/basic/shadowFilterP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/basic/shadowFilterP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/basic/shadowFilterP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/basic/shadowFilterP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/basic/shadowFilterV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/basic/shadowFilterV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/basic/shadowFilterV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/basic/shadowFilterV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/shadowMap/boxFilterP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/boxFilterP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/shadowMap/boxFilterP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/boxFilterP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/shadowMap/boxFilterV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/boxFilterV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/shadowMap/boxFilterV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/boxFilterV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/shadowMap/gl/boxFilterP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/gl/boxFilterP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/shadowMap/gl/boxFilterP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/gl/boxFilterP.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/shadowMap/gl/boxFilterV.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/gl/boxFilterV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/shadowMap/gl/boxFilterV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/gl/boxFilterV.glsl diff --git a/Templates/BaseGame/game/core/shaders/lighting/shadowMap/shadowMapIO.h b/Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/shadowMapIO.h similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/shadowMap/shadowMapIO.h rename to Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/shadowMapIO.h diff --git a/Templates/BaseGame/game/core/shaders/lighting/shadowMap/shadowMapIO_GLSL.h b/Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/shadowMapIO_GLSL.h similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/shadowMap/shadowMapIO_GLSL.h rename to Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/shadowMapIO_GLSL.h diff --git a/Templates/BaseGame/game/core/shaders/lighting/shadowMap/shadowMapIO_HLSL.h b/Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/shadowMapIO_HLSL.h similarity index 100% rename from Templates/BaseGame/game/core/shaders/lighting/shadowMap/shadowMapIO_HLSL.h rename to Templates/BaseGame/game/core/rendering/shaders/lighting/shadowMap/shadowMapIO_HLSL.h diff --git a/Templates/BaseGame/game/core/shaders/particleCompositeP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/particleCompositeP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/particleCompositeP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/particleCompositeP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/particleCompositeV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/particleCompositeV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/particleCompositeV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/particleCompositeV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/particlesP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/particlesP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/particlesP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/particlesP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/particlesV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/particlesV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/particlesV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/particlesV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/planarReflectBumpP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/planarReflectBumpP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/planarReflectBumpP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/planarReflectBumpP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/planarReflectBumpV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/planarReflectBumpV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/planarReflectBumpV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/planarReflectBumpV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/planarReflectP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/planarReflectP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/planarReflectP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/planarReflectP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/planarReflectV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/planarReflectV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/planarReflectV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/planarReflectV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/VolFogGlowP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/VolFogGlowP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/VolFogGlowP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/VolFogGlowP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/caustics/causticsP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/caustics/causticsP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/caustics/causticsP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/caustics/causticsP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/caustics/gl/causticsP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/caustics/gl/causticsP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/caustics/gl/causticsP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/caustics/gl/causticsP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/chromaticLens.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/chromaticLens.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/chromaticLens.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/chromaticLens.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_CalcCoC_P.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_CalcCoC_P.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_CalcCoC_P.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_CalcCoC_P.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_CalcCoC_V.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_CalcCoC_V.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_CalcCoC_V.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_CalcCoC_V.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_DownSample_P.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_DownSample_P.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_DownSample_P.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_DownSample_P.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_DownSample_V.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_DownSample_V.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_DownSample_V.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_DownSample_V.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_Final_P.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_Final_P.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_Final_P.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_Final_P.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_Final_V.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_Final_V.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_Final_V.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_Final_V.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_Gausian_P.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_Gausian_P.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_Gausian_P.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_Gausian_P.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_Gausian_V.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_Gausian_V.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_Gausian_V.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_Gausian_V.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_Passthrough_V.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_Passthrough_V.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_Passthrough_V.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_Passthrough_V.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_SmallBlur_P.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_SmallBlur_P.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_SmallBlur_P.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_SmallBlur_P.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/DOF_SmallBlur_V.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_SmallBlur_V.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/DOF_SmallBlur_V.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/DOF_SmallBlur_V.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_CalcCoC_P.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_CalcCoC_P.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_CalcCoC_P.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_CalcCoC_P.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_CalcCoC_V.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_CalcCoC_V.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_CalcCoC_V.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_CalcCoC_V.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_DownSample_P.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_DownSample_P.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_DownSample_P.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_DownSample_P.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_DownSample_V.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_DownSample_V.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_DownSample_V.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_DownSample_V.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_Final_P.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Final_P.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_Final_P.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Final_P.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_Final_V.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Final_V.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_Final_V.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Final_V.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_Gausian_P.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Gausian_P.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_Gausian_P.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Gausian_P.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_Gausian_V.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Gausian_V.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_Gausian_V.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Gausian_V.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_Passthrough_V.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Passthrough_V.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_Passthrough_V.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Passthrough_V.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_SmallBlur_P.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_SmallBlur_P.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_SmallBlur_P.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_SmallBlur_P.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_SmallBlur_V.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_SmallBlur_V.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/dof/gl/DOF_SmallBlur_V.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_SmallBlur_V.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/edgeaa/dbgEdgeDisplayP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/dbgEdgeDisplayP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/edgeaa/dbgEdgeDisplayP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/dbgEdgeDisplayP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/edgeaa/edgeAAP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/edgeAAP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/edgeaa/edgeAAP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/edgeAAP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/edgeaa/edgeAAV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/edgeAAV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/edgeaa/edgeAAV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/edgeAAV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/edgeaa/edgeDetectP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/edgeDetectP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/edgeaa/edgeDetectP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/edgeDetectP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/edgeaa/gl/dbgEdgeDisplayP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/dbgEdgeDisplayP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/edgeaa/gl/dbgEdgeDisplayP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/dbgEdgeDisplayP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/edgeaa/gl/edgeAAP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/edgeAAP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/edgeaa/gl/edgeAAP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/edgeAAP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/edgeaa/gl/edgeAAV.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/edgeAAV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/edgeaa/gl/edgeAAV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/edgeAAV.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/edgeaa/gl/edgeDetectP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/edgeDetectP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/edgeaa/gl/edgeDetectP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/edgeDetectP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/flashP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/flashP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/flashP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/flashP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/fogP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/fogP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/fogP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/fogP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/fxaa/Fxaa3_11.h b/Templates/BaseGame/game/core/rendering/shaders/postFX/fxaa/Fxaa3_11.h similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/fxaa/Fxaa3_11.h rename to Templates/BaseGame/game/core/rendering/shaders/postFX/fxaa/Fxaa3_11.h diff --git a/Templates/BaseGame/game/core/shaders/postFX/fxaa/fxaaP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/fxaa/fxaaP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/fxaa/fxaaP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/fxaa/fxaaP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/fxaa/fxaaV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/fxaa/fxaaV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/fxaa/fxaaV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/fxaa/fxaaV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/fxaa/gl/fxaaP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/fxaa/gl/fxaaP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/fxaa/gl/fxaaP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/fxaa/gl/fxaaP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/fxaa/gl/fxaaV.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/fxaa/gl/fxaaV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/fxaa/gl/fxaaV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/fxaa/gl/fxaaV.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gammaP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gammaP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gammaP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gammaP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/VolFogGlowP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/VolFogGlowP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/VolFogGlowP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/VolFogGlowP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/chromaticLens.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/chromaticLens.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/chromaticLens.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/chromaticLens.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/flashP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/flashP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/flashP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/flashP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/fogP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/fogP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/fogP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/fogP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/gammaP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/gammaP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/gammaP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/gammaP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/glowBlurP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/glowBlurP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/glowBlurP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/glowBlurP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/glowBlurV.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/glowBlurV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/glowBlurV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/glowBlurV.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/motionBlurP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/motionBlurP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/motionBlurP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/motionBlurP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/passthruP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/passthruP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/passthruP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/passthruP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/postFX.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/postFX.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/postFX.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/postFX.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/postFxV.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/postFxV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/postFxV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/postFxV.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/turbulenceP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/turbulenceP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/turbulenceP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/turbulenceP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/gl/underwaterFogP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/gl/underwaterFogP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/gl/underwaterFogP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/gl/underwaterFogP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/glowBlurP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/glowBlurP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/glowBlurP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/glowBlurP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/glowBlurV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/glowBlurV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/glowBlurV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/glowBlurV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/bloomGaussBlurHP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/bloomGaussBlurHP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/bloomGaussBlurHP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/bloomGaussBlurHP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/bloomGaussBlurVP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/bloomGaussBlurVP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/bloomGaussBlurVP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/bloomGaussBlurVP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/brightPassFilterP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/brightPassFilterP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/brightPassFilterP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/brightPassFilterP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/calculateAdaptedLumP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/calculateAdaptedLumP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/calculateAdaptedLumP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/calculateAdaptedLumP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/downScale4x4P.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/downScale4x4P.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/downScale4x4P.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/downScale4x4P.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/downScale4x4V.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/downScale4x4V.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/downScale4x4V.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/downScale4x4V.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/finalPassCombineP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/finalPassCombineP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/finalPassCombineP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/finalPassCombineP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/gl/bloomGaussBlurHP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/bloomGaussBlurHP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/gl/bloomGaussBlurHP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/bloomGaussBlurHP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/gl/bloomGaussBlurVP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/bloomGaussBlurVP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/gl/bloomGaussBlurVP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/bloomGaussBlurVP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/gl/brightPassFilterP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/brightPassFilterP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/gl/brightPassFilterP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/brightPassFilterP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/gl/calculateAdaptedLumP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/calculateAdaptedLumP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/gl/calculateAdaptedLumP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/calculateAdaptedLumP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/gl/downScale4x4P.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/downScale4x4P.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/gl/downScale4x4P.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/downScale4x4P.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/gl/downScale4x4V.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/downScale4x4V.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/gl/downScale4x4V.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/downScale4x4V.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/gl/finalPassCombineP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/finalPassCombineP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/gl/finalPassCombineP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/finalPassCombineP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/gl/luminanceVisP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/luminanceVisP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/gl/luminanceVisP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/luminanceVisP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/gl/sampleLumInitialP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/sampleLumInitialP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/gl/sampleLumInitialP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/sampleLumInitialP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/gl/sampleLumIterativeP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/sampleLumIterativeP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/gl/sampleLumIterativeP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/sampleLumIterativeP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/luminanceVisP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/luminanceVisP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/luminanceVisP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/luminanceVisP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/sampleLumInitialP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/sampleLumInitialP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/sampleLumInitialP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/sampleLumInitialP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/hdr/sampleLumIterativeP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/sampleLumIterativeP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/hdr/sampleLumIterativeP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/sampleLumIterativeP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/lightRay/gl/lightRayOccludeP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/gl/lightRayOccludeP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/lightRay/gl/lightRayOccludeP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/gl/lightRayOccludeP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/lightRay/gl/lightRayP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/gl/lightRayP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/lightRay/gl/lightRayP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/gl/lightRayP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/lightRay/lightRayOccludeP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/lightRayOccludeP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/lightRay/lightRayOccludeP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/lightRayOccludeP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/lightRay/lightRayP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/lightRayP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/lightRay/lightRayP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/lightRayP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/blendWeightCalculationP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/blendWeightCalculationP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/blendWeightCalculationP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/blendWeightCalculationP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/edgeDetectionP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/edgeDetectionP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/edgeDetectionP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/edgeDetectionP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/functions.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/functions.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/functions.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/functions.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/blendWeightCalculationP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/blendWeightCalculationP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/blendWeightCalculationP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/blendWeightCalculationP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/edgeDetectionP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/edgeDetectionP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/edgeDetectionP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/edgeDetectionP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/functions.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/functions.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/functions.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/functions.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/neighborhoodBlendingP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/neighborhoodBlendingP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/neighborhoodBlendingP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/neighborhoodBlendingP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/offsetV.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/offsetV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/offsetV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/offsetV.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/passthruV.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/passthruV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/gl/passthruV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/gl/passthruV.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/neighborhoodBlendingP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/neighborhoodBlendingP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/neighborhoodBlendingP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/neighborhoodBlendingP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/offsetV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/offsetV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/offsetV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/offsetV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/mlaa/passthruV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/passthruV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/mlaa/passthruV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/mlaa/passthruV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/motionBlurP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/motionBlurP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/motionBlurP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/motionBlurP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/oculusvr/barrelDistortionChromaP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/barrelDistortionChromaP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/oculusvr/barrelDistortionChromaP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/barrelDistortionChromaP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/oculusvr/barrelDistortionP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/barrelDistortionP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/oculusvr/barrelDistortionP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/barrelDistortionP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/oculusvr/gl/barrelDistortionChromaP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/gl/barrelDistortionChromaP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/oculusvr/gl/barrelDistortionChromaP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/gl/barrelDistortionChromaP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/oculusvr/gl/barrelDistortionP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/gl/barrelDistortionP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/oculusvr/gl/barrelDistortionP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/gl/barrelDistortionP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/oculusvr/gl/monoToStereoP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/gl/monoToStereoP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/oculusvr/gl/monoToStereoP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/gl/monoToStereoP.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/oculusvr/monoToStereoP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/monoToStereoP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/oculusvr/monoToStereoP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/oculusvr/monoToStereoP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/passthruP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/passthruP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/passthruP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/passthruP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/postFx.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/postFx.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/postFx.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/postFx.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/postFxV.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/postFxV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/postFxV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/postFxV.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/postFxV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/postFxV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/postFxV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/postFxV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/ssao/SSAO_Blur_P.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/SSAO_Blur_P.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/ssao/SSAO_Blur_P.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/SSAO_Blur_P.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/ssao/SSAO_Blur_V.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/SSAO_Blur_V.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/ssao/SSAO_Blur_V.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/SSAO_Blur_V.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/ssao/SSAO_P.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/SSAO_P.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/ssao/SSAO_P.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/SSAO_P.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/ssao/SSAO_PowerTable_P.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/SSAO_PowerTable_P.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/ssao/SSAO_PowerTable_P.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/SSAO_PowerTable_P.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/ssao/SSAO_PowerTable_V.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/SSAO_PowerTable_V.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/ssao/SSAO_PowerTable_V.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/SSAO_PowerTable_V.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/ssao/gl/SSAO_Blur_P.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_Blur_P.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/ssao/gl/SSAO_Blur_P.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_Blur_P.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/ssao/gl/SSAO_Blur_V.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_Blur_V.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/ssao/gl/SSAO_Blur_V.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_Blur_V.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/ssao/gl/SSAO_P.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_P.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/ssao/gl/SSAO_P.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_P.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/ssao/gl/SSAO_PowerTable_P.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_PowerTable_P.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/ssao/gl/SSAO_PowerTable_P.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_PowerTable_P.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/ssao/gl/SSAO_PowerTable_V.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_PowerTable_V.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/ssao/gl/SSAO_PowerTable_V.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_PowerTable_V.glsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/turbulenceP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/turbulenceP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/turbulenceP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/turbulenceP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/underwaterFogP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/underwaterFogP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/underwaterFogP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/underwaterFogP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/vignette/VignetteP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/vignette/VignetteP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/vignette/VignetteP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/vignette/VignetteP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/postFX/vignette/gl/VignetteP.glsl b/Templates/BaseGame/game/core/rendering/shaders/postFX/vignette/gl/VignetteP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/postFX/vignette/gl/VignetteP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/postFX/vignette/gl/VignetteP.glsl diff --git a/Templates/BaseGame/game/core/shaders/precipP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/precipP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/precipP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/precipP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/precipV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/precipV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/precipV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/precipV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/projectedShadowP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/projectedShadowP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/projectedShadowP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/projectedShadowP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/projectedShadowV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/projectedShadowV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/projectedShadowV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/projectedShadowV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/ribbons/basicRibbonShaderP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/ribbons/basicRibbonShaderP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/ribbons/basicRibbonShaderP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/ribbons/basicRibbonShaderP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/ribbons/basicRibbonShaderV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/ribbons/basicRibbonShaderV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/ribbons/basicRibbonShaderV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/ribbons/basicRibbonShaderV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/ribbons/gl/basicRibbonShaderP.glsl b/Templates/BaseGame/game/core/rendering/shaders/ribbons/gl/basicRibbonShaderP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/ribbons/gl/basicRibbonShaderP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/ribbons/gl/basicRibbonShaderP.glsl diff --git a/Templates/BaseGame/game/core/shaders/ribbons/gl/basicRibbonShaderV.glsl b/Templates/BaseGame/game/core/rendering/shaders/ribbons/gl/basicRibbonShaderV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/ribbons/gl/basicRibbonShaderV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/ribbons/gl/basicRibbonShaderV.glsl diff --git a/Templates/BaseGame/game/core/shaders/ribbons/gl/texRibbonShaderP.glsl b/Templates/BaseGame/game/core/rendering/shaders/ribbons/gl/texRibbonShaderP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/ribbons/gl/texRibbonShaderP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/ribbons/gl/texRibbonShaderP.glsl diff --git a/Templates/BaseGame/game/core/shaders/ribbons/gl/texRibbonShaderV.glsl b/Templates/BaseGame/game/core/rendering/shaders/ribbons/gl/texRibbonShaderV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/ribbons/gl/texRibbonShaderV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/ribbons/gl/texRibbonShaderV.glsl diff --git a/Templates/BaseGame/game/core/shaders/ribbons/texRibbonShaderP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/ribbons/texRibbonShaderP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/ribbons/texRibbonShaderP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/ribbons/texRibbonShaderP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/ribbons/texRibbonShaderV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/ribbons/texRibbonShaderV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/ribbons/texRibbonShaderV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/ribbons/texRibbonShaderV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/scatterSkyP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/scatterSkyP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/scatterSkyP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/scatterSkyP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/scatterSkyV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/scatterSkyV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/scatterSkyV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/scatterSkyV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/shaderModel.hlsl b/Templates/BaseGame/game/core/rendering/shaders/shaderModel.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/shaderModel.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/shaderModel.hlsl diff --git a/Templates/BaseGame/game/core/shaders/shaderModelAutoGen.hlsl b/Templates/BaseGame/game/core/rendering/shaders/shaderModelAutoGen.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/shaderModelAutoGen.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/shaderModelAutoGen.hlsl diff --git a/Templates/BaseGame/game/core/shaders/shdrConsts.h b/Templates/BaseGame/game/core/rendering/shaders/shdrConsts.h similarity index 100% rename from Templates/BaseGame/game/core/shaders/shdrConsts.h rename to Templates/BaseGame/game/core/rendering/shaders/shdrConsts.h diff --git a/Templates/BaseGame/game/core/shaders/terrain/blendP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/terrain/blendP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/terrain/blendP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/terrain/blendP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/terrain/blendV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/terrain/blendV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/terrain/blendV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/terrain/blendV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/terrain/gl/blendP.glsl b/Templates/BaseGame/game/core/rendering/shaders/terrain/gl/blendP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/terrain/gl/blendP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/terrain/gl/blendP.glsl diff --git a/Templates/BaseGame/game/core/shaders/terrain/gl/blendV.glsl b/Templates/BaseGame/game/core/rendering/shaders/terrain/gl/blendV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/terrain/gl/blendV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/terrain/gl/blendV.glsl diff --git a/Templates/BaseGame/game/core/shaders/terrain/terrain.glsl b/Templates/BaseGame/game/core/rendering/shaders/terrain/terrain.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/terrain/terrain.glsl rename to Templates/BaseGame/game/core/rendering/shaders/terrain/terrain.glsl diff --git a/Templates/BaseGame/game/core/shaders/terrain/terrain.hlsl b/Templates/BaseGame/game/core/rendering/shaders/terrain/terrain.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/terrain/terrain.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/terrain/terrain.hlsl diff --git a/Templates/BaseGame/game/core/shaders/torque.hlsl b/Templates/BaseGame/game/core/rendering/shaders/torque.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/torque.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/torque.hlsl diff --git a/Templates/BaseGame/game/core/shaders/water/gl/waterBasicP.glsl b/Templates/BaseGame/game/core/rendering/shaders/water/gl/waterBasicP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/water/gl/waterBasicP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/water/gl/waterBasicP.glsl diff --git a/Templates/BaseGame/game/core/shaders/water/gl/waterBasicV.glsl b/Templates/BaseGame/game/core/rendering/shaders/water/gl/waterBasicV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/water/gl/waterBasicV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/water/gl/waterBasicV.glsl diff --git a/Templates/BaseGame/game/core/shaders/water/gl/waterP.glsl b/Templates/BaseGame/game/core/rendering/shaders/water/gl/waterP.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/water/gl/waterP.glsl rename to Templates/BaseGame/game/core/rendering/shaders/water/gl/waterP.glsl diff --git a/Templates/BaseGame/game/core/shaders/water/gl/waterV.glsl b/Templates/BaseGame/game/core/rendering/shaders/water/gl/waterV.glsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/water/gl/waterV.glsl rename to Templates/BaseGame/game/core/rendering/shaders/water/gl/waterV.glsl diff --git a/Templates/BaseGame/game/core/shaders/water/waterBasicP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/water/waterBasicP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/water/waterBasicP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/water/waterBasicP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/water/waterBasicV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/water/waterBasicV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/water/waterBasicV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/water/waterBasicV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/water/waterP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/water/waterP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/water/waterP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/water/waterP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/water/waterV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/water/waterV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/water/waterV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/water/waterV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/wavesP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/wavesP.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/wavesP.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/wavesP.hlsl diff --git a/Templates/BaseGame/game/core/shaders/wavesV.hlsl b/Templates/BaseGame/game/core/rendering/shaders/wavesV.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/wavesV.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/wavesV.hlsl diff --git a/Templates/BaseGame/game/core/shaders/wind.hlsl b/Templates/BaseGame/game/core/rendering/shaders/wind.hlsl similarity index 100% rename from Templates/BaseGame/game/core/shaders/wind.hlsl rename to Templates/BaseGame/game/core/rendering/shaders/wind.hlsl diff --git a/Templates/BaseGame/game/core/sfx/Core_SFX.cs b/Templates/BaseGame/game/core/sfx/Core_SFX.cs new file mode 100644 index 000000000..acd5c6e08 --- /dev/null +++ b/Templates/BaseGame/game/core/sfx/Core_SFX.cs @@ -0,0 +1,15 @@ + +function Core_SFX::onCreate(%this) +{ + exec("./scripts/audio.cs"); + exec("./scripts/audioData.cs"); + exec("./scripts/audioAmbience.cs"); + exec("./scripts/audioDescriptions.cs"); + exec("./scripts/audioEnvironments.cs"); + exec("./scripts/audioStates.cs"); + +} + +function Core_SFX::onDestroy(%this) +{ +} \ No newline at end of file diff --git a/Templates/BaseGame/game/core/sfx/Core_SFX.module b/Templates/BaseGame/game/core/sfx/Core_SFX.module new file mode 100644 index 000000000..855fe2a11 --- /dev/null +++ b/Templates/BaseGame/game/core/sfx/Core_SFX.module @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/Templates/BaseGame/game/core/audio.cs b/Templates/BaseGame/game/core/sfx/scripts/audio.cs similarity index 100% rename from Templates/BaseGame/game/core/audio.cs rename to Templates/BaseGame/game/core/sfx/scripts/audio.cs diff --git a/Templates/BaseGame/game/core/sfx/audioAmbience.cs b/Templates/BaseGame/game/core/sfx/scripts/audioAmbience.cs similarity index 100% rename from Templates/BaseGame/game/core/sfx/audioAmbience.cs rename to Templates/BaseGame/game/core/sfx/scripts/audioAmbience.cs diff --git a/Templates/BaseGame/game/core/sfx/audioData.cs b/Templates/BaseGame/game/core/sfx/scripts/audioData.cs similarity index 100% rename from Templates/BaseGame/game/core/sfx/audioData.cs rename to Templates/BaseGame/game/core/sfx/scripts/audioData.cs diff --git a/Templates/BaseGame/game/core/sfx/audioDescriptions.cs b/Templates/BaseGame/game/core/sfx/scripts/audioDescriptions.cs similarity index 100% rename from Templates/BaseGame/game/core/sfx/audioDescriptions.cs rename to Templates/BaseGame/game/core/sfx/scripts/audioDescriptions.cs diff --git a/Templates/BaseGame/game/core/sfx/audioEnvironments.cs b/Templates/BaseGame/game/core/sfx/scripts/audioEnvironments.cs similarity index 100% rename from Templates/BaseGame/game/core/sfx/audioEnvironments.cs rename to Templates/BaseGame/game/core/sfx/scripts/audioEnvironments.cs diff --git a/Templates/BaseGame/game/core/sfx/audioStates.cs b/Templates/BaseGame/game/core/sfx/scripts/audioStates.cs similarity index 100% rename from Templates/BaseGame/game/core/sfx/audioStates.cs rename to Templates/BaseGame/game/core/sfx/scripts/audioStates.cs diff --git a/Templates/BaseGame/game/core/utility/Core_Utility.cs b/Templates/BaseGame/game/core/utility/Core_Utility.cs new file mode 100644 index 000000000..d412f3544 --- /dev/null +++ b/Templates/BaseGame/game/core/utility/Core_Utility.cs @@ -0,0 +1,11 @@ + +function Core_Utility::onCreate(%this) +{ + exec("./scripts/parseArgs.cs"); + exec("./scripts/globals.cs"); + exec("./scripts/helperFunctions.cs"); +} + +function Core_Utility::onDestroy(%this) +{ +} \ No newline at end of file diff --git a/Templates/BaseGame/game/core/utility/Core_Utility.module b/Templates/BaseGame/game/core/utility/Core_Utility.module new file mode 100644 index 000000000..cb6539040 --- /dev/null +++ b/Templates/BaseGame/game/core/utility/Core_Utility.module @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/Templates/BaseGame/game/core/globals.cs b/Templates/BaseGame/game/core/utility/scripts/globals.cs similarity index 95% rename from Templates/BaseGame/game/core/globals.cs rename to Templates/BaseGame/game/core/utility/scripts/globals.cs index d4e4f1ca3..fcf52390a 100644 --- a/Templates/BaseGame/game/core/globals.cs +++ b/Templates/BaseGame/game/core/utility/scripts/globals.cs @@ -35,10 +35,10 @@ $pref::Input::JoystickEnabled = 0; // ---------------------------------------------------------------------------- // Set directory paths for various data or default images. -$pref::Video::ProfilePath = "core/gfxprofile"; -$pref::Video::missingTexturePath = "core/images/missingTexture.png"; +$pref::Video::ProfilePath = "core/rendering/scripts/gfxprofile"; +/*$pref::Video::missingTexturePath = "core/images/missingTexture.png"; $pref::Video::unavailableTexturePath = "core/images/unavailable.png"; -$pref::Video::warningTexturePath = "core/images/warnMat.dds"; +$pref::Video::warningTexturePath = "core/images/warnMat.dds";*/ $pref::Video::disableVerticalSync = 1; $pref::Video::mode = "800 600 false 32 60 4"; diff --git a/Templates/BaseGame/game/core/helperFunctions.cs b/Templates/BaseGame/game/core/utility/scripts/helperFunctions.cs similarity index 99% rename from Templates/BaseGame/game/core/helperFunctions.cs rename to Templates/BaseGame/game/core/utility/scripts/helperFunctions.cs index 1b98f1ea5..8abe3e6e6 100644 --- a/Templates/BaseGame/game/core/helperFunctions.cs +++ b/Templates/BaseGame/game/core/utility/scripts/helperFunctions.cs @@ -966,9 +966,9 @@ function findGameObject(%name) { %assetId = %assetQuery.getAsset(%i); - %assetName = AssetDatabase.getAssetName(%assetId); + //%assetName = AssetDatabase.getAssetName(%assetId); - if(%assetName $= %name) + if(%assetId $= %name) { %gameObjectAsset = AssetDatabase.acquireAsset(%assetId); diff --git a/Templates/BaseGame/game/core/parseArgs.cs b/Templates/BaseGame/game/core/utility/scripts/parseArgs.cs similarity index 100% rename from Templates/BaseGame/game/core/parseArgs.cs rename to Templates/BaseGame/game/core/utility/scripts/parseArgs.cs diff --git a/Templates/BaseGame/game/main.cs.in b/Templates/BaseGame/game/main.cs.in index 3eed267df..1e3e37c44 100644 --- a/Templates/BaseGame/game/main.cs.in +++ b/Templates/BaseGame/game/main.cs.in @@ -16,39 +16,12 @@ $appName = "@TORQUE_APP_NAME@"; //----------------------------------------------------------------------------- // Load up scripts to initialise subsystems. -exec("core/main.cs"); - -// Parse the command line arguments -echo("\n--------- Parsing Arguments ---------"); -parseArgs(); - -// The canvas needs to be initialized before any gui scripts are run since -// some of the controls assume that the canvas exists at load time. -createCanvas($appName); +ModuleDatabase.setModuleExtension("module"); +ModuleDatabase.scanModules( "core", false ); +ModuleDatabase.LoadExplicit( "CoreModule" ); //----------------------------------------------------------------------------- -// Load console. -exec("core/console/main.cs"); - -// Init the physics plugin. -physicsInit(); - -sfxStartup(); - -// Set up networking. -setNetPort(0); - -// Start processing file change events. -startFileChangeNotifications(); - -// If we have editors, initialize them here as well -if (isToolBuild()) -{ - if(isFile("tools/main.cs") && !$isDedicated) - exec("tools/main.cs"); -} - -ModuleDatabase.setModuleExtension("module"); +// Load any gameplay modules ModuleDatabase.scanModules( "data", false ); ModuleDatabase.LoadGroup( "Game" ); @@ -85,14 +58,4 @@ else closeSplashWindow(); } -echo("Engine initialized..."); - -//----------------------------------------------------------------------------- -// Called when the engine is shutting down. -function onExit() -{ - // Stop file change events. - stopFileChangeNotifications(); - - ModuleDatabase.UnloadExplicit( "Game" ); -} \ No newline at end of file +echo("Engine initialized..."); \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/levels/BlankRoom.postfxpreset.cs b/Templates/BaseGame/game/tools/levels/BlankRoom.postfxpreset.cs index 8b616a84a..23a6c3ced 100644 --- a/Templates/BaseGame/game/tools/levels/BlankRoom.postfxpreset.cs +++ b/Templates/BaseGame/game/tools/levels/BlankRoom.postfxpreset.cs @@ -1,4 +1,4 @@ -$PostFXManager::Settings::ColorCorrectionRamp = "core/images/null_color_ramp.png"; +$PostFXManager::Settings::ColorCorrectionRamp = "core/postFX/images/null_color_ramp.png"; $PostFXManager::Settings::DOF::BlurCurveFar = ""; $PostFXManager::Settings::DOF::BlurCurveNear = ""; $PostFXManager::Settings::DOF::BlurMax = ""; diff --git a/Templates/Full/game/tools/convexEditor/images/occluderProxyImage.png b/Templates/Full/game/tools/convexEditor/images/occluderProxyImage.png new file mode 100644 index 000000000..51fe109f4 Binary files /dev/null and b/Templates/Full/game/tools/convexEditor/images/occluderProxyImage.png differ diff --git a/Templates/Full/game/tools/convexEditor/images/portalProxyImage.png b/Templates/Full/game/tools/convexEditor/images/portalProxyImage.png new file mode 100644 index 000000000..3828f437c Binary files /dev/null and b/Templates/Full/game/tools/convexEditor/images/portalProxyImage.png differ diff --git a/Templates/Full/game/tools/convexEditor/images/triggerProxyImage.png b/Templates/Full/game/tools/convexEditor/images/triggerProxyImage.png new file mode 100644 index 000000000..f21c4c9ad Binary files /dev/null and b/Templates/Full/game/tools/convexEditor/images/triggerProxyImage.png differ diff --git a/Templates/Full/game/tools/convexEditor/images/zoneProxyImage.png b/Templates/Full/game/tools/convexEditor/images/zoneProxyImage.png new file mode 100644 index 000000000..323e17498 Binary files /dev/null and b/Templates/Full/game/tools/convexEditor/images/zoneProxyImage.png differ diff --git a/Templates/Full/game/tools/convexEditor/materials.cs b/Templates/Full/game/tools/convexEditor/materials.cs new file mode 100644 index 000000000..c184f41e8 --- /dev/null +++ b/Templates/Full/game/tools/convexEditor/materials.cs @@ -0,0 +1,39 @@ +singleton Material( ZoneProxyMaterial ) +{ + mapTo = "ZoneProxyMaterial"; + diffuseMap[0] = "./images/zoneProxyImage"; + materialTag0 = "TestMaterial"; + translucent = true; + translucentBlendOp = "LerpAlpha"; + castShadows = false; +}; + +singleton Material( TriggerProxyMaterial ) +{ + mapTo = "TriggerProxyMaterial"; + diffuseMap[0] = "./images/triggerProxyImage"; + materialTag0 = "TestMaterial"; + translucent = true; + translucentBlendOp = "LerpAlpha"; + castShadows = false; +}; + +singleton Material( PortalProxyMaterial ) +{ + mapTo = "PortalProxyMaterial"; + diffuseMap[0] = "./images/portalProxyImage"; + materialTag0 = "TestMaterial"; + translucent = true; + translucentBlendOp = "LerpAlpha"; + castShadows = false; +}; + +singleton Material( OccluderProxyMaterial ) +{ + mapTo = "OccluderProxyMaterial"; + diffuseMap[0] = "./images/occluderProxyImage"; + materialTag0 = "TestMaterial"; + translucent = true; + translucentBlendOp = "LerpAlpha"; + castShadows = false; +}; \ No newline at end of file diff --git a/Templates/Modules/vr/VR.cs b/Templates/Modules/vr/VR.cs new file mode 100644 index 000000000..ea0ffd7a5 --- /dev/null +++ b/Templates/Modules/vr/VR.cs @@ -0,0 +1,9 @@ + +function VR::onCreate(%this) +{ + exec("./scripts/oculusVR.cs"); +} + +function VR::onDestroy(%this) +{ +} \ No newline at end of file diff --git a/Templates/Modules/vr/VR.module b/Templates/Modules/vr/VR.module new file mode 100644 index 000000000..14ccec0e0 --- /dev/null +++ b/Templates/Modules/vr/VR.module @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/Templates/BaseGame/game/core/oculusVROverlay.gui b/Templates/Modules/vr/guis/oculusVROverlay.gui similarity index 100% rename from Templates/BaseGame/game/core/oculusVROverlay.gui rename to Templates/Modules/vr/guis/oculusVROverlay.gui diff --git a/Templates/BaseGame/game/core/oculusVR.cs b/Templates/Modules/vr/scripts/oculusVR.cs similarity index 99% rename from Templates/BaseGame/game/core/oculusVR.cs rename to Templates/Modules/vr/scripts/oculusVR.cs index b0d7eb0b8..fa9562c18 100644 --- a/Templates/BaseGame/game/core/oculusVR.cs +++ b/Templates/Modules/vr/scripts/oculusVR.cs @@ -164,7 +164,7 @@ function enableOculusVRDisplay(%gameConnection, %trueStereoRendering) if (!isObject(OculusVROverlay)) { - exec("./oculusVROverlay.gui"); + exec("core/vr/guis/oculusVROverlay.gui"); } OculusCanvas.setContent(OculusVROverlay); diff --git a/Tools/CMake/modules/module_physx3.cmake b/Tools/CMake/modules/module_physx3.cmake index 5545120ee..a53075441 100644 --- a/Tools/CMake/modules/module_physx3.cmake +++ b/Tools/CMake/modules/module_physx3.cmake @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2015 GarageGames, LLC +# Copyright (c) 2017 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 @@ -20,16 +20,18 @@ # IN THE SOFTWARE. # ----------------------------------------------------------------------------- -# module Physx 3.3 +# module Physx 3.4 -option(TORQUE_PHYSICS_PHYSX3 "Use PhysX 3.3 physics" OFF) +#do note the inconsistent upper/lower case nvidia use for directory names in physx + +option(TORQUE_PHYSICS_PHYSX3 "Use PhysX 3.4 physics" OFF) if( NOT TORQUE_PHYSICS_PHYSX3 ) - return() + return() endif() if("${PHYSX3_BASE_PATH}" STREQUAL "") - set(PHYSX3_BASE_PATH "" CACHE PATH "PhysX 3.3 path" FORCE) + set(PHYSX3_BASE_PATH "" CACHE PATH "PhysX 3.4 path" FORCE) endif() #still no path we can't go any further @@ -39,63 +41,176 @@ if("${PHYSX3_BASE_PATH}" STREQUAL "") endif() #set physx path -set(PHYSX3_PATH "${PHYSX3_BASE_PATH}/PhysXSDK") +set(PHYSX3_PATH "${PHYSX3_BASE_PATH}/PhysX_3.4") -# TODO linux support +# Windows/ Visual Studio if(MSVC) if(TORQUE_CPU_X32) - if(MSVC11) - set(PHYSX3_LIBPATH_PREFIX vc11win32) - elseif(MSVC12) - set(PHYSX3_LIBPATH_PREFIX vc12win32) - elseif(MSVC14) - set(PHYSX3_LIBPATH_PREFIX vc14win32) - else() - return() - endif() + if(MSVC_VERSION EQUAL 1800 ) + set(PHYSX3_LIBPATH_PREFIX vc12win32) + elseif(MSVC_VERSION EQUAL 1900) + set(PHYSX3_LIBPATH_PREFIX vc14win32) + elseif(MSVC_VERSION GREATER_EQUAL 1910) + set(PHYSX3_LIBPATH_PREFIX vc15win32) + else() + message(FATAL_ERROR "This version of VS is not supported") + return() + endif() set(PHYSX3_LIBNAME_POSTFIX _x86) elseif(TORQUE_CPU_X64) - if(MSVC11) - set(PHYSX3_LIBPATH_PREFIX vc11win64) - elseif(MSVC12) - set(PHYSX3_LIBPATH_PREFIX vc12win64) - elseif(MSVC14) - set(PHYSX3_LIBPATH_PREFIX vc14win64) - else() - return() - endif() -set(PHYSX3_LIBNAME_POSTFIX _x64) + if(MSVC_VERSION EQUAL 1800 ) + set(PHYSX3_LIBPATH_PREFIX vc12win64) + elseif(MSVC_VERSION EQUAL 1900) + set(PHYSX3_LIBPATH_PREFIX vc14win64) + elseif(MSVC_VERSION GREATER_EQUAL 1910) + set(PHYSX3_LIBPATH_PREFIX vc15win64) + else() + message(FATAL_ERROR "This version of VS is not supported") + return() + endif() + set(PHYSX3_LIBNAME_POSTFIX _x64) + endif() endif() -endif(MSVC) +# Only suport 64bit on macOS and linux +if(APPLE) + set(PHYSX3_LIBPATH_PREFIX osx64) + set(PHYSX3_LIBNAME_POSTFIX _x64) +elseif(UNIX) + set(PHYSX3_LIBPATH_PREFIX linux64) + set(PHYSX3_LIBNAME_POSTFIX _x64) +endif() -MACRO(FIND_PHYSX3_LIBRARY VARNAME LIBNAME WITHPOSTFIX) +MACRO(FIND_PHYSX3_LIBRARY VARNAME LIBNAME WITHPOSTFIX SEARCHDIR) - set(LIBPOSTFIX "") - if(${WITHPOSTFIX}) - set(LIBPOSTFIX ${PHYSX3_LIBNAME_POSTFIX}) - endif(${WITHPOSTFIX}) - find_library(PHYSX3_${VARNAME}_LIBRARY NAMES ${LIBNAME}${LIBPOSTFIX} - PATHS ${PHYSX3_PATH}/Lib/${PHYSX3_LIBPATH_PREFIX}) - find_library(PHYSX3_${VARNAME}_LIBRARY_DEBUG NAMES ${LIBNAME}DEBUG${LIBPOSTFIX} - PATHS ${PHYSX3_PATH}/Lib/${PHYSX3_LIBPATH_PREFIX}) + set(LIBPOSTFIX "") + if(${WITHPOSTFIX}) + set(LIBPOSTFIX ${PHYSX3_LIBNAME_POSTFIX}) + endif(${WITHPOSTFIX}) + #release + find_library(PHYSX3_${VARNAME}_LIBRARY NAMES ${LIBNAME}${LIBPOSTFIX} PATHS ${SEARCHDIR}${PHYSX3_LIBPATH_PREFIX}) + #debug + find_library(PHYSX3_${VARNAME}_LIBRARY_DEBUG NAMES ${LIBNAME}DEBUG${LIBPOSTFIX} PATHS ${SEARCHDIR}${PHYSX3_LIBPATH_PREFIX}) -ENDMACRO(FIND_PHYSX3_LIBRARY VARNAME LIBNAME) +ENDMACRO() -# Find the Libs, we just use the full path to save playing around with link_directories -FIND_PHYSX3_LIBRARY(CORE PhysX3 1) -FIND_PHYSX3_LIBRARY(COMMON PhysX3Common 1) -FIND_PHYSX3_LIBRARY(COOKING PhysX3Cooking 1) -FIND_PHYSX3_LIBRARY(CHARACTER PhysX3CharacterKinematic 1) -FIND_PHYSX3_LIBRARY(EXTENSIONS PhysX3Extensions 0) -FIND_PHYSX3_LIBRARY(TASK PxTask 0) -FIND_PHYSX3_LIBRARY(DEBUGGER PhysXVisualDebuggerSDK 0) -FIND_PHYSX3_LIBRARY(PROFILE PhysXProfileSDK 0) +# Find the Libs +if( WIN32 ) + FIND_PHYSX3_LIBRARY(CORE PhysX3 1 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(COMMON PhysX3Common 1 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(COOKING PhysX3Cooking 1 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(CHARACTER PhysX3CharacterKinematic 1 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(EXTENSIONS PhysX3Extensions 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(TASK PxTask 1 ${PHYSX3_BASE_PATH}/PxShared/Lib/) + FIND_PHYSX3_LIBRARY(FOUNDATION PxFoundation 1 ${PHYSX3_BASE_PATH}/PxShared/Lib/) + FIND_PHYSX3_LIBRARY(PVD PxPvdSDK 1 ${PHYSX3_BASE_PATH}/PxShared/Lib/) + + if(NOT PHYSX3_CORE_LIBRARY) + message(FATAL_ERROR "Could not find core PhysX lib") + return() + endif() + + #Add the libs + set(PHYSX_LIBRARIES + ${PHYSX3_CORE_LIBRARY} + ${PHYSX3_COMMON_LIBRARY} + ${PHYSX3_EXTENSIONS_LIBRARY} + ${PHYSX3_COOKING_LIBRARY} + ${PHYSX3_CHARACTER_LIBRARY} + ${PHYSX3_TASK_LIBRARY} + ${PHYSX3_PVD_LIBRARY} + ${PHYSX3_FOUNDATION_LIBRARY} + ) + + set(PHYSX_LIBRARIES_DEBUG + ${PHYSX3_CORE_LIBRARY_DEBUG} + ${PHYSX3_COMMON_LIBRARY_DEBUG} + ${PHYSX3_EXTENSIONS_LIBRARY_DEBUG} + ${PHYSX3_COOKING_LIBRARY_DEBUG} + ${PHYSX3_CHARACTER_LIBRARY_DEBUG} + ${PHYSX3_TASK_LIBRARY_DEBUG} + ${PHYSX3_PVD_LIBRARY_DEBUG} + ${PHYSX3_FOUNDATION_LIBRARY_DEBUG} + ) +#macOS & linux +elseif(UNIX) + #common + FIND_PHYSX3_LIBRARY(EXTENSIONS PhysX3Extensions 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(CONTROLLER SimulationController 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(SCENEQUERY SceneQuery 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(LOWLEVEL LowLevel 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(LOWLEVEL_DYNAMICS LowLevelDynamics 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(LOWLEVEL_AABB LowLevelAABB 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(LOWLEVEL_CLOTH LowLevelCloth 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(LOWLEVEL_PARTICLES LowLevelParticles 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(TASK PxTask 0 ${PHYSX3_BASE_PATH}/PxShared/lib/) + #platform dependent + if(APPLE) + FIND_PHYSX3_LIBRARY(CORE PhysX3 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(COMMON PhysX3Common 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(COOKING PhysX3Cooking 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(CHARACTER PhysX3CharacterKinematic 0 ${PHYSX3_PATH}/Lib/) + FIND_PHYSX3_LIBRARY(FOUNDATION PxFoundation 0 ${PHYSX3_BASE_PATH}/PxShared/lib/) + FIND_PHYSX3_LIBRARY(PVD PxPvdSDK 0 ${PHYSX3_BASE_PATH}/PxShared/lib/) + else() #linux + FIND_PHYSX3_LIBRARY(CORE PhysX3 1 ${PHYSX3_PATH}/Bin/) + FIND_PHYSX3_LIBRARY(COMMON PhysX3Common 1 ${PHYSX3_PATH}/Bin/) + FIND_PHYSX3_LIBRARY(GPU PhysX3Gpu 1 ${PHYSX3_PATH}/Bin/) + FIND_PHYSX3_LIBRARY(CHARACTER PhysX3CharacterKinematic 1 ${PHYSX3_PATH}/Bin/) + FIND_PHYSX3_LIBRARY(COOKING PhysX3Cooking 1 ${PHYSX3_PATH}/Bin/) + FIND_PHYSX3_LIBRARY(FOUNDATION PxFoundation 1 ${PHYSX3_BASE_PATH}/PxShared/bin/) + FIND_PHYSX3_LIBRARY(PVD PxPvdSDK 1 ${PHYSX3_BASE_PATH}/PxShared/bin/) + FIND_PHYSX3_LIBRARY(XML PsFastXml 0 ${PHYSX3_BASE_PATH}/PxShared/lib/) + endif() + + if(NOT PHYSX3_CORE_LIBRARY) + message(FATAL_ERROR "Could not find core PhysX lib") + return() + endif() + + #Add the libs + set(PHYSX_LIBRARIES + ${PHYSX3_CORE_LIBRARY} + ${PHYSX3_CHARACTER_LIBRARY} + ${PHYSX3_COOKING_LIBRARY} + ${PHYSX3_COMMON_LIBRARY} + ${PHYSX3_GPU_LIBRARY} + ${PHYSX3_EXTENSIONS_LIBRARY} + ${PHYSX3_CONTROLLER_LIBRARY} + ${PHYSX3_SCENEQUERY_LIBRARY} + ${PHYSX3_LOWLEVEL_LIBRARY} + ${PHYSX3_LOWLEVEL_AABB_LIBRARY} + ${PHYSX3_LOWLEVEL_DYNAMICS_LIBRARY} + ${PHYSX3_LOWLEVEL_CLOTH_LIBRARY} + ${PHYSX3_LOWLEVEL_PARTICLES_LIBRARY} + ${PHYSX3_TASK_LIBRARY} + ${PHYSX3_XML_LIBRARY} + ${PHYSX3_FOUNDATION_LIBRARY} + ${PHYSX3_PVD_LIBRARY} + ) + + set(PHYSX_LIBRARIES_DEBUG + ${PHYSX3_CORE_LIBRARY_DEBUG} + ${PHYSX3_CHARACTER_LIBRARY_DEBUG} + ${PHYSX3_COOKING_LIBRARY_DEBUG} + ${PHYSX3_COMMON_LIBRARY_DEBUG} + ${PHYSX3_GPU_LIBRARY_DEBUG} + ${PHYSX3_EXTENSIONS_LIBRARY_DEBUG} + ${PHYSX3_CONTROLLER_LIBRARY_DEBUG} + ${PHYSX3_SCENEQUERY_LIBRARY_DEBUG} + ${PHYSX3_LOWLEVEL_LIBRARY_DEBUG} + ${PHYSX3_LOWLEVEL_AABB_LIBRARY_DEBUG} + ${PHYSX3_LOWLEVEL_DYNAMICS_LIBRARY_DEBUG} + ${PHYSX3_LOWLEVEL_CLOTH_LIBRARY_DEBUG} + ${PHYSX3_LOWLEVEL_PARTICLES_LIBRARY_DEBUG} + ${PHYSX3_TASK_LIBRARY_DEBUG} + ${PHYSX3_XML_LIBRARY_DEBUG} + ${PHYSX3_FOUNDATION_LIBRARY_DEBUG} + ${PHYSX3_PVD_LIBRARY_DEBUG} + ) -if(NOT PHYSX3_CORE_LIBRARY) - return() endif() # Defines @@ -106,56 +221,64 @@ addDef( "TORQUE_PHYSICS_ENABLED" ) addPath( "${srcDir}/T3D/physics/physx3" ) # Includes +addInclude( "${PHYSX3_BASE_PATH}/PxShared/include" ) +addInclude( "${PHYSX3_BASE_PATH}/PxShared/src/foundation/include" ) +addInclude( "${PHYSX3_BASE_PATH}/PxShared/src/pvd/include" ) addInclude( "${PHYSX3_PATH}/Include" ) -addInclude( "${PHYSX3_PATH}/Include/extensions" ) -addInclude( "${PHYSX3_PATH}/Include/foundation" ) -addInclude( "${PHYSX3_PATH}/Include/characterkinematic" ) -addInclude( "${PHYSX3_PATH}/Include/common" ) -#Add the libs -set(PHYSX_LIBRARIES_DEBUG - ${PHYSX3_CORE_LIBRARY_DEBUG} - ${PHYSX3_COMMON_LIBRARY_DEBUG} - ${PHYSX3_COOKING_LIBRARY_DEBUG} - ${PHYSX3_CHARACTER_LIBRARY_DEBUG} - ${PHYSX3_EXTENSIONS_LIBRARY_DEBUG} - ${PHYSX3_TASK_LIBRARY_DEBUG} - ${PHYSX3_DEBUGGER_LIBRARY_DEBUG} - ${PHYSX3_PROFILE_LIBRARY_DEBUG} -) +# Libs +addLibRelease( "${PHYSX_LIBRARIES}" ) +addLibDebug( "${PHYSX_LIBRARIES_DEBUG}" ) -set(PHYSX_LIBRARIES - ${PHYSX3_CORE_LIBRARY} - ${PHYSX3_COMMON_LIBRARY} - ${PHYSX3_COOKING_LIBRARY} - ${PHYSX3_CHARACTER_LIBRARY} - ${PHYSX3_EXTENSIONS_LIBRARY} - ${PHYSX3_TASK_LIBRARY} - ${PHYSX3_DEBUGGER_LIBRARY} - ${PHYSX3_PROFILE_LIBRARY} -) - -addLibRelease("${PHYSX_LIBRARIES}") -addLibDebug("${PHYSX_LIBRARIES_DEBUG}") - -#Install dll files +#Install files if( WIN32 ) - # File Copy for Release - INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Release") - INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3CharacterKinematic${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Release") - INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3Common${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Release") - INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3Cooking${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Release") + # File Copy for Release + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3Gpu${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3CharacterKinematic${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3Common${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3Cooking${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_BASE_PATH}/PxShared/bin/${PHYSX3_LIBPATH_PREFIX}/PxFoundation${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_BASE_PATH}/PxShared/bin/${PHYSX3_LIBPATH_PREFIX}/PxPvdSDK${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) - # File Copy for Debug - if(TORQUE_CPU_X32) - INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/nvToolsExt32_1.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Debug") - elseif(TORQUE_CPU_X64) - INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/nvToolsExt64_1.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Debug") - endif() - - INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3DEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Debug") - INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3CharacterKinematicDEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Debug") - INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3CommonDEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Debug") - INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3CookingDEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Debug") - -endif(WIN32) + # File Copy + if(TORQUE_CPU_X32) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysXDevice.dll" DESTINATION "${projectOutDir}") + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/nvToolsExt32_1.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + elseif(TORQUE_CPU_X64) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysXDevice64.dll" DESTINATION "${projectOutDir}") + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/nvToolsExt64_1.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + endif() + + #File copy for Debug + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3DEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3GpuDEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3CharacterKinematicDEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3CommonDEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/PhysX3CookingDEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_BASE_PATH}/PxShared/bin/${PHYSX3_LIBPATH_PREFIX}/PxFoundationDEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_BASE_PATH}/PxShared/bin/${PHYSX3_LIBPATH_PREFIX}/PxPvdSDKDEBUG${PHYSX3_LIBNAME_POSTFIX}.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + +endif() + +#linux - apple xcode physx build generates static libs +if(UNIX AND NOT APPLE) + # File Copy for Release + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/libPhysX3${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/libPhysX3CharacterKinematic${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/libPhysX3Common${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/libPhysX3Cooking${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_BASE_PATH}/PxShared/bin/${PHYSX3_LIBPATH_PREFIX}/libPxFoundation${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_BASE_PATH}/PxShared/bin/${PHYSX3_LIBPATH_PREFIX}/libPxPvdSDK${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/libPhysX3Gpu${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Release) + + # File Copy for Debug + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/libPhysX3DEBUG${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/libPhysX3CharacterKinematicDEBUG${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/libPhysX3CommonDEBUG${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/libPhysX3CookingDEBUG${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_BASE_PATH}/PxShared/bin/${PHYSX3_LIBPATH_PREFIX}/libPxFoundationDEBUG${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_BASE_PATH}/PxShared/bin/${PHYSX3_LIBPATH_PREFIX}/libPxPvdSDKDEBUG${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + INSTALL(FILES "${PHYSX3_PATH}/Bin/${PHYSX3_LIBPATH_PREFIX}/libPhysX3GpuDEBUG${PHYSX3_LIBNAME_POSTFIX}.so" DESTINATION "${projectOutDir}" CONFIGURATIONS Debug) + +endif()