Warning clean up.

This commit is contained in:
NathanSweet 2014-05-17 17:25:46 +02:00
parent 1d85ad6bd6
commit 8cdb2062c7
6 changed files with 16 additions and 17 deletions

View File

@ -218,7 +218,6 @@ void SkeletonRenderer::draw () {
ccDrawColor4B(0, 0, 255, 255);
glLineWidth(1);
CCPoint points[4];
ccV3F_C4B_T2F_Quad quad;
for (int i = 0, n = skeleton->slotCount; i < n; i++) {
spSlot* slot = skeleton->drawOrder[i];
if (!slot->attachment || slot->attachment->type != SP_ATTACHMENT_REGION) continue;

View File

@ -52,7 +52,7 @@ bool GoblinsExample::init () {
skeletonNode->setSkin("goblin");
Size windowSize = Director::getInstance()->getWinSize();
skeletonNode->setPosition(ccp(windowSize.width / 2, 20));
skeletonNode->setPosition(Point(windowSize.width / 2, 20));
addChild(skeletonNode);
scheduleUpdate();

View File

@ -224,10 +224,10 @@ void SkeletonRenderer::drawSkeleton (const kmMat4& transform, bool transformUpda
kmGLLoadMatrix(&transform);
if (debugSlots) {
// Slots.
ccDrawColor4B(0, 0, 255, 255);
DrawPrimitives::setDrawColor4B(0, 0, 255, 255);
glLineWidth(1);
CCPoint points[4];
ccV3F_C4B_T2F_Quad quad;
Point points[4];
V3F_C4B_T2F_Quad quad;
for (int i = 0, n = skeleton->slotCount; i < n; i++) {
spSlot* slot = skeleton->drawOrder[i];
if (!slot->attachment || slot->attachment->type != SP_ATTACHMENT_REGION) continue;
@ -237,26 +237,26 @@ void SkeletonRenderer::drawSkeleton (const kmMat4& transform, bool transformUpda
points[1] = Point(worldVertices[2], worldVertices[3]);
points[2] = Point(worldVertices[4], worldVertices[5]);
points[3] = Point(worldVertices[6], worldVertices[7]);
ccDrawPoly(points, 4, true);
DrawPrimitives::drawPoly(points, 4, true);
}
}
if (debugBones) {
// Bone lengths.
glLineWidth(2);
ccDrawColor4B(255, 0, 0, 255);
DrawPrimitives::setDrawColor4B(255, 0, 0, 255);
for (int i = 0, n = skeleton->boneCount; i < n; i++) {
spBone *bone = skeleton->bones[i];
float x = bone->data->length * bone->m00 + bone->worldX;
float y = bone->data->length * bone->m10 + bone->worldY;
ccDrawLine(Point(bone->worldX, bone->worldY), Point(x, y));
DrawPrimitives::drawLine(Point(bone->worldX, bone->worldY), Point(x, y));
}
// Bone origins.
ccPointSize(4);
ccDrawColor4B(0, 0, 255, 255); // Root bone is blue.
DrawPrimitives::setPointSize(4);
DrawPrimitives::setDrawColor4B(0, 0, 255, 255); // Root bone is blue.
for (int i = 0, n = skeleton->boneCount; i < n; i++) {
spBone *bone = skeleton->bones[i];
ccDrawPoint(Point(bone->worldX, bone->worldY));
if (i == 0) ccDrawColor4B(0, 255, 0, 255);
DrawPrimitives::drawPoint(Point(bone->worldX, bone->worldY));
if (i == 0) DrawPrimitives::setDrawColor4B(0, 255, 0, 255);
}
}
kmGLPopMatrix();

View File

@ -39,7 +39,7 @@ namespace spine {
class PolygonBatch;
/** Draws a skeleton. */
class SkeletonRenderer: public cocos2d::NodeRGBA, public cocos2d::BlendProtocol {
class SkeletonRenderer: public cocos2d::Node, public cocos2d::BlendProtocol {
public:
spSkeleton* skeleton;
spBone* rootBone;

View File

@ -74,7 +74,7 @@ void SkeletonRenderer::initialize () {
blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
setOpacityModifyRGB(true);
setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
setGLProgram(ShaderCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
scheduleUpdate();
}
@ -139,8 +139,8 @@ void SkeletonRenderer::draw (Renderer* renderer, const Matrix& transform, bool t
}
void SkeletonRenderer::drawSkeleton (const Matrix &transform, bool transformUpdated) {
getShaderProgram()->use();
getShaderProgram()->setUniformsForBuiltins(transform);
getGLProgram()->use();
getGLProgram()->setUniformsForBuiltins(transform);
Color3B nodeColor = getColor();
skeleton->r = nodeColor.r / (float)255;

View File

@ -39,7 +39,7 @@ namespace spine {
class PolygonBatch;
/** Draws a skeleton. */
class SkeletonRenderer: public cocos2d::NodeRGBA, public cocos2d::BlendProtocol {
class SkeletonRenderer: public cocos2d::Node, public cocos2d::BlendProtocol {
public:
spSkeleton* skeleton;
spBone* rootBone;