Skip to content

Commit

Permalink
Rebuild binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhonnyg committed Jan 13, 2025
1 parent c6440fd commit d20844b
Showing 136 changed files with 2,641 additions and 353 deletions.
26 changes: 26 additions & 0 deletions defold-rive/include/rive/advance_flags.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef _RIVE_ADVANCE_FLAGS_HPP_
#define _RIVE_ADVANCE_FLAGS_HPP_

#include "rive/enum_bitset.hpp"

namespace rive
{
enum class AdvanceFlags : unsigned short
{
None = 0,

/// Whether NestedArtboards should advance
AdvanceNested = 1 << 0,

/// Whether the Component should animate when advancing
Animate = 1 << 1,

/// Whether this Component is on the root artboard
IsRoot = 1 << 2,

/// Whether we are advancing to a new frame
NewFrame = 1 << 3,
};
RIVE_MAKE_ENUM_BITSET(AdvanceFlags)
} // namespace rive
#endif
20 changes: 20 additions & 0 deletions defold-rive/include/rive/advancing_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef _RIVE_ADVANCING_COMPONENT_HPP_
#define _RIVE_ADVANCING_COMPONENT_HPP_

#include "rive/advance_flags.hpp"

namespace rive
{
class Component;
class AdvancingComponent
{
public:
virtual bool advanceComponent(
float elapsedSeconds,
AdvanceFlags flags = AdvanceFlags::Animate |
AdvanceFlags::NewFrame) = 0;
static AdvancingComponent* from(Component* component);
};
} // namespace rive

#endif
12 changes: 11 additions & 1 deletion defold-rive/include/rive/animation/blend_animation_direct.hpp
Original file line number Diff line number Diff line change
@@ -4,11 +4,12 @@
#include <stdio.h>
namespace rive
{

class BindableProperty;
enum class DirectBlendSource : unsigned int
{
inputId = 0,
mixValue = 1,
dataBindId = 2,
};

class BlendAnimationDirect : public BlendAnimationDirectBase
@@ -17,7 +18,16 @@ class BlendAnimationDirect : public BlendAnimationDirectBase
StatusCode onAddedDirty(CoreContext* context) override;
StatusCode onAddedClean(CoreContext* context) override;
StatusCode import(ImportStack& importStack) override;
void bindableProperty(BindableProperty* value)
{
m_bindableProperty = value;
};
BindableProperty* bindableProperty() const { return m_bindableProperty; };

private:
BindableProperty* m_bindableProperty;
};

} // namespace rive

#endif
4 changes: 0 additions & 4 deletions defold-rive/include/rive/animation/blend_state_1d.hpp
Original file line number Diff line number Diff line change
@@ -7,10 +7,6 @@ namespace rive
class BlendState1D : public BlendState1DBase
{
public:
bool hasValidInputId() const { return inputId() != Core::emptyId; }

StatusCode import(ImportStack& importStack) override;

std::unique_ptr<StateInstance> makeInstance(
ArtboardInstance*) const override;
};
16 changes: 16 additions & 0 deletions defold-rive/include/rive/animation/blend_state_1d_input.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef _RIVE_BLEND_STATE1_DINPUT_HPP_
#define _RIVE_BLEND_STATE1_DINPUT_HPP_
#include "rive/generated/animation/blend_state_1d_input_base.hpp"
#include <stdio.h>
namespace rive
{
class BlendState1DInput : public BlendState1DInputBase
{
public:
bool hasValidInputId() const { return inputId() != Core::emptyId; }

StatusCode import(ImportStack& importStack) override;
};
} // namespace rive

#endif
20 changes: 20 additions & 0 deletions defold-rive/include/rive/animation/blend_state_1d_viewmodel.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef _RIVE_BLEND_STATE1_DVIEW_MODEL_HPP_
#define _RIVE_BLEND_STATE1_DVIEW_MODEL_HPP_
#include "rive/generated/animation/blend_state_1d_viewmodel_base.hpp"
#include "rive/data_bind/bindable_property.hpp"
#include <stdio.h>
namespace rive
{
class BlendState1DViewModel : public BlendState1DViewModelBase
{
public:
StatusCode import(ImportStack& importStack) override;

BindableProperty* bindableProperty() const { return m_bindableProperty; };

protected:
BindableProperty* m_bindableProperty;
};
} // namespace rive

#endif
1 change: 1 addition & 0 deletions defold-rive/include/rive/animation/cubic_interpolator.hpp
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ class CubicInterpolator : public CubicInterpolatorBase
{
public:
StatusCode onAddedDirty(CoreContext* context) override;
void initialize() override;

protected:
CubicInterpolatorSolver m_solver;
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef _RIVE_DATA_CONVERTER_RANGE_MAPPER_FLAGS_HPP_
#define _RIVE_DATA_CONVERTER_RANGE_MAPPER_FLAGS_HPP_

#include "rive/enum_bitset.hpp"

namespace rive
{
enum class DataConverterRangeMapperFlags : unsigned short
{

/// Whether the lower bound should be clamped
ClampLower = 1 << 0,

/// Whether the upper bound should be clamped
ClampUpper = 1 << 1,

/// Whether the value should wrap if it exceeds the range
Modulo = 1 << 2,

/// Whether to reverse the mapping
Reverse = 1 << 3,

};

RIVE_MAKE_ENUM_BITSET(DataConverterRangeMapperFlags)
} // namespace rive
#endif
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ class ElasticInterpolator : public ElasticInterpolatorBase
float transform(float factor) const override;

Easing easing() const { return (Easing)easingValue(); }
void initialize() override;

private:
ElasticEase m_elastic;
22 changes: 22 additions & 0 deletions defold-rive/include/rive/animation/hittable.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef _RIVE_HITTABLE_HPP_
#define _RIVE_HITTABLE_HPP_

#include "rive/math/aabb.hpp"

namespace rive
{
class Component;

// A Component that can be hit-tested via two passes: a faster AABB pass, and a
// more accurate HiFi pass.
class Hittable
{
public:
static Hittable* from(Component* component);
virtual bool hitTestAABB(const Vec2D& position) = 0;
virtual bool hitTestHiFi(const Vec2D& position, float hitRadius) = 0;
virtual ~Hittable() {}
};
} // namespace rive

#endif
2 changes: 2 additions & 0 deletions defold-rive/include/rive/animation/keyframe_interpolator.hpp
Original file line number Diff line number Diff line change
@@ -25,6 +25,8 @@ class KeyFrameInterpolator : public KeyFrameInterpolatorBase
virtual float transform(float factor) const = 0;

StatusCode import(ImportStack& importStack) override;

virtual void initialize(){};
};
} // namespace rive

Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ class NestedRemapAnimation : public NestedRemapAnimationBase
{
public:
void timeChanged() override;
bool advance(float elapsedSeconds) override;
bool advance(float elapsedSeconds, bool newFrame) override;
void initializeAnimation(ArtboardInstance*) override;
};
} // namespace rive
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ namespace rive
class NestedSimpleAnimation : public NestedSimpleAnimationBase
{
public:
bool advance(float elapsedSeconds) override;
bool advance(float elapsedSeconds, bool newFrame) override;
};
} // namespace rive

5 changes: 2 additions & 3 deletions defold-rive/include/rive/animation/nested_state_machine.hpp
Original file line number Diff line number Diff line change
@@ -20,17 +20,16 @@ class NestedStateMachine : public NestedStateMachineBase
public:
NestedStateMachine();
~NestedStateMachine() override;
bool advance(float elapsedSeconds) override;
bool advance(float elapsedSeconds, bool newFrame) override;
void initializeAnimation(ArtboardInstance*) override;
StateMachineInstance* stateMachineInstance();

HitResult pointerMove(Vec2D position);
HitResult pointerDown(Vec2D position);
HitResult pointerUp(Vec2D position);
HitResult pointerExit(Vec2D position);
#ifdef WITH_RIVE_TOOLS
bool tryChangeState();
bool hitTest(Vec2D position) const;
#endif

void addNestedInput(NestedInput* input);
size_t inputCount() { return m_nestedInputs.size(); }
20 changes: 14 additions & 6 deletions defold-rive/include/rive/animation/state_machine_instance.hpp
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@ class KeyedProperty;
class EventReport;
class DataBind;
class BindableProperty;
class HitDrawable;

#ifdef WITH_RIVE_TOOLS
class StateMachineInstance;
@@ -66,7 +67,12 @@ class StateMachineInstance : public Scene,
bool ignoreTriggers);
StateTransition* findAllowedTransition(StateInstance* stateFromInstance,
bool ignoreTriggers);
DataContext* m_DataContext;
DataContext* m_DataContext = nullptr;
void addToHitLookup(Component* target,
bool isLayoutComponent,
std::unordered_map<Component*, HitDrawable*>& hitLookup,
ListenerGroup* listenerGroup,
bool isOpaque);

public:
StateMachineInstance(const StateMachine* machine,
@@ -77,7 +83,9 @@ class StateMachineInstance : public Scene,
void markNeedsAdvance();
// Advance the state machine by the specified time. Returns true if the
// state machine will continue to animate after this advance.
bool advance(float seconds);
bool advance(float seconds, bool newFrame);

bool advance(float seconds) { return advance(seconds, true); }

// Returns true when the StateMachineInstance has more data to process.
bool needsAdvance() const;
@@ -107,14 +115,14 @@ class StateMachineInstance : public Scene,
const LayerState* stateChangedByIndex(size_t index) const;

bool advanceAndApply(float secs) override;
void advancedDataContext();
std::string name() const override;
HitResult pointerMove(Vec2D position) override;
HitResult pointerDown(Vec2D position) override;
HitResult pointerUp(Vec2D position) override;
HitResult pointerExit(Vec2D position) override;
#ifdef WITH_RIVE_TOOLS
bool tryChangeState();
bool hitTest(Vec2D position) const;
#endif

float durationSeconds() const override { return -1; }
Loop loop() const override { return Loop::oneShot; }
@@ -154,6 +162,7 @@ class StateMachineInstance : public Scene,
BindableProperty* bindablePropertyInstance(
BindableProperty* bindableProperty) const;
DataBind* bindableDataBind(BindableProperty* bindableProperty);
bool hasListeners() { return m_hitComponents.size() > 0; }
#ifdef TESTING
size_t hitComponentsCount() { return m_hitComponents.size(); };
HitComponent* hitComponent(size_t index)
@@ -183,6 +192,7 @@ class StateMachineInstance : public Scene,
std::unordered_map<BindableProperty*, BindableProperty*>
m_bindablePropertyInstances;
std::unordered_map<BindableProperty*, DataBind*> m_bindableDataBinds;
uint8_t m_drawOrderChangeCounter = 0;

#ifdef WITH_RIVE_TOOLS
public:
@@ -208,9 +218,7 @@ class HitComponent
ListenerType hitType,
bool canHit) = 0;
virtual void prepareEvent(Vec2D position, ListenerType hitType) = 0;
#ifdef WITH_RIVE_TOOLS
virtual bool hitTest(Vec2D position) const = 0;
#endif
#ifdef TESTING
int earlyOutCount = 0;
#endif
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ namespace rive
class TransitionBoolCondition : public TransitionBoolConditionBase
{
public:
bool evaluate(
const StateMachineInstance* stateMachineInstance) const override;
bool evaluate(const StateMachineInstance* stateMachineInstance,
bool ignoreTriggers) const override;

protected:
bool validateInputType(const StateMachineInput* input) const override;
3 changes: 2 additions & 1 deletion defold-rive/include/rive/animation/transition_comparator.hpp
Original file line number Diff line number Diff line change
@@ -14,7 +14,8 @@ class TransitionComparator : public TransitionComparatorBase
StatusCode import(ImportStack& importStack) override;
virtual bool compare(TransitionComparator* comparand,
TransitionConditionOp operation,
const StateMachineInstance* stateMachineInstance);
const StateMachineInstance* stateMachineInstance,
bool ignoreTriggers);

protected:
bool compareNumbers(float left, float right, TransitionConditionOp op);
4 changes: 2 additions & 2 deletions defold-rive/include/rive/animation/transition_condition.hpp
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@ class TransitionCondition : public TransitionConditionBase

StatusCode import(ImportStack& importStack) override;

virtual bool evaluate(
const StateMachineInstance* stateMachineInstance) const
virtual bool evaluate(const StateMachineInstance* stateMachineInstance,
bool ignoreTriggers) const
{
return true;
}
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ class TransitionNumberCondition : public TransitionNumberConditionBase
bool validateInputType(const StateMachineInput* input) const override;

public:
bool evaluate(
const StateMachineInstance* stateMachineInstance) const override;
bool evaluate(const StateMachineInstance* stateMachineInstance,
bool ignoreTriggers) const override;
};
} // namespace rive

Original file line number Diff line number Diff line change
@@ -11,7 +11,8 @@ class TransitionPropertyArtboardComparator
public:
bool compare(TransitionComparator* comparand,
TransitionConditionOp operation,
const StateMachineInstance* stateMachineInstance) override;
const StateMachineInstance* stateMachineInstance,
bool ignoreTriggers) override;

private:
float propertyValue(const StateMachineInstance* stateMachineInstance);
Original file line number Diff line number Diff line change
@@ -13,7 +13,8 @@ class TransitionPropertyViewModelComparator
StatusCode import(ImportStack& importStack) override;
bool compare(TransitionComparator* comparand,
TransitionConditionOp operation,
const StateMachineInstance* stateMachineInstance) override;
const StateMachineInstance* stateMachineInstance,
bool ignoreTriggers) override;
template <typename T = BindableProperty, typename U>
U value(const StateMachineInstance* stateMachineInstance)
{
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ namespace rive
class TransitionTriggerCondition : public TransitionTriggerConditionBase
{
public:
bool evaluate(
const StateMachineInstance* stateMachineInstance) const override;
bool evaluate(const StateMachineInstance* stateMachineInstance,
bool ignoreTriggers) const override;

protected:
bool validateInputType(const StateMachineInput* input) const override;
Loading

0 comments on commit d20844b

Please sign in to comment.