From 5ff292478bd62010247cec3c95cf14bfbacc7ec3 Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 6 Aug 2011 13:42:13 +0000 Subject: [PATCH] Adaptations to GD2. git-svn-id: svn://localhost@478 8062f311-0dae-4547-b526-b8ab9ac864a5 --- Extensions/TextObject/Extension.cpp | 148 +- Extensions/TextObject/TextActions.cpp | 124 - Extensions/TextObject/TextConditions.cpp | 104 - Extensions/TextObject/TextExpressions.cpp | 46 - Extensions/TextObject/TextExtension.cbp | 146 +- Extensions/TextObject/TextExtension.depend | 16026 +++++++++++++++++++ Extensions/TextObject/TextExtension.layout | 29 +- Extensions/TextObject/TextObject.cpp | 11 + Extensions/TextObject/TextObject.h | 28 +- Extensions/TextObject/TextObjectEditor.cpp | 138 +- Extensions/TextObject/TextObjectEditor.h | 60 +- 11 files changed, 16339 insertions(+), 521 deletions(-) delete mode 100644 Extensions/TextObject/TextActions.cpp delete mode 100644 Extensions/TextObject/TextConditions.cpp delete mode 100644 Extensions/TextObject/TextExpressions.cpp diff --git a/Extensions/TextObject/Extension.cpp b/Extensions/TextObject/Extension.cpp index ab2e578b7d..7cd8feba60 100644 --- a/Extensions/TextObject/Extension.cpp +++ b/Extensions/TextObject/Extension.cpp @@ -53,7 +53,10 @@ class Extension : public ExtensionBase _("Objet affichant un texte"), "Extensions/texticon.png", &CreateTextObject, - &DestroyTextObject); + &DestroyTextObject, + "TextObject"); + + objInfos.SetIncludeFile("TextObject/TextObject.h"); DECLARE_OBJECT_ACTION("String", _("Modifier le texte"), @@ -61,13 +64,13 @@ class Extension : public ExtensionBase _("Faire _PARAM2__PARAM1_ au texte de _PARAM0_"), _("Texte"), "res/actions/text24.png", - "res/actions/text.png", - &TextObject::ActString); + "res/actions/text.png"); - DECLARE_PARAMETER("object", _("Objet"), true, "Text") - DECLARE_PARAMETER("text", _("Texte"), false, "") - DECLARE_PARAMETER("signe", _("Signe de la modification"), false, "") - MAIN_OBJECTS_IN_PARAMETER(0) + instrInfo.AddParameter("object", _("Objet"), "Text", false); + instrInfo.AddParameter("string", _("Texte"), "", false); + instrInfo.AddParameter("operator", _("Signe de la modification"), "", false); + + instrInfo.cppCallingInformation.SetFunctionName("SetString").SetManipulatedType("string").SetAssociatedGetter("GetString").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_ACTION() @@ -77,13 +80,13 @@ class Extension : public ExtensionBase _("Le texte de _PARAM0_ est _PARAM2_ à _PARAM1_"), _("Texte"), "res/conditions/text24.png", - "res/conditions/text.png", - &TextObject::CondString); + "res/conditions/text.png"); - DECLARE_PARAMETER("object", _("Objet"), true, "Text") - DECLARE_PARAMETER("text", _("Texte à tester"), false, "") - DECLARE_PARAMETER("signe", _("Signe du test"), false, "") - MAIN_OBJECTS_IN_PARAMETER(0) + instrInfo.AddParameter("object", _("Objet"), "Text", false); + instrInfo.AddParameter("string", _("Texte à tester"), "", false); + instrInfo.AddParameter("relationalOperator", _("Signe du test"), "", false); + + instrInfo.cppCallingInformation.SetFunctionName("GetString").SetManipulatedType("string").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_CONDITION() @@ -93,12 +96,13 @@ class Extension : public ExtensionBase _("Changer la police de _PARAM0_ en _PARAM1_"), _("Police"), "res/actions/font24.png", - "res/actions/font.png", - &TextObject::ActFont); + "res/actions/font.png"); - DECLARE_PARAMETER("object", _("Objet"), true, "Text") - DECLARE_PARAMETER("police", _("Valeur"), false, "") - MAIN_OBJECTS_IN_PARAMETER(0) + instrInfo.AddParameter("object", _("Objet"), "Text", false); + instrInfo.AddParameter("police", _("Valeur"), "", false); + + + instrInfo.cppCallingInformation.SetFunctionName("SetFont").SetManipulatedType("string").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_ACTION() @@ -108,13 +112,14 @@ class Extension : public ExtensionBase _("Faire _PARAM2__PARAM1_ à la taille du texte de _PARAM0_"), _("Taille"), "res/actions/characterSize24.png", - "res/actions/characterSize.png", - &TextObject::ActSize); + "res/actions/characterSize.png"); - DECLARE_PARAMETER("object", _("Objet"), true, "Text") - DECLARE_PARAMETER("expression", _("Valeur"), false, "") - DECLARE_PARAMETER("signe", _("Signe de la modification"), false, "") - MAIN_OBJECTS_IN_PARAMETER(0) + instrInfo.AddParameter("object", _("Objet"), "Text", false); + instrInfo.AddParameter("expression", _("Valeur"), "", false); + instrInfo.AddParameter("operator", _("Signe de la modification"), "", false); + + + instrInfo.cppCallingInformation.SetFunctionName("SetCharacterSize").SetManipulatedType("number").SetAssociatedGetter("GetCharacterSize").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_ACTION() @@ -124,13 +129,14 @@ class Extension : public ExtensionBase _("La taille du texte de _PARAM0_ est _PARAM2_ à _PARAM1_"), _("Taille"), "res/conditions/characterSize24.png", - "res/conditions/characterSize.png", - &TextObject::CondSize); + "res/conditions/characterSize.png"); - DECLARE_PARAMETER("object", _("Objet"), true, "Text") - DECLARE_PARAMETER("expression", _("Taille à tester"), false, "") - DECLARE_PARAMETER("signe", _("Signe du test"), false, "") - MAIN_OBJECTS_IN_PARAMETER(0) + instrInfo.AddParameter("object", _("Objet"), "Text", false); + instrInfo.AddParameter("expression", _("Taille à tester"), "", false); + instrInfo.AddParameter("relationalOperator", _("Signe du test"), "", false); + + + instrInfo.cppCallingInformation.SetFunctionName("GetCharacterSize").SetManipulatedType("number").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_CONDITION() @@ -140,12 +146,13 @@ class Extension : public ExtensionBase _("Changer la couleur de _PARAM0_ en _PARAM1_"), _("Effets"), "res/actions/color24.png", - "res/actions/color.png", - &TextObject::ActChangeColor); + "res/actions/color.png"); - DECLARE_PARAMETER("object", _("Objet"), true, "Text") - DECLARE_PARAMETER("color", _("Couleur"), false, "") - MAIN_OBJECTS_IN_PARAMETER(0) + instrInfo.AddParameter("object", _("Objet"), "Text", false); + instrInfo.AddParameter("color", _("Couleur"), "", false); + + + instrInfo.cppCallingInformation.SetFunctionName("SetColor").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_ACTION() @@ -155,13 +162,14 @@ class Extension : public ExtensionBase _("Faire _PARAM2__PARAM1_ à l'opacité de _PARAM0_"), _("Visibilité"), "res/actions/opacity24.png", - "res/actions/opacity.png", - &TextObject::ActOpacity); + "res/actions/opacity.png"); - DECLARE_PARAMETER("object", _("Objet"), true, "Text") - DECLARE_PARAMETER("expression", _("Valeur"), false, "") - DECLARE_PARAMETER("signe", _("Signe de la modification"), false, "") - MAIN_OBJECTS_IN_PARAMETER(0) + instrInfo.AddParameter("object", _("Objet"), "Text", false); + instrInfo.AddParameter("expression", _("Valeur"), "", false); + instrInfo.AddParameter("operator", _("Signe de la modification"), "", false); + + + instrInfo.cppCallingInformation.SetFunctionName("SetOpacity").SetManipulatedType("number").SetAssociatedGetter("GetOpacity").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_ACTION() @@ -171,13 +179,15 @@ class Extension : public ExtensionBase _("L'opacité de _PARAM0_ est _PARAM2_ à _PARAM1_"), _("Visibilité"), "res/conditions/opacity24.png", - "res/conditions/opacity.png", - &TextObject::CondOpacity); + "res/conditions/opacity.png"); + + instrInfo.AddParameter("object", _("Objet"), "Text", false); + instrInfo.AddParameter("expression", _("Valeur à tester"), "", false); + instrInfo.AddParameter("relationalOperator", _("Signe du test"), "", false); + + + instrInfo.cppCallingInformation.SetFunctionName("GetOpacity").SetManipulatedType("number").SetIncludeFile("TextObject/TextObject.h"); - DECLARE_PARAMETER("object", _("Objet"), true, "Text") - DECLARE_PARAMETER("expression", _("Valeur à tester"), false, "") - DECLARE_PARAMETER("signe", _("Signe du test"), false, "") - MAIN_OBJECTS_IN_PARAMETER(0) DECLARE_END_OBJECT_CONDITION() @@ -188,13 +198,14 @@ class Extension : public ExtensionBase _("Faire _PARAM2__PARAM1_ à l'angle de _PARAM0_"), _("Rotation"), "res/actions/rotate24.png", - "res/actions/rotate.png", - &TextObject::ActAngle); + "res/actions/rotate.png"); - DECLARE_PARAMETER("object", _("Objet"), true, "Text") - DECLARE_PARAMETER("expression", _("Valeur"), false, "") - DECLARE_PARAMETER("signe", _("Signe de la modification"), false, "") - MAIN_OBJECTS_IN_PARAMETER(0) + instrInfo.AddParameter("object", _("Objet"), "Text", false); + instrInfo.AddParameter("expression", _("Valeur"), "", false); + instrInfo.AddParameter("operator", _("Signe de la modification"), "", false); + + + instrInfo.cppCallingInformation.SetFunctionName("SetAngle").SetManipulatedType("number").SetAssociatedGetter("GetAngle").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_ACTION() @@ -204,26 +215,33 @@ class Extension : public ExtensionBase _("L'angle de _PARAM0_ est _PARAM2_ à _PARAM1_"), _("Rotation"), "res/conditions/rotate24.png", - "res/conditions/rotate.png", - &TextObject::CondAngle); + "res/conditions/rotate.png"); - DECLARE_PARAMETER("object", _("Objet"), true, "Text") - DECLARE_PARAMETER("expression", _("Valeur à tester"), false, "") - DECLARE_PARAMETER("signe", _("Signe du test"), false, "") - MAIN_OBJECTS_IN_PARAMETER(0) + instrInfo.AddParameter("object", _("Objet"), "Text", false); + instrInfo.AddParameter("expression", _("Valeur à tester"), "", false); + instrInfo.AddParameter("relationalOperator", _("Signe du test"), "", false); + + + instrInfo.cppCallingInformation.SetFunctionName("GetAngle").SetManipulatedType("number").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_CONDITION() - DECLARE_OBJECT_EXPRESSION("Opacity", _("Opacité"), _("Opacité"), _("Opacité"), "res/actions/opacity.png", &TextObject::ExpOpacity) - DECLARE_PARAMETER("object", _("Objet"), true, "Text") + DECLARE_OBJECT_EXPRESSION("Opacity", _("Opacité"), _("Opacité"), _("Opacité"), "res/actions/opacity.png") + instrInfo.AddParameter("object", _("Objet"), "Text", false); + + instrInfo.cppCallingInformation.SetFunctionName("GetOpacity").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_EXPRESSION() - DECLARE_OBJECT_EXPRESSION("Angle", _("Angle"), _("Angle"), _("Rotation"), "res/actions/rotate.png", &TextObject::ExpAngle) - DECLARE_PARAMETER("object", _("Objet"), true, "Text") + DECLARE_OBJECT_EXPRESSION("Angle", _("Angle"), _("Angle"), _("Rotation"), "res/actions/rotate.png") + instrInfo.AddParameter("object", _("Objet"), "Text", false); + + instrInfo.cppCallingInformation.SetFunctionName("GetAngle").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_EXPRESSION() - DECLARE_OBJECT_STR_EXPRESSION("String", _("Texte"), _("Texte"), _("Texte"), "res/texteicon.png", &TextObject::ExpString) - DECLARE_PARAMETER("object", _("Objet"), true, "Text") + DECLARE_OBJECT_STR_EXPRESSION("String", _("Texte"), _("Texte"), _("Texte"), "res/texteicon.png") + instrInfo.AddParameter("object", _("Objet"), "Text", false); + + instrInfo.cppCallingInformation.SetFunctionName("GetString").SetIncludeFile("TextObject/TextObject.h"); DECLARE_END_OBJECT_STR_EXPRESSION() DECLARE_END_OBJECT() diff --git a/Extensions/TextObject/TextActions.cpp b/Extensions/TextObject/TextActions.cpp deleted file mode 100644 index b4d7f02156..0000000000 --- a/Extensions/TextObject/TextActions.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/** - -Game Develop - Text Object Extension -Copyright (c) 2008-2011 Florian Rival (Florian.Rival@gmail.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. - -*/ - -#include "TextObject.h" - -#include "GDL/Instruction.h" -#include "GDL/ObjectsConcerned.h" -#include "GDL/RuntimeScene.h" -#include "GDL/CommonTools.h" - - -/** - * Change the string - */ -bool TextObject::ActString( RuntimeScene & scene, ObjectsConcerned & objectsConcerned, const Instruction & action ) -{ - if ( action.GetParameter(2).GetAsModOperator() == GDExpression::Set ) - SetString( action.GetParameter(1).GetAsTextExpressionResult(scene, objectsConcerned, shared_from_this()) ); - else if ( action.GetParameter(2).GetAsModOperator() == GDExpression::Add ) - SetString( GetString() + action.GetParameter(1).GetAsTextExpressionResult(scene, objectsConcerned, shared_from_this()) ); - - return true; -} - -bool TextObject::ActFont( RuntimeScene & scene, ObjectsConcerned & objectsConcerned, const Instruction & action ) -{ - SetFont(action.GetParameter(1).GetAsTextExpressionResult(scene, objectsConcerned, shared_from_this())); - - return true; -} - - -bool TextObject::ActSize( RuntimeScene & scene, ObjectsConcerned & objectsConcerned, const Instruction & action ) -{ - if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Set ) - SetCharacterSize( static_cast(action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this()))); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Add ) - SetCharacterSize( GetCharacterSize() + static_cast(action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this()))); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Substract ) - SetCharacterSize( GetCharacterSize() - static_cast(action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this()))); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Multiply ) - SetCharacterSize( GetCharacterSize() * static_cast(action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this()))); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Divide ) - SetCharacterSize( GetCharacterSize() / static_cast(action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this()))); - - return true; -} - - -/** - * Modify opacity - */ -bool TextObject::ActOpacity( RuntimeScene & scene, ObjectsConcerned & objectsConcerned, const Instruction & action ) -{ - if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Set ) - SetOpacity( action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this())); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Add ) - SetOpacity( GetOpacity() + action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this())); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Substract ) - SetOpacity( GetOpacity() - action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this())); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Multiply ) - SetOpacity( GetOpacity() * action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this())); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Divide ) - SetOpacity( GetOpacity() / action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this())); - - return true; -} - -/** - * Change the color of the texte - */ -bool TextObject::ActChangeColor( RuntimeScene & scene, ObjectsConcerned & objectsConcerned, const Instruction & action ) -{ - vector < string > colors = SpliterStringToVector (action.GetParameter(1).GetAsTextExpressionResult(scene, objectsConcerned, shared_from_this()), ';'); - - if ( colors.size() < 3 ) return false; //La couleur est incorrecte - - SetColor(ToInt(colors[0]),ToInt(colors[1]),ToInt(colors[2])); - - return true; -} - - -/** - * Modify angle - */ -bool TextObject::ActAngle( RuntimeScene & scene, ObjectsConcerned & objectsConcerned, const Instruction & action ) -{ - if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Set ) - SetAngle( static_cast(action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this()))); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Add ) - SetAngle( GetAngle() + static_cast(action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this()))); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Substract ) - SetAngle( GetAngle() - static_cast(action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this()))); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Multiply ) - SetAngle( GetAngle() * static_cast(action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this()))); - else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Divide ) - SetAngle( GetAngle() / static_cast(action.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this()))); - - return true; -} diff --git a/Extensions/TextObject/TextConditions.cpp b/Extensions/TextObject/TextConditions.cpp deleted file mode 100644 index c78457da86..0000000000 --- a/Extensions/TextObject/TextConditions.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/** - -Game Develop - Text Object Extension -Copyright (c) 2008-2011 Florian Rival (Florian.Rival@gmail.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. - -*/ - -#include "TextObject.h" - -#include "GDL/Instruction.h" -#include "GDL/ObjectsConcerned.h" -#include "GDL/RuntimeScene.h" - - -/** - * Test the string - */ -bool TextObject::CondString( RuntimeScene & scene, ObjectsConcerned & objectsConcerned, const Instruction & condition ) -{ - if (( condition.GetParameter(2).GetAsCompOperator() == GDExpression::Equal && string(text.GetString()) == condition.GetParameter(1).GetAsTextExpressionResult(scene, objectsConcerned, shared_from_this()) ) || - ( condition.GetParameter(2).GetAsCompOperator() == GDExpression::Different && string(text.GetString()) != condition.GetParameter(1).GetAsTextExpressionResult(scene, objectsConcerned, shared_from_this()) ) - ) - { - return true; - } - - return false; -} - -bool TextObject::CondSize( RuntimeScene & scene, ObjectsConcerned & objectsConcerned, const Instruction & condition ) -{ - //optimisation : le test de signe en premier - if (( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Equal && GetCharacterSize() == condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Inferior && GetCharacterSize() < condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Superior && GetCharacterSize() > condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::InferiorOrEqual && GetCharacterSize() <= condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::SuperiorOrEqual && GetCharacterSize() >= condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Different && GetCharacterSize() != condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) - ) - { - return true; - } - - return false; -} - -/** - * Test the opacity - */ -bool TextObject::CondOpacity( RuntimeScene & scene, ObjectsConcerned & objectsConcerned, const Instruction & condition ) -{ - //optimisation : le test de signe en premier - if (( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Equal && GetOpacity() == condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Inferior && GetOpacity() < condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Superior && GetOpacity() > condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::InferiorOrEqual && GetOpacity() <= condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::SuperiorOrEqual && GetOpacity() >= condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Different && GetOpacity() != condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) - ) - { - return true; - } - - return false; -} - -/** - * Test the angle - */ -bool TextObject::CondAngle( RuntimeScene & scene, ObjectsConcerned & objectsConcerned, const Instruction & condition ) -{ - //optimisation : le test de signe en premier - if (( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Equal && GetAngle() == condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Inferior && GetAngle() < condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Superior && GetAngle() > condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::InferiorOrEqual && GetAngle() <= condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::SuperiorOrEqual && GetAngle() >= condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) || - ( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Different && GetAngle() != condition.GetParameter( 1 ).GetAsMathExpressionResult(scene, objectsConcerned, shared_from_this() ) ) - ) - { - return true; - } - - return false; -} diff --git a/Extensions/TextObject/TextExpressions.cpp b/Extensions/TextObject/TextExpressions.cpp deleted file mode 100644 index 282bf8da4b..0000000000 --- a/Extensions/TextObject/TextExpressions.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - -Game Develop - Text Object Extension -Copyright (c) 2008-2011 Florian Rival (Florian.Rival@gmail.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. - -*/ - -#include "GDL/Object.h" -#include "GDL/ExpressionInstruction.h" -#include "GDL/RuntimeScene.h" -#include "GDL/ObjectsConcerned.h" -#include "TextObject.h" - -double TextObject::ExpOpacity( const RuntimeScene & scene, ObjectsConcerned & objectsConcerned, ObjSPtr obj1, ObjSPtr obj2, const ExpressionInstruction & exprInstruction ) -{ - return opacity; -} - -double TextObject::ExpAngle( const RuntimeScene & scene, ObjectsConcerned & objectsConcerned, ObjSPtr obj1, ObjSPtr obj2, const ExpressionInstruction & exprInstruction ) -{ - return angle; -} - -std::string TextObject::ExpString( const RuntimeScene & scene, ObjectsConcerned & objectsConcerned, ObjSPtr obj1, ObjSPtr obj2, const StrExpressionInstruction & exprInstruction ) -{ - return text.GetString(); -} diff --git a/Extensions/TextObject/TextExtension.cbp b/Extensions/TextObject/TextExtension.cbp index 77fba8454e..4def537cda 100644 --- a/Extensions/TextObject/TextExtension.cbp +++ b/Extensions/TextObject/TextExtension.cbp @@ -10,7 +10,7 @@