issue #5, do some implementation

This commit is contained in:
Walzer 2010-07-16 09:53:59 +00:00
parent 669f59d721
commit cc9c52d0c7
4 changed files with 43 additions and 42 deletions

View File

@ -23,6 +23,7 @@ THE SOFTWARE.
****************************************************************************/
#include "CCNode.h"
#include "../support/CGPointExtension.h"
using namespace std;
@ -31,10 +32,10 @@ CCNode::CCNode(void)
,m_fRotation(0.0f)
,m_fScaleX(1.0f)
,m_fScaleY(1.0f)
,m_tPosition(CGPoint(0,0))
,m_tAnchorPointInPixels(CGPoint(0,0))
,m_tAnchorPoint(CGPoint(0,0))
,m_tContentSize(CGSize(0,0))
,m_tPosition(CGPointZero)
,m_tAnchorPointInPixels(CGPointZero)
,m_tAnchorPoint(CGPointZero)
,m_tContentSize(CGSizeZero)
// "whole screen" objects. like Scenes and Layers, should set isRelativeAnchorPoint to false
,m_bIsRelativeAnchorPoint(true)
,m_bIsTransformDirty(true)
@ -256,18 +257,17 @@ CGPoint CCNode::getAnchorPoint()
return m_tAnchorPoint;
}
/// @todo anchorPoint setter
void CCNode::setAnchorPoint(CGPoint point)
{
//if( ! CGPoint::CGPointEqualToPoint(point, m_tAnchorPoint) )
//{
// m_tAnchorPoint = point;
// this->m_tAnchorPointInPixels = ccp( m_tContentSize.width * m_tAnchorPoint.x, m_tContentSize.height * m_tAnchorPoint.y );
// m_bIsTransformDirty = m_bIsInverseDirty = true;
// #ifdef CCX_NODE_TRANSFORM_USING_AFFINE_MATRIX
// m_bIsTransformGLDirty = true;
// #endif
//}
if( ! CGPoint::CGPointEqualToPoint(point, m_tAnchorPoint) )
{
m_tAnchorPoint = point;
this->m_tAnchorPointInPixels = ccp( m_tContentSize.width * m_tAnchorPoint.x, m_tContentSize.height * m_tAnchorPoint.y );
m_bIsTransformDirty = m_bIsInverseDirty = true;
#ifdef CCX_NODE_TRANSFORM_USING_AFFINE_MATRIX
m_bIsTransformGLDirty = true;
#endif
}
}
/// anchorPointInPixels getter
@ -285,15 +285,15 @@ CGSize CCNode::getContentSize()
/// @todo contentSize setter
void CCNode::setContentSize(CGSize size)
{
//if( ! CGSizeEqualToSize(size, m_contentSize) )
//{
// m_contentSize = size;
// m_anchorPointInPixels = ccp( m_contentSize.width * m_anchorPoint.x, m_contentSize.height * m_anchorPoint.y );
// m_isTransformDirty = m_isInverseDirty = true;
// #ifdef CCX_NODE_TRANSFORM_USING_AFFINE_MATRIX
// m_bIsTransformGLDirty = true;
// #endif
//}
if( ! CGSize::CGSizeEqualToSize(size, m_tContentSize) )
{
m_tContentSize = size;
m_tAnchorPointInPixels = ccp( m_tContentSize.width * m_tAnchorPoint.x, m_tContentSize.height * m_tAnchorPoint.y );
m_bIsTransformDirty = m_bIsInverseDirty = true;
#ifdef CCX_NODE_TRANSFORM_USING_AFFINE_MATRIX
m_bIsTransformGLDirty = true;
#endif
}
}
@ -368,13 +368,12 @@ void CCNode::setUserData(void *var)
/** @todo
#if CC_COCOSNODE_RENDER_SUBPIXEL
#define RENDER_IN_SUBPIXEL
#else
#define RENDER_IN_SUBPIXEL (int)
#endif
*/

View File

@ -23,6 +23,7 @@ THE SOFTWARE.
****************************************************************************/
#include "CCTransition.h"
#include "../support/cgpointextension.h"
enum {
@ -92,20 +93,21 @@ void CCTransitionScene::draw()
void CCTransitionScene::finish()
{
/** @todo
/* clean up
[inScene setVisible:YES];
[inScene setPosition:ccp(0,0)];
[inScene setScale:1.0f];
[inScene setRotation:0.0f];
[inScene.camera restore];
// clean up
// m_pInScene->setIsVisible(true);
// m_pInScene->setPosition(ccp(0,0));
// m_pInScene->setScale(1.0f);
// m_pInScene->setRotation(0.0f);
// m_pInScene->getCamera()->restore();
//
// m_pOutScene->setIsVisible(false);
// m_pOutScene->setPosition(ccp(0,0));
// m_pOutScene->setScale(1.0f);
// m_pOutScene->setRotation(0.0f);
// m_pOutScene->getCamera()->restore();
[outScene setVisible:NO];
[outScene setPosition:ccp(0,0)];
[outScene setScale:1.0f];
[outScene setRotation:0.0f];
[outScene.camera restore];
[self schedule:@selector(setNewScene:) interval:0];*/
this->schedule(&CCTransitionScene::setNewScene, 0);
// [self schedule:@selector(setNewScene:) interval:0];*/
}
@ -318,8 +320,8 @@ CCIntervalAction* CCMoveInLTransition::easeActionWithAction(CCIntervalAction* ac
void CCMoveInLTransition::initScenes()
{
/** @todo
CGSize s = [[CCDirector sharedDirector] winSize];
[inScene setPosition: ccp( -s.width,0) ];*/
CGSize s = CCDirector::getSharedDirector()->getWinSize();
m_pInScene->setPosition: ccp( -s.width,0);*/
}

View File

@ -41,7 +41,7 @@ THE SOFTWARE.
- cpvadd( CGPointMake(1,1), CGPointMake(2,2) ); // mixing chipmunk and CG (avoid)
*/
#include "cocoa/CGGeometry.h"
#include "../cocoa/CGGeometry.h"
#include <math.h>

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#ifndef __SUPPORT_BASE64_H__
#define __SUPPORT_BASE64_H__
#include "platform/platform.h"
#include "../platform/platform.h"
#ifdef __cplusplus
extern "C" {