mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-24 20:05:39 -04:00
73c6e8583c
git-svn-id: svn://localhost@37 8062f311-0dae-4547-b526-b8ab9ac864a5
64 lines
4.2 KiB
C++
64 lines
4.2 KiB
C++
#include "GDL/Access.h"
|
|
#include "GDL/Instruction.h"
|
|
#include "GDL/ObjectsConcerned.h"
|
|
#include "GDL/RuntimeScene.h"
|
|
#include "DrawerObject.h"
|
|
|
|
bool DrawerObject::CondOutlineSize( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & condition, const Evaluateur & eval )
|
|
{
|
|
//optimisation : le test de signe en premier
|
|
if (( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Equal && GetOutlineSize() == eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Inferior && GetOutlineSize() < eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Superior && GetOutlineSize() > eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::InferiorOrEqual && GetOutlineSize() <= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::SuperiorOrEqual && GetOutlineSize() >= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Different && GetOutlineSize() != eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) )
|
|
)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
|
|
/**
|
|
* Test the fill color opacity
|
|
*/
|
|
bool DrawerObject::CondFillOpacity( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & condition, const Evaluateur & eval )
|
|
{
|
|
//optimisation : le test de signe en premier
|
|
if (( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Equal && GetFillOpacity() == eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Inferior && GetFillOpacity() < eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Superior && GetFillOpacity() > eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::InferiorOrEqual && GetFillOpacity() <= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::SuperiorOrEqual && GetFillOpacity() >= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Different && GetFillOpacity() != eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) )
|
|
)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Test the opacity
|
|
*/
|
|
bool DrawerObject::CondOutlineOpacity( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & condition, const Evaluateur & eval )
|
|
{
|
|
//optimisation : le test de signe en premier
|
|
if (( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Equal && GetOutlineOpacity() == eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Inferior && GetOutlineOpacity() < eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Superior && GetOutlineOpacity() > eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::InferiorOrEqual && GetOutlineOpacity() <= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::SuperiorOrEqual && GetOutlineOpacity() >= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
|
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Different && GetOutlineOpacity() != eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) )
|
|
)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|