@@ -428,14 +428,14 @@ void CCSprite::updateTextureCoords(CCRect rect)
428
428
if (m_bRectRotated)
429
429
{
430
430
#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
431
- left = (2 *rect.origin .x +1 )/(2 *atlasWidth);
432
- right = left+(rect.size .height *2 -2 )/(2 *atlasWidth);
433
- top = (2 *rect.origin .y +1 )/(2 *atlasHeight);
431
+ left = (2 *rect.origin .x +1 )/(2 *atlasWidth);
432
+ right = left+(rect.size .height *2 -2 )/(2 *atlasWidth);
433
+ top = (2 *rect.origin .y +1 )/(2 *atlasHeight);
434
434
bottom = top+(rect.size .width *2 -2 )/(2 *atlasHeight);
435
435
#else
436
- left = rect.origin .x /atlasWidth;
437
- right = left+(rect.size .height /atlasWidth);
438
- top = rect.origin .y /atlasHeight;
436
+ left = rect.origin .x /atlasWidth;
437
+ right = left+(rect.size .height /atlasWidth);
438
+ top = rect.origin .y /atlasHeight;
439
439
bottom = top+(rect.size .width /atlasHeight);
440
440
#endif // CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
441
441
@@ -449,46 +449,46 @@ void CCSprite::updateTextureCoords(CCRect rect)
449
449
CC_SWAP (left, right, float );
450
450
}
451
451
452
- m_sQuad.bl .texCoords .u = left;
453
- m_sQuad.bl .texCoords .v = top;
454
- m_sQuad.br .texCoords .u = left;
455
- m_sQuad.br .texCoords .v = bottom;
456
- m_sQuad.tl .texCoords .u = right;
457
- m_sQuad.tl .texCoords .v = top;
458
- m_sQuad.tr .texCoords .u = right;
452
+ m_sQuad.bl .texCoords .u = left;
453
+ m_sQuad.bl .texCoords .v = top;
454
+ m_sQuad.br .texCoords .u = left;
455
+ m_sQuad.br .texCoords .v = bottom;
456
+ m_sQuad.tl .texCoords .u = right;
457
+ m_sQuad.tl .texCoords .v = top;
458
+ m_sQuad.tr .texCoords .u = right;
459
459
m_sQuad.tr .texCoords .v = bottom;
460
460
}
461
461
else
462
462
{
463
- #if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
464
- left = (2 *rect.origin .x +1 )/(2 *atlasWidth);
465
- right = left + (rect.size .width *2 -2 )/(2 *atlasWidth);
466
- top = (2 *rect.origin .y +1 )/(2 *atlasHeight);
467
- bottom = top + (rect.size .height *2 -2 )/(2 *atlasHeight);
468
- #else
469
- left = rect.origin .x /atlasWidth;
470
- right = left + rect.size .width /atlasWidth;
471
- top = rect.origin .y /atlasHeight;
472
- bottom = top + rect.size .height /atlasHeight;
473
- #endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
474
-
475
- if (m_bFlipX)
476
- {
477
- CC_SWAP (left,right,float );
478
- }
479
-
480
- if (m_bFlipY)
481
- {
482
- CC_SWAP (top,bottom,float );
483
- }
484
-
485
- m_sQuad.bl .texCoords .u = left;
486
- m_sQuad.bl .texCoords .v = bottom;
487
- m_sQuad.br .texCoords .u = right;
488
- m_sQuad.br .texCoords .v = bottom;
489
- m_sQuad.tl .texCoords .u = left;
490
- m_sQuad.tl .texCoords .v = top;
491
- m_sQuad.tr .texCoords .u = right;
463
+ #if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
464
+ left = (2 *rect.origin .x +1 )/(2 *atlasWidth);
465
+ right = left + (rect.size .width *2 -2 )/(2 *atlasWidth);
466
+ top = (2 *rect.origin .y +1 )/(2 *atlasHeight);
467
+ bottom = top + (rect.size .height *2 -2 )/(2 *atlasHeight);
468
+ #else
469
+ left = rect.origin .x /atlasWidth;
470
+ right = left + rect.size .width /atlasWidth;
471
+ top = rect.origin .y /atlasHeight;
472
+ bottom = top + rect.size .height /atlasHeight;
473
+ #endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
474
+
475
+ if (m_bFlipX)
476
+ {
477
+ CC_SWAP (left,right,float );
478
+ }
479
+
480
+ if (m_bFlipY)
481
+ {
482
+ CC_SWAP (top,bottom,float );
483
+ }
484
+
485
+ m_sQuad.bl .texCoords .u = left;
486
+ m_sQuad.bl .texCoords .v = bottom;
487
+ m_sQuad.br .texCoords .u = right;
488
+ m_sQuad.br .texCoords .v = bottom;
489
+ m_sQuad.tl .texCoords .u = left;
490
+ m_sQuad.tl .texCoords .v = top;
491
+ m_sQuad.tr .texCoords .u = right;
492
492
m_sQuad.tr .texCoords .v = top;
493
493
}
494
494
}
@@ -543,10 +543,10 @@ void CCSprite::updateTransform(void)
543
543
// If any of the parents are not visible, then don't draw this node
544
544
if (! tv.visible )
545
545
{
546
- m_sQuad.br .vertices = m_sQuad.tl .vertices = m_sQuad.tr .vertices = m_sQuad.bl .vertices = vertex3 (0 ,0 ,0 );
547
- m_pobTextureAtlas->updateQuad (&m_sQuad, m_uAtlasIndex);
548
- m_bDirty = m_bRecursiveDirty = false ;
549
-
546
+ m_sQuad.br .vertices = m_sQuad.tl .vertices = m_sQuad.tr .vertices = m_sQuad.bl .vertices = vertex3 (0 ,0 ,0 );
547
+ m_pobTextureAtlas->updateQuad (&m_sQuad, m_uAtlasIndex);
548
+ m_bDirty = m_bRecursiveDirty = false ;
549
+
550
550
return ;
551
551
}
552
552
@@ -675,7 +675,7 @@ void CCSprite::draw(void)
675
675
}
676
676
677
677
#if CC_SPRITE_DEBUG_DRAW
678
- CCSize s = m_tContentSizeInPixels ;
678
+ CCSize s = m_tContentSize ;
679
679
CCPoint vertices[4 ]={
680
680
ccp (0 ,0 ),ccp (s.width ,0 ),
681
681
ccp (s.width ,s.height ),ccp (0 ,s.height ),
0 commit comments