Skip to content

Commit

Permalink
Update & publish new doc versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Blue Fire committed Nov 24, 2024
1 parent 606c186 commit 500af1a
Show file tree
Hide file tree
Showing 29 changed files with 106,081 additions and 104,395 deletions.

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2424,6 +2424,16 @@ spine_attachment spine_attachment_copy(spine_attachment attachment) {
return (spine_attachment) _attachment->copy();
}

spine_bounding_box_attachment spine_attachment_cast_to_bounding_box_attachment(spine_attachment attachment) {
if (attachment == nullptr) return nullptr;
Attachment *_attachment = (Attachment *) attachment;
if (_attachment->getRTTI().isExactly(BoundingBoxAttachment::rtti)) {
BoundingBoxAttachment *boundingBox = static_cast<BoundingBoxAttachment *>(_attachment);
return (spine_bounding_box_attachment) boundingBox;
}
return nullptr;
}

void spine_attachment_dispose(spine_attachment attachment) {
if (attachment == nullptr) return;
Attachment *_attachment = (Attachment *) attachment;
Expand Down Expand Up @@ -4681,3 +4691,112 @@ void spine_texture_region_set_original_height(spine_texture_region textureRegion
TextureRegion *_region = (TextureRegion *) textureRegion;
_region->originalHeight = originalHeight;
}

spine_skeleton_bounds spine_skeleton_bounds_create() {
return (spine_skeleton_bounds) new (__FILE__, __LINE__) SkeletonBounds();
}

void spine_skeleton_bounds_dispose(spine_skeleton_bounds bounds) {
if (bounds == nullptr) return;
SkeletonBounds *_bounds = (SkeletonBounds *) bounds;
delete _bounds;
}

void spine_skeleton_bounds_update(spine_skeleton_bounds bounds, spine_skeleton skeleton, spine_bool updateAabb) {
if (bounds == nullptr) return;
if (skeleton == nullptr) return;

SkeletonBounds *_bounds = (SkeletonBounds *) bounds;
Skeleton *_skeleton = (Skeleton *) skeleton;
_bounds->update(*_skeleton, updateAabb != 0);
}

spine_bool spine_skeleton_bounds_aabb_contains_point(spine_skeleton_bounds bounds, float x, float y) {
if (bounds == nullptr) return false;
return ((SkeletonBounds *) bounds)->aabbcontainsPoint(x, y);
}

spine_bool spine_skeleton_bounds_aabb_intersects_segment(spine_skeleton_bounds bounds, float x1, float y1, float x2, float y2) {
if (bounds == nullptr) return false;
return ((SkeletonBounds *) bounds)->aabbintersectsSegment(x1, y1, x2, y2);
}

spine_bool spine_skeleton_bounds_aabb_intersects_skeleton(spine_skeleton_bounds bounds, spine_skeleton_bounds otherBounds) {
if (bounds == nullptr) return false;
if (otherBounds == nullptr) return false;
return ((SkeletonBounds *) bounds)->aabbIntersectsSkeleton(*((SkeletonBounds *) bounds));
}

spine_bool spine_skeleton_bounds_contains_point(spine_skeleton_bounds bounds, spine_polygon polygon, float x, float y) {
if (bounds == nullptr) return false;
if (polygon == nullptr) return false;
return ((SkeletonBounds *) bounds)->containsPoint((Polygon *) polygon, x, y);
}

spine_bounding_box_attachment spine_skeleton_bounds_contains_point_attachment(spine_skeleton_bounds bounds, float x, float y) {
if (bounds == nullptr) return nullptr;
return (spine_bounding_box_attachment) ((SkeletonBounds *) bounds)->containsPoint(x, y);
}

spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_attachment(spine_skeleton_bounds bounds, float x1, float y1, float x2, float y2) {
if (bounds == nullptr) return nullptr;
return (spine_bounding_box_attachment) ((SkeletonBounds *) bounds)->intersectsSegment(x1, y1, x2, y2);
}

spine_bool spine_skeleton_bounds_intersects_segment(spine_skeleton_bounds bounds, spine_polygon polygon, float x1, float y1, float x2, float y2) {
if (bounds == nullptr) return false;
if (polygon == nullptr) return false;
return ((SkeletonBounds *) bounds)->intersectsSegment((Polygon *) polygon, x1, y1, x2, y2);
}

spine_polygon spine_skeleton_bounds_get_polygon(spine_skeleton_bounds bounds, spine_bounding_box_attachment attachment) {
if (bounds == nullptr) return nullptr;
if (attachment == nullptr) return nullptr;
return (spine_polygon) ((SkeletonBounds *) bounds)->getPolygon((BoundingBoxAttachment *) attachment);
}

spine_bounding_box_attachment spine_skeleton_bounds_get_bounding_box(spine_skeleton_bounds bounds, spine_polygon polygon) {
if (bounds == nullptr) return nullptr;
if (polygon == nullptr) return nullptr;
return (spine_bounding_box_attachment) ((SkeletonBounds *) bounds)->getBoundingBox((Polygon *) polygon);
}

int32_t spine_skeleton_bounds_get_num_polygons(spine_skeleton_bounds bounds) {
if (bounds == nullptr) return 0;
return (int32_t) ((SkeletonBounds *) bounds)->getPolygons().size();
}

spine_polygon *spine_skeleton_bounds_get_polygons(spine_skeleton_bounds bounds) {
if (bounds == nullptr) return nullptr;
return (spine_polygon *) ((SkeletonBounds *) bounds)->getPolygons().buffer();
}

int32_t spine_skeleton_bounds_get_num_bounding_boxes(spine_skeleton_bounds bounds) {
if (bounds == nullptr) return 0;
return (int32_t) ((SkeletonBounds *) bounds)->getBoundingBoxes().size();
}

spine_bounding_box_attachment *spine_skeleton_bounds_get_bounding_boxes(spine_skeleton_bounds bounds) {
if (bounds == nullptr) return nullptr;
return (spine_bounding_box_attachment *) ((SkeletonBounds *) bounds)->getBoundingBoxes().buffer();
}

float spine_skeleton_bounds_get_width(spine_skeleton_bounds bounds) {
if (bounds == nullptr) return 0;
return ((SkeletonBounds *) bounds)->getWidth();
}

float spine_skeleton_bounds_get_height(spine_skeleton_bounds bounds) {
if (bounds == nullptr) return 0;
return ((SkeletonBounds *) bounds)->getHeight();
}

int32_t spine_polygon_get_num_vertices(spine_polygon polygon) {
if (polygon == nullptr) return 0;
return ((Polygon *) polygon)->_vertices.size();
}

float *spine_polygon_get_vertices(spine_polygon polygon) {
if (polygon == nullptr) return 0;
return ((Polygon *) polygon)->_vertices.buffer();
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ SPINE_OPAQUE_TYPE(spine_vector)
SPINE_OPAQUE_TYPE(spine_skeleton_drawable)
SPINE_OPAQUE_TYPE(spine_skin_entry)
SPINE_OPAQUE_TYPE(spine_skin_entries)
SPINE_OPAQUE_TYPE(spine_skeleton_bounds)
SPINE_OPAQUE_TYPE(spine_polygon)

// @end: opaque_types

Expand Down Expand Up @@ -263,7 +265,7 @@ SPINE_CPP_LITE_EXPORT void spine_skeleton_data_set_width(spine_skeleton_data dat
SPINE_CPP_LITE_EXPORT float spine_skeleton_data_get_height(spine_skeleton_data data);
SPINE_CPP_LITE_EXPORT void spine_skeleton_data_set_height(spine_skeleton_data data, float height);
SPINE_CPP_LITE_EXPORT const utf8 *spine_skeleton_data_get_version(spine_skeleton_data data);
// OMITTED setVersion()
// OMITTED setVersion()
// @ignore
SPINE_CPP_LITE_EXPORT const utf8 *spine_skeleton_data_get_hash(spine_skeleton_data data);
// OMITTED setHash()
Expand Down Expand Up @@ -628,6 +630,8 @@ SPINE_CPP_LITE_EXPORT const utf8 *spine_attachment_get_name(spine_attachment att
SPINE_CPP_LITE_EXPORT spine_attachment_type spine_attachment_get_type(spine_attachment attachment);
// @ignore
SPINE_CPP_LITE_EXPORT spine_attachment spine_attachment_copy(spine_attachment attachment);
// @optional
SPINE_CPP_LITE_EXPORT spine_bounding_box_attachment spine_attachment_cast_to_bounding_box_attachment(spine_attachment attachment);
SPINE_CPP_LITE_EXPORT void spine_attachment_dispose(spine_attachment attachment);

SPINE_CPP_LITE_EXPORT spine_vector spine_point_attachment_compute_world_position(spine_point_attachment attachment, spine_bone bone);
Expand Down Expand Up @@ -1047,6 +1051,29 @@ SPINE_CPP_LITE_EXPORT void spine_texture_region_set_original_width(spine_texture
SPINE_CPP_LITE_EXPORT int32_t spine_texture_region_get_original_height(spine_texture_region textureRegion);
SPINE_CPP_LITE_EXPORT void spine_texture_region_set_original_height(spine_texture_region textureRegion, int32_t originalHeight);

// @ignore
SPINE_CPP_LITE_EXPORT spine_skeleton_bounds spine_skeleton_bounds_create();
SPINE_CPP_LITE_EXPORT void spine_skeleton_bounds_dispose(spine_skeleton_bounds bounds);
SPINE_CPP_LITE_EXPORT void spine_skeleton_bounds_update(spine_skeleton_bounds bounds, spine_skeleton skeleton, spine_bool updateAabb);
SPINE_CPP_LITE_EXPORT spine_bool spine_skeleton_bounds_aabb_contains_point(spine_skeleton_bounds bounds, float x, float y);
SPINE_CPP_LITE_EXPORT spine_bool spine_skeleton_bounds_aabb_intersects_segment(spine_skeleton_bounds bounds, float x1, float y1, float x2, float y2);
SPINE_CPP_LITE_EXPORT spine_bool spine_skeleton_bounds_aabb_intersects_skeleton(spine_skeleton_bounds bounds, spine_skeleton_bounds otherBounds);
SPINE_CPP_LITE_EXPORT spine_bool spine_skeleton_bounds_contains_point(spine_skeleton_bounds bounds, spine_polygon polygon, float x, float y);
SPINE_CPP_LITE_EXPORT spine_bounding_box_attachment spine_skeleton_bounds_contains_point_attachment(spine_skeleton_bounds bounds, float x, float y);
SPINE_CPP_LITE_EXPORT spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_attachment(spine_skeleton_bounds bounds, float x1, float y1, float x2, float y2);
SPINE_CPP_LITE_EXPORT spine_bool spine_skeleton_bounds_intersects_segment(spine_skeleton_bounds bounds, spine_polygon polygon, float x1, float y1, float x2, float y2);
SPINE_CPP_LITE_EXPORT spine_polygon spine_skeleton_bounds_get_polygon(spine_skeleton_bounds bounds, spine_bounding_box_attachment attachment);
SPINE_CPP_LITE_EXPORT spine_bounding_box_attachment spine_skeleton_bounds_get_bounding_box(spine_skeleton_bounds bounds, spine_polygon polygon);
SPINE_CPP_LITE_EXPORT int32_t spine_skeleton_bounds_get_num_polygons(spine_skeleton_bounds bounds);
SPINE_CPP_LITE_EXPORT spine_polygon *spine_skeleton_bounds_get_polygons(spine_skeleton_bounds bounds);
SPINE_CPP_LITE_EXPORT int32_t spine_skeleton_bounds_get_num_bounding_boxes(spine_skeleton_bounds bounds);
SPINE_CPP_LITE_EXPORT spine_bounding_box_attachment *spine_skeleton_bounds_get_bounding_boxes(spine_skeleton_bounds bounds);
SPINE_CPP_LITE_EXPORT float spine_skeleton_bounds_get_width(spine_skeleton_bounds bounds);
SPINE_CPP_LITE_EXPORT float spine_skeleton_bounds_get_height(spine_skeleton_bounds bounds);

SPINE_CPP_LITE_EXPORT int32_t spine_polygon_get_num_vertices(spine_polygon polygon);
SPINE_CPP_LITE_EXPORT float *spine_polygon_get_vertices(spine_polygon polygon);

// @end: function_declarations

#endif
Loading

0 comments on commit 500af1a

Please sign in to comment.