Merge branch 'v3' into v3_refactor_normalize

This commit is contained in:
Huabing.Xu 2014-04-30 20:08:37 +08:00
commit c722b74e36
6 changed files with 23 additions and 27 deletions

View File

@ -1 +1 @@
e1bea41c2505fcd3a7ca40e4840eb5e76498472b
cb0a40f4bf1621a4000378bebcf0a4c1f6b85037

View File

@ -725,21 +725,14 @@ void ParticleSystem::update(float dt)
tmp = radial + tangential + modeA.gravity;
tmp = tmp * dt;
p->modeA.dir = p->modeA.dir + tmp;
if (_configName.length()>0)
{
if (_yCoordFlipped == -1)
{
tmp = p->modeA.dir * dt;
}
else
{
tmp = p->modeA.dir * -dt;
}
}
else
{
tmp = p->modeA.dir * dt;
}
if (_configName.length()>0 && _yCoordFlipped == -1)
{
tmp = p->modeA.dir * -dt;
}
else
{
tmp = p->modeA.dir * dt;
}
p->pos = p->pos + tmp;
}

View File

@ -194,11 +194,12 @@ bool RenderTexture::initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat
do
{
_fullRect = _rtTextureRect = Rect(0,0,w,h);
Size size = Director::getInstance()->getWinSizeInPixels();
_fullviewPort = Rect(0,0,size.width,size.height);
//Size size = Director::getInstance()->getWinSizeInPixels();
//_fullviewPort = Rect(0,0,size.width,size.height);
w = (int)(w * CC_CONTENT_SCALE_FACTOR());
h = (int)(h * CC_CONTENT_SCALE_FACTOR());
_fullviewPort = Rect(0,0,w,h);
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO);
// textures must be power of two squared
@ -522,7 +523,6 @@ void RenderTexture::onBegin()
{
//
Director *director = Director::getInstance();
Size size = director->getWinSizeInPixels();
_oldProjMatrix = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, _projectionMatrix);
@ -541,14 +541,17 @@ void RenderTexture::onBegin()
#endif
const Size& texSize = _texture->getContentSizeInPixels();
// Calculate the adjustment ratios based on the old and new projections
Size size = director->getWinSizeInPixels();
float widthRatio = size.width / texSize.width;
float heightRatio = size.height / texSize.height;
Matrix orthoMatrix;
Matrix::createOrthographicOffCenter((float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1, 1, &orthoMatrix);
director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, orthoMatrix);
director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, orthoMatrix);
}
//calculate viewport
{
Rect viewport;
@ -696,12 +699,13 @@ void RenderTexture::begin()
// Calculate the adjustment ratios based on the old and new projections
Size size = director->getWinSizeInPixels();
float widthRatio = size.width / texSize.width;
float heightRatio = size.height / texSize.height;
Matrix orthoMatrix;
Matrix::createOrthographicOffCenter((float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1, 1, &orthoMatrix);
director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, orthoMatrix);
director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, orthoMatrix);
}
_groupCommand.init(_globalZOrder);

View File

@ -559,7 +559,7 @@ bool Value::asBool() const
return _baseData.doubleVal == 0.0 ? false : true;
}
return true;
return false;
}
std::string Value::asString() const

View File

@ -408,8 +408,7 @@ void RenderTextureZbuffer::renderScreenShot()
{
return;
}
texture->setAnchorPoint(Vector2(0, 0));
texture->setKeepMatrix(true);
texture->begin();
this->visit();

@ -1 +1 @@
Subproject commit 69c060f7e9004c23ddf1b7611d64d7ea15b27ea4
Subproject commit 4dbfa174debb2e98422510d7e0490b1ddb2a0b3d