Adding CMakeLists.txt and fixing some compiler warnings

This commit is contained in:
Stephen Gowen 2017-11-09 12:01:17 -05:00
parent e91a12cff1
commit 7983a6e743
6 changed files with 22 additions and 9 deletions

9
spine-cpp/CMakeLists.txt Normal file
View 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)

View File

@ -89,7 +89,12 @@ namespace Spine
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];
for (int i = 0; i < _capacity; ++i)
@ -101,7 +106,6 @@ namespace Spine
_header.next = &_trailer;
_trailer.prev = &_header;
_trailer.next = &_trailer;
_hashSize = 0;
}
~HashMap()

View File

@ -40,9 +40,9 @@
namespace Spine
{
Animation::Animation(std::string name, Vector<Timeline*>& timelines, float duration) :
_name(name),
_timelines(timelines),
_duration(duration)
_duration(duration),
_name(name)
{
assert(_name.length() > 0);
}

View File

@ -35,8 +35,8 @@
namespace Spine
{
Event::Event(float time, const EventData& data) :
_time(time),
_data(data),
_time(time),
_intValue(0),
_floatValue(0),
_stringValue()

View File

@ -52,11 +52,11 @@ namespace Spine
PathConstraint::PathConstraint(PathConstraintData& data, Skeleton& skeleton) : Constraint(),
_data(data),
_target(skeleton.findSlot(data.getTarget()->getName())),
_position(data.getPosition()),
_spacing(data.getSpacing()),
_rotateMix(data.getRotateMix()),
_translateMix(data.getTranslateMix()),
_target(skeleton.findSlot(data.getTarget()->getName()))
_translateMix(data.getTranslateMix())
{
_bones.reserve(_data.getBones().size());
for (BoneData** i = _data.getBones().begin(); i != _data.getBones().end(); ++i)

View File

@ -41,11 +41,11 @@ namespace Spine
{
TransformConstraint::TransformConstraint(TransformConstraintData& data, Skeleton& skeleton) : Constraint(),
_data(data),
_target(skeleton.findBone(data.getTarget()->getName())),
_rotateMix(data.getRotateMix()),
_translateMix(data.getTranslateMix()),
_scaleMix(data.getScaleMix()),
_shearMix(data.getShearMix()),
_target(skeleton.findBone(data.getTarget()->getName()))
_shearMix(data.getShearMix())
{
_bones.reserve(_data.getBones().size());
for (BoneData** i = _data.getBones().begin(); i != _data.getBones().end(); ++i)