mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Adding CMakeLists.txt and fixing some compiler warnings
This commit is contained in:
parent
e91a12cff1
commit
7983a6e743
9
spine-cpp/CMakeLists.txt
Normal file
9
spine-cpp/CMakeLists.txt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
include_directories(include)
|
||||||
|
file(GLOB INCLUDES "spine-cpp/include/**/*.h")
|
||||||
|
file(GLOB SOURCES "spine-cpp/src/**/*.cpp")
|
||||||
|
|
||||||
|
set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -Wall -std=c++03 -pedantic")
|
||||||
|
add_library(spine-cpp STATIC ${SOURCES} ${INCLUDES})
|
||||||
|
target_include_directories(spine-cpp PUBLIC spine-cpp/include)
|
||||||
|
install(TARGETS spine-cpp DESTINATION dist/lib)
|
||||||
|
install(FILES ${INCLUDES} DESTINATION dist/include)
|
||||||
@ -89,7 +89,12 @@ namespace Spine
|
|||||||
Entry* _entry;
|
Entry* _entry;
|
||||||
};
|
};
|
||||||
|
|
||||||
HashMap(size_t capacity = 65535) : _capacity(capacity), _hashFunction(), _header(), _trailer()
|
HashMap(size_t capacity = 65535) :
|
||||||
|
_hashFunction(),
|
||||||
|
_capacity(capacity),
|
||||||
|
_header(),
|
||||||
|
_trailer(),
|
||||||
|
_hashSize(0)
|
||||||
{
|
{
|
||||||
_hashTable = new Entry[capacity];
|
_hashTable = new Entry[capacity];
|
||||||
for (int i = 0; i < _capacity; ++i)
|
for (int i = 0; i < _capacity; ++i)
|
||||||
@ -101,7 +106,6 @@ namespace Spine
|
|||||||
_header.next = &_trailer;
|
_header.next = &_trailer;
|
||||||
_trailer.prev = &_header;
|
_trailer.prev = &_header;
|
||||||
_trailer.next = &_trailer;
|
_trailer.next = &_trailer;
|
||||||
_hashSize = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~HashMap()
|
~HashMap()
|
||||||
|
|||||||
@ -40,9 +40,9 @@
|
|||||||
namespace Spine
|
namespace Spine
|
||||||
{
|
{
|
||||||
Animation::Animation(std::string name, Vector<Timeline*>& timelines, float duration) :
|
Animation::Animation(std::string name, Vector<Timeline*>& timelines, float duration) :
|
||||||
_name(name),
|
|
||||||
_timelines(timelines),
|
_timelines(timelines),
|
||||||
_duration(duration)
|
_duration(duration),
|
||||||
|
_name(name)
|
||||||
{
|
{
|
||||||
assert(_name.length() > 0);
|
assert(_name.length() > 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,8 +35,8 @@
|
|||||||
namespace Spine
|
namespace Spine
|
||||||
{
|
{
|
||||||
Event::Event(float time, const EventData& data) :
|
Event::Event(float time, const EventData& data) :
|
||||||
_time(time),
|
|
||||||
_data(data),
|
_data(data),
|
||||||
|
_time(time),
|
||||||
_intValue(0),
|
_intValue(0),
|
||||||
_floatValue(0),
|
_floatValue(0),
|
||||||
_stringValue()
|
_stringValue()
|
||||||
|
|||||||
@ -52,11 +52,11 @@ namespace Spine
|
|||||||
|
|
||||||
PathConstraint::PathConstraint(PathConstraintData& data, Skeleton& skeleton) : Constraint(),
|
PathConstraint::PathConstraint(PathConstraintData& data, Skeleton& skeleton) : Constraint(),
|
||||||
_data(data),
|
_data(data),
|
||||||
|
_target(skeleton.findSlot(data.getTarget()->getName())),
|
||||||
_position(data.getPosition()),
|
_position(data.getPosition()),
|
||||||
_spacing(data.getSpacing()),
|
_spacing(data.getSpacing()),
|
||||||
_rotateMix(data.getRotateMix()),
|
_rotateMix(data.getRotateMix()),
|
||||||
_translateMix(data.getTranslateMix()),
|
_translateMix(data.getTranslateMix())
|
||||||
_target(skeleton.findSlot(data.getTarget()->getName()))
|
|
||||||
{
|
{
|
||||||
_bones.reserve(_data.getBones().size());
|
_bones.reserve(_data.getBones().size());
|
||||||
for (BoneData** i = _data.getBones().begin(); i != _data.getBones().end(); ++i)
|
for (BoneData** i = _data.getBones().begin(); i != _data.getBones().end(); ++i)
|
||||||
|
|||||||
@ -41,11 +41,11 @@ namespace Spine
|
|||||||
{
|
{
|
||||||
TransformConstraint::TransformConstraint(TransformConstraintData& data, Skeleton& skeleton) : Constraint(),
|
TransformConstraint::TransformConstraint(TransformConstraintData& data, Skeleton& skeleton) : Constraint(),
|
||||||
_data(data),
|
_data(data),
|
||||||
|
_target(skeleton.findBone(data.getTarget()->getName())),
|
||||||
_rotateMix(data.getRotateMix()),
|
_rotateMix(data.getRotateMix()),
|
||||||
_translateMix(data.getTranslateMix()),
|
_translateMix(data.getTranslateMix()),
|
||||||
_scaleMix(data.getScaleMix()),
|
_scaleMix(data.getScaleMix()),
|
||||||
_shearMix(data.getShearMix()),
|
_shearMix(data.getShearMix())
|
||||||
_target(skeleton.findBone(data.getTarget()->getName()))
|
|
||||||
{
|
{
|
||||||
_bones.reserve(_data.getBones().size());
|
_bones.reserve(_data.getBones().size());
|
||||||
for (BoneData** i = _data.getBones().begin(); i != _data.getBones().end(); ++i)
|
for (BoneData** i = _data.getBones().begin(); i != _data.getBones().end(); ++i)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user