Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop

This commit is contained in:
yinkaile 2013-12-19 15:44:05 +08:00
commit c02272ade3
8 changed files with 53 additions and 121 deletions

View File

@ -1203,7 +1203,7 @@ const kmMat4& Node::getNodeToParentTransform() const
0, 0, 1, 0,
0, 0, 0, 1};
kmMat4Multiply(&_transform, &skewMatrix, &_transform);
kmMat4Multiply(&_transform, &_transform, &skewMatrix);
// adjust anchor point
if (!_anchorPointInPoints.equals(Point::ZERO))

View File

@ -322,9 +322,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="renderer\CCGroupCommand.cpp" />
<ClCompile Include="renderer\CCMaterialManager.cpp" />
<ClCompile Include="renderer\CCNewClippingNode.cpp" />
<ClCompile Include="renderer\CCNewDrawNode.cpp" />
<ClCompile Include="renderer\CCNewLabelAtlas.cpp" />
<ClCompile Include="renderer\CCNewParticleSystemQuad.cpp" />
<ClCompile Include="renderer\CCNewRenderTexture.cpp" />
<ClCompile Include="renderer\CCNewSprite.cpp" />
<ClCompile Include="renderer\CCNewSpriteBatchNode.cpp" />
@ -534,9 +531,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="renderer\CCGroupCommand.h" />
<ClInclude Include="renderer\CCMaterialManager.h" />
<ClInclude Include="renderer\CCNewClippingNode.h" />
<ClInclude Include="renderer\CCNewDrawNode.h" />
<ClInclude Include="renderer\CCNewLabelAtlas.h" />
<ClInclude Include="renderer\CCNewParticleSystemQuad.h" />
<ClInclude Include="renderer\CCNewRenderTexture.h" />
<ClInclude Include="renderer\CCNewSprite.h" />
<ClInclude Include="renderer\CCNewSpriteBatchNode.h" />

View File

@ -587,15 +587,6 @@
<ClCompile Include="renderer\CCNewClippingNode.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="renderer\CCNewDrawNode.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="renderer\CCNewLabelAtlas.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="renderer\CCNewParticleSystemQuad.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="renderer\CCNewRenderTexture.cpp">
<Filter>renderer</Filter>
</ClCompile>
@ -1215,15 +1206,6 @@
<ClInclude Include="renderer\CCNewClippingNode.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="renderer\CCNewDrawNode.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="renderer\CCNewLabelAtlas.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="renderer\CCNewParticleSystemQuad.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="renderer\CCNewRenderTexture.h">
<Filter>renderer</Filter>
</ClInclude>

@ -1 +1 @@
Subproject commit fd61548d4697e68b5f893bdb919ab0667af26096
Subproject commit f7232cc1184f84b6a47cc2a44aaf045bf1a87c68

View File

@ -32,11 +32,10 @@
static std::function<NodeChildrenMainScene*()> createFunctions[] =
{
CL(IterateSpriteSheetForLoop),
CL(IterateSpriteSheetCArray),
CL(IterateSpriteSheetIterator),
CL(IterateSpriteSheetForEach),
CL(CallFuncsSpriteSheetForEach),
CL(CallFuncsSpriteSheetCMacro),
CL(AddSprite),
CL(AddSpriteSheet),
@ -312,43 +311,6 @@ const char* IterateSpriteSheetForLoop::testName()
return "Iterator: C++11 for loop";
}
////////////////////////////////////////////////////////
//
// IterateSpriteSheetCArray
//
////////////////////////////////////////////////////////
void IterateSpriteSheetCArray::update(float dt)
{
// iterate using fast enumeration protocol
auto& children = batchNode->getChildren();
// Object* object = NULL;
CC_PROFILER_START(this->profilerName());
//FIXME: James CCARRAY_FOREACH(children, object)
// {
// auto sprite = static_cast<Sprite*>(object);
// sprite->setVisible(false);
// }
CC_PROFILER_STOP(this->profilerName());
}
std::string IterateSpriteSheetCArray::title() const
{
return "Iterate SpriteSheet";
}
std::string IterateSpriteSheetCArray::subtitle() const
{
return "Iterate children using C Array API. See console";
}
const char* IterateSpriteSheetCArray::testName()
{
return "Iterator: CC_ARRAY_FOREACH";
}
////////////////////////////////////////////////////////
//
@ -387,6 +349,43 @@ const char* IterateSpriteSheetIterator::testName()
return "Iterator: begin(), end()";
}
////////////////////////////////////////////////////////
//
// IterateSpriteSheetForEach
//
////////////////////////////////////////////////////////
void IterateSpriteSheetForEach::update(float dt)
{
// iterate using fast enumeration protocol
auto& children = batchNode->getChildren();
CC_PROFILER_START(this->profilerName());
std::for_each(std::begin(children), std::end(children), [](Node *child) {
auto sprite = static_cast<Sprite*>(child);
sprite->setVisible(false);
});
CC_PROFILER_STOP(this->profilerName());
}
std::string IterateSpriteSheetForEach::title() const
{
return "Iterate SpriteSheet";
}
std::string IterateSpriteSheetForEach::subtitle() const
{
return "Iterate children using std::for_each(). See console";
}
const char* IterateSpriteSheetForEach::testName()
{
return "Iterator: std::for_each()";
}
////////////////////////////////////////////////////////
//
// CallFuncsSpriteSheetForEach
@ -428,38 +427,6 @@ const char* CallFuncsSpriteSheetForEach::testName()
return "Map: std::for_each";
}
////////////////////////////////////////////////////////
//
// CallFuncsSpriteSheetCMacro
//
////////////////////////////////////////////////////////
void CallFuncsSpriteSheetCMacro::update(float dt)
{
// iterate using fast enumeration protocol
auto& children = batchNode->getChildren();
CC_PROFILER_START(this->profilerName());
//FIXME: James arrayMakeObjectsPerformSelector(children, getPosition, Node*);
CC_PROFILER_STOP(this->profilerName());
}
std::string CallFuncsSpriteSheetCMacro::title() const
{
return "'map' functional call";
}
std::string CallFuncsSpriteSheetCMacro::subtitle() const
{
return "Using 'arrayMakeObjectsPerformSelector'. See console";
}
const char* CallFuncsSpriteSheetCMacro::testName()
{
return "Map: arrayMakeObjectsPerformSelector";
}
////////////////////////////////////////////////////////
//
// AddRemoveSpriteSheet

View File

@ -83,10 +83,10 @@ public:
virtual const char* testName();
};
class IterateSpriteSheetCArray : public IterateSpriteSheet
class IterateSpriteSheetForEach : public IterateSpriteSheet
{
public:
CREATE_FUNC(IterateSpriteSheetCArray);
CREATE_FUNC(IterateSpriteSheetForEach);
virtual void update(float dt);
@ -95,6 +95,7 @@ public:
virtual const char* testName();
};
class AddRemoveSpriteSheet : public NodeChildrenMainScene
{
public:
@ -126,18 +127,6 @@ public:
virtual const char* testName();
};
class CallFuncsSpriteSheetCMacro : public IterateSpriteSheet
{
public:
CREATE_FUNC(CallFuncsSpriteSheetCMacro);
virtual void update(float dt);
virtual std::string title() const override;
virtual std::string subtitle() const override;
virtual const char* testName();
};
///
class AddSprite : public AddRemoveSpriteSheet

View File

@ -10,7 +10,7 @@ class ShaderTestDemo2 : public BaseTest
{
public:
ShaderTestDemo2(void);
virtual std::string title() { return "Shader Sprite!";}
virtual std::string title() const { return "Shader Sprite!";}
void restartCallback(Object* sender);
void nextCallback(Object* sender);
void backCallback(Object* sender);
@ -29,7 +29,7 @@ public:
CREATE_FUNC(NormalSpriteTest);
NormalSpriteTest();
virtual std::string subtitle() {return "NormalSpriteTest";}
virtual std::string subtitle() const {return "NormalSpriteTest";}
};
class GreyScaleSpriteTest : public ShaderTestDemo2
@ -38,7 +38,7 @@ public:
CREATE_FUNC(GreyScaleSpriteTest);
GreyScaleSpriteTest();
virtual std::string subtitle() {return "GreyScaleSpriteTest";}
virtual std::string subtitle() const {return "GreyScaleSpriteTest";}
};
class BlurSpriteTest : public ShaderTestDemo2
@ -47,7 +47,7 @@ public:
CREATE_FUNC(BlurSpriteTest);
BlurSpriteTest();
virtual std::string subtitle() {return "BlurSpriteTest";}
virtual std::string subtitle() const {return "BlurSpriteTest";}
};
class NoiseSpriteTest : public ShaderTestDemo2
@ -55,7 +55,7 @@ class NoiseSpriteTest : public ShaderTestDemo2
public:
CREATE_FUNC(NoiseSpriteTest);
NoiseSpriteTest();
virtual std::string subtitle() {return "NoiseSpriteTest";}
virtual std::string subtitle() const {return "NoiseSpriteTest";}
};
class EdgeDetectionSpriteTest : public ShaderTestDemo2
@ -64,7 +64,7 @@ public:
CREATE_FUNC(EdgeDetectionSpriteTest);
EdgeDetectionSpriteTest();
virtual std::string subtitle() {return "EdgeDetectionSpriteTest";}
virtual std::string subtitle() const {return "EdgeDetectionSpriteTest";}
};
class BloomSpriteTest : public ShaderTestDemo2
@ -73,7 +73,7 @@ public:
CREATE_FUNC(BloomSpriteTest);
BloomSpriteTest();
virtual std::string subtitle() {return "BloomSpriteTest";}
virtual std::string subtitle() const {return "BloomSpriteTest";}
};
class LensFlareSpriteTest : public ShaderTestDemo2
@ -82,7 +82,7 @@ public:
CREATE_FUNC(LensFlareSpriteTest);
LensFlareSpriteTest();
virtual std::string subtitle() {return "LensFlareSpriteTest";}
virtual std::string subtitle() const {return "LensFlareSpriteTest";}
};
class CelShadingSpriteTest : public ShaderTestDemo2
@ -91,7 +91,7 @@ public:
CREATE_FUNC(CelShadingSpriteTest);
CelShadingSpriteTest();
virtual std::string subtitle() {return "CelShadingSpriteTest";}
virtual std::string subtitle() const {return "CelShadingSpriteTest";}
};
#endif

@ -1 +1 @@
Subproject commit 2385ac363e94068c4b888f0c9d7730c88f52dfc9
Subproject commit a8e5123121a4c537bfa9e79f7adb981c17b18e6e