Minor cleanup.

This commit is contained in:
NathanSweet 2013-03-31 03:24:05 +02:00
parent 7707f3517f
commit c5ffedab4e
3 changed files with 7 additions and 7 deletions

View File

@ -72,7 +72,7 @@ void CurveTimeline_setStepped (CurveTimeline* timeline, int frameIndex);
* cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
* the difference between the keyframe's values. */ * the difference between the keyframe's values. */
void CurveTimeline_setCurve (CurveTimeline* timeline, int frameIndex, float cx1, float cy1, float cx2, float cy2); void CurveTimeline_setCurve (CurveTimeline* timeline, int frameIndex, float cx1, float cy1, float cx2, float cy2);
float CurveTimeline_getCurvePercent (CurveTimeline* timeline, int frameIndex, float percent); float CurveTimeline_getCurvePercent (const CurveTimeline* timeline, int frameIndex, float percent);
/**/ /**/

View File

@ -119,7 +119,7 @@ void CurveTimeline_setCurve (CurveTimeline* self, int frameIndex, float cx1, flo
self->curves[i + 5] = tmp2y * pre5; self->curves[i + 5] = tmp2y * pre5;
} }
float CurveTimeline_getCurvePercent (CurveTimeline* self, int frameIndex, float percent) { float CurveTimeline_getCurvePercent (const CurveTimeline* self, int frameIndex, float percent) {
int curveIndex = frameIndex * 6; int curveIndex = frameIndex * 6;
float dfx = self->curves[curveIndex]; float dfx = self->curves[curveIndex];
if (dfx == CURVE_LINEAR) return percent; if (dfx == CURVE_LINEAR) return percent;

View File

@ -30,10 +30,10 @@
typedef struct { typedef struct {
Slot slot; Slot slot;
float attachmentTime; float attachmentTime;
} Internal; } SlotInternal;
Slot* Slot_create (SlotData* data, Skeleton* skeleton, Bone* bone) { Slot* Slot_create (SlotData* data, Skeleton* skeleton, Bone* bone) {
Internal* internal = CALLOC(Internal, 1) SlotInternal* internal = CALLOC(SlotInternal, 1)
Slot* self = &internal->slot; Slot* self = &internal->slot;
CAST(SlotData*, self->data) = data; CAST(SlotData*, self->data) = data;
CAST(Skeleton*, self->skeleton) = skeleton; CAST(Skeleton*, self->skeleton) = skeleton;
@ -52,15 +52,15 @@ void Slot_dispose (Slot* self) {
/* @param attachment May be null. */ /* @param attachment May be null. */
void Slot_setAttachment (Slot* self, Attachment* attachment) { void Slot_setAttachment (Slot* self, Attachment* attachment) {
CAST(Attachment*, self->attachment) = attachment; CAST(Attachment*, self->attachment) = attachment;
((Internal*)self)->attachmentTime = self->skeleton->time; ((SlotInternal*)self)->attachmentTime = self->skeleton->time;
} }
void Slot_setAttachmentTime (Slot* self, float time) { void Slot_setAttachmentTime (Slot* self, float time) {
((Internal*)self)->attachmentTime = self->skeleton->time - time; ((SlotInternal*)self)->attachmentTime = self->skeleton->time - time;
} }
float Slot_getAttachmentTime (const Slot* self) { float Slot_getAttachmentTime (const Slot* self) {
return self->skeleton->time - ((Internal*)self)->attachmentTime; return self->skeleton->time - ((SlotInternal*)self)->attachmentTime;
} }
void Slot_setToBindPose (Slot* self) { void Slot_setToBindPose (Slot* self) {