Skip to content

Commit 3aac021

Browse files
authored
Update to 1.9.7 beta (#147)
* Rebuild mac libraries * Updated more libraries * Update web libraries
1 parent 7330721 commit 3aac021

File tree

237 files changed

+6003
-485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+6003
-485
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#ifndef _RIVE_ADVANCE_FLAGS_HPP_
2+
#define _RIVE_ADVANCE_FLAGS_HPP_
3+
4+
#include "rive/enum_bitset.hpp"
5+
6+
namespace rive
7+
{
8+
enum class AdvanceFlags : unsigned short
9+
{
10+
None = 0,
11+
12+
/// Whether NestedArtboards should advance
13+
AdvanceNested = 1 << 0,
14+
15+
/// Whether the Component should animate when advancing
16+
Animate = 1 << 1,
17+
18+
/// Whether this Component is on the root artboard
19+
IsRoot = 1 << 2,
20+
21+
/// Whether we are advancing to a new frame
22+
NewFrame = 1 << 3,
23+
};
24+
RIVE_MAKE_ENUM_BITSET(AdvanceFlags)
25+
} // namespace rive
26+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#ifndef _RIVE_ADVANCING_COMPONENT_HPP_
2+
#define _RIVE_ADVANCING_COMPONENT_HPP_
3+
4+
#include "rive/advance_flags.hpp"
5+
6+
namespace rive
7+
{
8+
class Component;
9+
class AdvancingComponent
10+
{
11+
public:
12+
virtual bool advanceComponent(
13+
float elapsedSeconds,
14+
AdvanceFlags flags = AdvanceFlags::Animate |
15+
AdvanceFlags::NewFrame) = 0;
16+
static AdvancingComponent* from(Component* component);
17+
};
18+
} // namespace rive
19+
20+
#endif

defold-rive/include/rive/animation/arithmetic_operation.hpp

+11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ enum class ArithmeticOperation : int
1010
multiply = 2,
1111
divide = 3,
1212
modulo = 4,
13+
squareRoot = 5,
14+
power = 6,
15+
exp = 7,
16+
log = 8,
17+
cosine = 9,
18+
sine = 10,
19+
tangent = 11,
20+
acosine = 12,
21+
asine = 13,
22+
atangent = 14,
23+
atangent2 = 15,
1324
};
1425
} // namespace rive
1526

defold-rive/include/rive/animation/blend_animation_direct.hpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
#include <stdio.h>
55
namespace rive
66
{
7-
7+
class BindableProperty;
88
enum class DirectBlendSource : unsigned int
99
{
1010
inputId = 0,
1111
mixValue = 1,
12+
dataBindId = 2,
1213
};
1314

1415
class BlendAnimationDirect : public BlendAnimationDirectBase
@@ -17,7 +18,16 @@ class BlendAnimationDirect : public BlendAnimationDirectBase
1718
StatusCode onAddedDirty(CoreContext* context) override;
1819
StatusCode onAddedClean(CoreContext* context) override;
1920
StatusCode import(ImportStack& importStack) override;
21+
void bindableProperty(BindableProperty* value)
22+
{
23+
m_bindableProperty = value;
24+
};
25+
BindableProperty* bindableProperty() const { return m_bindableProperty; };
26+
27+
private:
28+
BindableProperty* m_bindableProperty;
2029
};
30+
2131
} // namespace rive
2232

2333
#endif

defold-rive/include/rive/animation/blend_state_1d.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ namespace rive
77
class BlendState1D : public BlendState1DBase
88
{
99
public:
10-
bool hasValidInputId() const { return inputId() != Core::emptyId; }
11-
12-
StatusCode import(ImportStack& importStack) override;
13-
1410
std::unique_ptr<StateInstance> makeInstance(
1511
ArtboardInstance*) const override;
1612
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef _RIVE_BLEND_STATE1_DINPUT_HPP_
2+
#define _RIVE_BLEND_STATE1_DINPUT_HPP_
3+
#include "rive/generated/animation/blend_state_1d_input_base.hpp"
4+
#include <stdio.h>
5+
namespace rive
6+
{
7+
class BlendState1DInput : public BlendState1DInputBase
8+
{
9+
public:
10+
bool hasValidInputId() const { return inputId() != Core::emptyId; }
11+
12+
StatusCode import(ImportStack& importStack) override;
13+
};
14+
} // namespace rive
15+
16+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#ifndef _RIVE_BLEND_STATE1_DVIEW_MODEL_HPP_
2+
#define _RIVE_BLEND_STATE1_DVIEW_MODEL_HPP_
3+
#include "rive/generated/animation/blend_state_1d_viewmodel_base.hpp"
4+
#include "rive/data_bind/bindable_property.hpp"
5+
#include <stdio.h>
6+
namespace rive
7+
{
8+
class BlendState1DViewModel : public BlendState1DViewModelBase
9+
{
10+
public:
11+
StatusCode import(ImportStack& importStack) override;
12+
13+
BindableProperty* bindableProperty() const { return m_bindableProperty; };
14+
15+
protected:
16+
BindableProperty* m_bindableProperty;
17+
};
18+
} // namespace rive
19+
20+
#endif

defold-rive/include/rive/animation/cubic_interpolator.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class CubicInterpolator : public CubicInterpolatorBase
99
{
1010
public:
1111
StatusCode onAddedDirty(CoreContext* context) override;
12+
void initialize() override;
1213

1314
protected:
1415
CubicInterpolatorSolver m_solver;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#ifndef _RIVE_DATA_CONVERTER_RANGE_MAPPER_FLAGS_HPP_
2+
#define _RIVE_DATA_CONVERTER_RANGE_MAPPER_FLAGS_HPP_
3+
4+
#include "rive/enum_bitset.hpp"
5+
6+
namespace rive
7+
{
8+
enum class DataConverterRangeMapperFlags : unsigned short
9+
{
10+
11+
/// Whether the lower bound should be clamped
12+
ClampLower = 1 << 0,
13+
14+
/// Whether the upper bound should be clamped
15+
ClampUpper = 1 << 1,
16+
17+
/// Whether the value should wrap if it exceeds the range
18+
Modulo = 1 << 2,
19+
20+
/// Whether to reverse the mapping
21+
Reverse = 1 << 3,
22+
23+
};
24+
25+
RIVE_MAKE_ENUM_BITSET(DataConverterRangeMapperFlags)
26+
} // namespace rive
27+
#endif

defold-rive/include/rive/animation/elastic_interpolator.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class ElasticInterpolator : public ElasticInterpolatorBase
1515
float transform(float factor) const override;
1616

1717
Easing easing() const { return (Easing)easingValue(); }
18+
void initialize() override;
1819

1920
private:
2021
ElasticEase m_elastic;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef _RIVE_HITTABLE_HPP_
2+
#define _RIVE_HITTABLE_HPP_
3+
4+
#include "rive/math/aabb.hpp"
5+
6+
namespace rive
7+
{
8+
class Component;
9+
10+
// A Component that can be hit-tested via two passes: a faster AABB pass, and a
11+
// more accurate HiFi pass.
12+
class Hittable
13+
{
14+
public:
15+
static Hittable* from(Component* component);
16+
virtual bool hitTestAABB(const Vec2D& position) = 0;
17+
virtual bool hitTestHiFi(const Vec2D& position, float hitRadius) = 0;
18+
virtual ~Hittable() {}
19+
};
20+
} // namespace rive
21+
22+
#endif

defold-rive/include/rive/animation/keyframe_interpolator.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class KeyFrameInterpolator : public KeyFrameInterpolatorBase
2525
virtual float transform(float factor) const = 0;
2626

2727
StatusCode import(ImportStack& importStack) override;
28+
29+
virtual void initialize(){};
2830
};
2931
} // namespace rive
3032

defold-rive/include/rive/animation/nested_remap_animation.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class NestedRemapAnimation : public NestedRemapAnimationBase
88
{
99
public:
1010
void timeChanged() override;
11-
bool advance(float elapsedSeconds) override;
11+
bool advance(float elapsedSeconds, bool newFrame) override;
1212
void initializeAnimation(ArtboardInstance*) override;
1313
};
1414
} // namespace rive

defold-rive/include/rive/animation/nested_simple_animation.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace rive
77
class NestedSimpleAnimation : public NestedSimpleAnimationBase
88
{
99
public:
10-
bool advance(float elapsedSeconds) override;
10+
bool advance(float elapsedSeconds, bool newFrame) override;
1111
};
1212
} // namespace rive
1313

defold-rive/include/rive/animation/nested_state_machine.hpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ class NestedStateMachine : public NestedStateMachineBase
2020
public:
2121
NestedStateMachine();
2222
~NestedStateMachine() override;
23-
bool advance(float elapsedSeconds) override;
23+
bool advance(float elapsedSeconds, bool newFrame) override;
2424
void initializeAnimation(ArtboardInstance*) override;
2525
StateMachineInstance* stateMachineInstance();
2626

2727
HitResult pointerMove(Vec2D position);
2828
HitResult pointerDown(Vec2D position);
2929
HitResult pointerUp(Vec2D position);
3030
HitResult pointerExit(Vec2D position);
31-
#ifdef WITH_RIVE_TOOLS
31+
bool tryChangeState();
3232
bool hitTest(Vec2D position) const;
33-
#endif
3433

3534
void addNestedInput(NestedInput* input);
3635
size_t inputCount() { return m_nestedInputs.size(); }

defold-rive/include/rive/animation/state_machine_input_instance.hpp

+27-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include <string>
55
#include <stdint.h>
6+
#include <vector>
7+
#include <algorithm>
68

79
namespace rive
810
{
@@ -73,17 +75,38 @@ class SMINumber : public SMIInput
7375
void value(float newValue);
7476
};
7577

76-
class SMITrigger : public SMIInput
78+
class Triggerable
79+
{
80+
81+
public:
82+
bool useInLayer(StateMachineLayerInstance* layer) const
83+
{
84+
auto it = std::find(m_usedLayers.begin(), m_usedLayers.end(), layer);
85+
if (it == m_usedLayers.end())
86+
{
87+
m_usedLayers.push_back(layer);
88+
return true;
89+
}
90+
return false;
91+
}
92+
93+
protected:
94+
mutable std::vector<StateMachineLayerInstance*> m_usedLayers;
95+
};
96+
97+
class SMITrigger : public SMIInput, public Triggerable
7798
{
7899
friend class StateMachineInstance;
79100
friend class TransitionTriggerCondition;
80-
81-
private:
82101
bool m_fired = false;
83102

84103
SMITrigger(const StateMachineTrigger* input,
85104
StateMachineInstance* machineInstance);
86-
void advanced() override { m_fired = false; }
105+
void advanced() override
106+
{
107+
m_fired = false;
108+
m_usedLayers.clear();
109+
}
87110

88111
public:
89112
void fire();

0 commit comments

Comments
 (0)