From f1ca3f9a8a950fdef2a9ee780c8443741552a49d Mon Sep 17 00:00:00 2001 From: Nite Luo Date: Tue, 26 Nov 2013 16:54:48 -0800 Subject: [PATCH] Fix NewRendererTest after change --- .../NewRendererTest/NewRendererTest.cpp | 4 --- .../Classes/NewRendererTest/NewRendererTest.h | 33 +++++++++++-------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp b/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp index 3fdc5b5fc8..6b24656607 100644 --- a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp @@ -31,8 +31,6 @@ Layer* nextTest() sceneIdx = sceneIdx % MAX_LAYER; auto layer = (createFunctions[sceneIdx])(); - layer->autorelease(); - return layer; } @@ -44,7 +42,6 @@ Layer* prevTest() sceneIdx += total; auto layer = (createFunctions[sceneIdx])(); - layer->autorelease(); return layer; } @@ -52,7 +49,6 @@ Layer* prevTest() Layer* restartTest() { auto layer = (createFunctions[sceneIdx])(); - layer->autorelease(); return layer; } diff --git a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.h b/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.h index 85be3bddd1..17d3cd0267 100644 --- a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.h +++ b/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.h @@ -26,9 +26,7 @@ public: class MultiSceneTest : public BaseTest { public: - MultiSceneTest(); - virtual ~MultiSceneTest(); - + CREATE_FUNC(MultiSceneTest); virtual string title(); virtual string subtitle(); virtual void onEnter(); @@ -36,13 +34,17 @@ public: void restartCallback(Object* sender); void nextCallback(Object* sender); void backCallback(Object* sender); + +protected: + MultiSceneTest(); + virtual ~MultiSceneTest(); + }; class NewSpriteTest : public MultiSceneTest { public: - NewSpriteTest(); - virtual ~NewSpriteTest(); + CREATE_FUNC(NewSpriteTest); virtual string title(); virtual string subtitle(); @@ -52,29 +54,31 @@ public: void onTouchesEnded(const std::vector& touches, Event* event); protected: - + NewSpriteTest(); + virtual ~NewSpriteTest(); }; class NewSpriteBatchTest : public MultiSceneTest { public: - NewSpriteBatchTest(); - virtual ~NewSpriteBatchTest(); + CREATE_FUNC(NewSpriteBatchTest); virtual string title(); virtual string subtitle(); void onTouchesEnded(const vector& touches, Event* event); void addNewSpriteWithCoords(Point p); +protected: + NewSpriteBatchTest(); + virtual ~NewSpriteBatchTest(); }; class NewClippingNodeTest : public MultiSceneTest { public: - NewClippingNodeTest(); - virtual ~NewClippingNodeTest(); + CREATE_FUNC(NewClippingNodeTest); virtual string title(); virtual string subtitle(); @@ -83,6 +87,9 @@ public: void onTouchesEnded(const std::vector& touches, Event *event); protected: + NewClippingNodeTest(); + virtual ~NewClippingNodeTest(); + bool _scrolling; Point _lastPoint; }; @@ -90,14 +97,14 @@ protected: class NewDrawNodeTest : public MultiSceneTest { public: - NewDrawNodeTest(); - virtual ~NewDrawNodeTest(); + CREATE_FUNC(NewDrawNodeTest) virtual string title(); virtual string subtitle(); protected: - + NewDrawNodeTest(); + virtual ~NewDrawNodeTest(); }; #endif //__NewRendererTest_H_