diff --git a/core/2d/CCLayer.h b/core/2d/CCLayer.h index 0057dd2c10..aa08484fff 100644 --- a/core/2d/CCLayer.h +++ b/core/2d/CCLayer.h @@ -6,7 +6,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2021-2022 Bytedance Inc. -https://axmolengine.github.io/axis +https://axmolengine.github.io/axmol Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/core/base/ccConfig.h b/core/base/ccConfig.h index aec3ef01da..21c7daa62b 100644 --- a/core/base/ccConfig.h +++ b/core/base/ccConfig.h @@ -5,7 +5,7 @@ Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -https://axmolengine.github.io/ +https://axmolengine.github.io/axmol Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -376,7 +376,6 @@ THE SOFTWARE. #endif namespace ax {} -namespace axis = ax; // DEPRECATED -namespace axmol = ax; // DEPRECATED +namespace axmol = ax; // end of namespace group /// @} diff --git a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.h b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.h index 4b8e4e9a0c..0da66ae073 100644 --- a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.h +++ b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.h @@ -32,7 +32,7 @@ DEFINE_TEST_SUITE(ActionManagerTests); class ActionManagerTest : public TestCase { protected: - axis::TextureAtlas* _atlas; + ax::TextureAtlas* _atlas; std::string _title; diff --git a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.h b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.h index 71b455e35f..b984c05de7 100644 --- a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.h +++ b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.h @@ -34,9 +34,9 @@ DEFINE_TEST_SUITE(ActionsEaseTests); class EaseSpriteDemo : public TestCase { protected: - axis::Sprite* _grossini; - axis::Sprite* _tamara; - axis::Sprite* _kathia; + ax::Sprite* _grossini; + ax::Sprite* _tamara; + ax::Sprite* _kathia; std::string _title; diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index e772b08907..70d951600a 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp @@ -1663,7 +1663,7 @@ void Issue1305::onEnter() void Issue1305::log(Node* sender) { - axis::log("This message SHALL ONLY appear when the sprite is added to the scene, NOT BEFORE"); + ax::log("This message SHALL ONLY appear when the sprite is added to the scene, NOT BEFORE"); } void Issue1305::onExit() @@ -2140,11 +2140,11 @@ void ActionResize::onEnter() imageViewResize->setContentSize(Size(50.0f, 40.0f)); imageViewResize->setPosition(Vec2((widgetSize.width / 2.0f) + offset.x, (widgetSize.height / 2.0f) + offset.y)); - auto resizeDown = axis::ResizeTo::create(2.8f, Size(50.0f, 40.0f)); - auto resizeUp = axis::ResizeTo::create(2.8f, Size(300.0f, 40.0f)); + auto resizeDown = ax::ResizeTo::create(2.8f, Size(50.0f, 40.0f)); + auto resizeUp = ax::ResizeTo::create(2.8f, Size(300.0f, 40.0f)); - auto resizeByDown = axis::ResizeBy::create(1.8f, Size(0.0f, -30.0f)); - auto resizeByUp = axis::ResizeBy::create(1.8f, Size(0.0f, 30.0f)); + auto resizeByDown = ax::ResizeBy::create(1.8f, Size(0.0f, -30.0f)); + auto resizeByUp = ax::ResizeBy::create(1.8f, Size(0.0f, 30.0f)); addChild(imageViewResize); auto rep = RepeatForever::create(Sequence::create(resizeUp, resizeDown, resizeByDown, resizeByUp, nullptr)); imageViewResize->runAction(rep); @@ -2155,11 +2155,11 @@ void ActionResize::onEnter() imageViewScale->setContentSize(Size(50.0f, 40.0f)); imageViewScale->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - auto scaleDownScale = axis::ScaleTo::create(2.8f, 1.0f); - auto scaleUpScale = axis::ScaleTo::create(2.8f, 6.0f, 1.0f); + auto scaleDownScale = ax::ScaleTo::create(2.8f, 1.0f); + auto scaleUpScale = ax::ScaleTo::create(2.8f, 6.0f, 1.0f); - auto scaleByDownScale = axis::ScaleBy::create(1.8f, 1.0f, 0.25f); - auto scaleByUpScale = axis::ScaleBy::create(1.8f, 1.0f, 4.0f); + auto scaleByDownScale = ax::ScaleBy::create(1.8f, 1.0f, 0.25f); + auto scaleByUpScale = ax::ScaleBy::create(1.8f, 1.0f, 4.0f); addChild(imageViewScale); auto rep2 = RepeatForever::create( Sequence::create(scaleUpScale, scaleDownScale, scaleByDownScale, scaleByUpScale, nullptr)); @@ -2227,8 +2227,8 @@ void Issue14936_1::onEnter() ActionsDemo::onEnter(); centerSprites(0); - auto origin = axis::Director::getInstance()->getVisibleOrigin(); - auto visibleSize = axis::Director::getInstance()->getVisibleSize(); + auto origin = ax::Director::getInstance()->getVisibleOrigin(); + auto visibleSize = ax::Director::getInstance()->getVisibleSize(); _count = 0; @@ -2256,8 +2256,8 @@ void Issue14936_2::onEnter() ActionsDemo::onEnter(); centerSprites(0); - auto origin = axis::Director::getInstance()->getVisibleOrigin(); - auto visibleSize = axis::Director::getInstance()->getVisibleSize(); + auto origin = ax::Director::getInstance()->getVisibleOrigin(); + auto visibleSize = ax::Director::getInstance()->getVisibleSize(); _count = 0; auto counterLabel = Label::createWithTTF("0", "fonts/Marker Felt.ttf", 16.0f); @@ -2303,21 +2303,21 @@ void SequenceWithFinalInstant::onEnter() { TestCase::onEnter(); - _manager = new axis::ActionManager(); + _manager = new ax::ActionManager(); - _target = axis::Node::create(); + _target = ax::Node::create(); _target->setActionManager(_manager); _target->retain(); _target->onEnter(); bool called(false); const auto f([&called]() -> void { - axis::log("Callback called."); + ax::log("Callback called."); called = true; }); const auto action = - axis::Sequence::create(axis::DelayTime::create(0.05f), axis::CallFunc::create(f), nullptr); + ax::Sequence::create(ax::DelayTime::create(0.05f), ax::CallFunc::create(f), nullptr); _target->runAction(action); _manager->update(0); diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h index 5d4eb5e171..ed05883e5a 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h @@ -34,9 +34,9 @@ DEFINE_TEST_SUITE(ActionsTests); class ActionsDemo : public TestCase { protected: - axis::Sprite* _grossini; - axis::Sprite* _tamara; - axis::Sprite* _kathia; + ax::Sprite* _grossini; + ax::Sprite* _tamara; + ax::Sprite* _kathia; public: virtual void onEnter() override; @@ -184,7 +184,7 @@ public: virtual std::string subtitle() const override; private: - axis::EventListenerCustom* _frameDisplayedListener; + ax::EventListenerCustom* _frameDisplayedListener; }; class ActionSequence : public ActionsDemo @@ -402,9 +402,9 @@ public: virtual void onEnter() override; virtual std::string title() const override; virtual std::string subtitle() const override; - virtual void addNewSpriteWithCoords(axis::Vec2 p); - virtual void runActionsInSprite(axis::Sprite* sprite); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + virtual void addNewSpriteWithCoords(ax::Vec2 p); + virtual void runActionsInSprite(ax::Sprite* sprite); + void onTouchesEnded(const std::vector& touches, ax::Event* event); }; class ActionMoveStacked : public ActionStacked @@ -413,7 +413,7 @@ public: CREATE_FUNC(ActionMoveStacked); virtual std::string title() const override; - virtual void runActionsInSprite(axis::Sprite* sprite) override; + virtual void runActionsInSprite(ax::Sprite* sprite) override; }; class ActionMoveJumpStacked : public ActionStacked @@ -422,7 +422,7 @@ public: CREATE_FUNC(ActionMoveJumpStacked); virtual std::string title() const override; - virtual void runActionsInSprite(axis::Sprite* sprite) override; + virtual void runActionsInSprite(ax::Sprite* sprite) override; }; class ActionMoveBezierStacked : public ActionStacked @@ -431,7 +431,7 @@ public: CREATE_FUNC(ActionMoveBezierStacked); virtual std::string title() const override; - virtual void runActionsInSprite(axis::Sprite* sprite) override; + virtual void runActionsInSprite(ax::Sprite* sprite) override; }; class ActionCatmullRomStacked : public ActionsDemo @@ -468,7 +468,7 @@ public: virtual std::string subtitle() const override; private: - axis::Sprite* _spriteTmp; + ax::Sprite* _spriteTmp; }; class Issue1305_2 : public ActionsDemo @@ -513,7 +513,7 @@ public: virtual void onEnter() override; virtual std::string subtitle() const override; virtual std::string title() const override; - void logSprRotation(axis::Sprite* sender); + void logSprRotation(ax::Sprite* sender); }; class Issue1398 : public ActionsDemo @@ -580,7 +580,7 @@ public: virtual std::string title() const override; private: - axis::Vector _pausedTargets; + ax::Vector _pausedTargets; }; class ActionResize : public ActionsDemo @@ -637,8 +637,8 @@ public: virtual void onExit() override; private: - axis::ActionManager* _manager; - axis::Node* _target; + ax::ActionManager* _manager; + ax::Node* _target; }; class Issue18003 : public ActionsDemo @@ -651,8 +651,8 @@ public: virtual void onExit() override; private: - axis::ActionManager* _manager; - axis::Node* _target; + ax::ActionManager* _manager; + ax::Node* _target; }; #endif diff --git a/tests/cpp-tests/Classes/AppDelegate.h b/tests/cpp-tests/Classes/AppDelegate.h index d2df13cf9b..b24535f428 100644 --- a/tests/cpp-tests/Classes/AppDelegate.h +++ b/tests/cpp-tests/Classes/AppDelegate.h @@ -35,7 +35,7 @@ class TestController; Private inheritance here hides part of interface from Director. */ -class AppDelegate : private axis::Application +class AppDelegate : private ax::Application { public: AppDelegate(); @@ -44,7 +44,7 @@ public: virtual void initGLContextAttrs(); /** - @brief Implement Director and axis::Scene* init code here. + @brief Implement Director and ax::Scene* init code here. @return true Initialize success, app continue. @return false Initialize failed, app terminate. */ diff --git a/tests/cpp-tests/Classes/BaseTest.h b/tests/cpp-tests/Classes/BaseTest.h index d6821e89cf..91c6676638 100644 --- a/tests/cpp-tests/Classes/BaseTest.h +++ b/tests/cpp-tests/Classes/BaseTest.h @@ -38,7 +38,7 @@ class TestSuite; /** * Each test case should inherit from TestCase, and add to a TestSuite object. */ -class TestCase : public axis::Scene +class TestCase : public ax::Scene { public: /** TestCase test type.*/ @@ -73,10 +73,10 @@ public: virtual std::string getActualOutput() const { return ""; } /** Callback functions.*/ - virtual void restartTestCallback(axis::Ref* sender); - virtual void nextTestCallback(axis::Ref* sender); - virtual void priorTestCallback(axis::Ref* sender); - virtual void onBackCallback(axis::Ref* sender); + virtual void restartTestCallback(ax::Ref* sender); + virtual void nextTestCallback(ax::Ref* sender); + virtual void priorTestCallback(ax::Ref* sender); + virtual void onBackCallback(ax::Ref* sender); /** * You should NEVER call this method, unless you know what you are doing. @@ -93,19 +93,19 @@ public: void setTestCaseName(std::string_view name) { _testCaseName = name; } std::string getTestCaseName() const { return _testCaseName; } - const axis::Label* getSubtitleLable() const { return _subtitleLabel; } - const axis::MenuItemImage* getRestartTestItem() const { return _restartTestItem; } + const ax::Label* getSubtitleLable() const { return _subtitleLabel; } + const ax::MenuItemImage* getRestartTestItem() const { return _restartTestItem; } virtual void onEnter() override; virtual bool init() override; protected: - axis::MenuItemImage* _priorTestItem; - axis::MenuItemImage* _restartTestItem; - axis::MenuItemImage* _nextTestItem; + ax::MenuItemImage* _priorTestItem; + ax::MenuItemImage* _restartTestItem; + ax::MenuItemImage* _nextTestItem; - axis::Label* _titleLabel; - axis::Label* _subtitleLabel; + ax::Label* _titleLabel; + ax::Label* _subtitleLabel; private: TestSuite* _testSuite; @@ -121,7 +121,7 @@ private: * * @note You should not inherit from TestBase directly. */ -class TestBase : public axis::Ref +class TestBase : public ax::Ref { public: virtual ~TestBase(); @@ -162,7 +162,7 @@ class TestController; class TestSuite : public TestBase { public: - void addTestCase(std::string_view testName, std::function callback); + void addTestCase(std::string_view testName, std::function callback); virtual void restartCurrTest(); virtual void enterNextTest(); @@ -172,7 +172,7 @@ public: virtual void runThisTest() override; private: - std::vector> _testCallbacks; + std::vector> _testCallbacks; int _currTestIndex; friend class TestController; @@ -184,8 +184,8 @@ class TestCustomTableView; * An instance of TestList is a means for displaying hierarchical lists of TestSuite. */ class TestList : public TestBase, - public axis::extension::TableViewDataSource, - public axis::extension::TableViewDelegate + public ax::extension::TableViewDataSource, + public ax::extension::TableViewDelegate { public: TestList(); @@ -195,15 +195,15 @@ public: virtual void runThisTest() override; - virtual void tableCellTouched(axis::extension::TableView* table, - axis::extension::TableViewCell* cell) override; - virtual axis::extension::TableViewCell* tableCellAtIndex(axis::extension::TableView* table, + virtual void tableCellTouched(ax::extension::TableView* table, + ax::extension::TableViewCell* cell) override; + virtual ax::extension::TableViewCell* tableCellAtIndex(ax::extension::TableView* table, ssize_t idx) override; - virtual axis::Size tableCellSizeForIndex(axis::extension::TableView* table, ssize_t idx) override; - virtual ssize_t numberOfCellsInTableView(axis::extension::TableView* table) override; + virtual ax::Size tableCellSizeForIndex(ax::extension::TableView* table, ssize_t idx) override; + virtual ssize_t numberOfCellsInTableView(ax::extension::TableView* table) override; - virtual void scrollViewDidScroll(axis::extension::ScrollView* view) override {} - virtual void scrollViewDidZoom(axis::extension::ScrollView* view) override {} + virtual void scrollViewDidScroll(ax::extension::ScrollView* view) override {} + virtual void scrollViewDidZoom(ax::extension::ScrollView* view) override {} void deatchTableView(); @@ -211,7 +211,7 @@ private: std::vector> _testCallbacks; bool _cellTouchEnabled; bool _shouldRestoreTableOffset; - axis::Vec2 _tableOffset; + ax::Vec2 _tableOffset; friend class TestController; TestCustomTableView* _tableView{}; }; @@ -238,15 +238,15 @@ private: * BaseTest is retained for compatibility with older versions. * @warning It should soon be removed. */ -class BaseTest : public axis::Layer +class BaseTest : public ax::Layer { public: virtual std::string title() const { return ""; } virtual std::string subtitle() const { return ""; } - virtual void restartCallback(axis::Ref* sender) {} - virtual void nextCallback(axis::Ref* sender) {} - virtual void backCallback(axis::Ref* sender) {} + virtual void restartCallback(ax::Ref* sender) {} + virtual void nextCallback(ax::Ref* sender) {} + virtual void backCallback(ax::Ref* sender) {} virtual void onEnter() override {} virtual void onExit() override {} diff --git a/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.h b/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.h index 512bcb518a..f7005f7caa 100644 --- a/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.h +++ b/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.h @@ -55,19 +55,19 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; virtual void update(float dt) override; - void addNewBillBoardWithCoords(axis::Vec3 p); - void addNewAniBillBoardWithCoords(axis::Vec3 p); - void rotateCameraCallback(axis::Ref* sender, float value); - void onTouchesMoved(const std::vector& touches, axis::Event* event); + void addNewBillBoardWithCoords(ax::Vec3 p); + void addNewAniBillBoardWithCoords(ax::Vec3 p); + void rotateCameraCallback(ax::Ref* sender, float value); + void onTouchesMoved(const std::vector& touches, ax::Event* event); - void menuCallback_orientedPoint(axis::Ref* sender); - void menuCallback_orientedPlane(axis::Ref* sender); + void menuCallback_orientedPoint(ax::Ref* sender); + void menuCallback_orientedPlane(ax::Ref* sender); protected: - axis::Camera* _camera; - axis::Layer* _layerBillBoard; + ax::Camera* _camera; + ax::Layer* _layerBillBoard; - std::vector _billboards; + std::vector _billboards; }; DEFINE_TEST_SUITE(BillBoardTests); diff --git a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp index f47a125f7f..91177d79be 100644 --- a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp +++ b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp @@ -290,7 +290,7 @@ void Box2DTest::addNewSpriteAtPosition(Vec2 p) parent->addChild(sprite); sprite->setB2Body(body); sprite->setPTMRatio(PTM_RATIO); - sprite->setPosition(axis::Vec2(p.x, p.y)); + sprite->setPosition(ax::Vec2(p.x, p.y)); } void Box2DTest::update(float dt) diff --git a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.h b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.h index 5b79551f87..682c4fccf0 100644 --- a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.h +++ b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.h @@ -47,18 +47,18 @@ public: void initPhysics(); void createResetButton(); - void addNewSpriteAtPosition(axis::Vec2 p); + void addNewSpriteAtPosition(ax::Vec2 p); void update(float dt) override; - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); - void toggleDebugCallback(axis::Ref* sender); + void toggleDebugCallback(ax::Ref* sender); private: b2World* world; - axis::Texture2D* _spriteTexture; - axis::DrawNode* drawBox2D; - axis::extension::PhysicsDebugNodeBox2D g_debugDraw; + ax::Texture2D* _spriteTexture; + ax::DrawNode* drawBox2D; + ax::extension::PhysicsDebugNodeBox2D g_debugDraw; bool showDebugDraw = true; }; diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp index c0ab3ccb9e..5373568068 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp @@ -40,7 +40,7 @@ enum }; Settings settings; -axis::Label* labelDebugDraw; +ax::Label* labelDebugDraw; enum { diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.h b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.h index ff5f9bcee2..d72d00dc7e 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.h +++ b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.h @@ -46,7 +46,7 @@ extern TestEntry g_testEntries[MAX_TESTS]; int RegisterTest(const char* category, const char* name, TestCreateFcn* fcn); -class Box2DTestBed : public TestCase, axis::Layer +class Box2DTestBed : public TestCase, ax::Layer { public: static Box2DTestBed* createWithEntryID(int entryId); @@ -66,20 +66,20 @@ public: bool initWithEntryID(int entryId); - bool onTouchBegan(axis::Touch* touch, axis::Event* event); - void onTouchMoved(axis::Touch* touch, axis::Event* event); - void onTouchEnded(axis::Touch* touch, axis::Event* event); + bool onTouchBegan(ax::Touch* touch, ax::Event* event); + void onTouchMoved(ax::Touch* touch, ax::Event* event); + void onTouchEnded(ax::Touch* touch, ax::Event* event); - void onKeyPressed(axis::EventKeyboard::KeyCode code, axis::Event* event); - void onKeyReleased(axis::EventKeyboard::KeyCode code, axis::Event* event); + void onKeyPressed(ax::EventKeyboard::KeyCode code, ax::Event* event); + void onKeyReleased(ax::EventKeyboard::KeyCode code, ax::Event* event); - void onMouseDown(axis::Event* event); - void onMouseUp(axis::Event* event); - void onMouseMove(axis::Event* event); - void onMouseScroll(axis::Event* event); + void onMouseDown(ax::Event* event); + void onMouseUp(ax::Event* event); + void onMouseMove(ax::Event* event); + void onMouseScroll(ax::Event* event); - axis::EventListenerTouchOneByOne* _touchListener; - axis::EventListenerKeyboard* _keyboardListener; + ax::EventListenerTouchOneByOne* _touchListener; + ax::EventListenerKeyboard* _keyboardListener; TestEntry* m_entry; Test* m_test; @@ -87,15 +87,15 @@ public: private: b2World* world; - axis::Texture2D* _spriteTexture; + ax::Texture2D* _spriteTexture; b2Vec2 pos; b2Vec2 oldPos; bool button[2]; // Debug stuff - axis::DrawNode* debugDrawNode; - axis::extension::PhysicsDebugNodeBox2D g_debugDraw; + ax::DrawNode* debugDrawNode; + ax::extension::PhysicsDebugNodeBox2D g_debugDraw; }; #endif diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp index 6b6dfcb704..47bdf9e69b 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp @@ -28,7 +28,7 @@ USING_NS_AX; USING_NS_AX_EXT; #if defined(AX_PLATFORM_PC) -extern axis::Label* labelDebugDraw; +extern ax::Label* labelDebugDraw; #endif void DestructionListener::SayGoodbye(b2Joint* joint) diff --git a/tests/cpp-tests/Classes/Box2DTestBed/tests/test.h b/tests/cpp-tests/Classes/Box2DTestBed/tests/test.h index ee483a3884..7cf97d5842 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/tests/test.h +++ b/tests/cpp-tests/Classes/Box2DTestBed/tests/test.h @@ -115,8 +115,8 @@ public: void DrawAABB(b2AABB* aabb, const b2Color& color); void Flush(); - axis::extension::PhysicsDebugNodeBox2D g_debugDraw; - axis::DrawNode* debugDrawNode; + ax::extension::PhysicsDebugNodeBox2D g_debugDraw; + ax::DrawNode* debugDrawNode; std::string debugString = ""; b2World* m_world; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-1159.h b/tests/cpp-tests/Classes/BugsTest/Bug-1159.h index 54272a24b0..db5b0c6e35 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-1159.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-1159.h @@ -34,7 +34,7 @@ public: virtual void onExit() override; virtual std::string title() const override { return "Bug1159"; } - void callBack(axis::Ref* sender); + void callBack(ax::Ref* sender); CREATE_FUNC(Bug1159Layer); }; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-12847.h b/tests/cpp-tests/Classes/BugsTest/Bug-12847.h index 36ae9039d1..9bbb5eff00 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-12847.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-12847.h @@ -44,12 +44,12 @@ protected: virtual void onExit() override; private: - axis::Sprite* sprite1; - axis::Sprite* sprite2; - axis::Sprite* sprite3; - axis::Sprite* sprite4; + ax::Sprite* sprite1; + ax::Sprite* sprite2; + ax::Sprite* sprite3; + ax::Sprite* sprite4; - axis::Director::Projection _projection = axis::Director::Projection::_3D; + ax::Director::Projection _projection = ax::Director::Projection::_3D; }; #endif /* defined(__cocos2d_tests__Bug_12847__) */ diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp index d0743f88ec..a296bf8d73 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp @@ -92,18 +92,18 @@ void Bug14327Layer::update(float dt) } } -void Bug14327Layer::editBoxEditingDidBegin(axis::ui::EditBox* editBox) +void Bug14327Layer::editBoxEditingDidBegin(ax::ui::EditBox* editBox) { log("editBox %p DidBegin !", editBox); } -void Bug14327Layer::editBoxEditingDidEndWithAction(axis::ui::EditBox* editBox, - axis::ui::EditBoxDelegate::EditBoxEndAction EditBoxEndAction) +void Bug14327Layer::editBoxEditingDidEndWithAction(ax::ui::EditBox* editBox, + ax::ui::EditBoxDelegate::EditBoxEndAction EditBoxEndAction) { log("editBox %p DidEnd !", editBox); } -void Bug14327Layer::editBoxTextChanged(axis::ui::EditBox* editBox, std::string_view text) +void Bug14327Layer::editBoxTextChanged(ax::ui::EditBox* editBox, std::string_view text) { log("editBox %p TextChanged, text: %s ", editBox, text.data()); } diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-14327.h b/tests/cpp-tests/Classes/BugsTest/Bug-14327.h index 0ea83dc7d1..419fcc6890 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-14327.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-14327.h @@ -31,7 +31,7 @@ # include "ui/UIEditBox/UIEditBox.h" -class Bug14327Layer : public BugsTestBase, public axis::ui::EditBoxDelegate +class Bug14327Layer : public BugsTestBase, public ax::ui::EditBoxDelegate { public: CREATE_FUNC(Bug14327Layer); @@ -39,20 +39,20 @@ public: virtual bool init() override; virtual std::string title() const override { return "Bug14327"; } - virtual void editBoxEditingDidBegin(axis::ui::EditBox* editBox) override; + virtual void editBoxEditingDidBegin(ax::ui::EditBox* editBox) override; virtual void editBoxEditingDidEndWithAction( - axis::ui::EditBox* editBox, - axis::ui::EditBoxDelegate::EditBoxEndAction EditBoxEndAction) override; - virtual void editBoxTextChanged(axis::ui::EditBox* editBox, std::string_view text) override; - virtual void editBoxReturn(axis::ui::EditBox* editBox) override; + ax::ui::EditBox* editBox, + ax::ui::EditBoxDelegate::EditBoxEndAction EditBoxEndAction) override; + virtual void editBoxTextChanged(ax::ui::EditBox* editBox, std::string_view text) override; + virtual void editBoxReturn(ax::ui::EditBox* editBox) override; protected: virtual void update(float dt) override; private: time_t _removeTime; - axis::Label* _TTFShowTime; - axis::ui::EditBox* _edit; + ax::Label* _TTFShowTime; + ax::ui::EditBox* _edit; }; #endif diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-15776.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-15776.cpp index 26fd2471be..fd6543847f 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-15776.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-15776.cpp @@ -44,7 +44,7 @@ bool Bug15776Layer::init() { if (BugsTestBase::init()) { - axis::Image* cocos2dxImage = new axis::Image(); + ax::Image* cocos2dxImage = new ax::Image(); cocos2dxImage->initWithImageData(nullptr, 0, false); // should not crash. invalid cocos2dImage auto texture2d = Director::getInstance()->getTextureCache()->addImage(cocos2dxImage, "unused"); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-422.h b/tests/cpp-tests/Classes/BugsTest/Bug-422.h index 4ed1ddd48f..ec3d2d8a58 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-422.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-422.h @@ -37,7 +37,7 @@ public: void reset(); void check(Node* target); - void menuCallback(axis::Ref* sender); + void menuCallback(ax::Ref* sender); }; #endif // __BUG_422_H__ diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.h b/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.h index ca563ac50e..2a9fccc123 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.h @@ -33,7 +33,7 @@ public: CREATE_FUNC(Bug458Layer); virtual bool init() override; - void selectAnswer(axis::Ref* sender); + void selectAnswer(ax::Ref* sender); }; #endif // __BUG_458_H__ diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.h b/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.h index f97c732664..64c2370c20 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.h @@ -27,7 +27,7 @@ #include "axmol.h" -class QuestionContainerSprite : public axis::Sprite +class QuestionContainerSprite : public ax::Sprite { public: virtual bool init() override; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-624.h b/tests/cpp-tests/Classes/BugsTest/Bug-624.h index 3d1c8f7d8a..2795acb377 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-624.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-624.h @@ -33,7 +33,7 @@ public: virtual ~Bug624Layer(); virtual bool init() override; void switchLayer(float dt); - virtual void onAcceleration(axis::Acceleration* acc, axis::Event* event); + virtual void onAcceleration(ax::Acceleration* acc, ax::Event* event); virtual std::string title() const override { return "Bug624"; } CREATE_FUNC(Bug624Layer); @@ -45,7 +45,7 @@ public: virtual ~Bug624Layer2(); virtual bool init() override; void switchLayer(float dt); - virtual void onAcceleration(axis::Acceleration* acc, axis::Event* event); + virtual void onAcceleration(ax::Acceleration* acc, ax::Event* event); virtual std::string title() const override { return "Bug624-2"; } CREATE_FUNC(Bug624Layer2); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-914.h b/tests/cpp-tests/Classes/BugsTest/Bug-914.h index 8753ae7db1..0ec252998d 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-914.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-914.h @@ -33,9 +33,9 @@ public: virtual bool init() override; virtual std::string title() const override { return "Bug914"; } - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void restart(axis::Ref* sender); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void restart(ax::Ref* sender); CREATE_FUNC(Bug914Layer); }; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-Child.h b/tests/cpp-tests/Classes/BugsTest/Bug-Child.h index 2e5ea399fd..89d6cf7bae 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-Child.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-Child.h @@ -43,15 +43,15 @@ public: virtual bool init() override; virtual std::string title() const override { return "BugChild"; } - void switchChild(axis::Ref* sender); + void switchChild(ax::Ref* sender); protected: - axis::Sprite* parent1; - axis::Sprite* parent2; + ax::Sprite* parent1; + ax::Sprite* parent2; - axis::Sprite* child; + ax::Sprite* child; - axis::Menu* menu; + ax::Menu* menu; }; class BugCameraMask : public BugsTestBase @@ -62,10 +62,10 @@ public: virtual bool init() override; virtual std::string title() const override { return "BugCameraMask"; } - void switchSpriteFlag(axis::Ref* sender); + void switchSpriteFlag(ax::Ref* sender); void updateSpriteMaskLabel(); Node* _sprite; - axis::Label* _spriteMaskLabel; + ax::Label* _spriteMaskLabel; }; #endif /* defined(__Bug_Child__) */ diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp index 827a1ad647..81aebaa046 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp @@ -409,8 +409,8 @@ void Camera3DTestDemo::addNewSpriteWithCoords(Vec3 p, } mesh->setScale(scale); } -void Camera3DTestDemo::onTouchesBegan(const std::vector& touches, axis::Event* event) {} -void Camera3DTestDemo::onTouchesMoved(const std::vector& touches, axis::Event* event) +void Camera3DTestDemo::onTouchesBegan(const std::vector& touches, ax::Event* event) {} +void Camera3DTestDemo::onTouchesMoved(const std::vector& touches, ax::Event* event) { if (touches.size() == 1) { @@ -489,7 +489,7 @@ void Camera3DTestDemo::updateState(float elapsedTime) } } } -void Camera3DTestDemo::onTouchesEnded(const std::vector& touches, axis::Event* event) +void Camera3DTestDemo::onTouchesEnded(const std::vector& touches, ax::Event* event) { for (auto& item : touches) { @@ -528,7 +528,7 @@ void Camera3DTestDemo::onTouchesEnded(const std::vector& touches, axis:: } } } -void onTouchesCancelled(const std::vector& touches, axis::Event* event) {} +void onTouchesCancelled(const std::vector& touches, ax::Event* event) {} void Camera3DTestDemo::updateCamera(float fDelta) { if (_mesh) @@ -1118,7 +1118,7 @@ void CameraArcBallDemo::onTouchsMoved(const std::vector& touchs, Event* } } -void CameraArcBallDemo::calculateArcBall(axis::Vec3& axis, float& angle, float p1x, float p1y, float p2x, float p2y) +void CameraArcBallDemo::calculateArcBall(ax::Vec3& axis, float& angle, float p1x, float p1y, float p2x, float p2y) { Mat4 rotation_matrix; Mat4::createRotation(_rotationQuat, &rotation_matrix); @@ -1379,7 +1379,7 @@ void FogTestDemo::onExit() void FogTestDemo::update(float dt) {} -void FogTestDemo::onTouchesMoved(const std::vector& touches, axis::Event* event) +void FogTestDemo::onTouchesMoved(const std::vector& touches, ax::Event* event) { if (touches.size() == 1) { diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h index db27342353..f4a235a63c 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h @@ -68,10 +68,10 @@ class CameraBaseTest : public TestCase { public: protected: - axis::BillBoard* bill1; - axis::BillBoard* bill2; - axis::Label* l1; - axis::Label* l2; + ax::BillBoard* bill1; + ax::BillBoard* bill2; + ax::Label* l1; + ax::Label* l2; }; class CameraRotationTest : public CameraBaseTest @@ -92,9 +92,9 @@ public: virtual std::string subtitle() const override; protected: - axis::Node* _camControlNode; - axis::Node* _camNode; - axis::EventListenerTouchOneByOne* _lis; + ax::Node* _camControlNode; + ax::Node* _camNode; + ax::EventListenerTouchOneByOne* _lis; }; class Camera3DTestDemo : public CameraBaseTest @@ -108,55 +108,55 @@ public: virtual void onExit() override; // overrides virtual std::string title() const override; - void addNewSpriteWithCoords(axis::Vec3 p, + void addNewSpriteWithCoords(ax::Vec3 p, std::string fileName, bool playAnimation = false, float scale = 1.0f, bool bindCamera = false); - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); - void scaleCameraCallback(axis::Ref* sender, float value); - void rotateCameraCallback(axis::Ref* sender, float value); - void SwitchViewCallback(axis::Ref* sender, CameraType cameraType); + void scaleCameraCallback(ax::Ref* sender, float value); + void rotateCameraCallback(ax::Ref* sender, float value); + void SwitchViewCallback(ax::Ref* sender, CameraType cameraType); void updateCamera(float fDelta); void move3D(float elapsedTime); void updateState(float elapsedTime); bool isState(unsigned int state, unsigned int bit) const; void reachEndCallBack(); - bool onTouchesCommon(axis::Touch* touch, axis::Event* event, bool* touchProperty); - bool onTouchesZoomOut(axis::Touch* touch, axis::Event* event); - void onTouchesZoomOutEnd(axis::Touch* touch, axis::Event* event); - bool onTouchesZoomIn(axis::Touch* touch, axis::Event* event); - void onTouchesZoomInEnd(axis::Touch* touch, axis::Event* event); + bool onTouchesCommon(ax::Touch* touch, ax::Event* event, bool* touchProperty); + bool onTouchesZoomOut(ax::Touch* touch, ax::Event* event); + void onTouchesZoomOutEnd(ax::Touch* touch, ax::Event* event); + bool onTouchesZoomIn(ax::Touch* touch, ax::Event* event); + void onTouchesZoomInEnd(ax::Touch* touch, ax::Event* event); - bool onTouchesRotateLeft(axis::Touch* touch, axis::Event* event); - void onTouchesRotateLeftEnd(axis::Touch* touch, axis::Event* event); - bool onTouchesRotateRight(axis::Touch* touch, axis::Event* event); - void onTouchesRotateRightEnd(axis::Touch* touch, axis::Event* event); + bool onTouchesRotateLeft(ax::Touch* touch, ax::Event* event); + void onTouchesRotateLeftEnd(ax::Touch* touch, ax::Event* event); + bool onTouchesRotateRight(ax::Touch* touch, ax::Event* event); + void onTouchesRotateRightEnd(ax::Touch* touch, ax::Event* event); protected: std::string _title; - axis::Layer* _layer3D; - axis::MeshRenderer* _mesh; - axis::Vec3 _targetPos; + ax::Layer* _layer3D; + ax::MeshRenderer* _mesh; + ax::Vec3 _targetPos; CameraType _cameraType; - axis::MenuItem* _incRot; - axis::MenuItem* _decRot; + ax::MenuItem* _incRot; + ax::MenuItem* _decRot; unsigned int _curState; - axis::Camera* _camera; - axis::MoveTo* _moveAction; + ax::Camera* _camera; + ax::MoveTo* _moveAction; bool _bZoomOut; bool _bZoomIn; bool _bRotateLeft; bool _bRotateRight; - axis::Label* _RotateRightlabel; - axis::Label* _RotateLeftlabel; - axis::Label* _ZoomInlabel; - axis::Label* _ZoomOutlabel; + ax::Label* _RotateRightlabel; + ax::Label* _RotateLeftlabel; + ax::Label* _ZoomInlabel; + ax::Label* _ZoomOutlabel; }; class CameraCullingDemo : public CameraBaseTest @@ -174,22 +174,22 @@ public: // overrides virtual std::string title() const override; void reachEndCallBack(); - void switchViewCallback(axis::Ref* sender); - void addMeshCallback(axis::Ref* sender); - void delMeshCallback(axis::Ref* sender); + void switchViewCallback(ax::Ref* sender); + void addMeshCallback(ax::Ref* sender); + void delMeshCallback(ax::Ref* sender); void drawCameraFrustum(); protected: - axis::Label* _labelMeshCount; - axis::Layer* _layer3D; - std::vector _objects; + ax::Label* _labelMeshCount; + ax::Layer* _layer3D; + std::vector _objects; CameraType _cameraType; - axis::Camera* _cameraFirst; - axis::Camera* _cameraThird; - axis::MoveBy* _moveAction; - axis::DrawNode3D* _drawAABB; - axis::DrawNode3D* _drawFrustum; + ax::Camera* _cameraFirst; + ax::Camera* _cameraThird; + ax::MoveBy* _moveAction; + ax::DrawNode3D* _drawAABB; + ax::DrawNode3D* _drawFrustum; int _row; }; @@ -208,11 +208,11 @@ public: // overrides virtual std::string title() const override; - void switchOperateCallback(axis::Ref* sender); - void switchTargetCallback(axis::Ref* sender); - void onTouchsMoved(const std::vector& touchs, axis::Event* event); + void switchOperateCallback(ax::Ref* sender); + void switchTargetCallback(ax::Ref* sender); + void onTouchsMoved(const std::vector& touchs, ax::Event* event); void updateCameraTransform(); - void calculateArcBall(axis::Vec3& axis, + void calculateArcBall(ax::Vec3& axis, float& angle, float p1x, float p1y, @@ -221,18 +221,18 @@ public: float projectToSphere(float r, float x, float y); // points on the screen project to arc ball protected: - axis::Layer* _layer3D; + ax::Layer* _layer3D; CameraType _cameraType; - axis::Camera* _camera; - axis::DrawNode3D* _drawGrid; - axis::Quaternion _rotationQuat; // rotation Quaternion + ax::Camera* _camera; + ax::DrawNode3D* _drawGrid; + ax::Quaternion _rotationQuat; // rotation Quaternion float _radius; // arc ball radius float _distanceZ; OperateCamType _operate; // switch rotate or zoom - axis::Vec3 _center; // camera look target + ax::Vec3 _center; // camera look target int _target; // switch camera look target - axis::MeshRenderer* _mesh1; - axis::MeshRenderer* _mesh2; + ax::MeshRenderer* _mesh1; + ax::MeshRenderer* _mesh2; }; class FogTestDemo : public CameraBaseTest @@ -250,21 +250,21 @@ public: // overrides virtual std::string title() const override; - void onTouchesMoved(const std::vector& touches, axis::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); - void switchTypeCallback(axis::Ref* sender, int type); + void switchTypeCallback(ax::Ref* sender, int type); protected: CameraType _cameraType = CameraType::Free; - axis::Layer* _layer3D = nullptr; - axis::Camera* _camera = nullptr; - axis::MeshRenderer* _mesh1 = nullptr; - axis::MeshRenderer* _mesh2 = nullptr; - axis::backend::ProgramState* _programState1 = nullptr; - axis::backend::ProgramState* _programState2 = nullptr; + ax::Layer* _layer3D = nullptr; + ax::Camera* _camera = nullptr; + ax::MeshRenderer* _mesh1 = nullptr; + ax::MeshRenderer* _mesh2 = nullptr; + ax::backend::ProgramState* _programState1 = nullptr; + ax::backend::ProgramState* _programState2 = nullptr; #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) - axis::EventListenerCustom* _backToForegroundListener; + ax::EventListenerCustom* _backToForegroundListener; #endif }; diff --git a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp index 89215249ed..3a6f38dff0 100644 --- a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp +++ b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp @@ -84,7 +84,7 @@ ChipmunkTest::ChipmunkTest() #endif addChild(parent, 0, kTagParentNode); - addNewSpriteAtPosition(axis::Vec2(200.0f, 200.0f)); + addNewSpriteAtPosition(ax::Vec2(200.0f, 200.0f)); // menu for debug layer MenuItemFont::setFontSize(18); @@ -202,7 +202,7 @@ void ChipmunkTest::reset(Ref* sender) getTestSuite()->restartCurrTest(); } -void ChipmunkTest::addNewSpriteAtPosition(axis::Vec2 pos) +void ChipmunkTest::addNewSpriteAtPosition(ax::Vec2 pos) { int posx, posy; @@ -232,7 +232,7 @@ void ChipmunkTest::addNewSpriteAtPosition(axis::Vec2 pos) cpShapeSetFriction(shape, 0.5f); cpSpaceAddShape(_space, shape); - auto sprite = PhysicsSpriteChipmunk2D::createWithTexture(_spriteTexture, axis::Rect(posx, posy, 85, 121)); + auto sprite = PhysicsSpriteChipmunk2D::createWithTexture(_spriteTexture, ax::Rect(posx, posy, 85, 121)); parent->addChild(sprite); sprite->setCPBody(body); @@ -268,7 +268,7 @@ void ChipmunkTest::onAcceleration(Acceleration* acc, Event* event) prevX = accelX; prevY = accelY; - auto v = axis::Vec2(accelX, accelY); + auto v = ax::Vec2(accelX, accelY); v = v * 200; cpSpaceSetGravity(_space, cpv(v.x, v.y)); } diff --git a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.h b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.h index 8984a6f11f..c67d681a11 100644 --- a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.h +++ b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.h @@ -44,17 +44,17 @@ public: void onEnter() override; void initPhysics(); void createResetButton(); - void reset(axis::Ref* sender); + void reset(ax::Ref* sender); - void addNewSpriteAtPosition(axis::Vec2 p); + void addNewSpriteAtPosition(ax::Vec2 p); void update(float dt) override; - void toggleDebugCallback(axis::Ref* sender); - void onTouchesEnded(const std::vector& touches, axis::Event* event); - virtual void onAcceleration(axis::Acceleration* acc, axis::Event* event); + void toggleDebugCallback(ax::Ref* sender); + void onTouchesEnded(const std::vector& touches, ax::Event* event); + virtual void onAcceleration(ax::Acceleration* acc, ax::Event* event); private: - axis::Texture2D* _spriteTexture; // weak ref - axis::extension::PhysicsDebugNodeChipmunk2D* _debugLayer; // weak ref + ax::Texture2D* _spriteTexture; // weak ref + ax::extension::PhysicsDebugNodeChipmunk2D* _debugLayer; // weak ref cpSpace* _space; // strong ref cpShape* _walls[4]; diff --git a/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp b/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp index bce1a217f6..de7abd1446 100644 --- a/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp +++ b/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp @@ -100,7 +100,7 @@ char const* ChipmunkDemoMessageString = NULL; cpShapeFilter GRAB_FILTER = {CP_NO_GROUP, (unsigned int)GRABBABLE_MASK_BIT, (unsigned int)GRABBABLE_MASK_BIT}; cpShapeFilter NOT_GRABBABLE_FILTER = {CP_NO_GROUP, ~GRABBABLE_MASK_BIT, ~GRABBABLE_MASK_BIT}; -axis::DrawNode* drawCP = NULL; +ax::DrawNode* drawCP = NULL; void ChipmunkDemoDefaultDrawImpl(cpSpace* space){}; @@ -168,7 +168,7 @@ void ChipmunkDebugDrawBB(cpBB bb, cpSpaceDebugColor color) Color4F(0.0f, 0.0f, 1.0f, 1.0f)); } -axis::Label* label; +ax::Label* label; static int max_arbiters = 0; static int max_points = 0; @@ -305,7 +305,7 @@ void updateMouseBody(void) ChipmunkTestBed::ChipmunkTestBed() { - // halx99: since axis init scene default camera at 'initWithXXX' function, only change design size at scene + // halx99: since axmol init scene default camera at 'initWithXXX' function, only change design size at scene // construct is ok see also: https://github.com/axmolengine/axmol/commit/581a7921554c09746616759d5a5ca6ce9d3eaa22 auto director = Director::getInstance(); auto glView = director->getOpenGLView(); diff --git a/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.h b/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.h index 19bb9840ed..45f73a1f4f 100644 --- a/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.h +++ b/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.h @@ -43,27 +43,27 @@ public: void onEnter() override; void createResetButton(); - void reset(axis::Ref* sender); + void reset(ax::Ref* sender); void update(float dt) override; virtual void initPhysics(); - void onMouseDown(axis::Event* event); - void onMouseUp(axis::Event* event); - void onMouseMove(axis::Event* event); + void onMouseDown(ax::Event* event); + void onMouseUp(ax::Event* event); + void onMouseMove(ax::Event* event); void DrawInfo(); void updateInit(ChipmunkDemo tt); cpSpace* _space; // strong ref - axis::extension::PhysicsDebugNodeChipmunk2D* _debugLayer; // weak ref + ax::extension::PhysicsDebugNodeChipmunk2D* _debugLayer; // weak ref int keyPresses; bool mousePresses = false; private: - axis::EventListenerMouse* _mouseListener; - axis::Node* _trackNode; - axis::DrawNode* draw; - axis::Label* drawInfo; + ax::EventListenerMouse* _mouseListener; + ax::Node* _trackNode; + ax::DrawNode* draw; + ax::Label* drawInfo; }; class LogoSmashDemo : public ChipmunkTestBed diff --git a/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.h b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.h index be2c8af933..b108413fd6 100644 --- a/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.h +++ b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.h @@ -35,8 +35,8 @@ public: CREATE_FUNC(ClickAndMoveTestCase); ClickAndMoveTestCase(); - bool onTouchBegan(axis::Touch* touch, axis::Event* event); - void onTouchEnded(axis::Touch* touch, axis::Event* event); + bool onTouchBegan(ax::Touch* touch, ax::Event* event); + void onTouchEnded(ax::Touch* touch, ax::Event* event); }; #endif diff --git a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.h b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.h index de52320898..a7c02d15d0 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.h +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.h @@ -57,15 +57,15 @@ public: virtual std::string subtitle() const override; virtual void setup() override; - virtual axis::Action* actionRotate(); - virtual axis::Action* actionScale(); + virtual ax::Action* actionRotate(); + virtual ax::Action* actionScale(); - virtual axis::DrawNode* shape(); - virtual axis::Sprite* grossini(); + virtual ax::DrawNode* shape(); + virtual ax::Sprite* grossini(); - virtual axis::Node* stencil(); - virtual axis::ClippingNode* clipper(); - virtual axis::Node* content(); + virtual ax::Node* stencil(); + virtual ax::ClippingNode* clipper(); + virtual ax::Node* content(); }; class ShapeTest : public BasicTest @@ -76,8 +76,8 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - virtual axis::Node* stencil() override; - virtual axis::Node* content() override; + virtual ax::Node* stencil() override; + virtual ax::Node* content() override; }; class ShapeInvertedTest : public ShapeTest @@ -87,7 +87,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - virtual axis::ClippingNode* clipper() override; + virtual ax::ClippingNode* clipper() override; }; class SpriteTest : public BasicTest @@ -98,9 +98,9 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - virtual axis::Node* stencil() override; - virtual axis::ClippingNode* clipper() override; - virtual axis::Node* content() override; + virtual ax::Node* stencil() override; + virtual ax::ClippingNode* clipper() override; + virtual ax::Node* content() override; }; class SpriteNoAlphaTest : public SpriteTest @@ -110,7 +110,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - virtual axis::ClippingNode* clipper() override; + virtual ax::ClippingNode* clipper() override; }; class SpriteInvertedTest : public SpriteTest @@ -120,7 +120,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - virtual axis::ClippingNode* clipper() override; + virtual ax::ClippingNode* clipper() override; }; class NestedTest : public BaseClippingNodeTest @@ -142,13 +142,13 @@ public: virtual void setup() override; virtual std::string title() const override; virtual std::string subtitle() const override; - void pokeHoleAtPoint(axis::Vec2 point); - void onTouchesBegan(const std::vector& touches, axis::Event* event); + void pokeHoleAtPoint(ax::Vec2 point); + void onTouchesBegan(const std::vector& touches, ax::Event* event); private: - axis::ClippingNode* _outerClipper; - axis::Node* _holes; - axis::Node* _holesStencil; + ax::ClippingNode* _outerClipper; + ax::Node* _holes; + ax::Node* _holesStencil; }; class ScrollViewDemo : public BaseClippingNodeTest @@ -159,13 +159,13 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; virtual void setup() override; - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); private: bool _scrolling; - axis::Vec2 _lastPoint; + ax::Vec2 _lastPoint; }; //#if _AX_DEBUG > 1 @@ -180,7 +180,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; virtual void setup() override; - virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override; + virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override; virtual void setupStencilForClippingOnPlane(int plane); virtual void setupStencilForDrawingOnPlane(int plane); @@ -190,13 +190,13 @@ protected: void onBeforeDrawSprite(int planeIndex); void initCommands(); - std::vector _renderCmds; -// axis::CallbackCommand _enableStencilCallback; -// axis::CallbackCommand _disableStencilCallback; - axis::Vector _sprites; - axis::Vector _spritesStencil; - axis::backend::UniformLocation _locColor; - axis::backend::UniformLocation _locMVPMatrix; + std::vector _renderCmds; +// ax::CallbackCommand _enableStencilCallback; +// ax::CallbackCommand _disableStencilCallback; + ax::Vector _sprites; + ax::Vector _spritesStencil; + ax::backend::UniformLocation _locColor; + ax::backend::UniformLocation _locMVPMatrix; }; class RawStencilBufferTest2 : public RawStencilBufferTest @@ -235,7 +235,7 @@ public: virtual void setupStencilForDrawingOnPlane(int plane) override; private: - axis::backend::UniformLocation _alphaMVPMatrix; + ax::backend::UniformLocation _alphaMVPMatrix; }; class RawStencilBufferTest5 : public RawStencilBufferTestAlphaTest diff --git a/tests/cpp-tests/Classes/ConfigurationTest/ConfigurationTest.cpp b/tests/cpp-tests/Classes/ConfigurationTest/ConfigurationTest.cpp index 030db7e521..9f5e7b3744 100644 --- a/tests/cpp-tests/Classes/ConfigurationTest/ConfigurationTest.cpp +++ b/tests/cpp-tests/Classes/ConfigurationTest/ConfigurationTest.cpp @@ -70,7 +70,7 @@ void ConfigurationQuery::onEnter() { ConfigurationBase::onEnter(); - log("cocos2d version: %s", Configuration::getInstance()->getValue("axis.version").asString().c_str()); + log("cocos2d version: %s", Configuration::getInstance()->getValue("axmol.version").asString().c_str()); log("OpenGL version: %s", Configuration::getInstance()->getValue("gl.version").asString().c_str()); } diff --git a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h index 9274361b3b..211f6c4777 100644 --- a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h +++ b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h @@ -52,7 +52,7 @@ protected: ConsoleCustomCommand(); virtual ~ConsoleCustomCommand(); - axis::Console* _console; + ax::Console* _console; private: AX_DISALLOW_COPY_AND_ASSIGN(ConsoleCustomCommand); diff --git a/tests/cpp-tests/Classes/CurlTest/CurlTest.h b/tests/cpp-tests/Classes/CurlTest/CurlTest.h index 2755ea63d8..dc537d85bf 100644 --- a/tests/cpp-tests/Classes/CurlTest/CurlTest.h +++ b/tests/cpp-tests/Classes/CurlTest/CurlTest.h @@ -38,10 +38,10 @@ public: CurlTest(); ~CurlTest(); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); private: - axis::Label* _label; + ax::Label* _label; }; #endif // _CURL_TEST_H_ diff --git a/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h b/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h index ec089874b6..5164e5f283 100644 --- a/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h +++ b/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h @@ -33,13 +33,13 @@ DEFINE_TEST_SUITE(EffectAdvanceTests); class EffectAdvanceBaseTest : public TestCase { protected: - axis::TextureAtlas* _atlas; + ax::TextureAtlas* _atlas; std::string _title; - axis::Node* _bgNode; - axis::Node* _target1; - axis::Node* _target2; + ax::Node* _bgNode; + ax::Node* _target1; + ax::Node* _target2; public: virtual void onEnter() override; diff --git a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp index e2fc7531e3..b031ec00f3 100644 --- a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp +++ b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp @@ -60,7 +60,7 @@ Shaky3DDemo::Shaky3DDemo() _subtitle = ""; } -axis::ActionInterval* Shaky3DDemo::createEffect(float t) +ax::ActionInterval* Shaky3DDemo::createEffect(float t) { return Shaky3D::create(t, Size(15, 10), 5, false); } @@ -71,12 +71,12 @@ Waves3DDemo::Waves3DDemo() _subtitle = ""; } -axis::ActionInterval* Waves3DDemo::createEffect(float t) +ax::ActionInterval* Waves3DDemo::createEffect(float t) { return Waves3D::create(t, Size(15, 10), 5, 40); } -axis::ActionInterval* FlipX3DDemo::createEffect(float t) +ax::ActionInterval* FlipX3DDemo::createEffect(float t) { auto flipx = FlipX3D::create(t); auto flipx_back = flipx->reverse(); @@ -90,7 +90,7 @@ FlipX3DDemo::FlipX3DDemo() _subtitle = ""; } -axis::ActionInterval* FlipY3DDemo::createEffect(float t) +ax::ActionInterval* FlipY3DDemo::createEffect(float t) { auto flipy = FlipY3D::create(t); auto flipy_back = flipy->reverse(); @@ -105,7 +105,7 @@ FlipY3DDemo::FlipY3DDemo() _subtitle = ""; } -axis::ActionInterval* Lens3DDemo::createEffect(float t) +ax::ActionInterval* Lens3DDemo::createEffect(float t) { auto size = Director::getInstance()->getWinSize(); return Lens3D::create(t, Size(15, 10), Vec2(size.width / 2, size.height / 2), 240); @@ -117,7 +117,7 @@ Lens3DDemo::Lens3DDemo() _subtitle = ""; } -axis::ActionInterval* Ripple3DDemo::createEffect(float t) +ax::ActionInterval* Ripple3DDemo::createEffect(float t) { auto size = Director::getInstance()->getWinSize(); return Ripple3D::create(t, Size(32, 24), Vec2(size.width / 2, size.height / 2), 240, 4, 160); @@ -129,7 +129,7 @@ Ripple3DDemo::Ripple3DDemo() _subtitle = ""; } -axis::ActionInterval* LiquidDemo::createEffect(float t) +ax::ActionInterval* LiquidDemo::createEffect(float t) { return Liquid::create(t, Size(16, 12), 4, 20); } @@ -140,7 +140,7 @@ LiquidDemo::LiquidDemo() _subtitle = ""; } -axis::ActionInterval* WavesDemo::createEffect(float t) +ax::ActionInterval* WavesDemo::createEffect(float t) { return Waves::create(t, Size(16, 12), 4, 20, true, true); } @@ -151,7 +151,7 @@ WavesDemo::WavesDemo() _subtitle = ""; } -axis::ActionInterval* TwirlDemo::createEffect(float t) +ax::ActionInterval* TwirlDemo::createEffect(float t) { auto size = Director::getInstance()->getWinSize(); return Twirl::create(t, Size(12, 8), Vec2(size.width / 2, size.height / 2), 1, 2.5f); @@ -163,7 +163,7 @@ TwirlDemo::TwirlDemo() _subtitle = ""; } -axis::ActionInterval* ShakyTiles3DDemo::createEffect(float t) +ax::ActionInterval* ShakyTiles3DDemo::createEffect(float t) { return ShakyTiles3D::create(t, Size(16, 12), 5, false); } @@ -174,7 +174,7 @@ ShakyTiles3DDemo::ShakyTiles3DDemo() _subtitle = ""; } -axis::ActionInterval* ShatteredTiles3DDemo::createEffect(float t) +ax::ActionInterval* ShatteredTiles3DDemo::createEffect(float t) { return ShatteredTiles3D::create(t, Size(16, 12), 5, false); } @@ -185,7 +185,7 @@ ShatteredTiles3DDemo::ShatteredTiles3DDemo() _subtitle = ""; } -axis::ActionInterval* ShuffleTilesDemo::createEffect(float t) +ax::ActionInterval* ShuffleTilesDemo::createEffect(float t) { auto shuffle = ShuffleTiles::create(t, Size(16, 12), 25); auto shuffle_back = shuffle->reverse(); @@ -200,7 +200,7 @@ ShuffleTilesDemo::ShuffleTilesDemo() _subtitle = ""; } -axis::ActionInterval* FadeOutTRTilesDemo::createEffect(float t) +ax::ActionInterval* FadeOutTRTilesDemo::createEffect(float t) { auto fadeout = FadeOutTRTiles::create(t, Size(16, 12)); auto back = fadeout->reverse(); @@ -215,7 +215,7 @@ FadeOutTRTilesDemo::FadeOutTRTilesDemo() _subtitle = ""; } -axis::ActionInterval* FadeOutBLTilesDemo::createEffect(float t) +ax::ActionInterval* FadeOutBLTilesDemo::createEffect(float t) { auto fadeout = FadeOutBLTiles::create(t, Size(16, 12)); auto back = fadeout->reverse(); @@ -230,7 +230,7 @@ FadeOutBLTilesDemo::FadeOutBLTilesDemo() _subtitle = ""; } -axis::ActionInterval* FadeOutUpTilesDemo::createEffect(float t) +ax::ActionInterval* FadeOutUpTilesDemo::createEffect(float t) { auto fadeout = FadeOutUpTiles::create(t, Size(16, 12)); auto back = fadeout->reverse(); @@ -245,7 +245,7 @@ FadeOutUpTilesDemo::FadeOutUpTilesDemo() _subtitle = ""; } -axis::ActionInterval* FadeOutDownTilesDemo::createEffect(float t) +ax::ActionInterval* FadeOutDownTilesDemo::createEffect(float t) { auto fadeout = FadeOutDownTiles::create(t, Size(16, 12)); auto back = fadeout->reverse(); @@ -260,7 +260,7 @@ FadeOutDownTilesDemo::FadeOutDownTilesDemo() _subtitle = ""; } -axis::ActionInterval* TurnOffTilesDemo::createEffect(float t) +ax::ActionInterval* TurnOffTilesDemo::createEffect(float t) { auto fadeout = TurnOffTiles::create(t, Size(48, 32), 25); auto back = fadeout->reverse(); @@ -275,7 +275,7 @@ TurnOffTilesDemo::TurnOffTilesDemo() _subtitle = ""; } -axis::ActionInterval* WavesTiles3DDemo::createEffect(float t) +ax::ActionInterval* WavesTiles3DDemo::createEffect(float t) { return WavesTiles3D::create(t, Size(15, 10), 4, 120); } @@ -286,7 +286,7 @@ WavesTiles3DDemo::WavesTiles3DDemo() _subtitle = ""; } -axis::ActionInterval* JumpTiles3DDemo::createEffect(float t) +ax::ActionInterval* JumpTiles3DDemo::createEffect(float t) { return JumpTiles3D::create(t, Size(15, 10), 2, 30); } @@ -297,7 +297,7 @@ JumpTiles3DDemo::JumpTiles3DDemo() _subtitle = ""; } -axis::ActionInterval* SplitRowsDemo::createEffect(float t) +ax::ActionInterval* SplitRowsDemo::createEffect(float t) { return SplitRows::create(t, 9); } @@ -308,7 +308,7 @@ SplitRowsDemo::SplitRowsDemo() _subtitle = ""; } -axis::ActionInterval* SplitColsDemo::createEffect(float t) +ax::ActionInterval* SplitColsDemo::createEffect(float t) { return SplitCols::create(t, 9); } @@ -319,7 +319,7 @@ SplitColsDemo::SplitColsDemo() _subtitle = ""; } -axis::ActionInterval* PageTurn3DDemo::createEffect(float t) +ax::ActionInterval* PageTurn3DDemo::createEffect(float t) { return PageTurn3D::create(t, Size(15, 10)); } @@ -330,7 +330,7 @@ PageTurn3DDemo::PageTurn3DDemo() _subtitle = ""; } -axis::ActionInterval* PageTurn3DRectDemo::createEffect(float t) +ax::ActionInterval* PageTurn3DRectDemo::createEffect(float t) { return PageTurn3D::create(t, Size(15, 10)); } diff --git a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.h b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.h index 9d43e2d712..576802e2c4 100644 --- a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.h +++ b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.h @@ -37,14 +37,14 @@ public: protected: virtual bool init() override; - virtual axis::ActionInterval* createEffect(float t) { return nullptr; } + virtual ax::ActionInterval* createEffect(float t) { return nullptr; } void checkAnim(float dt); virtual bool isRectEffect() { return false; } virtual std::string title() const override { return _title; }; virtual std::string subtitle() const override { return _subtitle; }; std::string _title; std::string _subtitle; - axis::NodeGrid* _gridNodeTarget; + ax::NodeGrid* _gridNodeTarget; }; class Shaky3DDemo : public EffectBaseTest @@ -54,7 +54,7 @@ public: Shaky3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class Waves3DDemo : public EffectBaseTest @@ -64,7 +64,7 @@ public: Waves3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class FlipX3DDemo : public EffectBaseTest @@ -74,7 +74,7 @@ public: FlipX3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class FlipY3DDemo : public EffectBaseTest @@ -84,7 +84,7 @@ public: FlipY3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class Lens3DDemo : public EffectBaseTest @@ -94,7 +94,7 @@ public: Lens3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class Ripple3DDemo : public EffectBaseTest @@ -104,7 +104,7 @@ public: Ripple3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class LiquidDemo : public EffectBaseTest @@ -114,7 +114,7 @@ public: LiquidDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class WavesDemo : public EffectBaseTest @@ -124,7 +124,7 @@ public: WavesDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class TwirlDemo : public EffectBaseTest @@ -134,7 +134,7 @@ public: TwirlDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class ShakyTiles3DDemo : public EffectBaseTest @@ -144,7 +144,7 @@ public: ShakyTiles3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class ShatteredTiles3DDemo : public EffectBaseTest @@ -154,7 +154,7 @@ public: ShatteredTiles3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class ShuffleTilesDemo : public EffectBaseTest @@ -164,7 +164,7 @@ public: ShuffleTilesDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class FadeOutTRTilesDemo : public EffectBaseTest @@ -174,7 +174,7 @@ public: FadeOutTRTilesDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class FadeOutBLTilesDemo : public EffectBaseTest @@ -184,7 +184,7 @@ public: FadeOutBLTilesDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class FadeOutUpTilesDemo : public EffectBaseTest @@ -194,7 +194,7 @@ public: FadeOutUpTilesDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class FadeOutDownTilesDemo : public EffectBaseTest @@ -204,7 +204,7 @@ public: FadeOutDownTilesDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class TurnOffTilesDemo : public EffectBaseTest @@ -214,7 +214,7 @@ public: TurnOffTilesDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class WavesTiles3DDemo : public EffectBaseTest @@ -224,7 +224,7 @@ public: WavesTiles3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class JumpTiles3DDemo : public EffectBaseTest @@ -234,7 +234,7 @@ public: JumpTiles3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class SplitRowsDemo : public EffectBaseTest @@ -244,7 +244,7 @@ public: SplitRowsDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class SplitColsDemo : public EffectBaseTest @@ -254,7 +254,7 @@ public: SplitColsDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class PageTurn3DDemo : public EffectBaseTest @@ -264,7 +264,7 @@ public: PageTurn3DDemo(); protected: - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; class PageTurn3DRectDemo : public EffectBaseTest @@ -275,7 +275,7 @@ public: protected: virtual bool isRectEffect() override { return true; } - virtual axis::ActionInterval* createEffect(float t) override; + virtual ax::ActionInterval* createEffect(float t) override; }; #endif diff --git a/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp index 16f58565bb..dfb3b16e5b 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp @@ -127,7 +127,7 @@ void AssetsManagerExLoaderScene::startDownloadCallback(Ref* sender) else { _amListener = - axis::extension::EventListenerAssetsManagerEx::create(_am, [this](EventAssetsManagerEx* event) { + ax::extension::EventListenerAssetsManagerEx::create(_am, [this](EventAssetsManagerEx* event) { static int failCount = 0; switch (event->getEventCode()) { diff --git a/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h b/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h index e665992e64..5f4719c2c0 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h @@ -37,7 +37,7 @@ public: AssetsManagerExLoaderScene(int testIndex); - void startDownloadCallback(axis::Ref* sender); + void startDownloadCallback(ax::Ref* sender); virtual std::string title() const override; @@ -46,12 +46,12 @@ public: private: int _testIndex; - axis::Layer* _loadLayer; - axis::Menu* _downloadMenu; + ax::Layer* _loadLayer; + ax::Menu* _downloadMenu; - axis::extension::AssetsManagerEx* _am; - axis::Label* _progress; - axis::extension::EventListenerAssetsManagerEx* _amListener; + ax::extension::AssetsManagerEx* _am; + ax::Label* _progress; + ax::extension::EventListenerAssetsManagerEx* _amListener; void onLoadEnd(); }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h index c975681196..64a752d717 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h @@ -31,10 +31,10 @@ #include "GUI/CCScrollView/CCScrollView.h" #include "GUI/CCScrollView/CCTableView.h" -class CustomTableViewCell : public axis::extension::TableViewCell +class CustomTableViewCell : public ax::extension::TableViewCell { public: - virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override; + virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override; }; #endif /* __CUSTOMTABELVIEWCELL_H__ */ diff --git a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h index e47d075b2e..dac78fac60 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h @@ -32,22 +32,22 @@ DEFINE_TEST_SUITE(TableViewTests); class TableViewTest : public TestCase, - public axis::extension::TableViewDataSource, - public axis::extension::TableViewDelegate + public ax::extension::TableViewDataSource, + public ax::extension::TableViewDelegate { public: CREATE_FUNC(TableViewTest); virtual bool init() override; - virtual void scrollViewDidScroll(axis::extension::ScrollView* view) override{}; - virtual void scrollViewDidZoom(axis::extension::ScrollView* view) override {} - virtual void tableCellTouched(axis::extension::TableView* table, - axis::extension::TableViewCell* cell) override; - virtual axis::Size tableCellSizeForIndex(axis::extension::TableView* table, ssize_t idx) override; - virtual axis::extension::TableViewCell* tableCellAtIndex(axis::extension::TableView* table, + virtual void scrollViewDidScroll(ax::extension::ScrollView* view) override{}; + virtual void scrollViewDidZoom(ax::extension::ScrollView* view) override {} + virtual void tableCellTouched(ax::extension::TableView* table, + ax::extension::TableViewCell* cell) override; + virtual ax::Size tableCellSizeForIndex(ax::extension::TableView* table, ssize_t idx) override; + virtual ax::extension::TableViewCell* tableCellAtIndex(ax::extension::TableView* table, ssize_t idx) override; - virtual ssize_t numberOfCellsInTableView(axis::extension::TableView* table) override; + virtual ssize_t numberOfCellsInTableView(ax::extension::TableView* table) override; }; #endif // __TABLEVIEWTESTSCENE_H__ diff --git a/tests/cpp-tests/Classes/InputTest/MouseTest.h b/tests/cpp-tests/Classes/InputTest/MouseTest.h index eedba010ac..c3a6a552d7 100644 --- a/tests/cpp-tests/Classes/InputTest/MouseTest.h +++ b/tests/cpp-tests/Classes/InputTest/MouseTest.h @@ -42,18 +42,18 @@ public: MouseEventTest(); ~MouseEventTest(); - void onMouseDown(axis::Event* event); - void onMouseUp(axis::Event* event); - void onMouseMove(axis::Event* event); - void onMouseScroll(axis::Event* event); + void onMouseDown(ax::Event* event); + void onMouseUp(ax::Event* event); + void onMouseMove(ax::Event* event); + void onMouseScroll(ax::Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; private: - axis::Label* _labelAction; - axis::Label* _labelPosition; - axis::EventListenerMouse* _mouseListener; + ax::Label* _labelAction; + ax::Label* _labelPosition; + ax::EventListenerMouse* _mouseListener; }; class HideMouseTest : public BaseMouseTest @@ -67,7 +67,7 @@ public: virtual std::string subtitle() const override; private: - axis::EventListenerMouse* _lis; + ax::EventListenerMouse* _lis; }; #endif diff --git a/tests/cpp-tests/Classes/IntervalTest/IntervalTest.h b/tests/cpp-tests/Classes/IntervalTest/IntervalTest.h index 0ec04a2365..7e8d8e5a1d 100644 --- a/tests/cpp-tests/Classes/IntervalTest/IntervalTest.h +++ b/tests/cpp-tests/Classes/IntervalTest/IntervalTest.h @@ -41,11 +41,11 @@ public: // CREATE_NODE(IntervalLayer); protected: - axis::Label* _label0; - axis::Label* _label1; - axis::Label* _label2; - axis::Label* _label3; - axis::Label* _label4; + ax::Label* _label0; + ax::Label* _label1; + ax::Label* _label2; + ax::Label* _label3; + ax::Label* _label4; float _time0, _time1, _time2, _time3, _time4; }; diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index 29fc820dec..14380c72f9 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -673,7 +673,7 @@ std::string LabelFNTMultiLineAlignment::subtitle() const return ""; } -void LabelFNTMultiLineAlignment::selectAlignmentItem(axis::MenuItemFont* item) +void LabelFNTMultiLineAlignment::selectAlignmentItem(ax::MenuItemFont* item) { if (this->_lastAlignmentItem && this->_lastAlignmentItem != item) { @@ -700,7 +700,7 @@ void LabelFNTMultiLineAlignment::selectAlignmentItem(axis::MenuItemFont* item) } } -void LabelFNTMultiLineAlignment::selectSentenceItem(axis::MenuItemFont* item) +void LabelFNTMultiLineAlignment::selectSentenceItem(ax::MenuItemFont* item) { if (this->_lastSentenceItem && this->_lastSentenceItem != item) { @@ -714,7 +714,7 @@ void LabelFNTMultiLineAlignment::selectSentenceItem(axis::MenuItemFont* item) this->_label->setString(str); } -std::string LabelFNTMultiLineAlignment::getItemString(axis::MenuItemFont* item) +std::string LabelFNTMultiLineAlignment::getItemString(ax::MenuItemFont* item) { std::string str; @@ -737,7 +737,7 @@ std::string LabelFNTMultiLineAlignment::getItemString(axis::MenuItemFont* item) return str; } -void LabelFNTMultiLineAlignment::stringChanged(axis::Ref* sender) +void LabelFNTMultiLineAlignment::stringChanged(ax::Ref* sender) { auto item = (MenuItemFont*)sender; @@ -746,7 +746,7 @@ void LabelFNTMultiLineAlignment::stringChanged(axis::Ref* sender) this->snapArrowsToEdge(); } -void LabelFNTMultiLineAlignment::alignmentChanged(axis::Ref* sender) +void LabelFNTMultiLineAlignment::alignmentChanged(ax::Ref* sender) { auto item = static_cast(sender); @@ -755,7 +755,7 @@ void LabelFNTMultiLineAlignment::alignmentChanged(axis::Ref* sender) this->snapArrowsToEdge(); } -void LabelFNTMultiLineAlignment::onTouchesBegan(const std::vector& touches, axis::Event* event) +void LabelFNTMultiLineAlignment::onTouchesBegan(const std::vector& touches, ax::Event* event) { auto touch = touches[0]; auto location = touch->getLocationInView(); @@ -767,7 +767,7 @@ void LabelFNTMultiLineAlignment::onTouchesBegan(const std::vector& touch } } -void LabelFNTMultiLineAlignment::onTouchesEnded(const std::vector& touches, axis::Event* event) +void LabelFNTMultiLineAlignment::onTouchesEnded(const std::vector& touches, ax::Event* event) { _drag = false; this->snapArrowsToEdge(); @@ -775,7 +775,7 @@ void LabelFNTMultiLineAlignment::onTouchesEnded(const std::vector& touch this->_arrowsBar->setVisible(false); } -void LabelFNTMultiLineAlignment::onTouchesMoved(const std::vector& touches, axis::Event* event) +void LabelFNTMultiLineAlignment::onTouchesMoved(const std::vector& touches, ax::Event* event) { if (!_drag) { @@ -835,7 +835,7 @@ std::string LabelFNTMultiLineAlignmentUNICODE::subtitle() const return ""; } -std::string LabelFNTMultiLineAlignmentUNICODE::getItemString(axis::MenuItemFont* item) +std::string LabelFNTMultiLineAlignmentUNICODE::getItemString(ax::MenuItemFont* item) { std::string str; @@ -1208,8 +1208,8 @@ LabelTTFEmoji::LabelTTFEmoji() auto label = Label::createWithTTF(emojiString, "fonts/NotoEmoji-Regular.ttf", 23); label->setPosition(winSize.width / 2, winSize.height / 2); label->setDimensions(winSize.width, winSize.height); - label->setVerticalAlignment(axis::TextVAlignment::CENTER); - label->setHorizontalAlignment(axis::TextHAlignment::CENTER); + label->setVerticalAlignment(ax::TextVAlignment::CENTER); + label->setHorizontalAlignment(ax::TextHAlignment::CENTER); addChild(label); } @@ -2261,7 +2261,7 @@ LabelLayoutBaseTest::LabelLayoutBaseTest() this->initSliders(size); } -void LabelLayoutBaseTest::initFontSizeChange(const axis::Size& size) +void LabelLayoutBaseTest::initFontSizeChange(const ax::Size& size) { auto fontSizeLabel = Label::createWithSystemFont("font size:20", "Arial", 10); fontSizeLabel->setName("fontSize"); @@ -2281,7 +2281,7 @@ void LabelLayoutBaseTest::initFontSizeChange(const axis::Size& size) this->addChild(fontSizeLabel); } -void LabelLayoutBaseTest::initWrapOption(const axis::Size& size) +void LabelLayoutBaseTest::initWrapOption(const ax::Size& size) { auto label = Label::createWithSystemFont("Enable Wrap:", "Arial", 10); label->setColor(Color3B::WHITE); @@ -2310,7 +2310,7 @@ void LabelLayoutBaseTest::initWrapOption(const axis::Size& size) this->addChild(checkBox); } -void LabelLayoutBaseTest::initToggleLabelTypeOption(const axis::Size& size) +void LabelLayoutBaseTest::initToggleLabelTypeOption(const ax::Size& size) { auto label = Label::createWithSystemFont("Toggle Label Type:", "Arial", 10); label->setColor(Color3B::WHITE); @@ -2347,7 +2347,7 @@ void LabelLayoutBaseTest::initToggleLabelTypeOption(const axis::Size& size) this->addChild(checkBox); } -void LabelLayoutBaseTest::initAlignmentOption(const axis::Size& size) +void LabelLayoutBaseTest::initAlignmentOption(const ax::Size& size) { // add text alignment settings MenuItemFont::setFontSize(30); @@ -2368,7 +2368,7 @@ void LabelLayoutBaseTest::initAlignmentOption(const axis::Size& size) this->addChild(menu); } -void LabelLayoutBaseTest::initSliders(const axis::Size& size) +void LabelLayoutBaseTest::initSliders(const ax::Size& size) { auto slider = ui::Slider::create(); slider->setTag(1); @@ -2417,7 +2417,7 @@ void LabelLayoutBaseTest::initSliders(const axis::Size& size) }); } -void LabelLayoutBaseTest::initTestLabel(const axis::Size& size) +void LabelLayoutBaseTest::initTestLabel(const ax::Size& size) { auto center = VisibleRect::center(); _label = Label::createWithTTF("五六七八This is a very long sentence一二三四.", "fonts/HKYuanMini.ttf", 20); @@ -2429,7 +2429,7 @@ void LabelLayoutBaseTest::initTestLabel(const axis::Size& size) _labelType = 0; } -void LabelLayoutBaseTest::initDrawNode(const axis::Size& size) +void LabelLayoutBaseTest::initDrawNode(const ax::Size& size) { _drawNode = DrawNode::create(); @@ -2468,7 +2468,7 @@ void LabelLayoutBaseTest::setAlignmentBottom(Ref* sender) _label->setVerticalAlignment(TextVAlignment::BOTTOM); } -void LabelLayoutBaseTest::valueChanged(axis::Ref* sender, axis::extension::Control::EventType controlEvent) +void LabelLayoutBaseTest::valueChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent) { ControlStepper* pControl = (ControlStepper*)sender; // Change value of label. @@ -2501,7 +2501,7 @@ void LabelLayoutBaseTest::valueChanged(axis::Ref* sender, axis::extension::Contr // AXLOG("label line height = %f", _label->getLineHeight()); } -void LabelLayoutBaseTest::updateDrawNodeSize(const axis::Size& drawNodeSize) +void LabelLayoutBaseTest::updateDrawNodeSize(const ax::Size& drawNodeSize) { auto origin = Director::getInstance()->getWinSize(); auto labelSize = _label->getContentSize(); @@ -3077,7 +3077,7 @@ LabelItalics::LabelItalics() addChild(_label2a, 0, kTagBitmapAtlas2); _label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 6)); - auto menuItem = MenuItemFont::create("disable italics", [&](axis::Ref* sender) { + auto menuItem = MenuItemFont::create("disable italics", [&](ax::Ref* sender) { _label2a->disableEffect(LabelEffect::ITALICS); _label1a->disableEffect(LabelEffect::ITALICS); }); @@ -3129,7 +3129,7 @@ LabelBold::LabelBold() addChild(_label2a, 0, kTagBitmapAtlas2); _label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 6)); - auto menuItem = MenuItemFont::create("disable bold", [&](axis::Ref* sender) { + auto menuItem = MenuItemFont::create("disable bold", [&](ax::Ref* sender) { _label2a->disableEffect(LabelEffect::BOLD); _label1a->disableEffect(LabelEffect::BOLD); }); @@ -3181,7 +3181,7 @@ LabelUnderline::LabelUnderline() addChild(_label2a, 0, kTagBitmapAtlas2); _label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 6)); - auto menuItem = MenuItemFont::create("disable underline", [&](axis::Ref* sender) { + auto menuItem = MenuItemFont::create("disable underline", [&](ax::Ref* sender) { _label2a->disableEffect(LabelEffect::UNDERLINE); _label1a->disableEffect(LabelEffect::UNDERLINE); }); @@ -3223,7 +3223,7 @@ LabelUnderlineMultiline::LabelUnderlineMultiline() addChild(_label2a, 0, kTagBitmapAtlas2); _label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 3)); - auto menuItem = MenuItemFont::create("disable underline", [&](axis::Ref* sender) { + auto menuItem = MenuItemFont::create("disable underline", [&](ax::Ref* sender) { _label2a->disableEffect(LabelEffect::UNDERLINE); _label1a->disableEffect(LabelEffect::UNDERLINE); }); @@ -3265,7 +3265,7 @@ LabelStrikethrough::LabelStrikethrough() addChild(_label2a, 0, kTagBitmapAtlas2); _label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 3)); - auto menuItem = MenuItemFont::create("disable underline", [&](axis::Ref* sender) { + auto menuItem = MenuItemFont::create("disable underline", [&](ax::Ref* sender) { _label2a->disableEffect(LabelEffect::STRIKETHROUGH); _label1a->disableEffect(LabelEffect::STRIKETHROUGH); }); @@ -3403,14 +3403,14 @@ LabelIssue15214::LabelIssue15214() // 1 Label* label = Label::createWithTTF("TTF with setColor()", "fonts/arial.ttf", 24.0f); label->enableUnderline(); - label->setColor(axis::Color3B::BLUE); + label->setColor(ax::Color3B::BLUE); label->setPosition(size.width / 2, size.height / 5 * 4); this->addChild(label); // 2 Label* label2 = Label::createWithSystemFont("System with setColor()", "Verdana", 24.0f); label2->enableUnderline(); - label2->setColor(axis::Color3B::BLUE); + label2->setColor(ax::Color3B::BLUE); label2->setPosition(size.width / 2, size.height / 5 * 3); this->addChild(label2); @@ -3597,7 +3597,7 @@ LabelIssue20523::LabelIssue20523() auto size = Director::getInstance()->getWinSize(); auto _crashingLabel = Label::createWithTTF("0", "fonts/Marker Felt.ttf", 120); _crashingLabel->setPosition(Vec2(size.width / 2, size.height / 2)); - _crashingLabel->setColor(axis::Color3B(200, 200, 200)); + _crashingLabel->setColor(ax::Color3B(200, 200, 200)); addChild(_crashingLabel, 1); //_crashingLabel->setWidth(size.width); @@ -3646,7 +3646,7 @@ std::string LabelLetterColorsTest::subtitle() const return "Should not crash!"; } -void LabelLetterColorsTest::setLetterColors(axis::Label* label, const axis::Color3B& color) +void LabelLetterColorsTest::setLetterColors(ax::Label* label, const ax::Color3B& color) { int n = label->getStringLength(); for (int i = 0; i < n; ++i) diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h index 5687d8d030..9ade9be1d0 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h @@ -170,22 +170,22 @@ public: void snapArrowsToEdge(); virtual std::string title() const override; virtual std::string subtitle() const override; - void stringChanged(axis::Ref* sender); - void alignmentChanged(axis::Ref* sender); - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void selectAlignmentItem(axis::MenuItemFont* item); - void selectSentenceItem(axis::MenuItemFont* item); - virtual std::string getItemString(axis::MenuItemFont* item); + void stringChanged(ax::Ref* sender); + void alignmentChanged(ax::Ref* sender); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void selectAlignmentItem(ax::MenuItemFont* item); + void selectSentenceItem(ax::MenuItemFont* item); + virtual std::string getItemString(ax::MenuItemFont* item); protected: - axis::Label* _label = nullptr; - axis::Sprite* _arrowsBar = nullptr; - axis::Sprite* _arrows = nullptr; - std::vector _menuItems; - axis::MenuItemFont* _lastSentenceItem = nullptr; - axis::MenuItemFont* _lastAlignmentItem = nullptr; + ax::Label* _label = nullptr; + ax::Sprite* _arrowsBar = nullptr; + ax::Sprite* _arrows = nullptr; + std::vector _menuItems; + ax::MenuItemFont* _lastSentenceItem = nullptr; + ax::MenuItemFont* _lastAlignmentItem = nullptr; bool _drag = false; }; @@ -198,7 +198,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - virtual std::string getItemString(axis::MenuItemFont* item) override; + virtual std::string getItemString(ax::MenuItemFont* item) override; }; class LabelFNTUNICODELanguages : public AtlasDemoNew @@ -286,13 +286,13 @@ public: virtual std::string subtitle() const override; private: - void setAlignmentLeft(axis::Ref* sender); - void setAlignmentCenter(axis::Ref* sender); - void setAlignmentRight(axis::Ref* sender); + void setAlignmentLeft(ax::Ref* sender); + void setAlignmentCenter(ax::Ref* sender); + void setAlignmentRight(ax::Ref* sender); void updateAlignment(); - axis::Label* _label; - axis::TextHAlignment _horizAlign; + ax::Label* _label; + ax::TextHAlignment _horizAlign; }; class LabelTTFEmoji : public AtlasDemoNew @@ -374,13 +374,13 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type); + void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); private: - axis::Label* shadowLabelOutline; - axis::Label* shadowLabelTTF; - axis::Label* shadowLabelGrow; - axis::Label* shadowLabelBMFont; + ax::Label* shadowLabelOutline; + ax::Label* shadowLabelTTF; + ax::Label* shadowLabelGrow; + ax::Label* shadowLabelBMFont; }; class LabelCharMapTest : public AtlasDemoNew @@ -459,14 +459,14 @@ public: virtual std::string subtitle() const override; private: - void setAlignmentLeft(axis::Ref* sender); - void setAlignmentCenter(axis::Ref* sender); - void setAlignmentRight(axis::Ref* sender); - void setAlignmentTop(axis::Ref* sender); - void setAlignmentMiddle(axis::Ref* sender); - void setAlignmentBottom(axis::Ref* sender); + void setAlignmentLeft(ax::Ref* sender); + void setAlignmentCenter(ax::Ref* sender); + void setAlignmentRight(ax::Ref* sender); + void setAlignmentTop(ax::Ref* sender); + void setAlignmentMiddle(ax::Ref* sender); + void setAlignmentBottom(ax::Ref* sender); - axis::Label* _label; + ax::Label* _label; }; class LabelIssue4428Test : public AtlasDemoNew @@ -501,10 +501,10 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type); + void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); private: - axis::Label* label; + ax::Label* label; }; class LabelAdditionalKerningTest : public AtlasDemoNew @@ -517,10 +517,10 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type); + void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); private: - axis::Label* label; + ax::Label* label; }; class LabelIssue8492Test : public AtlasDemoNew @@ -704,27 +704,27 @@ class LabelLayoutBaseTest : public AtlasDemoNew { public: LabelLayoutBaseTest(); - void updateDrawNodeSize(const axis::Size& drawNodeSize); - axis::extension::ControlStepper* makeControlStepper(); - void valueChanged(axis::Ref* sender, axis::extension::Control::EventType controlEvent); + void updateDrawNodeSize(const ax::Size& drawNodeSize); + ax::extension::ControlStepper* makeControlStepper(); + void valueChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent); protected: - void setAlignmentLeft(axis::Ref* sender); - void setAlignmentCenter(axis::Ref* sender); - void setAlignmentRight(axis::Ref* sender); - void setAlignmentTop(axis::Ref* sender); - void setAlignmentMiddle(axis::Ref* sender); - void setAlignmentBottom(axis::Ref* sender); + void setAlignmentLeft(ax::Ref* sender); + void setAlignmentCenter(ax::Ref* sender); + void setAlignmentRight(ax::Ref* sender); + void setAlignmentTop(ax::Ref* sender); + void setAlignmentMiddle(ax::Ref* sender); + void setAlignmentBottom(ax::Ref* sender); - void initWrapOption(const axis::Size& size); - void initToggleLabelTypeOption(const axis::Size& size); - void initAlignmentOption(const axis::Size& size); - void initFontSizeChange(const axis::Size& size); - void initSliders(const axis::Size& size); - void initTestLabel(const axis::Size& size); - void initDrawNode(const axis::Size& size); - axis::DrawNode* _drawNode; - axis::Label* _label; + void initWrapOption(const ax::Size& size); + void initToggleLabelTypeOption(const ax::Size& size); + void initAlignmentOption(const ax::Size& size); + void initFontSizeChange(const ax::Size& size); + void initSliders(const ax::Size& size); + void initTestLabel(const ax::Size& size); + void initDrawNode(const ax::Size& size); + ax::DrawNode* _drawNode; + ax::Label* _label; int _labelType; }; @@ -801,7 +801,7 @@ public: LabelToggleTypeTest(); void initToggleCheckboxes(); - void onChangedRadioButtonSelect(axis::ui::RadioButton* radioButton, axis::ui::RadioButton::EventType type); + void onChangedRadioButtonSelect(ax::ui::RadioButton* radioButton, ax::ui::RadioButton::EventType type); virtual std::string title() const override; virtual std::string subtitle() const override; @@ -814,7 +814,7 @@ public: LabelSystemFontTest(); void initToggleCheckboxes(); - void onChangedRadioButtonSelect(axis::ui::RadioButton* radioButton, axis::ui::RadioButton::EventType type); + void onChangedRadioButtonSelect(ax::ui::RadioButton* radioButton, ax::ui::RadioButton::EventType type); virtual std::string title() const override; virtual std::string subtitle() const override; @@ -861,8 +861,8 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - axis::Label* _label1a; - axis::Label* _label2a; + ax::Label* _label1a; + ax::Label* _label2a; }; class LabelBold : public AtlasDemoNew @@ -874,8 +874,8 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - axis::Label* _label1a; - axis::Label* _label2a; + ax::Label* _label1a; + ax::Label* _label2a; }; class LabelUnderline : public AtlasDemoNew @@ -887,8 +887,8 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - axis::Label* _label1a; - axis::Label* _label2a; + ax::Label* _label1a; + ax::Label* _label2a; }; class LabelUnderlineMultiline : public AtlasDemoNew @@ -900,8 +900,8 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - axis::Label* _label1a; - axis::Label* _label2a; + ax::Label* _label1a; + ax::Label* _label2a; }; class LabelStrikethrough : public AtlasDemoNew @@ -913,8 +913,8 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - axis::Label* _label1a; - axis::Label* _label2a; + ax::Label* _label1a; + ax::Label* _label2a; }; class LabelLocalizationTest : public AtlasDemoNew @@ -923,13 +923,13 @@ public: CREATE_FUNC(LabelLocalizationTest); LabelLocalizationTest(); - void onChangedRadioButtonSelect(axis::ui::RadioButton* radioButton, axis::ui::RadioButton::EventType type); + void onChangedRadioButtonSelect(ax::ui::RadioButton* radioButton, ax::ui::RadioButton::EventType type); virtual std::string title() const override; virtual std::string subtitle() const override; - axis::Label* _label1; - axis::Label* _label2; + ax::Label* _label1; + ax::Label* _label2; cocostudio::ILocalizationManager* _localizationJson; cocostudio::ILocalizationManager* _localizationBin; }; @@ -1027,7 +1027,7 @@ public: virtual std::string subtitle() const override; private: - static void setLetterColors(axis::Label* label, const axis::Color3B& color); + static void setLetterColors(ax::Label* label, const ax::Color3B& color); }; #endif diff --git a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp index 07fbd10b0f..b4b183c995 100644 --- a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp +++ b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp @@ -855,7 +855,7 @@ void LayerRadialGradientTest::onEnter() addChild(listview); } -axis::ui::Slider* LayerRadialGradientTest::createSlider() +ax::ui::Slider* LayerRadialGradientTest::createSlider() { auto slider = ui::Slider::create(); slider->setTouchEnabled(true); @@ -870,18 +870,18 @@ axis::ui::Slider* LayerRadialGradientTest::createSlider() return slider; } -void LayerRadialGradientTest::listviewCallback(axis::Ref* sender, axis::ui::ListView::EventType type) +void LayerRadialGradientTest::listviewCallback(ax::Ref* sender, ax::ui::ListView::EventType type) { // clear all text to white - auto listview = static_cast(sender); + auto listview = static_cast(sender); for (auto&& item : listview->getItems()) - static_cast(item)->setColor(axis::Color3B::WHITE); + static_cast(item)->setColor(ax::Color3B::WHITE); _currentSeletedItemIndex = (int)listview->getCurSelectedIndex(); - listview->getItem(_currentSeletedItemIndex)->setColor(axis::Color3B::RED); + listview->getItem(_currentSeletedItemIndex)->setColor(ax::Color3B::RED); int percent = 100; - auto slider = static_cast(getChildByTag(101)); + auto slider = static_cast(getChildByTag(101)); switch (_currentSeletedItemIndex) { case 0: @@ -910,9 +910,9 @@ void LayerRadialGradientTest::listviewCallback(axis::Ref* sender, axis::ui::List } } -void LayerRadialGradientTest::sliderCallback(axis::Ref* sender, axis::ui::Slider::EventType type) +void LayerRadialGradientTest::sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType type) { - auto slider = static_cast(sender); + auto slider = static_cast(sender); float percent = slider->getPercent() / 100.f; switch (_currentSeletedItemIndex) { @@ -946,32 +946,32 @@ void LayerRadialGradientTest::sliderCallback(axis::Ref* sender, axis::ui::Slider } } -axis::ui::ListView* LayerRadialGradientTest::createListView() +ax::ui::ListView* LayerRadialGradientTest::createListView() { - auto listview = axis::ui::ListView::create(); + auto listview = ax::ui::ListView::create(); - auto scale = axis::ui::Text::create(); + auto scale = ax::ui::Text::create(); scale->setString("scale[0-2]"); - scale->setColor(axis::Color3B::RED); // default seleted item + scale->setColor(ax::Color3B::RED); // default seleted item scale->setTouchEnabled(true); listview->pushBackCustomItem(scale); - auto skewx = axis::ui::Text::create(); + auto skewx = ax::ui::Text::create(); skewx->setString("skewx[0-90]"); skewx->setTouchEnabled(true); listview->pushBackCustomItem(skewx); - auto skewy = axis::ui::Text::create(); + auto skewy = ax::ui::Text::create(); skewy->setString("skewy[0-90]"); skewy->setTouchEnabled(true); listview->pushBackCustomItem(skewy); - auto expand = axis::ui::Text::create(); + auto expand = ax::ui::Text::create(); expand->setString("expand[0-1]"); expand->setTouchEnabled(true); listview->pushBackCustomItem(expand); - auto radius = axis::ui::Text::create(); + auto radius = ax::ui::Text::create(); radius->setString("radius[0-300]"); radius->setTouchEnabled(true); listview->pushBackCustomItem(radius); diff --git a/tests/cpp-tests/Classes/LayerTest/LayerTest.h b/tests/cpp-tests/Classes/LayerTest/LayerTest.h index f8a949cbd4..1c7cc951df 100644 --- a/tests/cpp-tests/Classes/LayerTest/LayerTest.h +++ b/tests/cpp-tests/Classes/LayerTest/LayerTest.h @@ -96,11 +96,11 @@ public: virtual void onEnter() override; virtual std::string subtitle() const override; - void updateSize(axis::Vec2& touchLocation); + void updateSize(ax::Vec2& touchLocation); - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); }; class LayerTest2 : public LayerTest @@ -126,10 +126,10 @@ class LayerGradientTest : public LayerTest public: CREATE_FUNC(LayerGradientTest); LayerGradientTest(); - void onTouchesMoved(const std::vector& touches, axis::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; - void toggleItem(axis::Ref* sender); + void toggleItem(ax::Ref* sender); }; class LayerGradientTest2 : public LayerTest @@ -146,7 +146,7 @@ class LayerIgnoreAnchorPointPos : public LayerTest public: CREATE_FUNC(LayerIgnoreAnchorPointPos); virtual void onEnter() override; - void onToggle(axis::Ref* pObject); + void onToggle(ax::Ref* pObject); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -156,7 +156,7 @@ class LayerIgnoreAnchorPointRot : public LayerTest public: CREATE_FUNC(LayerIgnoreAnchorPointRot); virtual void onEnter() override; - void onToggle(axis::Ref* pObject); + void onToggle(ax::Ref* pObject); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -166,7 +166,7 @@ class LayerIgnoreAnchorPointScale : public LayerTest public: CREATE_FUNC(LayerIgnoreAnchorPointScale); virtual void onEnter() override; - void onToggle(axis::Ref* pObject); + void onToggle(ax::Ref* pObject); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -191,7 +191,7 @@ public: void step(float dt); private: - axis::LayerColor* _layer[3]; + ax::LayerColor* _layer[3]; }; class LayerBug3162B : public LayerTest @@ -205,7 +205,7 @@ public: void step(float dt); private: - axis::LayerColor* _layer[3]; + ax::LayerColor* _layer[3]; }; class LayerColorOccludeBug : public LayerTest @@ -218,7 +218,7 @@ public: virtual std::string subtitle() const override; private: - axis::LayerColor* _layer; + ax::LayerColor* _layer; }; class LayerRadialGradientTest : public LayerTest @@ -228,14 +228,14 @@ public: virtual void onEnter() override; virtual std::string title() const override; - void sliderCallback(axis::Ref* sender, axis::ui::Slider::EventType type); - void listviewCallback(axis::Ref* sender, axis::ui::ListView::EventType type); + void sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType type); + void listviewCallback(ax::Ref* sender, ax::ui::ListView::EventType type); private: - axis::ui::Slider* createSlider(); - axis::ui::ListView* createListView(); + ax::ui::Slider* createSlider(); + ax::ui::ListView* createListView(); - axis::LayerRadialGradient* _layer; + ax::LayerRadialGradient* _layer; int _currentSeletedItemIndex; }; diff --git a/tests/cpp-tests/Classes/LightTest/LightTest.h b/tests/cpp-tests/Classes/LightTest/LightTest.h index 1e848fb892..3f314da181 100644 --- a/tests/cpp-tests/Classes/LightTest/LightTest.h +++ b/tests/cpp-tests/Classes/LightTest/LightTest.h @@ -41,22 +41,22 @@ public: virtual void update(float delta) override; - void SwitchLight(axis::Ref* sender, axis::LightType lightType); + void SwitchLight(ax::Ref* sender, ax::LightType lightType); private: void addSprite(); void addLights(); private: - axis::AmbientLight* _ambientLight; - axis::DirectionLight* _directionalLight; - axis::PointLight* _pointLight; - axis::SpotLight* _spotLight; + ax::AmbientLight* _ambientLight; + ax::DirectionLight* _directionalLight; + ax::PointLight* _pointLight; + ax::SpotLight* _spotLight; - axis::Label* _ambientLightLabel; - axis::Label* _directionalLightLabel; - axis::Label* _pointLightLabel; - axis::Label* _spotLightLabel; + ax::Label* _ambientLightLabel; + ax::Label* _directionalLightLabel; + ax::Label* _pointLightLabel; + ax::Label* _spotLightLabel; }; #endif diff --git a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.h b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.h index 96a2441d7e..e8803353f2 100644 --- a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.h +++ b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.h @@ -69,12 +69,12 @@ public: private: struct Locations { - Locations(axis::backend::ProgramState* ps, axis::backend::UniformLocation loc) + Locations(ax::backend::ProgramState* ps, ax::backend::UniformLocation loc) : programState(ps), location(loc) {} - axis::backend::ProgramState* programState = nullptr; - axis::backend::UniformLocation location; + ax::backend::ProgramState* programState = nullptr; + ax::backend::UniformLocation location; }; std::vector timeUniforms; }; @@ -94,9 +94,9 @@ public: void updateUniformTime(float); private: - axis::backend::UniformLocation _locationTime; + ax::backend::UniformLocation _locationTime; EffectAutoBindingResolver* _resolver = nullptr; - axis::backend::ProgramState* _noiseProgramState = nullptr; + ax::backend::ProgramState* _noiseProgramState = nullptr; }; class Material_setTechnique : public MaterialSystemBaseTest @@ -110,7 +110,7 @@ public: private: void changeMaterial(float dt); - axis::MeshRenderer* _mesh; + ax::MeshRenderer* _mesh; int _techniqueState; }; diff --git a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp index 84595a0529..8c6f484f9b 100644 --- a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp +++ b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp @@ -478,7 +478,7 @@ void BugsTest::issue1410MenuCallback(Ref* sender) log("NO CRASHES"); } -void BugsTest::issue1410v2MenuCallback(axis::Ref* pSender) +void BugsTest::issue1410v2MenuCallback(ax::Ref* pSender) { auto menu = static_cast(static_cast(pSender)->getParent()); menu->setEnabled(true); @@ -487,7 +487,7 @@ void BugsTest::issue1410v2MenuCallback(axis::Ref* pSender) log("NO CRASHES. AND MENU SHOULD STOP WORKING"); } -void BugsTest::backMenuCallback(axis::Ref* pSender) +void BugsTest::backMenuCallback(ax::Ref* pSender) { static_cast(_parent)->switchTo(0, false); } diff --git a/tests/cpp-tests/Classes/MenuTest/MenuTest.h b/tests/cpp-tests/Classes/MenuTest/MenuTest.h index 5f41fd1e34..6654f9e4e6 100644 --- a/tests/cpp-tests/Classes/MenuTest/MenuTest.h +++ b/tests/cpp-tests/Classes/MenuTest/MenuTest.h @@ -40,39 +40,39 @@ public: virtual bool init() override; }; -class MenuLayerMainMenu : public axis::Layer +class MenuLayerMainMenu : public ax::Layer { protected: - axis::MenuItem* _disabledItem; - axis::EventListenerTouchOneByOne* _touchListener; + ax::MenuItem* _disabledItem; + ax::EventListenerTouchOneByOne* _touchListener; public: MenuLayerMainMenu(); ~MenuLayerMainMenu(); public: - bool touchBegan(axis::Touch* touch, axis::Event* event); - void touchEnded(axis::Touch* touch, axis::Event* event); - void touchCancelled(axis::Touch* touch, axis::Event* event); - void touchMoved(axis::Touch* touch, axis::Event* event); + bool touchBegan(ax::Touch* touch, ax::Event* event); + void touchEnded(ax::Touch* touch, ax::Event* event); + void touchCancelled(ax::Touch* touch, ax::Event* event); + void touchMoved(ax::Touch* touch, ax::Event* event); void allowTouches(float dt); - void menuCallback(axis::Ref* sender); - void menuCallbackConfig(axis::Ref* sender); - void menuCallbackDisabled(axis::Ref* sender); - void menuCallback2(axis::Ref* sender); - void menuCallbackPriorityTest(axis::Ref* sender); - void menuCallbackBugsTest(axis::Ref* pSender); - void onQuit(axis::Ref* sender); - void menuMovingCallback(axis::Ref* pSender); + void menuCallback(ax::Ref* sender); + void menuCallbackConfig(ax::Ref* sender); + void menuCallbackDisabled(ax::Ref* sender); + void menuCallback2(ax::Ref* sender); + void menuCallbackPriorityTest(ax::Ref* sender); + void menuCallbackBugsTest(ax::Ref* pSender); + void onQuit(ax::Ref* sender); + void menuMovingCallback(ax::Ref* pSender); // CREATE_NODE(MenuLayer1); }; -class MenuLayer2 : public axis::Layer +class MenuLayer2 : public ax::Layer { protected: - axis::Vec2 _centeredMenu; + ax::Vec2 _centeredMenu; bool _alignedH; void alignMenusH(); @@ -82,56 +82,56 @@ public: MenuLayer2(); ~MenuLayer2(); - void menuCallback(axis::Ref* sender); - void menuCallbackOpacity(axis::Ref* sender); - void menuCallbackAlign(axis::Ref* sender); + void menuCallback(ax::Ref* sender); + void menuCallbackOpacity(ax::Ref* sender); + void menuCallbackAlign(ax::Ref* sender); // CREATE_NODE(MenuLayer2); }; -class MenuLayer3 : public axis::Layer +class MenuLayer3 : public ax::Layer { protected: - axis::MenuItem* _disabledItem; + ax::MenuItem* _disabledItem; public: MenuLayer3(); ~MenuLayer3(); }; -class MenuLayer4 : public axis::Layer +class MenuLayer4 : public ax::Layer { public: MenuLayer4(); ~MenuLayer4(); - void menuCallback(axis::Ref* sender); - void backCallback(axis::Ref* sender); + void menuCallback(ax::Ref* sender); + void backCallback(ax::Ref* sender); }; -class BugsTest : public axis::Layer +class BugsTest : public ax::Layer { public: BugsTest(); - void issue1410MenuCallback(axis::Ref* pSender); - void issue1410v2MenuCallback(axis::Ref* pSender); - void backMenuCallback(axis::Ref* pSender); + void issue1410MenuCallback(ax::Ref* pSender); + void issue1410v2MenuCallback(ax::Ref* pSender); + void backMenuCallback(ax::Ref* pSender); }; -class RemoveMenuItemWhenMove : public axis::Layer +class RemoveMenuItemWhenMove : public ax::Layer { public: RemoveMenuItemWhenMove(); ~RemoveMenuItemWhenMove(); - bool onTouchBegan(axis::Touch* touch, axis::Event* event); - void onTouchMoved(axis::Touch* touch, axis::Event* event); + bool onTouchBegan(ax::Touch* touch, ax::Event* event); + void onTouchMoved(ax::Touch* touch, ax::Event* event); - void goBack(axis::Ref* pSender); + void goBack(ax::Ref* pSender); private: - axis::MenuItemFont* item; - axis::EventListenerTouchOneByOne* _touchListener; + ax::MenuItemFont* item; + ax::EventListenerTouchOneByOne* _touchListener; }; #endif diff --git a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp index 58b3a943a7..4221e2bbef 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp +++ b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp @@ -126,7 +126,7 @@ void DrawNode3D::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) } } -void DrawNode3D::updateCommand(axis::Renderer* renderer, const Mat4& transform, uint32_t flags) +void DrawNode3D::updateCommand(ax::Renderer* renderer, const Mat4& transform, uint32_t flags) { auto& matrixP = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); auto mvp = matrixP * transform; diff --git a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h index 3b59a38175..ee99bfcf29 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h +++ b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h @@ -33,16 +33,16 @@ NS_AX_BEGIN /** * Copy DrawNode for 3D geometry drawing. */ -class DrawNode3D : public axis::Node +class DrawNode3D : public ax::Node { public: /** creates and initialize a DrawNode3D node */ - static axis::DrawNode3D* create(); + static ax::DrawNode3D* create(); /** * Draw 3D Line */ - void drawLine(const axis::Vec3& from, const axis::Vec3& to, const Color4F& color); + void drawLine(const ax::Vec3& from, const ax::Vec3& to, const Color4F& color); /** * Draw 3D cube @@ -57,7 +57,7 @@ public: * vertices[7]:Left-top-back. * @param color */ - void drawCube(axis::Vec3* vertices, const Color4F& color); + void drawCube(ax::Vec3* vertices, const Color4F& color); /** Clear the geometry in the node's buffer. */ void clear(); @@ -77,10 +77,10 @@ public: */ void setBlendFunc(const BlendFunc& blendFunc); - void updateCommand(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags); + void updateCommand(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags); // Overrides - virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override; + virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override; DrawNode3D(); virtual ~DrawNode3D(); @@ -93,7 +93,7 @@ protected: void ensureCapacity(int count); BlendFunc _blendFunc; - axis::CustomCommand _customCommand; + ax::CustomCommand _customCommand; backend::ProgramState* _programStateLine = nullptr; backend::DepthStencilDescriptor* _depthstencilDescriptor = nullptr; backend::UniformLocation _locMVPMatrix; diff --git a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp index 04c7ca61f1..40cc21a9da 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp +++ b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp @@ -95,7 +95,7 @@ MeshRendererTestDemo::~MeshRendererTestDemo() //------------------------------------------------------------------ MeshRendererForceDepthTest::MeshRendererForceDepthTest() { - auto orc = axis::MeshRenderer::create("MeshRendererTest/orc.c3b"); + auto orc = ax::MeshRenderer::create("MeshRendererTest/orc.c3b"); orc->setScale(5); orc->setPositionNormalized(Vec2(.5f, .3f)); orc->setPositionZ(40); @@ -180,7 +180,7 @@ void MeshRendererBasicTest::addNewMeshWithCoords(Vec2 p) mesh->setTexture("MeshRendererTest/boss.png"); // - // mesh->setEffect(axis::EFFECT_OUTLINE); + // mesh->setEffect(ax::EFFECT_OUTLINE); // add to scene addChild(mesh); @@ -398,7 +398,7 @@ std::string MeshRendererFakeShadowTest::subtitle() const return "touch the screen to move around"; } -void MeshRendererFakeShadowTest::Move(axis::Ref* sender, int value) +void MeshRendererFakeShadowTest::Move(ax::Ref* sender, int value) { _orc->setPositionX(_orc->getPositionX() + value); } @@ -498,11 +498,11 @@ bool MeshRendererFakeShadowTest::isState(unsigned int state, unsigned int bit) c return (state & bit) == bit; } -void MeshRendererFakeShadowTest::onTouchesBegan(const std::vector& touches, axis::Event* event) {} +void MeshRendererFakeShadowTest::onTouchesBegan(const std::vector& touches, ax::Event* event) {} -void MeshRendererFakeShadowTest::onTouchesMoved(const std::vector& touches, axis::Event* event) {} +void MeshRendererFakeShadowTest::onTouchesMoved(const std::vector& touches, ax::Event* event) {} -void MeshRendererFakeShadowTest::onTouchesEnded(const std::vector& touches, axis::Event* event) +void MeshRendererFakeShadowTest::onTouchesEnded(const std::vector& touches, ax::Event* event) { for (auto&&item : touches) { @@ -634,7 +634,7 @@ std::string MeshRendererLightMapTest::subtitle() const return "drag the screen to move around"; } -void MeshRendererLightMapTest::onTouchesMoved(const std::vector& touches, axis::Event* event) +void MeshRendererLightMapTest::onTouchesMoved(const std::vector& touches, ax::Event* event) { if (touches.size() == 1) { @@ -2125,7 +2125,7 @@ void MeshRendererCubeMapTest::addNewMeshWithCoords(Vec2 p) #endif } -void MeshRendererCubeMapTest::onTouchesMoved(const std::vector& touches, axis::Event* event) +void MeshRendererCubeMapTest::onTouchesMoved(const std::vector& touches, ax::Event* event) { if (touches.size()) { @@ -2165,7 +2165,7 @@ Issue9767::Issue9767() Issue9767::~Issue9767() {} -void Issue9767::menuCallback_SwitchShader(axis::Ref* sender) +void Issue9767::menuCallback_SwitchShader(ax::Ref* sender) { AX_SAFE_RELEASE_NULL(_programState); if (_shaderType == Issue9767::ShaderType::SHADER_TEX) @@ -2271,7 +2271,7 @@ Animate3DCallbackTest::Animate3DCallbackTest() ((PUParticleSystem3D*)node)->startParticleSystem(); } - axis::log("frame %d", info->frame); + ax::log("frame %d", info->frame); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(listener, -1); } @@ -2365,7 +2365,7 @@ CameraBackgroundClearTest::CameraBackgroundClearTest() _label->setPosition(s.width / 2.f, VisibleRect::top().y * 0.8f); } -void CameraBackgroundClearTest::switch_CameraClearMode(axis::Ref* sender) +void CameraBackgroundClearTest::switch_CameraClearMode(ax::Ref* sender) { auto brush = _camera->getBackgroundBrush(); CameraBackgroundBrush::BrushType type = CameraBackgroundBrush::BrushType::NONE; @@ -2585,7 +2585,7 @@ std::string MeshRendererPropertyTest::subtitle() const } void MeshRendererPropertyTest::update(float delta) {} -void MeshRendererPropertyTest::printMeshName(axis::Ref* sender) +void MeshRendererPropertyTest::printMeshName(ax::Ref* sender) { AXLOG("MeshName Begin"); Vector meshes = _mesh->getMeshes(); @@ -2595,7 +2595,7 @@ void MeshRendererPropertyTest::printMeshName(axis::Ref* sender) } AXLOG("MeshName End"); } -void MeshRendererPropertyTest::removeUsedTexture(axis::Ref* sender) +void MeshRendererPropertyTest::removeUsedTexture(ax::Ref* sender) { if (_meshTex != nullptr) { @@ -2604,7 +2604,7 @@ void MeshRendererPropertyTest::removeUsedTexture(axis::Ref* sender) } } -void MeshRendererPropertyTest::resetTexture(axis::Ref* sender) +void MeshRendererPropertyTest::resetTexture(ax::Ref* sender) { if (_meshTex != nullptr) { @@ -2628,7 +2628,7 @@ void MeshRendererPropertyTest::refreshMeshRender() cacheTex = Director::getInstance()->getTextureCache()->addImage(image, "/dummyTexture"); image->release(); } - mesh->setTexture(cacheTex, axis::NTextureData::Usage::Diffuse, false); + mesh->setTexture(cacheTex, ax::NTextureData::Usage::Diffuse, false); } } @@ -2645,7 +2645,7 @@ Issue16155Test::Issue16155Test() addChild(mesh); removeChild(mesh); - axis::log("Issue 16155: Ref count:%d. Run this test again. RC should be the same", rcBefore); + ax::log("Issue 16155: Ref count:%d. Run this test again. RC should be the same", rcBefore); } std::string Issue16155Test::title() const diff --git a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h index 9ee93a50ff..d4e3f80714 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h +++ b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h @@ -75,8 +75,8 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewMeshWithCoords(axis::Vec2 p); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void addNewMeshWithCoords(ax::Vec2 p); + void onTouchesEnded(const std::vector& touches, ax::Event* event); }; class MeshRendererUVAnimationTest : public MeshRendererTestDemo @@ -93,10 +93,10 @@ protected: float _cylinder_texture_offset; float _shining_duration; - axis::backend::ProgramState* _state = nullptr; + ax::backend::ProgramState* _state = nullptr; #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) - axis::EventListenerCustom* _backToForegroundListener; + ax::EventListenerCustom* _backToForegroundListener; #endif }; @@ -115,25 +115,25 @@ public: virtual ~MeshRendererFakeShadowTest(); virtual std::string title() const override; virtual std::string subtitle() const override; - void Move(axis::Ref* sender, int value); + void Move(ax::Ref* sender, int value); void updateCamera(float fDelta); void move3D(float elapsedTime); void updateState(float elapsedTime); bool isState(unsigned int state, unsigned int bit) const; - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); private: - axis::Camera* _camera; - axis::Vec3 _targetPos; + ax::Camera* _camera; + ax::Vec3 _targetPos; unsigned int _curState; - axis::MeshRenderer* _plane; - axis::MeshRenderer* _orc; - axis::backend::ProgramState* _state = nullptr; + ax::MeshRenderer* _plane; + ax::MeshRenderer* _orc; + ax::backend::ProgramState* _state = nullptr; #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) - axis::EventListenerCustom* _backToForegroundListener; + ax::EventListenerCustom* _backToForegroundListener; #endif }; @@ -145,10 +145,10 @@ public: virtual ~MeshRendererLightMapTest(); virtual std::string title() const override; virtual std::string subtitle() const override; - void onTouchesMoved(const std::vector& touches, axis::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); private: - axis::Camera* _camera; + ax::Camera* _camera; }; class MeshRendererBasicToonShaderTest : public MeshRendererTestDemo @@ -161,10 +161,10 @@ public: virtual std::string subtitle() const override; protected: - axis::backend::ProgramState* _state; + ax::backend::ProgramState* _state; #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) - axis::EventListenerCustom* _backToForegroundListener; + ax::EventListenerCustom* _backToForegroundListener; #endif }; @@ -186,15 +186,15 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewMeshWithCoords(axis::Vec2 p); + void addNewMeshWithCoords(ax::Vec2 p); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); protected: - std::vector _meshes; + std::vector _meshes; #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) - axis::EventListenerCustom* _backToForegroundListener; + ax::EventListenerCustom* _backToForegroundListener; #endif }; @@ -207,9 +207,9 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void menuCallback_asyncLoadMesh(axis::Ref* sender); + void menuCallback_asyncLoadMesh(ax::Ref* sender); - void asyncLoad_Callback(axis::MeshRenderer* mesh, void* param); + void asyncLoad_Callback(ax::MeshRenderer* mesh, void* param); protected: std::vector _paths; // model paths to be loaded @@ -223,17 +223,17 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewMeshWithCoords(axis::Vec2 p); + void addNewMeshWithCoords(ax::Vec2 p); - void switchAnimationQualityCallback(axis::Ref* sender); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void switchAnimationQualityCallback(ax::Ref* sender); + void onTouchesEnded(const std::vector& touches, ax::Event* event); std::string getAnimationQualityMessage() const; private: - std::vector _meshes; + std::vector _meshes; int _animateQuality; - axis::MenuItemFont* _menuItem; + ax::MenuItemFont* _menuItem; }; class MeshRendererWithSkinOutlineTest : public MeshRendererTestDemo @@ -245,15 +245,15 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewMeshWithCoords(axis::Vec2 p); + void addNewMeshWithCoords(ax::Vec2 p); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); protected: - std::vector _meshes; + std::vector _meshes; #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) - axis::EventListenerCustom* _backToForegroundListener; + ax::EventListenerCustom* _backToForegroundListener; #endif }; @@ -266,7 +266,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); virtual void update(float dt) override; @@ -285,16 +285,16 @@ protected: void renewCallBack(); - axis::MeshRenderer* _mesh; + ax::MeshRenderer* _mesh; - axis::Action* _swim; - axis::Animate3D* _hurt; + ax::Action* _swim; + ax::Animate3D* _hurt; float _elapseTransTime; State _state; - axis::MoveTo* _moveAction; + ax::MoveTo* _moveAction; }; class AttachmentTest : public MeshRendererTestDemo @@ -305,13 +305,13 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); - void addNewMeshWithCoords(axis::Vec2 p); + void addNewMeshWithCoords(ax::Vec2 p); protected: bool _hasWeapon; - axis::MeshRenderer* _mesh; + ax::MeshRenderer* _mesh; }; class MeshRendererReskinTest : public MeshRendererTestDemo @@ -321,10 +321,10 @@ public: MeshRendererReskinTest(); virtual std::string title() const override; virtual std::string subtitle() const override; - void onTouchesEnded(const std::vector& touches, axis::Event* event); - void addNewMeshWithCoords(axis::Vec2 p); + void onTouchesEnded(const std::vector& touches, ax::Event* event); + void addNewMeshWithCoords(ax::Vec2 p); - void menuCallback_reSkin(axis::Ref* sender); + void menuCallback_reSkin(ax::Ref* sender); protected: void applyCurSkin(); @@ -343,7 +343,7 @@ protected: std::vector _skins[(int)SkinType::MAX_TYPE]; // all skins int _curSkin[(int)SkinType::MAX_TYPE]; // current skin index - axis::MeshRenderer* _mesh; + ax::MeshRenderer* _mesh; }; class MeshRendererWithOBBPerformanceTest : public MeshRendererTestDemo @@ -354,35 +354,35 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; virtual void update(float dt) override; - void addNewOBBWithCoords(axis::Vec2 p); - void addNewMeshWithCoords(axis::Vec2 p); - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void addOBBCallback(axis::Ref* sender); - void delOBBCallback(axis::Ref* sender); + void addNewOBBWithCoords(ax::Vec2 p); + void addNewMeshWithCoords(ax::Vec2 p); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void addOBBCallback(ax::Ref* sender); + void delOBBCallback(ax::Ref* sender); void addOBBWithCount(float value); void delOBBWithCount(float value); protected: - axis::MeshRenderer* _mesh; - std::vector _obb; - axis::DrawNode3D* _drawOBB; - axis::Label* _labelCubeCount; - axis::MoveTo* _moveAction; - axis::OBB _obbt; - axis::OBB _obbtOri; // tortoise origin obb - axis::DrawNode3D* _drawDebug; + ax::MeshRenderer* _mesh; + std::vector _obb; + ax::DrawNode3D* _drawOBB; + ax::Label* _labelCubeCount; + ax::MoveTo* _moveAction; + ax::OBB _obbt; + ax::OBB _obbtOri; // tortoise origin obb + ax::DrawNode3D* _drawDebug; bool _hasCollider; std::set _intersetList; void initDrawBox(); void reachEndCallBack(); - void unproject(const axis::Mat4& viewProjection, - const axis::Size* viewport, - axis::Vec3* src, - axis::Vec3* dst); - void calculateRayByLocationInView(axis::Ray* ray, const axis::Vec2& location); + void unproject(const ax::Mat4& viewProjection, + const ax::Size* viewport, + ax::Vec3* src, + ax::Vec3* dst); + void calculateRayByLocationInView(ax::Ray* ray, const ax::Vec2& location); }; class MeshRendererMirrorTest : public MeshRendererTestDemo @@ -393,12 +393,12 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewMeshWithCoords(axis::Vec2 p); + void addNewMeshWithCoords(ax::Vec2 p); protected: bool _hasWeapon; - axis::MeshRenderer* _mesh; - axis::MeshRenderer* _mirrorMesh; + ax::MeshRenderer* _mesh; + ax::MeshRenderer* _mirrorMesh; }; class QuaternionTest : public MeshRendererTestDemo @@ -409,11 +409,11 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewMeshWithCoords(axis::Vec2 p); + void addNewMeshWithCoords(ax::Vec2 p); virtual void update(float delta) override; protected: - axis::MeshRenderer* _mesh; + ax::MeshRenderer* _mesh; float _arcSpeed; float _radius; float _accAngle; @@ -430,7 +430,7 @@ public: virtual void update(float delta) override; - void menuCallback_Message(axis::Ref* sender); + void menuCallback_Message(ax::Ref* sender); protected: void switchCase(); @@ -441,7 +441,7 @@ protected: _UI_3D_UI, MAX_CASE_NUM, }; - axis::Label* _label; + ax::Label* _label; int _caseIdx; // use case index std::string _useCaseTitles[(int)USECASE::MAX_CASE_NUM]; }; @@ -455,10 +455,10 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewMeshWithCoords(axis::Vec2 p); + void addNewMeshWithCoords(ax::Vec2 p); protected: - std::vector _meshes; + std::vector _meshes; int _vectorIndex; }; @@ -476,18 +476,18 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewMeshWithCoords(axis::Vec2); + void addNewMeshWithCoords(ax::Vec2); - void onTouchesMoved(const std::vector& touches, axis::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); protected: - axis::TextureCube* _textureCube; - axis::Skybox* _skyBox; - axis::MeshRenderer* _teapot; - axis::Camera* _camera; + ax::TextureCube* _textureCube; + ax::Skybox* _skyBox; + ax::MeshRenderer* _teapot; + ax::Camera* _camera; #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) - axis::EventListenerCustom* _backToForegroundListener; + ax::EventListenerCustom* _backToForegroundListener; #endif }; @@ -507,11 +507,11 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void menuCallback_SwitchShader(axis::Ref* sender); + void menuCallback_SwitchShader(ax::Ref* sender); protected: ShaderType _shaderType; - axis::MeshRenderer* _mesh; + ax::MeshRenderer* _mesh; }; /// Clipping MeshRenderer @@ -535,7 +535,7 @@ public: virtual std::string subtitle() const override; protected: - axis::MeshRenderer* _meshRenderer; + ax::MeshRenderer* _meshRenderer; }; class CameraBackgroundClearTest : public MeshRendererTestDemo @@ -546,11 +546,11 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void switch_CameraClearMode(axis::Ref* sender); + void switch_CameraClearMode(ax::Ref* sender); protected: - axis::Camera* _camera; - axis::Label* _label; + ax::Camera* _camera; + ax::Label* _label; }; class MeshRendererVertexColorTest : public MeshRendererTestDemo @@ -564,9 +564,9 @@ public: virtual ~MeshRendererVertexColorTest(); protected: - axis::MeshRenderer* _mesh; + ax::MeshRenderer* _mesh; #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) - axis::EventListenerCustom* _backToForegroundListener; + ax::EventListenerCustom* _backToForegroundListener; #endif }; @@ -580,8 +580,8 @@ public: virtual void update(float delta) override; protected: - axis::MeshRenderer* _mesh; - axis::MotionStreak3D* _streak; + ax::MeshRenderer* _mesh; + ax::MotionStreak3D* _streak; }; class MeshRendererNormalMappingTest : public MeshRendererTestDemo @@ -605,15 +605,15 @@ public: virtual std::string subtitle() const override; virtual void update(float delta) override; - void printMeshName(axis::Ref* sender); - void removeUsedTexture(axis::Ref* sender); - void resetTexture(axis::Ref* sender); + void printMeshName(ax::Ref* sender); + void removeUsedTexture(ax::Ref* sender); + void resetTexture(ax::Ref* sender); void refreshMeshRender(); protected: - axis::MeshRenderer* _mesh; - axis::Texture2D* _meshTex; + ax::MeshRenderer* _mesh; + ax::Texture2D* _meshTex; std::string _texFile; }; diff --git a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.h b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.h index aa00c8bda7..6ec251305b 100644 --- a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.h +++ b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.h @@ -39,17 +39,17 @@ public: virtual std::string subtitle() const override; virtual void onEnter() override; - void modeCallback(axis::Ref* sender); + void modeCallback(ax::Ref* sender); protected: - axis::MotionStreak* _streak; + ax::MotionStreak* _streak; }; class MotionStreakTest1 : public MotionStreakTest { protected: - axis::Node* _root; - axis::Node* _target; + ax::Node* _root; + ax::Node* _target; public: CREATE_FUNC(MotionStreakTest1); @@ -61,13 +61,13 @@ public: class MotionStreakTest2 : public MotionStreakTest { protected: - axis::Node* _root; - axis::Node* _target; + ax::Node* _root; + ax::Node* _target; public: CREATE_FUNC(MotionStreakTest2); virtual void onEnter() override; - void onTouchesMoved(const std::vector& touches, axis::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -83,7 +83,7 @@ public: virtual void update(float dt) override; private: - axis::Vec2 _center; + ax::Vec2 _center; float _radius; float _angle; }; diff --git a/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.h b/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.h index 97c9f136b6..77338feed3 100644 --- a/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.h +++ b/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.h @@ -36,10 +36,10 @@ public: virtual bool init() override; - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); - void onTouchesCancelled(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); + void onTouchesCancelled(const std::vector& touches, ax::Event* event); }; #endif /* __MULTITOUCHTEST_H__ */ diff --git a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp index bc7a4afed8..1f50406a37 100644 --- a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp +++ b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp @@ -105,13 +105,13 @@ bool NavMeshBaseTestDemo::init() return true; } -void NavMeshBaseTestDemo::onTouchesBegan(const std::vector& touches, axis::Event* event) +void NavMeshBaseTestDemo::onTouchesBegan(const std::vector& touches, ax::Event* event) { _needMoveAgents = true; touchesBegan(touches, event); } -void NavMeshBaseTestDemo::onTouchesMoved(const std::vector& touches, axis::Event* event) +void NavMeshBaseTestDemo::onTouchesMoved(const std::vector& touches, ax::Event* event) { if (touches.size() && _camera) { @@ -130,7 +130,7 @@ void NavMeshBaseTestDemo::onTouchesMoved(const std::vector& touche touchesMoved(touches, event); } -void NavMeshBaseTestDemo::onTouchesEnded(const std::vector& touches, axis::Event* event) +void NavMeshBaseTestDemo::onTouchesEnded(const std::vector& touches, ax::Event* event) { touchesEnded(touches, event); } @@ -220,7 +220,7 @@ Vec3 jump(const Vec3* pV1, const Vec3* pV2, float height, float t) return pOut; } -void NavMeshBaseTestDemo::moveAgents(const axis::Vec3& des) +void NavMeshBaseTestDemo::moveAgents(const ax::Vec3& des) { for (auto&& iter : _agents) { @@ -279,7 +279,7 @@ std::string NavMeshBasicTestDemo::subtitle() const return "Basic Test"; } -void NavMeshBasicTestDemo::touchesEnded(const std::vector& touches, axis::Event* event) +void NavMeshBasicTestDemo::touchesEnded(const std::vector& touches, ax::Event* event) { if (!_needMoveAgents) return; @@ -355,8 +355,8 @@ bool NavMeshAdvanceTestDemo::init() _debugLabel->retain(); auto menuItem0 = MenuItemLabel::create(_obstacleLabel, [=](Ref*) { - float x = axis::random(-50.0f, 50.0f); - float z = axis::random(-50.0f, 50.0f); + float x = ax::random(-50.0f, 50.0f); + float z = ax::random(-50.0f, 50.0f); Physics3DWorld::HitResult result; getPhysics3DWorld()->rayCast(Vec3(x, 50.0f, z), Vec3(x, -50.0f, z), &result); createObstacle(result.hitPosition); @@ -365,8 +365,8 @@ bool NavMeshAdvanceTestDemo::init() menuItem0->setPosition(Vec2(VisibleRect::left().x, VisibleRect::top().y - 50)); auto menuItem1 = MenuItemLabel::create(_agentLabel, [=](Ref*) { - float x = axis::random(-50.0f, 50.0f); - float z = axis::random(-50.0f, 50.0f); + float x = ax::random(-50.0f, 50.0f); + float z = ax::random(-50.0f, 50.0f); Physics3DWorld::HitResult result; getPhysics3DWorld()->rayCast(Vec3(x, 50.0f, z), Vec3(x, -50.0f, z), &result); createAgent(result.hitPosition); @@ -415,7 +415,7 @@ std::string NavMeshAdvanceTestDemo::subtitle() const return "Advance Test"; } -void NavMeshAdvanceTestDemo::touchesEnded(const std::vector& touches, axis::Event* event) +void NavMeshAdvanceTestDemo::touchesEnded(const std::vector& touches, ax::Event* event) { if (!_needMoveAgents) return; diff --git a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h index 8a820816c7..6f40b6e6a4 100644 --- a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h +++ b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h @@ -52,23 +52,23 @@ public: // overrides virtual bool init() override; virtual void update(float delta) override; - virtual void onTouchesBegan(const std::vector& touches, axis::Event* event); - virtual void onTouchesMoved(const std::vector& touches, axis::Event* event); - virtual void onTouchesEnded(const std::vector& touches, axis::Event* event); + virtual void onTouchesBegan(const std::vector& touches, ax::Event* event); + virtual void onTouchesMoved(const std::vector& touches, ax::Event* event); + virtual void onTouchesEnded(const std::vector& touches, ax::Event* event); protected: void initScene(); - void createAgent(const axis::Vec3& pos); - void createObstacle(const axis::Vec3& pos); - void moveAgents(const axis::Vec3& des); - virtual void touchesBegan(const std::vector& touches, axis::Event* event){}; - virtual void touchesMoved(const std::vector& touches, axis::Event* event){}; - virtual void touchesEnded(const std::vector& touches, axis::Event* event){}; + void createAgent(const ax::Vec3& pos); + void createObstacle(const ax::Vec3& pos); + void moveAgents(const ax::Vec3& des); + virtual void touchesBegan(const std::vector& touches, ax::Event* event){}; + virtual void touchesMoved(const std::vector& touches, ax::Event* event){}; + virtual void touchesEnded(const std::vector& touches, ax::Event* event){}; protected: - axis::Camera* _camera; + ax::Camera* _camera; float _angle; - std::vector> _agents; + std::vector> _agents; bool _needMoveAgents; }; @@ -87,12 +87,12 @@ public: virtual void onEnter() override; protected: - virtual void touchesBegan(const std::vector& touches, axis::Event* event) override{}; - virtual void touchesMoved(const std::vector& touches, axis::Event* event) override{}; - virtual void touchesEnded(const std::vector& touches, axis::Event* event) override; + virtual void touchesBegan(const std::vector& touches, ax::Event* event) override{}; + virtual void touchesMoved(const std::vector& touches, ax::Event* event) override{}; + virtual void touchesEnded(const std::vector& touches, ax::Event* event) override; protected: - axis::Label* _debugLabel; + ax::Label* _debugLabel; }; class NavMeshAdvanceTestDemo : public NavMeshBaseTestDemo @@ -110,14 +110,14 @@ public: virtual void onEnter() override; protected: - virtual void touchesBegan(const std::vector& touches, axis::Event* event) override{}; - virtual void touchesMoved(const std::vector& touches, axis::Event* event) override{}; - virtual void touchesEnded(const std::vector& touches, axis::Event* event) override; + virtual void touchesBegan(const std::vector& touches, ax::Event* event) override{}; + virtual void touchesMoved(const std::vector& touches, ax::Event* event) override{}; + virtual void touchesEnded(const std::vector& touches, ax::Event* event) override; protected: - axis::Label* _obstacleLabel; - axis::Label* _agentLabel; - axis::Label* _debugLabel; + ax::Label* _obstacleLabel; + ax::Label* _agentLabel; + ax::Label* _debugLabel; }; #endif diff --git a/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp b/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp index 5c7afccc72..90cbd2fbe6 100644 --- a/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp +++ b/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp @@ -66,7 +66,7 @@ struct DownloaderTest : public TestCase TAG_SPRITE, }; - Node* createDownloadView(const char* name, const axis::ui::Button::ccWidgetClickCallback& callback) + Node* createDownloadView(const char* name, const ax::ui::Button::ccWidgetClickCallback& callback) { Size viewSize(220, 120); float margin = 5; @@ -217,7 +217,7 @@ struct DownloaderTest : public TestCase }; // define success callback - downloader->onDataTaskSuccess = [this](const axis::network::DownloadTask& task, + downloader->onDataTaskSuccess = [this](const ax::network::DownloadTask& task, std::vector& data) { // create texture from data Texture2D* texture = nullptr; @@ -252,7 +252,7 @@ struct DownloaderTest : public TestCase AX_SAFE_RELEASE(texture); }; - downloader->onFileTaskSuccess = [this](const axis::network::DownloadTask& task) { + downloader->onFileTaskSuccess = [this](const ax::network::DownloadTask& task) { Texture2D* texture = nullptr; do { @@ -286,7 +286,7 @@ struct DownloaderTest : public TestCase }; // define failed callback - downloader->onTaskError = [this](const axis::network::DownloadTask& task, int errorCode, + downloader->onTaskError = [this](const ax::network::DownloadTask& task, int errorCode, int errorCodeInternal, std::string_view errorStr) { log("Failed to download : %s, identifier(%s) error code(%d), internal error code(%d) desc(%s)", task.requestURL.c_str(), task.identifier.c_str(), errorCode, errorCodeInternal, errorStr.data()); diff --git a/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp b/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp index 734d0a0d96..a0735321f3 100644 --- a/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp +++ b/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp @@ -102,7 +102,7 @@ HttpClientTest::~HttpClientTest() HttpClient::destroyInstance(); } -void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) +void HttpClientTest::onMenuGetTestClicked(ax::Ref* sender) { // test 1(sync request test) { @@ -175,7 +175,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) _labelStatusCode->setString("waiting..."); } -void HttpClientTest::onMenuPostTestClicked(axis::Ref* sender) +void HttpClientTest::onMenuPostTestClicked(ax::Ref* sender) { // test 1 { @@ -213,7 +213,7 @@ void HttpClientTest::onMenuPostTestClicked(axis::Ref* sender) _labelStatusCode->setString("waiting..."); } -void HttpClientTest::onMenuPostBinaryTestClicked(axis::Ref* sender) +void HttpClientTest::onMenuPostBinaryTestClicked(ax::Ref* sender) { HttpRequest* request = new HttpRequest(); request->setUrl("https://httpbin.org/post"); @@ -381,7 +381,7 @@ HttpClientClearRequestsTest::~HttpClientClearRequestsTest() HttpClient::destroyInstance(); } -void HttpClientClearRequestsTest::onMenuCancelAllClicked(axis::Ref* sender) +void HttpClientClearRequestsTest::onMenuCancelAllClicked(ax::Ref* sender) { for (int i = 0; i < 10; i++) { @@ -409,7 +409,7 @@ void HttpClientClearRequestsTest::onMenuCancelAllClicked(axis::Ref* sender) _labelStatusCode->setString("waiting..."); } -void HttpClientClearRequestsTest::onMenuCancelSomeClicked(axis::Ref* sender) +void HttpClientClearRequestsTest::onMenuCancelSomeClicked(ax::Ref* sender) { // test 1 for (int i = 0; i < 10; i++) diff --git a/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.h b/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.h index 1de57b107a..c5c40c0ef8 100644 --- a/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.h +++ b/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.h @@ -41,19 +41,19 @@ public: virtual ~HttpClientTest(); // Menu Callbacks - void onMenuGetTestClicked(axis::Ref* sender); - void onMenuPostTestClicked(axis::Ref* sender); - void onMenuPostBinaryTestClicked(axis::Ref* sender); - void onMenuPutTestClicked(axis::Ref* sender); - void onMenuDeleteTestClicked(axis::Ref* sender); + void onMenuGetTestClicked(ax::Ref* sender); + void onMenuPostTestClicked(ax::Ref* sender); + void onMenuPostBinaryTestClicked(ax::Ref* sender); + void onMenuPutTestClicked(ax::Ref* sender); + void onMenuDeleteTestClicked(ax::Ref* sender); // Http Response Callback - void onHttpRequestCompleted(axis::network::HttpClient* sender, axis::network::HttpResponse* response); + void onHttpRequestCompleted(ax::network::HttpClient* sender, ax::network::HttpResponse* response); virtual std::string title() const override { return "Http Request Test"; } private: - axis::Label* _labelStatusCode; + ax::Label* _labelStatusCode; }; class HttpClientClearRequestsTest : public TestCase @@ -65,19 +65,19 @@ public: virtual ~HttpClientClearRequestsTest(); // Menu Callbacks - void onMenuCancelAllClicked(axis::Ref* sender); - void onMenuCancelSomeClicked(axis::Ref* sender); + void onMenuCancelAllClicked(ax::Ref* sender); + void onMenuCancelSomeClicked(ax::Ref* sender); // Http Response Callback - void onHttpRequestCompleted(axis::network::HttpClient* sender, axis::network::HttpResponse* response); + void onHttpRequestCompleted(ax::network::HttpClient* sender, ax::network::HttpResponse* response); virtual std::string title() const override { return "Http Request Test"; } private: int _totalExpectedRequests; int _totalProcessedRequests; - axis::Label* _labelTrakingData; - axis::Label* _labelStatusCode; + ax::Label* _labelTrakingData; + ax::Label* _labelStatusCode; }; #endif //__HTTPREQUESTHTTP_H diff --git a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp index 96e6d46205..f703ed18a3 100644 --- a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp +++ b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp @@ -62,7 +62,7 @@ AudioEngineTests::AudioEngineTests() namespace { -class TextButton : public axis::Label +class TextButton : public ax::Label { public: static TextButton* create(std::string_view text, const std::function& onTriggered) @@ -213,7 +213,7 @@ std::string AudioEngineTestDemo::title() const return "New Audio Engine Test"; } -void AudioEngineTestDemo::onBackCallback(axis::Ref* sender) +void AudioEngineTestDemo::onBackCallback(ax::Ref* sender) { AudioEngine::end(); TestCase::onBackCallback(sender); @@ -897,7 +897,7 @@ bool AudioPerformanceTest::init() unschedule("test"); schedule( [audioFiles](float dt) { - int index = axis::random(0, (int)(audioFiles.size() - 1)); + int index = ax::random(0, (int)(audioFiles.size() - 1)); AX_PROFILER_START("play2d"); AudioEngine::play2d(audioFiles[index]); AX_PROFILER_STOP("play2d"); diff --git a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.h b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.h index 130da878aa..6ee1719ca1 100644 --- a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.h +++ b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.h @@ -44,7 +44,7 @@ public: virtual std::string title() const override; virtual void onExit() override; - virtual void onBackCallback(axis::Ref* sender) override; + virtual void onBackCallback(ax::Ref* sender) override; protected: std::shared_ptr _isDestroyed; @@ -74,7 +74,7 @@ private: void* _timeSlider; bool _updateTimeSlider; bool _isStopped; - axis::Label* _playOverLabel; + ax::Label* _playOverLabel; }; class AudioWavTest : public AudioEngineTestDemo @@ -96,7 +96,7 @@ private: int _curIndex = -1; std::vector _wavFiles; - axis::Label* _stateLabel = nullptr; + ax::Label* _stateLabel = nullptr; }; class PlaySimultaneouslyTest : public AudioEngineTestDemo @@ -135,10 +135,10 @@ public: private: static const int FILE_COUNT = 2; std::string _files[FILE_COUNT]; - axis::AudioProfile _audioProfile; + ax::AudioProfile _audioProfile; int _audioCount; - axis::Label* _showLabel; + ax::Label* _showLabel; float _time; float _minDelay; void* _timeSlider; diff --git a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 9ef898202d..21cecd6f03 100644 --- a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -1707,7 +1707,7 @@ Issue8194::Issue8194() #define tagB 101 // dispatch custom event in another custom event, make the custom event "Issue8194" take effect immediately _listener = - getEventDispatcher()->addCustomEventListener(Director::EVENT_AFTER_UPDATE, [this](axis::EventCustom* event) { + getEventDispatcher()->addCustomEventListener(Director::EVENT_AFTER_UPDATE, [this](ax::EventCustom* event) { if (nodesAdded) { // AXLOG("Fire Issue8194 Event"); @@ -1728,8 +1728,8 @@ Issue8194::Issue8194() auto nodeA = Node::create(); addChild(nodeA, 1, tagA); - axis::EventListenerCustom* listenerA = - axis::EventListenerCustom::create("Issue8194", [&](axis::EventCustom* event) { + ax::EventListenerCustom* listenerA = + ax::EventListenerCustom::create("Issue8194", [&](ax::EventCustom* event) { _subtitleLabel->setString("Bug has been fixed."); event->stopPropagation(); }); @@ -1739,8 +1739,8 @@ Issue8194::Issue8194() auto nodeB = Node::create(); addChild(nodeB, -1, tagB); - axis::EventListenerCustom* listenerB = - axis::EventListenerCustom::create("Issue8194", [&](axis::EventCustom* event) { + ax::EventListenerCustom* listenerB = + ax::EventListenerCustom::create("Issue8194", [&](ax::EventCustom* event) { _subtitleLabel->setString("Bug exist yet."); event->stopPropagation(); }); @@ -1778,7 +1778,7 @@ Issue9898::Issue9898() auto nodeA = Node::create(); addChild(nodeA); - _listener = axis::EventListenerCustom::create("Issue9898", [&](axis::EventCustom* event) { + _listener = ax::EventListenerCustom::create("Issue9898", [&](ax::EventCustom* event) { _eventDispatcher->removeEventListener(_listener); _eventDispatcher->dispatchCustomEvent("Issue9898"); }); diff --git a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h index ed2617e338..38049ffcf7 100644 --- a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h +++ b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h @@ -81,8 +81,8 @@ public: virtual std::string subtitle() const override; private: - axis::EventListenerCustom* _listener; - axis::EventListenerCustom* _listener2; + ax::EventListenerCustom* _listener; + ax::EventListenerCustom* _listener2; }; class LabelKeyboardEventTest : public EventDispatcherTestDemo @@ -114,7 +114,7 @@ public: virtual std::string subtitle() const override; private: - axis::Sprite* _sprite; + ax::Sprite* _sprite; bool _spriteSaved; }; @@ -138,16 +138,16 @@ public: virtual void update(float dt) override; - void onEvent1(axis::EventCustom* event); - void onEvent2(axis::EventCustom* event); + void onEvent1(ax::EventCustom* event); + void onEvent2(ax::EventCustom* event); virtual std::string title() const override; virtual std::string subtitle() const override; protected: int _count1, _count2, _count3, _count4; - axis::Label *_label1, *_label2, *_label3, *_label4; - axis::EventListenerCustom *_event1, *_event2, *_event3, *_event4; + ax::Label *_label1, *_label2, *_label3, *_label4; + ax::EventListenerCustom *_event1, *_event2, *_event3, *_event4; }; class GlobalZTouchTest : public EventDispatcherTestDemo @@ -162,7 +162,7 @@ public: virtual std::string subtitle() const override; protected: - axis::Sprite* _sprite; + ax::Sprite* _sprite; float _accum; }; @@ -176,8 +176,8 @@ public: virtual std::string subtitle() const override; protected: - bool isPointInNode(axis::Vec2 pt, axis::Node* node); - bool isPointInTopHalfAreaOfScreen(axis::Vec2 pt); + bool isPointInNode(ax::Vec2 pt, ax::Node* node); + bool isPointInTopHalfAreaOfScreen(ax::Vec2 pt); }; class PauseResumeTargetTest : public EventDispatcherTestDemo @@ -204,11 +204,11 @@ public: virtual std::string subtitle() const override; private: - axis::Sprite* _touchableSprite; - axis::MenuItemFont* _itemPauseTouch; - axis::MenuItemFont* _itemResumeTouch; - axis::MenuItemFont* _itemAddToScene; - axis::MenuItemFont* _itemRemoveFromScene; + ax::Sprite* _touchableSprite; + ax::MenuItemFont* _itemPauseTouch; + ax::MenuItemFont* _itemResumeTouch; + ax::MenuItemFont* _itemAddToScene; + ax::MenuItemFont* _itemRemoveFromScene; }; class PauseResumeTargetTest3 : public EventDispatcherTestDemo @@ -222,7 +222,7 @@ public: virtual std::string subtitle() const override; private: - axis::Sprite* _touchableSprite; + ax::Sprite* _touchableSprite; }; class Issue4129 : public EventDispatcherTestDemo @@ -236,7 +236,7 @@ public: virtual std::string subtitle() const override; private: - axis::EventListenerCustom* _customlistener; + ax::EventListenerCustom* _customlistener; bool _bugFixed; }; @@ -295,7 +295,7 @@ public: virtual std::string subtitle() const override; private: - axis::EventListenerCustom* _listener; + ax::EventListenerCustom* _listener; }; class Issue9898 : public EventDispatcherTestDemo @@ -308,7 +308,7 @@ public: virtual std::string subtitle() const override; private: - axis::EventListenerCustom* _listener; + ax::EventListenerCustom* _listener; }; #endif /* defined(__samples__NewEventDispatcherTest__) */ diff --git a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp index d0f4d0d64c..fe55f4acc0 100644 --- a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp +++ b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp @@ -554,13 +554,13 @@ void SpriteCreation::doTest() spriteCache.clear(); } -void SpriteCreation::addSpritesCallback(axis::Ref*) +void SpriteCreation::addSpritesCallback(ax::Ref*) { updateSpriteCountLabel(totalSprites + suggestDelta); doTest(); } -void SpriteCreation::delSpritesCallback(axis::Ref*) +void SpriteCreation::delSpritesCallback(ax::Ref*) { updateSpriteCountLabel(totalSprites - suggestDelta); doTest(); @@ -754,7 +754,7 @@ void CaptureNodeTest::onCaptured(Ref*) BugAutoCulling::BugAutoCulling() { Size s = Director::getInstance()->getWinSize(); - auto fastmap = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); + auto fastmap = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); this->addChild(fastmap); for (int i = 0; i < 30; i++) { @@ -856,7 +856,7 @@ RendererUniformBatch::RendererUniformBatch() } } -axis::backend::ProgramState* RendererUniformBatch::createBlurProgramState() +ax::backend::ProgramState* RendererUniformBatch::createBlurProgramState() { auto programState = new backend::ProgramState(ProgramManager::getInstance()->getCustomProgram(CustomProgramType::BLUR)); @@ -877,7 +877,7 @@ axis::backend::ProgramState* RendererUniformBatch::createBlurProgramState() return programState; } -axis::backend::ProgramState* RendererUniformBatch::createSepiaProgramState() +ax::backend::ProgramState* RendererUniformBatch::createSepiaProgramState() { auto programState = new backend::ProgramState(ProgramManager::getInstance()->getCustomProgram(CustomProgramType::SEPIA)); diff --git a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h index e449c8a543..85c7047743 100644 --- a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h +++ b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h @@ -53,7 +53,7 @@ public: void createSpriteTest(); void createNewSpriteTest(); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); protected: NewSpriteTest(); @@ -80,16 +80,16 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); protected: NewClippingNodeTest(); virtual ~NewClippingNodeTest(); bool _scrolling; - axis::Vec2 _lastPoint; + ax::Vec2 _lastPoint; }; class NewDrawNodeTest : public MultiSceneTest @@ -114,9 +114,9 @@ public: protected: NewCullingTest(); virtual ~NewCullingTest(); - bool onTouchBegan(axis::Touch* touch, axis::Event* event); - void onTouchMoved(axis::Touch* touch, axis::Event* event); - axis::Vec2 _lastPos; + bool onTouchBegan(ax::Touch* touch, ax::Event* event); + void onTouchMoved(ax::Touch* touch, ax::Event* event); + ax::Vec2 _lastPos; }; class SpriteCreation : public MultiSceneTest @@ -136,9 +136,9 @@ public: protected: int totalSprites = 1000; int suggestDelta = 100; - axis::Label* _labelSpriteNum = nullptr; - axis::Label* labelCreate = nullptr; - axis::Label* labelDestory = nullptr; + ax::Label* _labelSpriteNum = nullptr; + ax::Label* labelCreate = nullptr; + ax::Label* labelDestory = nullptr; SpriteCreation(); virtual ~SpriteCreation(); }; @@ -168,7 +168,7 @@ protected: CaptureScreenTest(); ~CaptureScreenTest(); - void onCaptured(axis::Ref*); + void onCaptured(ax::Ref*); void afterCaptured(bool succeed, std::string_view outputFile); std::string _filename; @@ -187,7 +187,7 @@ protected: CaptureNodeTest(); ~CaptureNodeTest(); - void onCaptured(axis::Ref*); + void onCaptured(ax::Ref*); std::string _filename; }; @@ -224,8 +224,8 @@ public: protected: RendererUniformBatch(); - axis::backend::ProgramState* createBlurProgramState(); - axis::backend::ProgramState* createSepiaProgramState(); + ax::backend::ProgramState* createBlurProgramState(); + ax::backend::ProgramState* createSepiaProgramState(); }; class RendererUniformBatch2 : public MultiSceneTest @@ -238,8 +238,8 @@ public: protected: RendererUniformBatch2(); - axis::backend::ProgramState* createBlurProgramState(); - axis::backend::ProgramState* createSepiaProgramState(); + ax::backend::ProgramState* createBlurProgramState(); + ax::backend::ProgramState* createSepiaProgramState(); }; class NonBatchSprites : public MultiSceneTest @@ -274,7 +274,7 @@ protected: float _maDt = 1.0f / 60.0f; float _rmaDt = 1.0f / 60.0f; const float DEST_DT_30FPS = 1.0f / 30.0f; - axis::Label* _totalSprites = nullptr; + ax::Label* _totalSprites = nullptr; Ticker _contSlow = Ticker(20); Ticker _contFast = Ticker(2); Ticker _around30fps = Ticker(60 * 3); diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.h b/tests/cpp-tests/Classes/NodeTest/NodeTest.h index 37055e2f6b..da0062cc6b 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.h +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.h @@ -41,7 +41,7 @@ protected: TestCocosNodeDemo(); virtual ~TestCocosNodeDemo(); - axis::Director::Projection _preProjection; + ax::Director::Projection _preProjection; }; class NodeTest2 : public TestCocosNodeDemo @@ -208,8 +208,8 @@ public: protected: CameraTest1(); - axis::Sprite* _sprite1; - axis::Sprite* _sprite2; + ax::Sprite* _sprite1; + ax::Sprite* _sprite2; }; class CameraTest2 : public TestCocosNodeDemo @@ -224,15 +224,15 @@ public: protected: CameraTest2(); - axis::Sprite* _sprite1; - axis::Sprite* _sprite2; + ax::Sprite* _sprite1; + ax::Sprite* _sprite2; }; class ConvertToNode : public TestCocosNodeDemo { public: CREATE_FUNC(ConvertToNode); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; @@ -273,7 +273,7 @@ public: protected: NodeGlobalZValueTest(); - axis::Sprite* _sprite; + ax::Sprite* _sprite; }; class NodeNormalizedPositionTest1 : public TestCocosNodeDemo @@ -298,7 +298,7 @@ protected: NodeNormalizedPositionTest2(); void update(float dt) override; - axis::Size _copyContentSize; + ax::Size _copyContentSize; float _accum; }; @@ -314,7 +314,7 @@ protected: void update(float dt) override; float _accum; - axis::Sprite* sprite; + ax::Sprite* sprite; }; class NodeNameTest : public TestCocosNodeDemo diff --git a/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.h b/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.h index dbe716bfe6..eb9bd8f1d5 100644 --- a/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.h +++ b/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.h @@ -37,10 +37,10 @@ public: OpenURLTest(); ~OpenURLTest(); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); private: - axis::Label* _label; + ax::Label* _label; }; #endif // _OPEN_URL_TEST_H_ diff --git a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.h b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.h index 146e3d5b66..49a94ea072 100644 --- a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.h +++ b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.h @@ -32,15 +32,15 @@ DEFINE_TEST_SUITE(ParallaxTests); class ParallaxDemo : public TestCase { protected: - axis::TextureAtlas* _atlas; + ax::TextureAtlas* _atlas; }; class Parallax1 : public ParallaxDemo { protected: - axis::Node* _root; - axis::Node* _target; - axis::MotionStreak* _streak; + ax::Node* _root; + ax::Node* _target; + ax::MotionStreak* _streak; public: CREATE_FUNC(Parallax1); @@ -51,15 +51,15 @@ public: class Parallax2 : public ParallaxDemo { protected: - axis::Node* _root; - axis::Node* _target; - axis::MotionStreak* _streak; + ax::Node* _root; + ax::Node* _target; + ax::MotionStreak* _streak; public: CREATE_FUNC(Parallax2); Parallax2(); - void onTouchesMoved(const std::vector& touches, axis::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); virtual std::string title() const override; }; @@ -67,16 +67,16 @@ public: class Issue2572 : public ParallaxDemo { protected: - axis::ParallaxNode* _paraNode; + ax::ParallaxNode* _paraNode; float _moveTimer; float _addTimer; - axis::Vector _childList; + ax::Vector _childList; ssize_t _preListSize; int _printCount; float _addChildStep; float _wholeMoveTime; - axis::Vec2 _wholeMoveSize; + ax::Vec2 _wholeMoveSize; virtual void update(float dt) override; diff --git a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp index a08e8deccc..be9aa6353a 100644 --- a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp +++ b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp @@ -90,9 +90,9 @@ bool Particle3DTestDemo::init() return true; } -void Particle3DTestDemo::onTouchesBegan(const std::vector& touches, axis::Event* event) {} +void Particle3DTestDemo::onTouchesBegan(const std::vector& touches, ax::Event* event) {} -void Particle3DTestDemo::onTouchesMoved(const std::vector& touches, axis::Event* event) +void Particle3DTestDemo::onTouchesMoved(const std::vector& touches, ax::Event* event) { if (touches.size()) { @@ -105,7 +105,7 @@ void Particle3DTestDemo::onTouchesMoved(const std::vector& touches, axis } } -void Particle3DTestDemo::onTouchesEnded(const std::vector& touches, axis::Event* event) {} +void Particle3DTestDemo::onTouchesEnded(const std::vector& touches, ax::Event* event) {} Particle3DTestDemo::Particle3DTestDemo(void) : _angle(0.0f) {} diff --git a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.h b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.h index 7dcdea08c3..5c130d6bb9 100644 --- a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.h +++ b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.h @@ -44,14 +44,14 @@ public: virtual std::string title() const override; virtual void update(float delta) override; - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); protected: std::string _title; - axis::Camera* _camera; - axis::Label* _particleLab; + ax::Camera* _camera; + ax::Label* _particleLab; float _angle; }; diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h index a6a9803ce2..49cede133a 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h @@ -32,9 +32,9 @@ DEFINE_TEST_SUITE(ParticleTests); class ParticleDemo : public TestCase { protected: - axis::ParticleSystemQuad* _emitter; - axis::Sprite* _background; - axis::LayerColor* _color; + ax::ParticleSystemQuad* _emitter; + ax::Sprite* _background; + ax::LayerColor* _color; public: ~ParticleDemo(); @@ -44,11 +44,11 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void toggleCallback(axis::Ref* sender); + void toggleCallback(ax::Ref* sender); - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); virtual void update(float dt) override; void setEmitterPosition(); @@ -484,8 +484,8 @@ public: virtual std::string subtitle() const override; private: - axis::Node* _parent1; - axis::Node* _parent2; + ax::Node* _parent1; + ax::Node* _parent2; }; class ParticleBatchMultipleEmitters : public ParticleDemo @@ -542,7 +542,7 @@ public: virtual std::string subtitle() const override; private: - axis::ParticleBatchNode* _batchNode; + ax::ParticleBatchNode* _batchNode; }; class ReorderParticleSystems : public ParticleDemo @@ -556,7 +556,7 @@ public: virtual std::string subtitle() const override; private: - axis::ParticleBatchNode* _batchNode; + ax::ParticleBatchNode* _batchNode; }; class PremultipliedAlphaTest : public ParticleDemo diff --git a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp index aace738df5..1433874151 100644 --- a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp +++ b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp @@ -52,7 +52,7 @@ enum #define ARRAY_SIZE_Y 3 #define ARRAY_SIZE_Z 4 -static axis::Scene* physicsScene = nullptr; +static ax::Scene* physicsScene = nullptr; Physics3DTests::Physics3DTests() { @@ -143,13 +143,13 @@ bool Physics3DTestDemo::init() return false; } -void Physics3DTestDemo::onTouchesBegan(const std::vector& touches, axis::Event* event) +void Physics3DTestDemo::onTouchesBegan(const std::vector& touches, ax::Event* event) { _needShootBox = true; event->stopPropagation(); } -void Physics3DTestDemo::onTouchesMoved(const std::vector& touches, axis::Event* event) +void Physics3DTestDemo::onTouchesMoved(const std::vector& touches, ax::Event* event) { if (touches.size() && _camera) { @@ -168,7 +168,7 @@ void Physics3DTestDemo::onTouchesMoved(const std::vector& touches, axis: } } -void Physics3DTestDemo::onTouchesEnded(const std::vector& touches, axis::Event* event) +void Physics3DTestDemo::onTouchesEnded(const std::vector& touches, ax::Event* event) { if (!_needShootBox) return; @@ -191,7 +191,7 @@ void Physics3DTestDemo::update(float /*delta*/) {} Physics3DTestDemo::~Physics3DTestDemo() {} -void Physics3DTestDemo::shootBox(const axis::Vec3& des) +void Physics3DTestDemo::shootBox(const ax::Vec3& des) { Physics3DRigidBodyDes rbDes; Vec3 linearVel = des - _camera->getPosition3D(); @@ -534,7 +534,7 @@ bool Physics3DConstraintDemo::init() return true; } -void Physics3DConstraintDemo::onTouchesBegan(const std::vector& touches, axis::Event* event) +void Physics3DConstraintDemo::onTouchesBegan(const std::vector& touches, ax::Event* event) { // ray trace if (_camera) @@ -566,7 +566,7 @@ void Physics3DConstraintDemo::onTouchesBegan(const std::vector& to Physics3DTestDemo::onTouchesBegan(touches, event); _needShootBox = false; } -void Physics3DConstraintDemo::onTouchesMoved(const std::vector& touches, axis::Event* event) +void Physics3DConstraintDemo::onTouchesMoved(const std::vector& touches, ax::Event* event) { if (_constraint) { @@ -586,7 +586,7 @@ void Physics3DConstraintDemo::onTouchesMoved(const std::vector& to } Physics3DTestDemo::onTouchesMoved(touches, event); } -void Physics3DConstraintDemo::onTouchesEnded(const std::vector& touches, axis::Event* event) +void Physics3DConstraintDemo::onTouchesEnded(const std::vector& touches, ax::Event* event) { if (_constraint) { diff --git a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h index e8861860a1..d78c283455 100644 --- a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h +++ b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h @@ -60,16 +60,16 @@ public: virtual std::string subtitle() const override; virtual void update(float delta) override; - virtual void onTouchesBegan(const std::vector& touches, axis::Event* event); - virtual void onTouchesMoved(const std::vector& touches, axis::Event* event); - virtual void onTouchesEnded(const std::vector& touches, axis::Event* event); + virtual void onTouchesBegan(const std::vector& touches, ax::Event* event); + virtual void onTouchesMoved(const std::vector& touches, ax::Event* event); + virtual void onTouchesEnded(const std::vector& touches, ax::Event* event); protected: - void shootBox(const axis::Vec3& des); + void shootBox(const ax::Vec3& des); protected: std::string _title; - axis::Camera* _camera = nullptr; + ax::Camera* _camera = nullptr; float _angle = 0.f; bool _needShootBox = false; }; @@ -97,12 +97,12 @@ public: virtual bool init() override; - virtual void onTouchesBegan(const std::vector& touches, axis::Event* event) override; - virtual void onTouchesMoved(const std::vector& touches, axis::Event* event) override; - virtual void onTouchesEnded(const std::vector& touches, axis::Event* event) override; + virtual void onTouchesBegan(const std::vector& touches, ax::Event* event) override; + virtual void onTouchesMoved(const std::vector& touches, ax::Event* event) override; + virtual void onTouchesEnded(const std::vector& touches, ax::Event* event) override; protected: - axis::Physics3DConstraint* _constraint; // for picking + ax::Physics3DConstraint* _constraint; // for picking float _pickingDistance; // picking distance }; diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h index 8b9d555975..6bf433583f 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h @@ -42,31 +42,31 @@ public: virtual void onEnter() override; virtual std::string title() const override; - void toggleDebugCallback(axis::Ref* sender); + void toggleDebugCallback(ax::Ref* sender); - axis::Sprite* addGrossiniAtPosition(axis::Vec2 p, float scale = 1.0); - axis::Sprite* makeBall(axis::Vec2 point, + ax::Sprite* addGrossiniAtPosition(ax::Vec2 p, float scale = 1.0); + ax::Sprite* makeBall(ax::Vec2 point, float radius, - axis::PhysicsMaterial material = axis::PHYSICSBODY_MATERIAL_DEFAULT); - axis::Sprite* makeBox(axis::Vec2 point, - axis::Size size, + ax::PhysicsMaterial material = ax::PHYSICSBODY_MATERIAL_DEFAULT); + ax::Sprite* makeBox(ax::Vec2 point, + ax::Size size, int color = 0, - axis::PhysicsMaterial material = axis::PHYSICSBODY_MATERIAL_DEFAULT); - axis::Sprite* makeTriangle(axis::Vec2 point, - axis::Size size, + ax::PhysicsMaterial material = ax::PHYSICSBODY_MATERIAL_DEFAULT); + ax::Sprite* makeTriangle(ax::Vec2 point, + ax::Size size, int color = 0, - axis::PhysicsMaterial material = axis::PHYSICSBODY_MATERIAL_DEFAULT); + ax::PhysicsMaterial material = ax::PHYSICSBODY_MATERIAL_DEFAULT); - bool onTouchBegan(axis::Touch* touch, axis::Event* event); - void onTouchMoved(axis::Touch* touch, axis::Event* event); - void onTouchEnded(axis::Touch* touch, axis::Event* event); + bool onTouchBegan(ax::Touch* touch, ax::Event* event); + void onTouchMoved(ax::Touch* touch, ax::Event* event); + void onTouchEnded(ax::Touch* touch, ax::Event* event); void toggleDebug(); protected: - axis::Texture2D* _spriteTexture; - axis::SpriteBatchNode* _ball; - std::unordered_map _mouses; + ax::Texture2D* _spriteTexture; + ax::SpriteBatchNode* _ball; + std::unordered_map _mouses; bool _debugDraw; }; @@ -88,8 +88,8 @@ public: void onEnter() override; virtual std::string subtitle() const override; - void onTouchesEnded(const std::vector& touches, axis::Event* event); - void onAcceleration(axis::Acceleration* acc, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); + void onAcceleration(ax::Acceleration* acc, ax::Event* event); }; class PhysicsDemoPyramidStack : public PhysicsDemo @@ -112,15 +112,15 @@ public: void onEnter() override; virtual std::string title() const override; void update(float delta) override; - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); - void changeModeCallback(axis::Ref* sender); + void changeModeCallback(ax::Ref* sender); - bool anyRay(axis::PhysicsWorld& world, const axis::PhysicsRayCastInfo& info, void* data); + bool anyRay(ax::PhysicsWorld& world, const ax::PhysicsRayCastInfo& info, void* data); private: float _angle; - axis::DrawNode* _node; + ax::DrawNode* _node; int _mode; }; @@ -152,9 +152,9 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - bool onTouchBegan(axis::Touch* touch, axis::Event* event); - void onTouchMoved(axis::Touch* touch, axis::Event* event); - void onTouchEnded(axis::Touch* touch, axis::Event* event); + bool onTouchBegan(ax::Touch* touch, ax::Event* event); + void onTouchMoved(ax::Touch* touch, ax::Event* event); + void onTouchEnded(ax::Touch* touch, ax::Event* event); private: float _distance; @@ -169,7 +169,7 @@ public: void onEnter() override; virtual std::string title() const override; - bool onContactBegin(axis::PhysicsContact& contact); + bool onContactBegin(ax::PhysicsContact& contact); }; class PhysicsDemoSlice : public PhysicsDemo @@ -181,10 +181,10 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - bool slice(axis::PhysicsWorld& world, const axis::PhysicsRayCastInfo& info, void* data); - void clipPoly(axis::PhysicsShapePolygon* shape, axis::Vec2 normal, float distance); + bool slice(ax::PhysicsWorld& world, const ax::PhysicsRayCastInfo& info, void* data); + void clipPoly(ax::PhysicsShapePolygon* shape, ax::Vec2 normal, float distance); - void onTouchEnded(axis::Touch* touch, axis::Event* event); + void onTouchEnded(ax::Touch* touch, ax::Event* event); private: int _sliceTag; @@ -207,12 +207,12 @@ public: void onEnter() override; void resetTest(); - bool onContactBegin(axis::PhysicsContact& contact); + bool onContactBegin(ax::PhysicsContact& contact); virtual std::string title() const override; virtual std::string subtitle() const override; - void onDecrease(axis::Ref* sender); - void onIncrease(axis::Ref* sender); + void onDecrease(ax::Ref* sender); + void onIncrease(ax::Ref* sender); private: int _yellowBoxNum; @@ -251,13 +251,13 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void changeBodyCallback(axis::Ref* sender); + void changeBodyCallback(ax::Ref* sender); private: - axis::Sprite* _nodeA; - axis::Sprite* _nodeB; - axis::PhysicsBody* _body; - axis::MenuItemFont* _button; + ax::Sprite* _nodeA; + ax::Sprite* _nodeB; + ax::PhysicsBody* _body; + ax::MenuItemFont* _button; bool _bodyInA; }; @@ -281,11 +281,11 @@ public: void onEnter() override; virtual std::string title() const override; - bool onTouchBegan(axis::Touch* touch, axis::Event* event); + bool onTouchBegan(ax::Touch* touch, ax::Event* event); private: - axis::Sprite* _parentSprite; - axis::Layer* _rootLayer; + ax::Sprite* _parentSprite; + ax::Layer* _rootLayer; }; class PhysicsIssue9959 : public PhysicsDemo diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index 03b2a1a9e2..db8eaa2e90 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -85,17 +85,17 @@ std::string RenderTextureSave::subtitle() const return "Press 'Save Image' to create an snapshot of the render texture"; } -void RenderTextureSave::clearImage(axis::Ref* sender) +void RenderTextureSave::clearImage(ax::Ref* sender) { _target->clear(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1()); } -void RenderTextureSave::clearImageTransparent(axis::Ref* sender) +void RenderTextureSave::clearImageTransparent(ax::Ref* sender) { _target->clear(0, 0, 0, 0); } -void RenderTextureSave::saveImageWithPremultipliedAlpha(axis::Ref* sender) +void RenderTextureSave::saveImageWithPremultipliedAlpha(ax::Ref* sender) { static int counter = 0; @@ -120,7 +120,7 @@ void RenderTextureSave::saveImageWithPremultipliedAlpha(axis::Ref* sender) counter++; } -void RenderTextureSave::saveImageWithNonPremultipliedAlpha(axis::Ref* sender) +void RenderTextureSave::saveImageWithNonPremultipliedAlpha(ax::Ref* sender) { static int counter = 0; @@ -146,7 +146,7 @@ void RenderTextureSave::saveImageWithNonPremultipliedAlpha(axis::Ref* sender) counter++; } -void RenderTextureSave::addImage(axis::Ref* sender) +void RenderTextureSave::addImage(ax::Ref* sender) { auto s = Director::getInstance()->getWinSize(); diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h index 5bd99f563c..3af3e38360 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h @@ -42,16 +42,16 @@ public: ~RenderTextureSave(); virtual std::string title() const override; virtual std::string subtitle() const override; - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void clearImage(axis::Ref* pSender); - void clearImageTransparent(axis::Ref* sender); - void saveImageWithPremultipliedAlpha(axis::Ref* pSender); - void saveImageWithNonPremultipliedAlpha(axis::Ref* pSender); - void addImage(axis::Ref* sender); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void clearImage(ax::Ref* pSender); + void clearImageTransparent(ax::Ref* sender); + void saveImageWithPremultipliedAlpha(ax::Ref* pSender); + void saveImageWithNonPremultipliedAlpha(ax::Ref* pSender); + void addImage(ax::Ref* sender); private: - axis::RenderTexture* _target; - axis::Vector _brushs; + ax::RenderTexture* _target; + ax::Vector _brushs; }; class RenderTextureIssue937 : public RenderTextureTest @@ -69,26 +69,26 @@ public: CREATE_FUNC(RenderTextureZbuffer); RenderTextureZbuffer(); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; void renderScreenShot(); private: - axis::SpriteBatchNode* mgr; + ax::SpriteBatchNode* mgr; - axis::Sprite* sp1; - axis::Sprite* sp2; - axis::Sprite* sp3; - axis::Sprite* sp4; - axis::Sprite* sp5; - axis::Sprite* sp6; - axis::Sprite* sp7; - axis::Sprite* sp8; - axis::Sprite* sp9; + ax::Sprite* sp1; + ax::Sprite* sp2; + ax::Sprite* sp3; + ax::Sprite* sp4; + ax::Sprite* sp5; + ax::Sprite* sp6; + ax::Sprite* sp7; + ax::Sprite* sp8; + ax::Sprite* sp9; }; class RenderTextureTestDepthStencil : public RenderTextureTest @@ -99,28 +99,28 @@ public: virtual ~RenderTextureTestDepthStencil(); virtual std::string title() const override; virtual std::string subtitle() const override; - virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override; + virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override; private: -// axis::CallbackCommand _renderCmds[4]; +// ax::CallbackCommand _renderCmds[4]; void onBeforeClear(); void onBeforeStencil(); void onBeforeDraw(); void onAfterDraw(); private: - axis::Renderer* _renderer; - axis::backend::DepthStencilDescriptor _dsDesc; - axis::RenderTexture* _rtx; - axis::Sprite* _spriteDS; - axis::Sprite* _spriteDraw; + ax::Renderer* _renderer; + ax::backend::DepthStencilDescriptor _dsDesc; + ax::RenderTexture* _rtx; + ax::Sprite* _spriteDS; + ax::Sprite* _spriteDraw; }; class RenderTextureTargetNode : public RenderTextureTest { private: - axis::Sprite *sprite1, *sprite2; - axis::RenderTexture* renderTexture; + ax::Sprite *sprite1, *sprite2; + ax::RenderTexture* renderTexture; public: CREATE_FUNC(RenderTextureTargetNode); @@ -130,7 +130,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void touched(axis::Ref* sender); + void touched(ax::Ref* sender); }; class RenderTexturePartTest : public RenderTextureTest @@ -143,34 +143,34 @@ public: virtual std::string subtitle() const override; private: - axis::RenderTexture* _rend; - axis::Sprite* _spriteDraw; + ax::RenderTexture* _rend; + ax::Sprite* _spriteDraw; }; class SpriteRenderTextureBug : public RenderTextureTest { public: - class SimpleSprite : public axis::Sprite + class SimpleSprite : public ax::Sprite { public: - static SimpleSprite* create(const char* filename, const axis::Rect& rect); + static SimpleSprite* create(const char* filename, const ax::Rect& rect); SimpleSprite(); ~SimpleSprite(); - virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags); + virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags); public: - axis::RenderTexture* _rt; + ax::RenderTexture* _rt; }; public: CREATE_FUNC(SpriteRenderTextureBug); SpriteRenderTextureBug(); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; - SimpleSprite* addNewSpriteWithCoords(const axis::Vec2& p); + SimpleSprite* addNewSpriteWithCoords(const ax::Vec2& p); }; class Issue16113Test : public RenderTextureTest diff --git a/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.h b/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.h index a1d1c7ea36..1df1548588 100644 --- a/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.h +++ b/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.h @@ -37,14 +37,14 @@ public: virtual bool init() override; }; -class SpriteLayer : public axis::Layer +class SpriteLayer : public ax::Layer { public: virtual void onEnter() override; CREATE_FUNC(SpriteLayer) }; -class TestLayer : public axis::Layer +class TestLayer : public ax::Layer { public: virtual void onEnter() override; @@ -52,7 +52,7 @@ public: CREATE_FUNC(TestLayer) }; -class RotateWorldMainLayer : public axis::Layer +class RotateWorldMainLayer : public ax::Layer { public: virtual void onEnter() override; diff --git a/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp b/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp index 19c7f88257..bf969f0e99 100644 --- a/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp +++ b/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp @@ -39,11 +39,11 @@ class SkeletonAnimationCullingFix : public SkeletonAnimation public: SkeletonAnimationCullingFix() : SkeletonAnimation() {} - virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t transformFlags) override + virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t transformFlags) override { glDisable(GL_CULL_FACE); SkeletonAnimation::draw(renderer, transform, transformFlags); - RenderState::StateBlock::invalidate(axis::RenderState::StateBlock::RS_ALL_ONES); + RenderState::StateBlock::invalidate(ax::RenderState::StateBlock::RS_ALL_ONES); } static SkeletonAnimationCullingFix* createWithFile(std::string_view skeletonDataFile, @@ -100,7 +100,7 @@ private: // init in createWorld3D() TextureCube* _textureCube; Skybox* _skyBox; - axis::Terrain* _terrain; + ax::Terrain* _terrain; Player* _player; Node* _monsters[2]; @@ -130,7 +130,7 @@ private: std::vector _skins[(int)SkinType::MAX_TYPE]; // all skins int _curSkin[(int)SkinType::MAX_TYPE]; // current skin index - axis::MeshRenderer* _reskinGirl; + ax::MeshRenderer* _reskinGirl; // for capture screen static const int SNAPSHOT_TAG = 119; diff --git a/tests/cpp-tests/Classes/SceneTest/SceneTest.h b/tests/cpp-tests/Classes/SceneTest/SceneTest.h index d995455f44..e1544fe8ba 100644 --- a/tests/cpp-tests/Classes/SceneTest/SceneTest.h +++ b/tests/cpp-tests/Classes/SceneTest/SceneTest.h @@ -30,7 +30,7 @@ DEFINE_TEST_SUITE(SceneTests); -class SceneTestLayer1 : public axis::Layer +class SceneTestLayer1 : public ax::Layer { public: CREATE_FUNC(SceneTestLayer1); @@ -42,12 +42,12 @@ public: virtual void onEnterTransitionDidFinish() override; void testDealloc(float dt); - void onPushScene(axis::Ref* sender); - void onPushSceneTran(axis::Ref* sender); - void onQuit(axis::Ref* sender); + void onPushScene(ax::Ref* sender); + void onPushSceneTran(ax::Ref* sender); + void onQuit(ax::Ref* sender); }; -class SceneTestLayer2 : public axis::Layer +class SceneTestLayer2 : public ax::Layer { float _timeCounter; @@ -57,12 +57,12 @@ public: SceneTestLayer2(); void testDealloc(float dt); - void onGoBack(axis::Ref* sender); - void onReplaceScene(axis::Ref* sender); - void onReplaceSceneTran(axis::Ref* sender); + void onGoBack(ax::Ref* sender); + void onReplaceScene(ax::Ref* sender); + void onReplaceSceneTran(ax::Ref* sender); }; -class SceneTestLayer3 : public axis::LayerColor +class SceneTestLayer3 : public ax::LayerColor { public: CREATE_FUNC(SceneTestLayer3); @@ -71,10 +71,10 @@ public: virtual bool init() override; virtual void testDealloc(float dt); - void item0Clicked(axis::Ref* sender); - void item1Clicked(axis::Ref* sender); - void item2Clicked(axis::Ref* sender); - void item3Clicked(axis::Ref* sender); + void item0Clicked(ax::Ref* sender); + void item1Clicked(ax::Ref* sender); + void item2Clicked(ax::Ref* sender); + void item3Clicked(ax::Ref* sender); }; class SceneTestScene : public TestCase diff --git a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp index fbeed9fc93..93ac7c0f96 100644 --- a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp +++ b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp @@ -1004,7 +1004,7 @@ public: ~TestNode2() { - axis::log("Delete TestNode (should not crash)"); + ax::log("Delete TestNode (should not crash)"); this->unscheduleAllCallbacks(); } @@ -1383,7 +1383,7 @@ void SchedulerRemoveEntryWhileUpdate::onExit() SchedulerTestLayer::onExit(); } -SchedulerRemoveEntryWhileUpdate::TestClass::TestClass(int index, TestClass* nextObj, axis::Scheduler* scheduler) +SchedulerRemoveEntryWhileUpdate::TestClass::TestClass(int index, TestClass* nextObj, ax::Scheduler* scheduler) : _nextObj(nextObj), _index(index), _scheduler(scheduler) {} @@ -1446,7 +1446,7 @@ void SchedulerRemoveSelectorDuringCall::callback(float) { if (!_scheduled) { - axis::log("Error: unscheduled callback must not be called."); + ax::log("Error: unscheduled callback must not be called."); return; } diff --git a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.h b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.h index 6c7f33e758..29d16669c1 100644 --- a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.h +++ b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.h @@ -222,7 +222,7 @@ public: void stopUpdate(float dt); }; -class TestNode : public axis::Node +class TestNode : public ax::Node { public: CREATE_FUNC(TestNode); @@ -272,9 +272,9 @@ public: void onExit() override; virtual std::string title() const override; virtual std::string subtitle() const override; - axis::extension::ControlSlider* sliderCtl(); - void sliderAction(axis::Ref* sender, axis::extension::Control::EventType controlEvent); - axis::extension::ControlSlider* _sliderCtl; + ax::extension::ControlSlider* sliderCtl(); + void sliderAction(ax::Ref* sender, ax::extension::Control::EventType controlEvent); + ax::extension::ControlSlider* _sliderCtl; }; class TwoSchedulers : public SchedulerTestLayer @@ -286,15 +286,15 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; void onEnter() override; - axis::extension::ControlSlider* sliderCtl(); - void sliderAction(axis::Ref* sender, axis::extension::Control::EventType controlEvent); - axis::Scheduler* sched1; - axis::Scheduler* sched2; - axis::ActionManager* actionManager1; - axis::ActionManager* actionManager2; + ax::extension::ControlSlider* sliderCtl(); + void sliderAction(ax::Ref* sender, ax::extension::Control::EventType controlEvent); + ax::Scheduler* sched1; + ax::Scheduler* sched2; + ax::ActionManager* actionManager1; + ax::ActionManager* actionManager2; - axis::extension::ControlSlider* sliderCtl1; - axis::extension::ControlSlider* sliderCtl2; + ax::extension::ControlSlider* sliderCtl1; + ax::extension::ControlSlider* sliderCtl2; }; class SchedulerIssue2268 : public SchedulerTestLayer @@ -309,7 +309,7 @@ public: void update(float dt) override; private: - axis::Node* testNode; + ax::Node* testNode; }; class SchedulerIssueWithReschedule : public SchedulerTestLayer @@ -349,7 +349,7 @@ public: virtual void update(float dt) override; - bool onTouchBegan(axis::Touch* touch, axis::Event* event); + bool onTouchBegan(ax::Touch* touch, ax::Event* event); }; class SchedulerIssue10232 : public SchedulerTestLayer @@ -376,7 +376,7 @@ public: void update(float dt) override; private: - axis::Sprite* _sprite; + ax::Sprite* _sprite; }; class SchedulerIssue17149 : public SchedulerTestLayer @@ -432,13 +432,13 @@ private: class TestClass { public: - TestClass(int index, TestClass* nextObj, axis::Scheduler* scheduler); + TestClass(int index, TestClass* nextObj, ax::Scheduler* scheduler); void update(float dt); private: TestClass* _nextObj = nullptr; int _index = 0; - axis::Scheduler* _scheduler = nullptr; + ax::Scheduler* _scheduler = nullptr; bool _cleanedUp = false; }; std::vector _testvector; diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index 2f090afc17..14ca8598cd 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -412,7 +412,7 @@ SpriteBlur* SpriteBlur::create(const char* pszFileName) { SpriteBlur* pRet = new SpriteBlur(); bool result = pRet->initWithFile(""); - axis::log("Test call Sprite::initWithFile with bad file name result is : %s", result ? "true" : "false"); + ax::log("Test call Sprite::initWithFile with bad file name result is : %s", result ? "true" : "false"); if (pRet->initWithFile(pszFileName)) { diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h index 0b1b2a321b..27c5b869e0 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h @@ -112,13 +112,13 @@ public: virtual std::string subtitle() const override; virtual bool init() override; void createSliderCtls(); - void onRadiusChanged(axis::Ref* sender, axis::extension::Control::EventType controlEvent); - void onSampleNumChanged(axis::Ref* sender, axis::extension::Control::EventType controlEvent); + void onRadiusChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent); + void onSampleNumChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent); protected: SpriteBlur* _blurSprite; - axis::extension::ControlSlider* _sliderRadiusCtl; - axis::extension::ControlSlider* _sliderNumCtrl; + ax::extension::ControlSlider* _sliderRadiusCtl; + ax::extension::ControlSlider* _sliderNumCtrl; }; class ShaderRetroEffect : public ShaderTestDemo @@ -132,19 +132,19 @@ public: virtual void update(float dt) override; protected: - axis::Label* _label; + ax::Label* _label; float _accum; }; -class ShaderNode : public axis::Node +class ShaderNode : public ax::Node { public: CREATE_FUNC(ShaderNode); static ShaderNode* shaderNodeWithVertex(std::string_view vert, std::string_view frag); virtual void update(float dt) override; - virtual void setPosition(const axis::Vec2& newPosition) override; - virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override; + virtual void setPosition(const ax::Vec2& newPosition) override; + virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override; protected: ShaderNode(); @@ -153,7 +153,7 @@ protected: bool initWithVertex(std::string_view vert, std::string_view frag); void loadShaderVertex(std::string_view vert, std::string_view frag); - virtual bool setProgramState(axis::backend::ProgramState* programState, bool needsRetain = true) override + virtual bool setProgramState(ax::backend::ProgramState* programState, bool needsRetain = true) override { if (Node::setProgramState(programState, needsRetain)) { @@ -166,20 +166,20 @@ protected: void updateUniforms(); - axis::Vec2 _center; - axis::Vec2 _resolution; + ax::Vec2 _center; + ax::Vec2 _resolution; float _time; std::string _vertFileName; std::string _fragFileName; - axis::CustomCommand _customCommand; + ax::CustomCommand _customCommand; - axis::backend::UniformLocation _locResolution; - axis::backend::UniformLocation _locCenter; - axis::backend::UniformLocation _locMVP; - axis::backend::UniformLocation _locTime; - axis::backend::UniformLocation _locSinTime; - axis::backend::UniformLocation _locCosTime; - axis::backend::UniformLocation _locScreenSize; + ax::backend::UniformLocation _locResolution; + ax::backend::UniformLocation _locCenter; + ax::backend::UniformLocation _locMVP; + ax::backend::UniformLocation _locTime; + ax::backend::UniformLocation _locSinTime; + ax::backend::UniformLocation _locCosTime; + ax::backend::UniformLocation _locScreenSize; }; class ShaderLensFlare : public ShaderTestDemo @@ -211,10 +211,10 @@ class ShaderMultiTexture : public ShaderTestDemo public: CREATE_FUNC(ShaderMultiTexture); ShaderMultiTexture(); - axis::ui::Slider* createSliderCtl(); - void changeTexture(axis::Ref*); + ax::ui::Slider* createSliderCtl(); + void changeTexture(ax::Ref*); int _changedTextureId; - axis::Sprite* _sprite; + ax::Sprite* _sprite; virtual std::string title() const override; virtual std::string subtitle() const override; diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h index b17d4d3ce1..9e14628635 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h @@ -41,20 +41,20 @@ public: // class EffectSprite; -class Effect : public axis::Ref +class Effect : public ax::Ref { public: - axis::backend::ProgramState* getProgramState() const { return _programState; } + ax::backend::ProgramState* getProgramState() const { return _programState; } virtual void setTarget(EffectSprite* sprite) {} protected: bool initProgramState(std::string_view fragmentFilename); Effect(); virtual ~Effect(); - axis::backend::ProgramState* _programState = nullptr; + ax::backend::ProgramState* _programState = nullptr; #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) std::string _fragSource; - axis::EventListenerCustom* _backgroundListener; + ax::EventListenerCustom* _backgroundListener; #endif }; @@ -68,7 +68,7 @@ public: protected: ssize_t _vectorIndex; - axis::Vector _effects; + ax::Vector _effects; EffectSprite* _sprite; }; @@ -81,14 +81,14 @@ public: virtual std::string subtitle() const { return "Sprite Lamp effects"; } // callback public: - virtual void onTouchesBegan(const std::vector& touches, axis::Event* unused_event); - virtual void onTouchesMoved(const std::vector& touches, axis::Event* unused_event); - virtual void onTouchesEnded(const std::vector& touches, axis::Event* unused_event); + virtual void onTouchesBegan(const std::vector& touches, ax::Event* unused_event); + virtual void onTouchesMoved(const std::vector& touches, ax::Event* unused_event); + virtual void onTouchesEnded(const std::vector& touches, ax::Event* unused_event); protected: EffectSprite* _sprite; Effect* _effect; - axis::Sprite* _lightSprite; + ax::Sprite* _lightSprite; }; #endif diff --git a/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp b/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp index ac655ad4e9..178a616264 100644 --- a/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp +++ b/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp @@ -103,7 +103,7 @@ bool SpineTestLayer::init() return false; EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = [this](Touch* touch, axis::Event* event) -> bool { + listener->onTouchBegan = [this](Touch* touch, ax::Event* event) -> bool { if (!skeletonNode) return true; _touchIndex = (_touchIndex + 1) % 3; @@ -262,7 +262,7 @@ bool IKExample::init() // the current mouse location. The location is converted // to the skeleton's coordinate system. EventListenerMouse* mouseListener = EventListenerMouse::create(); - mouseListener->onMouseMove = [this](axis::Event* event) -> void { + mouseListener->onMouseMove = [this](ax::Event* event) -> void { // convert the mosue location to the skeleton's coordinate space // and store it. EventMouse* mouseEvent = dynamic_cast(event); diff --git a/tests/cpp-tests/Classes/SpineTest/SpineTest.h b/tests/cpp-tests/Classes/SpineTest/SpineTest.h index bd2436515e..3ae025bbac 100644 --- a/tests/cpp-tests/Classes/SpineTest/SpineTest.h +++ b/tests/cpp-tests/Classes/SpineTest/SpineTest.h @@ -103,7 +103,7 @@ public: virtual bool init(); private: - axis::Vec2 position; + ax::Vec2 position; }; class MixAndMatchExample : public SpineTestLayer @@ -144,7 +144,7 @@ public: private: spine::SkeletonRenderer* frontNode; - axis::DrawNode* betweenNode; + ax::DrawNode* betweenNode; }; class SpineboyExample : public SpineTestLayer diff --git a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp index 0d4f6e7df8..9d90359a86 100644 --- a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp +++ b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp @@ -48,7 +48,7 @@ SpriteFrameCachePixelFormatTest::SpriteFrameCachePixelFormatTest() infoLabel = Label::create(); infoLabel->setAnchorPoint(Point(0.5f, 1.0f)); - infoLabel->setAlignment(axis::TextHAlignment::CENTER); + infoLabel->setAlignment(ax::TextHAlignment::CENTER); infoLabel->setPosition(screenSize.width * 0.5f, screenSize.height * 0.7f); addChild(infoLabel); @@ -77,7 +77,7 @@ SpriteFrameCachePixelFormatTest::SpriteFrameCachePixelFormatTest() } void SpriteFrameCachePixelFormatTest::loadSpriteFrames(std::string_view file, - axis::backend::PixelFormat expectedFormat) + ax::backend::PixelFormat expectedFormat) { SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file); SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("sprite_frames_test/grossini.png"); @@ -108,7 +108,7 @@ SpriteFrameCacheLoadMultipleTimes::SpriteFrameCacheLoadMultipleTimes() } void SpriteFrameCacheLoadMultipleTimes::loadSpriteFrames(std::string_view file, - axis::backend::PixelFormat expectedFormat) + ax::backend::PixelFormat expectedFormat) { SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file); SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("sprite_frames_test/grossini.png"); @@ -126,7 +126,7 @@ SpriteFrameCacheFullCheck::SpriteFrameCacheFullCheck() loadSpriteFrames("Images/test_polygon.plist", backend::PixelFormat::RGBA8); } -void SpriteFrameCacheFullCheck::loadSpriteFrames(std::string_view file, axis::backend::PixelFormat expectedFormat) +void SpriteFrameCacheFullCheck::loadSpriteFrames(std::string_view file, ax::backend::PixelFormat expectedFormat) { auto cache = SpriteFrameCache::getInstance(); @@ -477,7 +477,7 @@ SpriteFrameCacheJsonAtlasTest::SpriteFrameCacheJsonAtlasTest() infoLabel = Label::create(); infoLabel->setAnchorPoint(Point(0.5f, 1.0f)); - infoLabel->setAlignment(axis::TextHAlignment::CENTER); + infoLabel->setAlignment(ax::TextHAlignment::CENTER); infoLabel->setPosition(screenSize.width * 0.5f, screenSize.height * 0.7f); addChild(infoLabel); @@ -491,7 +491,7 @@ SpriteFrameCacheJsonAtlasTest::~SpriteFrameCacheJsonAtlasTest() } void SpriteFrameCacheJsonAtlasTest::loadSpriteFrames(std::string_view file, - axis::backend::PixelFormat expectedFormat) + ax::backend::PixelFormat expectedFormat) { SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file, GenericJsonArraySpriteSheetLoader::FORMAT); SpriteFrame* spriteFrame = diff --git a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.h b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.h index 7d72d865ef..1d59e72135 100644 --- a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.h +++ b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.h @@ -41,10 +41,10 @@ public: SpriteFrameCachePixelFormatTest(); private: - void loadSpriteFrames(std::string_view file, axis::backend::PixelFormat expectedFormat); + void loadSpriteFrames(std::string_view file, ax::backend::PixelFormat expectedFormat); private: - axis::Label* infoLabel; + ax::Label* infoLabel; }; class SpriteFrameCacheLoadMultipleTimes : public TestCase @@ -58,7 +58,7 @@ public: SpriteFrameCacheLoadMultipleTimes(); private: - void loadSpriteFrames(std::string_view file, axis::backend::PixelFormat expectedFormat); + void loadSpriteFrames(std::string_view file, ax::backend::PixelFormat expectedFormat); }; class SpriteFrameCacheFullCheck : public TestCase @@ -72,7 +72,7 @@ public: SpriteFrameCacheFullCheck(); private: - void loadSpriteFrames(std::string_view file, axis::backend::PixelFormat expectedFormat); + void loadSpriteFrames(std::string_view file, ax::backend::PixelFormat expectedFormat); }; class SpriteFrameCacheJsonAtlasTest : public TestCase @@ -87,7 +87,7 @@ public: ~SpriteFrameCacheJsonAtlasTest() override; private: - void loadSpriteFrames(std::string_view file, axis::backend::PixelFormat expectedFormat); + void loadSpriteFrames(std::string_view file, ax::backend::PixelFormat expectedFormat); - axis::Label* infoLabel; + ax::Label* infoLabel; }; diff --git a/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp b/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp index 5f928ef932..4524f3a620 100644 --- a/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp +++ b/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp @@ -301,7 +301,7 @@ bool SpritePolygonTestSlider::init() void SpritePolygonTestSlider::initSliders() { auto vsize = Director::getInstance()->getVisibleSize(); - axis::ui::Slider* slider = axis::ui::Slider::create(); + ax::ui::Slider* slider = ax::ui::Slider::create(); slider->loadBarTexture("cocosui/sliderTrack.png"); slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); slider->loadProgressBarTexture("cocosui/sliderProgress.png"); @@ -328,11 +328,11 @@ void SpritePolygonTestSlider::makeSprites(const std::string* list, const int cou } } -void SpritePolygonTestSlider::changeEpsilon(axis::Ref* pSender, axis::ui::Slider::EventType type) +void SpritePolygonTestSlider::changeEpsilon(ax::Ref* pSender, ax::ui::Slider::EventType type) { - if (type == axis::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) + if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { - axis::ui::Slider* slider = dynamic_cast(pSender); + ax::ui::Slider* slider = dynamic_cast(pSender); float epsilon = powf(slider->getPercent() / 100.0, 2) * 19.0f + 1.0f; for (auto&&child : _children) { @@ -350,7 +350,7 @@ void SpritePolygonTestSlider::changeEpsilon(axis::Ref* pSender, axis::ui::Slider } } -void SpritePolygonTestSlider::updateLabel(const axis::Sprite* sp, const PolygonInfo& pinfo) +void SpritePolygonTestSlider::updateLabel(const ax::Sprite* sp, const PolygonInfo& pinfo) { Label* label = (Label*)(sp->getChildByName(sp->getName())); auto filename = sp->getName(); diff --git a/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.h b/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.h index 57fec6f711..147320ea93 100644 --- a/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.h +++ b/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.h @@ -36,7 +36,7 @@ protected: std::string _subtitle; bool _isDebugDraw; bool _isNeedDebugMenu; - axis::Vector _drawNodes; + ax::Vector _drawNodes; virtual std::string title() const override { return _title; }; virtual std::string subtitle() const override { return _subtitle; }; virtual bool init() override; @@ -50,9 +50,9 @@ protected: class SpritePolygonTestDemo : public SpritePolygonTestCase { protected: - axis::Sprite* _polygonSprite; - axis::Sprite* _polygonSprite_fix; - axis::Sprite* _normalSprite; + ax::Sprite* _polygonSprite; + ax::Sprite* _polygonSprite_fix; + ax::Sprite* _normalSprite; virtual bool init() override; virtual void initSprites(){}; void initTouches(); @@ -77,15 +77,15 @@ public: class SpritePolygonTestSlider : public SpritePolygonTestCase { protected: - axis::Label* _epsilonLabel; + ax::Label* _epsilonLabel; int _tagIndex; - axis::Sprite* makeSprite(std::string_view filename, const axis::Vec2& pos); + ax::Sprite* makeSprite(std::string_view filename, const ax::Vec2& pos); virtual bool init() override; void initSliders(); virtual void initSprites(){}; void makeSprites(const std::string* list, const int count, const float y); - void changeEpsilon(Ref* pSender, axis::ui::Slider::EventType type); - void updateLabel(const axis::Sprite* sp, const axis::PolygonInfo& pinfo); + void changeEpsilon(Ref* pSender, ax::ui::Slider::EventType type); + void updateLabel(const ax::Sprite* sp, const ax::PolygonInfo& pinfo); }; class SpritePolygonTest3 : public SpritePolygonTestSlider @@ -114,11 +114,11 @@ protected: virtual bool init() override; void initTouch(); void loadDefaultSprites(); - void addSpritePolygon(const axis::Vec2& pos); + void addSpritePolygon(const ax::Vec2& pos); void update(float dt) override; private: - axis::PolygonInfo _polygonInfo; + ax::PolygonInfo _polygonInfo; int _tagIndex; }; @@ -134,7 +134,7 @@ protected: int _triCount; int _pixelCount; float _elapsedTime; - axis::Label* _perfLabel; + ax::Label* _perfLabel; int _continuousLowDt; float _continuousHighDtTime; float _waitingTime; @@ -167,8 +167,8 @@ public: SpritePolygonPerformanceTestDynamic(); protected: - axis::Sprite* makeSprite() override; - axis::PolygonInfo _pinfo; + ax::Sprite* makeSprite() override; + ax::PolygonInfo _pinfo; virtual void initIncrementStats() override; }; @@ -179,7 +179,7 @@ public: SpritePerformanceTestDynamic(); protected: - virtual axis::Sprite* makeSprite() override; + virtual ax::Sprite* makeSprite() override; virtual void initIncrementStats() override; }; @@ -255,7 +255,7 @@ protected: float _maDt = 1.0f / 60.0f; float _rmaDt = 1.0f / 60.0f; const float DEST_DT_30FPS = 1.0f / 30.0f; - axis::Label* _totalSprites = nullptr; + ax::Label* _totalSprites = nullptr; Ticker _contSlow = Ticker(20); Ticker _contFast = Ticker(2); Ticker _around30fps = Ticker(60 * 3); diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h index 335f32ede3..99cc50ceef 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h @@ -48,8 +48,8 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewSpriteWithCoords(axis::Vec2 p); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void addNewSpriteWithCoords(ax::Vec2 p); + void onTouchesEnded(const std::vector& touches, ax::Event* event); }; class SpriteBatchNode1 : public SpriteTestDemo @@ -57,8 +57,8 @@ class SpriteBatchNode1 : public SpriteTestDemo public: CREATE_FUNC(SpriteBatchNode1); SpriteBatchNode1(); - void addNewSpriteWithCoords(axis::Vec2 p); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void addNewSpriteWithCoords(ax::Vec2 p); + void onTouchesEnded(const std::vector& touches, ax::Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -151,13 +151,13 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; void reorderSprite(float dt); - axis::Sprite* makeSpriteZ(int aZ); + ax::Sprite* makeSpriteZ(int aZ); private: - axis::SpriteBatchNode* batchNode; - axis::Sprite* sprite1; - axis::Sprite* sprite2; - axis::Sprite* sprite3; + ax::SpriteBatchNode* batchNode; + ax::Sprite* sprite1; + ax::Sprite* sprite2; + ax::Sprite* sprite3; }; class SpriteBatchNodeReorderIssue767 : public SpriteTestDemo @@ -293,14 +293,14 @@ public: SpriteNewTexture(); virtual ~SpriteNewTexture(); void addNewSprite(); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; protected: bool _usingTexture1; - axis::Texture2D* _texture1; - axis::Texture2D* _texture2; + ax::Texture2D* _texture1; + ax::Texture2D* _texture2; }; class SpriteBatchNodeNewTexture : public SpriteTestDemo @@ -310,13 +310,13 @@ public: SpriteBatchNodeNewTexture(); virtual ~SpriteBatchNodeNewTexture(); void addNewSprite(); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; protected: - axis::Texture2D* _texture1; - axis::Texture2D* _texture2; + ax::Texture2D* _texture1; + ax::Texture2D* _texture2; }; class SpriteFrameTest : public SpriteTestDemo @@ -332,8 +332,8 @@ public: void flipSprites(float dt); private: - axis::Sprite* _sprite1; - axis::Sprite* _sprite2; + ax::Sprite* _sprite1; + ax::Sprite* _sprite2; int _counter; }; @@ -655,12 +655,12 @@ public: void reorderSprite(float dt); private: - axis::Node* _node; - axis::Sprite* _sprite1; - axis::Sprite* _sprite2; - axis::Sprite* _sprite3; - axis::Sprite* _sprite4; - axis::Sprite* _sprite5; + ax::Node* _node; + ax::Sprite* _sprite1; + ax::Sprite* _sprite2; + ax::Sprite* _sprite3; + ax::Sprite* _sprite4; + ax::Sprite* _sprite5; }; class SpriteBatchNodeReorderSameIndex : public SpriteTestDemo @@ -674,12 +674,12 @@ public: void reorderSprite(float dt); private: - axis::SpriteBatchNode* _batchNode; - axis::Sprite* _sprite1; - axis::Sprite* _sprite2; - axis::Sprite* _sprite3; - axis::Sprite* _sprite4; - axis::Sprite* _sprite5; + ax::SpriteBatchNode* _batchNode; + ax::Sprite* _sprite1; + ax::Sprite* _sprite2; + ax::Sprite* _sprite3; + ax::Sprite* _sprite4; + ax::Sprite* _sprite5; }; class SpriteBatchNodeReorderOneChild : public SpriteTestDemo @@ -691,8 +691,8 @@ public: virtual std::string title() const override; private: - axis::SpriteBatchNode* _batchNode; - axis::Sprite* _reorderSprite; + ax::SpriteBatchNode* _batchNode; + ax::Sprite* _reorderSprite; }; class SpriteBatchNodeSkewNegativeScaleChildren : public SpriteTestDemo @@ -791,10 +791,10 @@ public: virtual std::string subtitle() const override { return "Rotation should based on the anchor point"; }; protected: - axis::Sprite* sprite1; - axis::Sprite* sprite2; + ax::Sprite* sprite1; + ax::Sprite* sprite2; - axis::Vec3 rotation; + ax::Vec3 rotation; }; class SpriteSlice9Test1 : public SpriteTestDemo @@ -844,7 +844,7 @@ public: virtual void update(float dt) override; private: - axis::Sprite* _sprites[3]; + ax::Sprite* _sprites[3]; float _elapsed; }; @@ -859,7 +859,7 @@ public: virtual void update(float dt) override; private: - axis::Sprite* _sprites[3]; + ax::Sprite* _sprites[3]; float _elapsed; }; @@ -920,10 +920,10 @@ public: protected: float _accum; - axis::Sprite* _s1; - axis::Sprite* _s2; - axis::Sprite* _s3; - axis::Sprite* _s4; + ax::Sprite* _s1; + ax::Sprite* _s2; + ax::Sprite* _s3; + ax::Sprite* _s4; }; #endif diff --git a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp index 38d55934ea..d97235cfce 100644 --- a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp +++ b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp @@ -78,7 +78,7 @@ std::string TerrainSimple::subtitle() const return "Drag to walkThru"; } -void TerrainSimple::onTouchesMoved(const std::vector& touches, axis::Event* event) +void TerrainSimple::onTouchesMoved(const std::vector& touches, ax::Event* event) { float delta = Director::getInstance()->getDeltaTime(); auto touch = touches[0]; @@ -168,9 +168,9 @@ TerrainWalkThru::TerrainWalkThru() addChild(_terrain); } -void TerrainWalkThru::onTouchesBegan(const std::vector& touches, axis::Event* event) {} +void TerrainWalkThru::onTouchesBegan(const std::vector& touches, ax::Event* event) {} -void TerrainWalkThru::onTouchesEnd(const std::vector& touches, axis::Event* event) +void TerrainWalkThru::onTouchesEnd(const std::vector& touches, ax::Event* event) { auto touch = touches[0]; auto location = touch->getLocationInView(); @@ -372,7 +372,7 @@ std::string TerrainWithLightMap::subtitle() const { return "Drag to walkThru"; } -void TerrainWithLightMap::onTouchesMoved(const std::vector& touches, axis::Event* event) +void TerrainWithLightMap::onTouchesMoved(const std::vector& touches, ax::Event* event) { float delta = Director::getInstance()->getDeltaTime(); auto touch = touches[0]; diff --git a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.h b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.h index 8fc79aee58..07a70302b0 100644 --- a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.h +++ b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.h @@ -46,11 +46,11 @@ public: TerrainSimple(); virtual std::string title() const override; virtual std::string subtitle() const override; - void onTouchesMoved(const std::vector& touches, axis::Event* event); - axis::Terrain* _terrain; + void onTouchesMoved(const std::vector& touches, ax::Event* event); + ax::Terrain* _terrain; protected: - axis::Camera* _camera; + ax::Camera* _camera; }; # define PLAYER_STATE_LEFT 0 @@ -59,10 +59,10 @@ protected: # define PLAYER_STATE_FORWARD 3 # define PLAYER_STATE_BACKWARD 4 -class Player : public axis::MeshRenderer +class Player : public ax::MeshRenderer { public: - static Player* create(const char* file, axis::Camera* cam, axis::Terrain* terrain); + static Player* create(const char* file, ax::Camera* cam, ax::Terrain* terrain); virtual bool isDone() const; virtual void update(float dt); @@ -71,14 +71,14 @@ public: void forward(); void backward(); void idle(); - axis::Vec3 _targetPos; + ax::Vec3 _targetPos; void updateState(); float _headingAngle; - axis::Vec3 _headingAxis; + ax::Vec3 _headingAxis; private: - axis::Terrain* _terrain; - axis::Camera* _cam; + ax::Terrain* _terrain; + ax::Camera* _cam; int _playerState; }; @@ -89,12 +89,12 @@ public: TerrainWalkThru(); virtual std::string title() const override; virtual std::string subtitle() const override; - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesEnd(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesEnd(const std::vector& touches, ax::Event* event); protected: - axis::Camera* _camera; - axis::Terrain* _terrain; + ax::Camera* _camera; + ax::Terrain* _terrain; Player* _player; }; @@ -105,11 +105,11 @@ public: TerrainWithLightMap(); virtual std::string title() const override; virtual std::string subtitle() const override; - void onTouchesMoved(const std::vector& touches, axis::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); protected: - axis::Terrain* _terrain; - axis::Camera* _camera; + ax::Terrain* _terrain; + ax::Camera* _camera; }; #endif // !TERRAIN_TESH_H diff --git a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h index 33799228c5..4184e831d6 100644 --- a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h +++ b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h @@ -35,21 +35,21 @@ DEFINE_TEST_SUITE(TextInputTests); // KeyboardNotificationLayer for test IME keyboard notification. ////////////////////////////////////////////////////////////////////////// -class KeyboardNotificationLayer : public TestCase, public axis::IMEDelegate +class KeyboardNotificationLayer : public TestCase, public ax::IMEDelegate { public: KeyboardNotificationLayer(); virtual std::string title() const override; - virtual void onClickTrackNode(bool bClicked, const axis::Vec2& touchPos) = 0; + virtual void onClickTrackNode(bool bClicked, const ax::Vec2& touchPos) = 0; - virtual void keyboardWillShow(axis::IMEKeyboardNotificationInfo& info) override; + virtual void keyboardWillShow(ax::IMEKeyboardNotificationInfo& info) override; - bool onTouchBegan(axis::Touch* touch, axis::Event* event); - void onTouchEnded(axis::Touch* touch, axis::Event* event); + bool onTouchBegan(ax::Touch* touch, ax::Event* event); + void onTouchEnded(ax::Touch* touch, ax::Event* event); protected: - axis::Node* _trackNode; - axis::Vec2 _beginPos; + ax::Node* _trackNode; + ax::Vec2 _beginPos; }; ////////////////////////////////////////////////////////////////////////// @@ -62,7 +62,7 @@ public: CREATE_FUNC(TextFieldTTFDefaultTest); // KeyboardNotificationLayer virtual std::string subtitle() const override; - virtual void onClickTrackNode(bool bClicked, const axis::Vec2& touchPos) override; + virtual void onClickTrackNode(bool bClicked, const ax::Vec2& touchPos) override; // Layer virtual void onEnter() override; @@ -72,10 +72,10 @@ public: // TextFieldTTFActionTest ////////////////////////////////////////////////////////////////////////// -class TextFieldTTFActionTest : public KeyboardNotificationLayer, public axis::TextFieldDelegate +class TextFieldTTFActionTest : public KeyboardNotificationLayer, public ax::TextFieldDelegate { - axis::TextFieldTTF* _textField; - axis::Action* _textFieldAction; + ax::TextFieldTTF* _textField; + ax::Action* _textFieldAction; bool _action; size_t _charLimit; // the textfield max char limit @@ -85,18 +85,18 @@ public: // KeyboardNotificationLayer virtual std::string subtitle() const override; - virtual void onClickTrackNode(bool bClicked, const axis::Vec2& touchPos) override; + virtual void onClickTrackNode(bool bClicked, const ax::Vec2& touchPos) override; // Layer virtual void onEnter() override; virtual void onExit() override; // TextFieldDelegate - virtual bool onTextFieldAttachWithIME(axis::TextFieldTTF* sender) override; - virtual bool onTextFieldDetachWithIME(axis::TextFieldTTF* sender) override; - virtual bool onTextFieldInsertText(axis::TextFieldTTF* sender, const char* text, size_t nLen) override; - virtual bool onTextFieldDeleteBackward(axis::TextFieldTTF* sender, const char* delText, size_t nLen) override; - virtual bool onDraw(axis::TextFieldTTF* sender); + virtual bool onTextFieldAttachWithIME(ax::TextFieldTTF* sender) override; + virtual bool onTextFieldDetachWithIME(ax::TextFieldTTF* sender) override; + virtual bool onTextFieldInsertText(ax::TextFieldTTF* sender, const char* text, size_t nLen) override; + virtual bool onTextFieldDeleteBackward(ax::TextFieldTTF* sender, const char* delText, size_t nLen) override; + virtual bool onDraw(ax::TextFieldTTF* sender); }; ////////////////////////////////////////////////////////////////////////// @@ -123,7 +123,7 @@ public: CREATE_FUNC(TextFieldTTSetCursorFromPoint); // KeyboardNotificationLayer virtual std::string subtitle() const override; - virtual void onClickTrackNode(bool bClicked, const axis::Vec2& touchPos) override; + virtual void onClickTrackNode(bool bClicked, const ax::Vec2& touchPos) override; // Layer virtual void onEnter() override; diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp index f4fd53694f..1366ea7cd6 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp @@ -2129,7 +2129,7 @@ void TextureMemoryAlloc::onEnter() menu2->setPosition(Vec2(s.width / 2, s.height / 4)); } -void TextureMemoryAlloc::changeBackgroundVisible(axis::Ref* sender) +void TextureMemoryAlloc::changeBackgroundVisible(ax::Ref* sender) { if (_background) { @@ -2137,7 +2137,7 @@ void TextureMemoryAlloc::changeBackgroundVisible(axis::Ref* sender) } } -void TextureMemoryAlloc::updateImage(axis::Ref* sender) +void TextureMemoryAlloc::updateImage(ax::Ref* sender) { if (_background) { @@ -2223,7 +2223,7 @@ std::string TexturePVRv3Premult::subtitle() const return "All images should look exactly the same"; } -void TexturePVRv3Premult::transformSprite(axis::Sprite* sprite) +void TexturePVRv3Premult::transformSprite(ax::Sprite* sprite) { auto fade = FadeOut::create(2); auto dl = DelayTime::create(2); diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.h b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.h index 38a08647c2..b86756cfd0 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.h +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.h @@ -45,7 +45,7 @@ public: virtual std::string title() const override; virtual void onEnter() override; - axis::Node* _background; + ax::Node* _background; }; class TextureETC1Alpha : public TextureDemo @@ -57,10 +57,10 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewSpriteWithCoords(axis::Vec2 p); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void addNewSpriteWithCoords(ax::Vec2 p); + void onTouchesEnded(const std::vector& touches, ax::Event* event); - axis::Node* _background; + ax::Node* _background; }; class TextureETC2 : public TextureDemo @@ -73,9 +73,9 @@ public: virtual std::string subtitle() const override; void addNewSpriteWithCoords(); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); - axis::Node* _background; + ax::Node* _background; }; class TextureBMP : public TextureDemo @@ -86,8 +86,8 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewSpriteWithCoords(axis::Vec2 p); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void addNewSpriteWithCoords(ax::Vec2 p); + void onTouchesEnded(const std::vector& touches, ax::Event* event); }; class TextureTGA : public TextureDemo @@ -460,7 +460,7 @@ public: virtual float getDuration() const override { return 5.0f; } void loadImages(float dt); - void imageLoaded(axis::Texture2D* texture); + void imageLoaded(ax::Texture2D* texture); virtual std::string title() const override; virtual std::string subtitle() const override; virtual void onEnter() override; @@ -515,12 +515,12 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; virtual void onEnter() override; - virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override; + virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override; protected: - void onDraw(const axis::Mat4& transform, uint32_t flags); + void onDraw(const ax::Mat4& transform, uint32_t flags); - axis::Texture2D *_tex1, *_Tex2F; + ax::Texture2D *_tex1, *_Tex2F; }; class TextureDrawInRect : public TextureDemo @@ -531,12 +531,12 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; virtual void onEnter() override; - virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override; + virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override; protected: - void onDraw(const axis::Mat4& transform, uint32_t flags); + void onDraw(const ax::Mat4& transform, uint32_t flags); - axis::Texture2D *_tex1, *_Tex2F; + ax::Texture2D *_tex1, *_Tex2F; }; class TextureMemoryAlloc : public TextureDemo @@ -546,11 +546,11 @@ public: virtual void onEnter() override; virtual std::string title() const override; virtual std::string subtitle() const override; - void updateImage(axis::Ref* sender); - void changeBackgroundVisible(axis::Ref* sender); + void updateImage(ax::Ref* sender); + void changeBackgroundVisible(ax::Ref* sender); private: - axis::Sprite* _background; + ax::Sprite* _background; }; class TexturePVRv3Premult : public TextureDemo @@ -562,7 +562,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void transformSprite(axis::Sprite* sprite); + void transformSprite(ax::Sprite* sprite); }; // S3TC Dxt1 texture format test diff --git a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp index 11f5cb8b19..2d524c7ee7 100644 --- a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp +++ b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp @@ -88,7 +88,7 @@ TextureCacheTest::TextureCacheTest() : _numberOfSprites(20), _numberOfLoadedSpri AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); } -void TextureCacheTest::loadingCallBack(axis::Texture2D* texture) +void TextureCacheTest::loadingCallBack(ax::Texture2D* texture) { ++_numberOfLoadedSprites; char tmp[10]; diff --git a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.h b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.h index 92ae43399c..1455951fe4 100644 --- a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.h +++ b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.h @@ -38,13 +38,13 @@ public: TextureCacheTest(); void addSprite(); - void loadingCallBack(axis::Texture2D* texture); + void loadingCallBack(ax::Texture2D* texture); virtual float getDuration() const override { return 3.5f; } private: - axis::Label* _labelLoading; - axis::Label* _labelPercent; + ax::Label* _labelLoading; + ax::Label* _labelPercent; int _numberOfSprites; int _numberOfLoadedSprites; }; @@ -57,8 +57,8 @@ public: TextureCacheUnbindTest(); private: - void textureLoadedA(axis::Texture2D* texture); - void textureLoadedB(axis::Texture2D* texture); + void textureLoadedA(ax::Texture2D* texture); + void textureLoadedB(ax::Texture2D* texture); }; #endif // _TEXTURECACHE_TEST_H_ diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp b/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp index 8a19ec9b92..50c2ef3ab0 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp @@ -223,7 +223,7 @@ TMXOrthoTestNew::TMXOrthoTestNew() // auto color = LayerColor::create( Color4B(64,64,64,255) ); // addChild(color, -1); - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); addChild(map, 0, kTagTileMap); @@ -266,7 +266,7 @@ std::string TMXOrthoTestNew::title() const //------------------------------------------------------------------ TMXOrthoTest2New::TMXOrthoTest2New() { - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test1.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test1.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -287,7 +287,7 @@ std::string TMXOrthoTest2New::title() const //------------------------------------------------------------------ TMXOrthoTest3New::TMXOrthoTest3New() { - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test3.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test3.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -309,7 +309,7 @@ std::string TMXOrthoTest3New::title() const //------------------------------------------------------------------ TMXOrthoTest4New::TMXOrthoTest4New() { - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test4.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test4.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s1 = map->getContentSize(); @@ -337,7 +337,7 @@ void TMXOrthoTest4New::removeSprite(float dt) { unschedule(AX_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite)); - auto map = static_cast(getChildByTag(kTagTileMap)); + auto map = static_cast(getChildByTag(kTagTileMap)); auto layer = map->getLayer("Layer 0"); auto s = layer->getLayerSize(); @@ -370,7 +370,7 @@ TMXReadWriteTestNew::TMXReadWriteTestNew() { _gid = 0; - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -434,8 +434,8 @@ void TMXReadWriteTestNew::removeSprite(Node* sender) void TMXReadWriteTestNew::updateCol(float dt) { - auto map = (axis::FastTMXTiledMap*)getChildByTag(kTagTileMap); - auto layer = (axis::FastTMXLayer*)map->getChildByTag(0); + auto map = (ax::FastTMXTiledMap*)getChildByTag(kTagTileMap); + auto layer = (ax::FastTMXLayer*)map->getChildByTag(0); ////----AXLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads()); ////----AXLOG("++++children: %d", layer->getChildren()->count() ); @@ -454,8 +454,8 @@ void TMXReadWriteTestNew::repaintWithGID(float dt) { // unschedule:_cmd); - auto map = (axis::FastTMXTiledMap*)getChildByTag(kTagTileMap); - auto layer = (axis::FastTMXLayer*)map->getChildByTag(0); + auto map = (ax::FastTMXTiledMap*)getChildByTag(kTagTileMap); + auto layer = (ax::FastTMXLayer*)map->getChildByTag(0); auto s = layer->getLayerSize(); for (int x = 0; x < s.width; x++) @@ -470,8 +470,8 @@ void TMXReadWriteTestNew::removeTiles(float dt) { unschedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles)); - auto map = (axis::FastTMXTiledMap*)getChildByTag(kTagTileMap); - auto layer = (axis::FastTMXLayer*)map->getChildByTag(0); + auto map = (ax::FastTMXTiledMap*)getChildByTag(kTagTileMap); + auto layer = (ax::FastTMXLayer*)map->getChildByTag(0); auto s = layer->getLayerSize(); for (int y = 0; y < s.height; y++) @@ -495,7 +495,7 @@ TMXHexTestNew::TMXHexTestNew() auto color = LayerColor::create(Color4B(64, 64, 64, 255)); addChild(color, -1); - auto map = axis::FastTMXTiledMap::create("TileMaps/hexa-test.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/hexa-test.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -517,7 +517,7 @@ TMXIsoTestNew::TMXIsoTestNew() auto color = LayerColor::create(Color4B(64, 64, 64, 255)); addChild(color, -1); - auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/iso-test.tmx"); addChild(map, 0, kTagTileMap); // move map to the center of the screen @@ -541,7 +541,7 @@ TMXIsoTest1New::TMXIsoTest1New() auto color = LayerColor::create(Color4B(64, 64, 64, 255)); addChild(color, -1); - auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test1.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/iso-test1.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -565,7 +565,7 @@ TMXIsoTest2New::TMXIsoTest2New() auto color = LayerColor::create(Color4B(64, 64, 64, 255)); addChild(color, -1); - auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test2.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/iso-test2.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -592,7 +592,7 @@ TMXUncompressedTestNew::TMXUncompressedTestNew() auto color = LayerColor::create(Color4B(64, 64, 64, 255)); addChild(color, -1); - auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test2-uncompressed.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/iso-test2-uncompressed.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -626,7 +626,7 @@ std::string TMXUncompressedTestNew::title() const //------------------------------------------------------------------ TMXTilesetTestNew::TMXTilesetTestNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test5.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test5.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -645,7 +645,7 @@ std::string TMXTilesetTestNew::title() const //------------------------------------------------------------------ TMXOrthoObjectsTestNew::TMXOrthoObjectsTestNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/ortho-objects.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/ortho-objects.tmx"); addChild(map, -1, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -694,7 +694,7 @@ std::string TMXOrthoObjectsTestNew::subtitle() const TMXIsoObjectsTestNew::TMXIsoObjectsTestNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test-objectgroup.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/iso-test-objectgroup.tmx"); addChild(map, -1, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -744,13 +744,13 @@ std::string TMXIsoObjectsTestNew::subtitle() const TMXResizeTestNew::TMXResizeTestNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test5.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test5.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); AXLOG("ContentSize: %f, %f", s.width, s.height); - axis::FastTMXLayer* layer; + ax::FastTMXLayer* layer; layer = map->getLayer("Layer 0"); auto ls = layer->getLayerSize(); @@ -781,7 +781,7 @@ std::string TMXResizeTestNew::subtitle() const TMXIsoZorderNew::TMXIsoZorderNew() { Director::getInstance()->getRenderer()->setDepthTest(false); - auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test-zorder.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/iso-test-zorder.tmx"); addChild(map, 0, kTagTileMap); auto s = map->getContentSize(); @@ -848,7 +848,7 @@ std::string TMXIsoZorderNew::subtitle() const //------------------------------------------------------------------ TMXOrthoZorderNew::TMXOrthoZorderNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-zorder.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test-zorder.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -907,7 +907,7 @@ std::string TMXOrthoZorderNew::subtitle() const //------------------------------------------------------------------ TMXIsoVertexZNew::TMXIsoVertexZNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test-vertexz.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/iso-test-vertexz.tmx"); addChild(map, 0, kTagTileMap); auto s = map->getContentSize(); @@ -979,7 +979,7 @@ std::string TMXIsoVertexZNew::subtitle() const //------------------------------------------------------------------ TMXOrthoVertexZNew::TMXOrthoVertexZNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-vertexz.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test-vertexz.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -1050,7 +1050,7 @@ std::string TMXOrthoVertexZNew::subtitle() const //------------------------------------------------------------------ TMXIsoMoveLayerNew::TMXIsoMoveLayerNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test-movelayer.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/iso-test-movelayer.tmx"); addChild(map, 0, kTagTileMap); map->setPosition(Vec2(-700.0f, -50.0f)); @@ -1076,7 +1076,7 @@ std::string TMXIsoMoveLayerNew::subtitle() const //------------------------------------------------------------------ TMXOrthoMoveLayerNew::TMXOrthoMoveLayerNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-movelayer.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test-movelayer.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -1101,7 +1101,7 @@ std::string TMXOrthoMoveLayerNew::subtitle() const TMXTilePropertyTestNew::TMXTilePropertyTestNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/ortho-tile-property.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/ortho-tile-property.tmx"); addChild(map, 0, kTagTileMap); for (int i = 1; i <= 20; i++) @@ -1131,7 +1131,7 @@ std::string TMXTilePropertyTestNew::subtitle() const TMXOrthoFlipTestNew::TMXOrthoFlipTestNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/ortho-rotation-test.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/ortho-rotation-test.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -1154,7 +1154,7 @@ std::string TMXOrthoFlipTestNew::title() const TMXOrthoFlipRunTimeTestNew::TMXOrthoFlipRunTimeTestNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/ortho-rotation-test.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/ortho-rotation-test.tmx"); addChild(map, 0, kTagTileMap); auto s = map->getContentSize(); @@ -1178,7 +1178,7 @@ std::string TMXOrthoFlipRunTimeTestNew::subtitle() const void TMXOrthoFlipRunTimeTestNew::flipIt(float dt) { - auto map = (axis::FastTMXTiledMap*)getChildByTag(kTagTileMap); + auto map = (ax::FastTMXTiledMap*)getChildByTag(kTagTileMap); auto layer = map->getLayer("Layer 0"); // blue diamond @@ -1224,7 +1224,7 @@ TMXOrthoFromXMLTestNew::TMXOrthoFromXMLTestNew() auto fileUtils = FileUtils::getInstance(); std::string str = fileUtils->getStringFromFile(fileUtils->fullPathForFilename(file.c_str())); - auto map = axis::FastTMXTiledMap::createWithXML(str, resources.c_str()); + auto map = ax::FastTMXTiledMap::createWithXML(str, resources.c_str()); addChild(map, 0, kTagTileMap); auto s = map->getContentSize(); @@ -1250,7 +1250,7 @@ TMXOrthoXMLFormatTestNew::TMXOrthoXMLFormatTestNew() // 1. load xml format tilemap // 2. gid lower than firstgid is ignored // 3. firstgid in tsx is ignored, tile property in tsx loaded correctly. - auto map = axis::FastTMXTiledMap::create("TileMaps/xml-test.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/xml-test.tmx"); addChild(map, 0, kTagTileMap); auto s = map->getContentSize(); @@ -1277,7 +1277,7 @@ std::string TMXOrthoXMLFormatTestNew::title() const //------------------------------------------------------------------ TMXBug987New::TMXBug987New() { - auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test6.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test6.tmx"); addChild(map, 0, kTagTileMap); Size AX_UNUSED s1 = map->getContentSize(); @@ -1305,7 +1305,7 @@ std::string TMXBug987New::subtitle() const //------------------------------------------------------------------ TMXBug787New::TMXBug787New() { - auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test-bug787.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/iso-test-bug787.tmx"); addChild(map, 0, kTagTileMap); map->setScale(0.25f); @@ -1328,7 +1328,7 @@ std::string TMXBug787New::subtitle() const //------------------------------------------------------------------ TMXGIDObjectsTestNew::TMXGIDObjectsTestNew() { - auto map = axis::FastTMXTiledMap::create("TileMaps/test-object-layer.tmx"); + auto map = ax::FastTMXTiledMap::create("TileMaps/test-object-layer.tmx"); addChild(map, -1, kTagTileMap); Size AX_UNUSED s = map->getContentSize(); @@ -1393,7 +1393,7 @@ std::string TileAnimTestNew::title() const return "Tile animation test. Click to toggle the animation"; } -void TileAnimTestNew::onTouchBegan(const std::vector& touches, axis::Event* event) +void TileAnimTestNew::onTouchBegan(const std::vector& touches, ax::Event* event) { _animStarted = !_animStarted; map->setTileAnimEnabled(_animStarted); diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.h b/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.h index 67f22af33e..4c29faeaa2 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.h +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.h @@ -39,7 +39,7 @@ public: virtual std::string subtitle() const override; virtual void onExit() override; - void onTouchesMoved(const std::vector& touches, axis::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); }; class TileMapTestNew : public TileDemoNew @@ -192,7 +192,7 @@ public: class TMXIsoZorderNew : public TileDemoNew { - axis::Sprite* _tamara; + ax::Sprite* _tamara; public: CREATE_FUNC(TMXIsoZorderNew); @@ -207,7 +207,7 @@ public: class TMXOrthoZorderNew : public TileDemoNew { - axis::Sprite* _tamara; + ax::Sprite* _tamara; public: CREATE_FUNC(TMXOrthoZorderNew); @@ -221,7 +221,7 @@ public: class TMXIsoVertexZNew : public TileDemoNew { - axis::Sprite* _tamara; + ax::Sprite* _tamara; public: CREATE_FUNC(TMXIsoVertexZNew); @@ -237,7 +237,7 @@ public: class TMXOrthoVertexZNew : public TileDemoNew { - axis::Sprite* _tamara; + ax::Sprite* _tamara; public: CREATE_FUNC(TMXOrthoVertexZNew); @@ -346,9 +346,9 @@ public: TileAnimTestNew(); virtual std::string title() const override; - axis::FastTMXTiledMap* map; + ax::FastTMXTiledMap* map; bool _animStarted = true; - void onTouchBegan(const std::vector& touches, axis::Event* event); + void onTouchBegan(const std::vector& touches, ax::Event* event); }; #endif diff --git a/tests/cpp-tests/Classes/TouchesTest/Ball.h b/tests/cpp-tests/Classes/TouchesTest/Ball.h index 9a1bc64443..aa52f42dbc 100644 --- a/tests/cpp-tests/Classes/TouchesTest/Ball.h +++ b/tests/cpp-tests/Classes/TouchesTest/Ball.h @@ -29,26 +29,26 @@ class Paddle; -class Ball : public axis::Sprite +class Ball : public ax::Sprite { - axis::Vec2 _velocity; + ax::Vec2 _velocity; public: Ball(); virtual ~Ball(); float radius(); - // BOOL initWithTexture(axis::Texture2D* aTexture); - // virtual void setTexture(axis::Texture2D* newTexture); + // BOOL initWithTexture(ax::Texture2D* aTexture); + // virtual void setTexture(ax::Texture2D* newTexture); void move(float delta); void collideWithPaddle(Paddle* paddle); public: - void setVelocity(axis::Vec2 velocity) { _velocity = velocity; } - axis::Vec2 getVelocity() { return _velocity; } + void setVelocity(ax::Vec2 velocity) { _velocity = velocity; } + ax::Vec2 getVelocity() { return _velocity; } public: - static Ball* ballWithTexture(axis::Texture2D* aTexture); + static Ball* ballWithTexture(ax::Texture2D* aTexture); }; #endif diff --git a/tests/cpp-tests/Classes/TouchesTest/Paddle.h b/tests/cpp-tests/Classes/TouchesTest/Paddle.h index 1ba14e8a62..29982e3239 100644 --- a/tests/cpp-tests/Classes/TouchesTest/Paddle.h +++ b/tests/cpp-tests/Classes/TouchesTest/Paddle.h @@ -33,7 +33,7 @@ typedef enum tagPaddleState kPaddleStateUngrabbed } PaddleState; -class Paddle : public axis::Sprite, public axis::Clonable +class Paddle : public ax::Sprite, public ax::Clonable { PaddleState _state; @@ -41,17 +41,17 @@ public: Paddle(); virtual ~Paddle(); - axis::Rect getRect(); - bool initWithTexture(axis::Texture2D* aTexture) override; + ax::Rect getRect(); + bool initWithTexture(ax::Texture2D* aTexture) override; virtual void onEnter() override; virtual void onExit() override; - bool containsTouchLocation(axis::Touch* touch); - bool onTouchBegan(axis::Touch* touch, axis::Event* event); - void onTouchMoved(axis::Touch* touch, axis::Event* event); - void onTouchEnded(axis::Touch* touch, axis::Event* event); + bool containsTouchLocation(ax::Touch* touch); + bool onTouchBegan(ax::Touch* touch, ax::Event* event); + void onTouchMoved(ax::Touch* touch, ax::Event* event); + void onTouchEnded(ax::Touch* touch, ax::Event* event); virtual Paddle* clone() const override; - static Paddle* createWithTexture(axis::Texture2D* aTexture); + static Paddle* createWithTexture(ax::Texture2D* aTexture); }; #endif diff --git a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp index bb233d18c6..92580fb9a8 100644 --- a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp +++ b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp @@ -172,9 +172,9 @@ std::string ForceTouchTest::subtitle() const return std::string("Touch with force to see info label changes\nOnly work on iPhone6s / iPhone6s Plus"); } -void ForceTouchTest::onTouchesBegan(const std::vector& touches, axis::Event* event) {} +void ForceTouchTest::onTouchesBegan(const std::vector& touches, ax::Event* event) {} -void ForceTouchTest::onTouchesMoved(const std::vector& touches, axis::Event* event) +void ForceTouchTest::onTouchesMoved(const std::vector& touches, ax::Event* event) { for (auto&& t : touches) { @@ -185,7 +185,7 @@ void ForceTouchTest::onTouchesMoved(const std::vector& touches, ax } } -void ForceTouchTest::onTouchesEnded(const std::vector& touches, axis::Event* event) +void ForceTouchTest::onTouchesEnded(const std::vector& touches, ax::Event* event) { sprintf(formatBuffer, _Info_Formatter, 0.0f, 0.0f); _infoLabel->setString(std::string(formatBuffer)); diff --git a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.h b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.h index ea4905759b..2294c8b3a3 100644 --- a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.h +++ b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.h @@ -39,12 +39,12 @@ public: class Ball; class Paddle; -class PongLayer : public axis::Layer +class PongLayer : public ax::Layer { private: Ball* _ball; - axis::Vector _paddles; - axis::Vec2 _ballStartingVelocity; + ax::Vector _paddles; + ax::Vec2 _ballStartingVelocity; public: CREATE_FUNC(PongLayer); @@ -63,15 +63,15 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); protected: ForceTouchTest(); virtual ~ForceTouchTest(); - axis::Label* _infoLabel; + ax::Label* _infoLabel; }; #endif diff --git a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.h b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.h index 98af48d4ff..8721236bfc 100644 --- a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.h +++ b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.h @@ -37,7 +37,7 @@ public: CREATE_FUNC(TransitionsTest); }; -class TestLayer1 : public axis::Layer +class TestLayer1 : public ax::Layer { public: static TestLayer1* create(std::string_view transitionName); @@ -53,7 +53,7 @@ public: virtual void onExit() override; }; -class TestLayer2 : public axis::Layer +class TestLayer2 : public ax::Layer { public: static TestLayer2* create(std::string_view transitionName); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index f3147d81c5..bf2b948e6a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -147,13 +147,13 @@ void UIButtonTest::touchEvent(Ref* pSender, Widget::TouchEventType type) } } -void UIButtonTest::printWidgetResources(axis::Ref* sender) +void UIButtonTest::printWidgetResources(ax::Ref* sender) { - axis::ResourceData normalFileName = _button->getNormalFile(); + ax::ResourceData normalFileName = _button->getNormalFile(); AXLOG("normalFileName Name : %s, Type: %d", normalFileName.file.c_str(), normalFileName.type); - axis::ResourceData clickedFileName = _button->getPressedFile(); + ax::ResourceData clickedFileName = _button->getPressedFile(); AXLOG("clickedFileName Name : %s, Type: %d", clickedFileName.file.c_str(), clickedFileName.type); - axis::ResourceData disabledFileName = _button->getDisabledFile(); + ax::ResourceData disabledFileName = _button->getDisabledFile(); AXLOG("disabledFileName Name : %s, Type: %d", disabledFileName.file.c_str(), disabledFileName.type); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h index a6ce3176ac..7340864863 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h @@ -39,13 +39,13 @@ public: ~UIButtonTest(); virtual bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); - void printWidgetResources(axis::Ref* sender); + void printWidgetResources(ax::Ref* sender); protected: - axis::ui::Text* _displayValueLabel; - axis::ui::Button* _button; + ax::ui::Text* _displayValueLabel; + ax::ui::Button* _button; }; class UIButtonTest_Scale9 : public UIScene @@ -57,10 +57,10 @@ public: ~UIButtonTest_Scale9(); virtual bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonTest_Scale9_State_Change : public UIScene @@ -72,10 +72,10 @@ public: ~UIButtonTest_Scale9_State_Change(); virtual bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonTest_PressedAction : public UIScene @@ -87,10 +87,10 @@ public: ~UIButtonTest_PressedAction(); virtual bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonTest_Title : public UIScene @@ -102,10 +102,10 @@ public: ~UIButtonTest_Title(); virtual bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonTestRemoveSelf : public UIScene @@ -117,10 +117,10 @@ public: ~UIButtonTestRemoveSelf(); virtual bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonTestSwitchScale9 : public UIScene @@ -132,10 +132,10 @@ public: ~UIButtonTestSwitchScale9(); virtual bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonTestZoomScale : public UIScene @@ -147,10 +147,10 @@ public: ~UIButtonTestZoomScale(); virtual bool init() override; - void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type); + void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonTextOnly : public UIScene @@ -164,7 +164,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonIgnoreContentSizeTest : public UIScene @@ -178,7 +178,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonTitleEffectTest : public UIScene @@ -192,7 +192,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonFlipTest : public UIScene @@ -206,7 +206,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonNormalDefaultTest : public UIScene @@ -220,7 +220,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonDisableDefaultTest : public UIScene @@ -234,7 +234,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIButtonCloneTest : public UIScene @@ -248,7 +248,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class Issue12249 : public UIScene @@ -261,7 +261,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class Issue17116 : public UIScene diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp index fc15afba85..53efb3f118 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp @@ -98,19 +98,19 @@ void UICheckBoxTest::selectedEvent(Ref* pSender, CheckBox::EventType type) } } -void UICheckBoxTest::printWidgetResources(axis::Ref* sender) +void UICheckBoxTest::printWidgetResources(ax::Ref* sender) { - axis::ResourceData backGroundFileName = _checkBox->getBackNormalFile(); + ax::ResourceData backGroundFileName = _checkBox->getBackNormalFile(); AXLOG("backGroundFile Name : %s, Type: %d", backGroundFileName.file.c_str(), backGroundFileName.type); - axis::ResourceData backGroundSelectedFileName = _checkBox->getBackPressedFile(); + ax::ResourceData backGroundSelectedFileName = _checkBox->getBackPressedFile(); AXLOG("backGroundSelectedFile Name : %s, Type: %d", backGroundSelectedFileName.file.c_str(), backGroundSelectedFileName.type); - axis::ResourceData backGroundDisabledFileName = _checkBox->getBackDisabledFile(); + ax::ResourceData backGroundDisabledFileName = _checkBox->getBackDisabledFile(); AXLOG("backGroundDisabledFile Name : %s, Type: %d", backGroundDisabledFileName.file.c_str(), backGroundDisabledFileName.type); - axis::ResourceData frontCrossFileName = _checkBox->getCrossNormalFile(); + ax::ResourceData frontCrossFileName = _checkBox->getCrossNormalFile(); AXLOG("frontCrossFile Name : %s, Type: %d", frontCrossFileName.file.c_str(), frontCrossFileName.type); - axis::ResourceData frontCrossDisabledFileName = _checkBox->getCrossDisabledFile(); + ax::ResourceData frontCrossDisabledFileName = _checkBox->getCrossDisabledFile(); AXLOG("frontCrossDisabledFile Name : %s, Type: %d", frontCrossDisabledFileName.file.c_str(), frontCrossDisabledFileName.type); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h index cb714a6d6e..bfb64d2d52 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h @@ -39,13 +39,13 @@ public: ~UICheckBoxTest(); virtual bool init() override; - void selectedEvent(axis::Ref* sender, axis::ui::CheckBox::EventType type); + void selectedEvent(ax::Ref* sender, ax::ui::CheckBox::EventType type); - void printWidgetResources(axis::Ref* sender); + void printWidgetResources(ax::Ref* sender); protected: - axis::ui::Text* _displayValueLabel; - axis::ui::CheckBox* _checkBox; + ax::ui::Text* _displayValueLabel; + ax::ui::CheckBox* _checkBox; }; class UICheckBoxDefaultBehaviorTest : public UIScene @@ -59,7 +59,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UICheckBoxCopyTest : public UIScene @@ -73,6 +73,6 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; #endif /* defined(__TestCpp__UICheckBoxTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp index 9412fdea5f..d8c1d70817 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp @@ -137,18 +137,18 @@ bool UIEditBoxTest::init() return false; } -void UIEditBoxTest::editBoxEditingDidBegin(axis::ui::EditBox* editBox) +void UIEditBoxTest::editBoxEditingDidBegin(ax::ui::EditBox* editBox) { log("editBox %p DidBegin !", editBox); } -void UIEditBoxTest::editBoxEditingDidEndWithAction(axis::ui::EditBox* editBox, - axis::ui::EditBoxDelegate::EditBoxEndAction action) +void UIEditBoxTest::editBoxEditingDidEndWithAction(ax::ui::EditBox* editBox, + ax::ui::EditBoxDelegate::EditBoxEndAction action) { log("editBox %p DidEnd with action %d!", editBox, action); } -void UIEditBoxTest::editBoxTextChanged(axis::ui::EditBox* editBox, std::string_view text) +void UIEditBoxTest::editBoxTextChanged(ax::ui::EditBox* editBox, std::string_view text) { log("editBox %p TextChanged, text: %s ", editBox, text.data()); editBox->setText(text.data()); @@ -270,12 +270,12 @@ bool UIEditBoxTestToggleVisibility::init() return false; } -void UIEditBoxTestToggleVisibility::editBoxEditingDidBegin(axis::ui::EditBox* editBox) +void UIEditBoxTestToggleVisibility::editBoxEditingDidBegin(ax::ui::EditBox* editBox) { log("editBox %p DidBegin !", editBox); } -void UIEditBoxTestToggleVisibility::editBoxTextChanged(axis::ui::EditBox* editBox, std::string_view text) +void UIEditBoxTestToggleVisibility::editBoxTextChanged(ax::ui::EditBox* editBox, std::string_view text) { log("editBox %p TextChanged, text: %s ", editBox, text.data()); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.h index e1d83fcfe9..497cd974ed 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.h @@ -30,44 +30,44 @@ DEFINE_TEST_SUITE(UIEditBoxTests); -class UIEditBoxTest : public UIScene, public axis::ui::EditBoxDelegate +class UIEditBoxTest : public UIScene, public ax::ui::EditBoxDelegate { public: CREATE_FUNC(UIEditBoxTest); virtual bool init() override; - virtual void editBoxEditingDidBegin(axis::ui::EditBox* editBox) override; - virtual void editBoxEditingDidEndWithAction(axis::ui::EditBox* editBox, - axis::ui::EditBoxDelegate::EditBoxEndAction action) override; - virtual void editBoxTextChanged(axis::ui::EditBox* editBox, std::string_view text) override; - virtual void editBoxReturn(axis::ui::EditBox* editBox) override; + virtual void editBoxEditingDidBegin(ax::ui::EditBox* editBox) override; + virtual void editBoxEditingDidEndWithAction(ax::ui::EditBox* editBox, + ax::ui::EditBoxDelegate::EditBoxEndAction action) override; + virtual void editBoxTextChanged(ax::ui::EditBox* editBox, std::string_view text) override; + virtual void editBoxReturn(ax::ui::EditBox* editBox) override; protected: - axis::Label* _TTFShowEditReturn; - axis::ui::EditBox* _editName; - axis::ui::EditBox* _editPassword; - axis::ui::EditBox* _editEmail; - axis::Node* _editEmailParent; + ax::Label* _TTFShowEditReturn; + ax::ui::EditBox* _editName; + ax::ui::EditBox* _editPassword; + ax::ui::EditBox* _editEmail; + ax::Node* _editEmailParent; }; -class UIEditBoxTestToggleVisibility : public UIScene, public axis::ui::EditBoxDelegate +class UIEditBoxTestToggleVisibility : public UIScene, public ax::ui::EditBoxDelegate { public: CREATE_FUNC(UIEditBoxTestToggleVisibility); virtual bool init() override; - virtual void editBoxEditingDidBegin(axis::ui::EditBox* editBox) override; - virtual void editBoxTextChanged(axis::ui::EditBox* editBox, std::string_view text) override; - virtual void editBoxReturn(axis::ui::EditBox* editBox) override; + virtual void editBoxEditingDidBegin(ax::ui::EditBox* editBox) override; + virtual void editBoxTextChanged(ax::ui::EditBox* editBox, std::string_view text) override; + virtual void editBoxReturn(ax::ui::EditBox* editBox) override; protected: - axis::Label* _TTFShowEditReturn; - axis::ui::EditBox* _editName; - axis::ui::EditBox* _editPassword; - axis::ui::EditBox* _editEmail; - axis::Node* _editEmailParent; + ax::Label* _TTFShowEditReturn; + ax::ui::EditBox* _editName; + ax::ui::EditBox* _editPassword; + ax::ui::EditBox* _editEmail; + ax::Node* _editEmailParent; }; class UIEditBoxTestTextHorizontalAlignment : public UIScene diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp index a670b98625..59067f3f9c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp @@ -103,7 +103,7 @@ bool UIFocusTestBase::init() return false; } -void UIFocusTestBase::onImageViewClicked(axis::Ref* ref, Widget::TouchEventType touchType) +void UIFocusTestBase::onImageViewClicked(ax::Ref* ref, Widget::TouchEventType touchType) { if (touchType == Widget::TouchEventType::ENDED) { @@ -123,33 +123,33 @@ void UIFocusTestBase::onImageViewClicked(axis::Ref* ref, Widget::TouchEventType void UIFocusTestBase::onLeftKeyPressed() { - axis::EventKeyboard::KeyCode cocos2dKey = EventKeyboard::KeyCode::KEY_DPAD_LEFT; - axis::EventKeyboard event(cocos2dKey, false); - axis::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); + ax::EventKeyboard::KeyCode cocos2dKey = EventKeyboard::KeyCode::KEY_DPAD_LEFT; + ax::EventKeyboard event(cocos2dKey, false); + ax::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } void UIFocusTestBase::onRightKeyPressed() { - axis::EventKeyboard::KeyCode cocos2dKey = EventKeyboard::KeyCode::KEY_DPAD_RIGHT; - axis::EventKeyboard event(cocos2dKey, false); - axis::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); + ax::EventKeyboard::KeyCode cocos2dKey = EventKeyboard::KeyCode::KEY_DPAD_RIGHT; + ax::EventKeyboard event(cocos2dKey, false); + ax::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } void UIFocusTestBase::onUpKeyPressed() { - axis::EventKeyboard::KeyCode cocos2dKey = EventKeyboard::KeyCode::KEY_DPAD_UP; - axis::EventKeyboard event(cocos2dKey, false); - axis::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); + ax::EventKeyboard::KeyCode cocos2dKey = EventKeyboard::KeyCode::KEY_DPAD_UP; + ax::EventKeyboard event(cocos2dKey, false); + ax::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } void UIFocusTestBase::onDownKeyPressed() { - axis::EventKeyboard::KeyCode cocos2dKey = EventKeyboard::KeyCode::KEY_DPAD_DOWN; - axis::EventKeyboard event(cocos2dKey, false); - axis::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); + ax::EventKeyboard::KeyCode cocos2dKey = EventKeyboard::KeyCode::KEY_DPAD_DOWN; + ax::EventKeyboard event(cocos2dKey, false); + ax::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } -void UIFocusTestBase::onFocusChanged(axis::ui::Widget* widgetLostFocus, axis::ui::Widget* widgetGetFocus) +void UIFocusTestBase::onFocusChanged(ax::ui::Widget* widgetLostFocus, ax::ui::Widget* widgetGetFocus) { if (widgetGetFocus && widgetGetFocus->isFocusEnabled()) { @@ -211,7 +211,7 @@ bool UIFocusTestHorizontal::init() return false; } -void UIFocusTestHorizontal::toggleFocusLoop(axis::Ref* pObjc, Widget::TouchEventType type) +void UIFocusTestHorizontal::toggleFocusLoop(ax::Ref* pObjc, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -271,7 +271,7 @@ bool UIFocusTestVertical::init() return false; } -void UIFocusTestVertical::toggleFocusLoop(axis::Ref* pObjc, Widget::TouchEventType type) +void UIFocusTestVertical::toggleFocusLoop(ax::Ref* pObjc, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -367,7 +367,7 @@ bool UIFocusTestNestedLayout1::init() return false; } -void UIFocusTestNestedLayout1::toggleFocusLoop(axis::Ref* pObjc, Widget::TouchEventType type) +void UIFocusTestNestedLayout1::toggleFocusLoop(ax::Ref* pObjc, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -463,7 +463,7 @@ bool UIFocusTestNestedLayout2::init() return false; } -void UIFocusTestNestedLayout2::toggleFocusLoop(axis::Ref* pObjc, Widget::TouchEventType type) +void UIFocusTestNestedLayout2::toggleFocusLoop(ax::Ref* pObjc, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -564,7 +564,7 @@ bool UIFocusTestNestedLayout3::init() return false; } -void UIFocusTestNestedLayout3::toggleFocusLoop(axis::Ref* pObjc, Widget::TouchEventType type) +void UIFocusTestNestedLayout3::toggleFocusLoop(ax::Ref* pObjc, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.h index 39d490ef27..06e84e9add 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.h @@ -49,15 +49,15 @@ public: virtual void onRightKeyPressed(); virtual void onUpKeyPressed(); virtual void onDownKeyPressed(); - virtual void onFocusChanged(axis::ui::Widget* widgetLostFocus, axis::ui::Widget* widgetGetFocus); + virtual void onFocusChanged(ax::ui::Widget* widgetLostFocus, ax::ui::Widget* widgetGetFocus); - void onImageViewClicked(axis::Ref* ref, axis::ui::Widget::TouchEventType touchType); + void onImageViewClicked(ax::Ref* ref, ax::ui::Widget::TouchEventType touchType); protected: - axis::Menu* _dpadMenu; - axis::ui::Widget* _firstFocusedWidget; - axis::EventListenerFocus* _eventListener; - axis::ui::Button* _toggleButton; + ax::Menu* _dpadMenu; + ax::ui::Widget* _firstFocusedWidget; + ax::EventListenerFocus* _eventListener; + ax::ui::Button* _toggleButton; }; class UIFocusTestHorizontal : public UIFocusTestBase @@ -70,11 +70,11 @@ public: virtual bool init() override; - void toggleFocusLoop(axis::Ref*, axis::ui::Widget::TouchEventType); + void toggleFocusLoop(ax::Ref*, ax::ui::Widget::TouchEventType); protected: - axis::ui::Layout* _horizontalLayout; - axis::ui::Text* _loopText; + ax::ui::Layout* _horizontalLayout; + ax::ui::Text* _loopText; }; class UIFocusTestVertical : public UIFocusTestBase @@ -87,11 +87,11 @@ public: virtual bool init() override; - void toggleFocusLoop(axis::Ref*, axis::ui::Widget::TouchEventType); + void toggleFocusLoop(ax::Ref*, ax::ui::Widget::TouchEventType); protected: - axis::ui::Layout* _verticalLayout; - axis::ui::Text* _loopText; + ax::ui::Layout* _verticalLayout; + ax::ui::Text* _loopText; }; class UIFocusTestNestedLayout1 : public UIFocusTestBase @@ -104,11 +104,11 @@ public: virtual bool init() override; - void toggleFocusLoop(axis::Ref*, axis::ui::Widget::TouchEventType); + void toggleFocusLoop(ax::Ref*, ax::ui::Widget::TouchEventType); protected: - axis::ui::Layout* _verticalLayout; - axis::ui::Text* _loopText; + ax::ui::Layout* _verticalLayout; + ax::ui::Text* _loopText; }; class UIFocusTestNestedLayout2 : public UIFocusTestBase @@ -121,11 +121,11 @@ public: virtual bool init() override; - void toggleFocusLoop(axis::Ref*, axis::ui::Widget::TouchEventType); + void toggleFocusLoop(ax::Ref*, ax::ui::Widget::TouchEventType); protected: - axis::ui::Layout* _horizontalLayout; - axis::ui::Text* _loopText; + ax::ui::Layout* _horizontalLayout; + ax::ui::Text* _loopText; }; class UIFocusTestNestedLayout3 : public UIFocusTestBase @@ -138,11 +138,11 @@ public: virtual bool init() override; - void toggleFocusLoop(axis::Ref*, axis::ui::Widget::TouchEventType); + void toggleFocusLoop(ax::Ref*, ax::ui::Widget::TouchEventType); protected: - axis::ui::Layout* _verticalLayout; - axis::ui::Text* _loopText; + ax::ui::Layout* _verticalLayout; + ax::ui::Text* _loopText; }; #endif /* defined(__cocos2d_tests__UIFocusTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp index ed57bf932d..2067eb16f0 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp @@ -74,9 +74,9 @@ bool UIImageViewTest::init() return false; } -void UIImageViewTest::printWidgetResources(axis::Ref* sender) +void UIImageViewTest::printWidgetResources(ax::Ref* sender) { - axis::ResourceData textureFile = _image->getRenderFile(); + ax::ResourceData textureFile = _image->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h index 8508f45942..47b734a1d8 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h @@ -37,10 +37,10 @@ public: virtual bool init() override; - void printWidgetResources(axis::Ref* sender); + void printWidgetResources(ax::Ref* sender); protected: - axis::ui::ImageView* _image; + ax::ui::ImageView* _image; }; class UIImageViewTest_Scale9 : public UIScene diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp index 4f48c8b932..8670c8a96e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp @@ -294,9 +294,9 @@ bool UILayoutTest_BackGroundImage::init() return false; } -void UILayoutTest_BackGroundImage::printWidgetResources(axis::Ref* sender) +void UILayoutTest_BackGroundImage::printWidgetResources(ax::Ref* sender) { - axis::ResourceData textureFile = _layout->getRenderFile(); + ax::ResourceData textureFile = _layout->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } @@ -979,7 +979,7 @@ bool UILayout_Clipping_Test::init() Layout* layout1 = Layout::create(); layout1->setClippingEnabled(true); layout1->setContentSize(Size(widgetSize.width / 4, widgetSize.height / 3)); - layout1->setClippingType(axis::ui::Layout::ClippingType::SCISSOR); + layout1->setClippingType(ax::ui::Layout::ClippingType::SCISSOR); layout1->setPosition(Vec2(widgetSize.width / 4.0f, widgetSize.height / 2.0f)); layout1->setAnchorPoint(Vec2(0.5, 0.5)); _uiLayer->addChild(layout1); @@ -988,7 +988,7 @@ bool UILayout_Clipping_Test::init() sublayout1->setClippingEnabled(true); sublayout1->setBackGroundImage("cocosui/Hello.png"); sublayout1->setContentSize(Size(widgetSize.width / 6, widgetSize.width / 2)); - sublayout1->setClippingType(axis::ui::Layout::ClippingType::STENCIL); + sublayout1->setClippingType(ax::ui::Layout::ClippingType::STENCIL); sublayout1->setPosition(Vec2(widgetSize.width / 8.0f + widgetSize.width / 16.0f, widgetSize.height / 6.0f)); sublayout1->setAnchorPoint(Vec2(0.5, 0.5)); sublayout1->runAction(RepeatForever::create(Sequence::createWithTwoActions( @@ -998,7 +998,7 @@ bool UILayout_Clipping_Test::init() Layout* layout2 = Layout::create(); layout2->setClippingEnabled(true); layout2->setContentSize(Size(widgetSize.width / 4, widgetSize.height / 3)); - layout2->setClippingType(axis::ui::Layout::ClippingType::SCISSOR); + layout2->setClippingType(ax::ui::Layout::ClippingType::SCISSOR); layout2->setPosition(Vec2(widgetSize.width * 3.0f / 4.0f, widgetSize.height / 2.0f)); layout2->setAnchorPoint(Vec2(0.5, 0.5)); _uiLayer->addChild(layout2); @@ -1007,7 +1007,7 @@ bool UILayout_Clipping_Test::init() sublayout2->setClippingEnabled(true); sublayout2->setBackGroundImage("cocosui/Hello.png"); sublayout2->setContentSize(Size(widgetSize.width / 6, widgetSize.width / 2)); - sublayout2->setClippingType(axis::ui::Layout::ClippingType::SCISSOR); + sublayout2->setClippingType(ax::ui::Layout::ClippingType::SCISSOR); sublayout2->setPosition(Vec2(widgetSize.width / 8.0f + widgetSize.width / 16.0f, widgetSize.height / 6.0f)); sublayout2->setAnchorPoint(Vec2(0.5, 0.5)); sublayout2->runAction(RepeatForever::create(Sequence::createWithTwoActions( diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h index fcff5c7a38..899ddb0b90 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h @@ -69,10 +69,10 @@ public: CREATE_FUNC(UILayoutTest_BackGroundImage); - void printWidgetResources(axis::Ref* sender); + void printWidgetResources(ax::Ref* sender); protected: - axis::ui::Layout* _layout; + ax::ui::Layout* _layout; }; class UILayoutTest_BackGroundImage_Scale9 : public UIScene @@ -141,10 +141,10 @@ public: CREATE_FUNC(UILayoutComponentTest); virtual bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::LayerColor* _baseLayer; + ax::LayerColor* _baseLayer; }; class UILayoutComponent_Berth_Test : public UILayoutComponentTest diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp index 585aa5392c..b8a4759813 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp @@ -192,7 +192,7 @@ bool UIListViewTest_Vertical::init() return false; } -float UIListViewTest_Vertical::getItemPositionYInView(axis::ui::Widget* item) const +float UIListViewTest_Vertical::getItemPositionYInView(ax::ui::Widget* item) const { auto worldPos = item->getParent()->convertToWorldSpaceAR(item->getPosition()); auto viewPos = this->_listView->convertToNodeSpaceAR(worldPos); @@ -258,14 +258,14 @@ void UIListViewTest_Vertical::selectedItemEvent(Ref* pSender, ListView::EventTyp { switch (type) { - case axis::ui::ListView::EventType::ON_SELECTED_ITEM_START: + case ax::ui::ListView::EventType::ON_SELECTED_ITEM_START: { ListView* listView = static_cast(pSender); auto item = listView->getItem(listView->getCurSelectedIndex()); log("select child start index = %d", item->getTag()); break; } - case axis::ui::ListView::EventType::ON_SELECTED_ITEM_END: + case ax::ui::ListView::EventType::ON_SELECTED_ITEM_END: { ListView* listView = static_cast(pSender); auto item = listView->getItem(listView->getCurSelectedIndex()); @@ -399,7 +399,7 @@ bool UIListViewTest_Horizontal::init() return false; } -float UIListViewTest_Horizontal::getItemPositionXInView(axis::ui::Widget* item) const +float UIListViewTest_Horizontal::getItemPositionXInView(ax::ui::Widget* item) const { auto worldPos = item->getParent()->convertToWorldSpaceAR(item->getPosition()); auto viewPos = this->_listView->convertToNodeSpaceAR(worldPos); @@ -463,14 +463,14 @@ void UIListViewTest_Horizontal::selectedItemEvent(Ref* pSender, ListView::EventT { switch (type) { - case axis::ui::ListView::EventType::ON_SELECTED_ITEM_START: + case ax::ui::ListView::EventType::ON_SELECTED_ITEM_START: { ListView* listView = static_cast(pSender); auto item = listView->getItem(listView->getCurSelectedIndex()); log("select child start index = %d", item->getTag()); break; } - case axis::ui::ListView::EventType::ON_SELECTED_ITEM_END: + case ax::ui::ListView::EventType::ON_SELECTED_ITEM_END: { ListView* listView = static_cast(pSender); auto item = listView->getItem(listView->getCurSelectedIndex()); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h index 229c9489aa..e53e116a95 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h @@ -40,15 +40,15 @@ public: ~UIListViewTest_Vertical(); virtual bool init() override; - void selectedItemEvent(axis::Ref* sender, axis::ui::ListView::EventType type); - void selectedItemEventScrollView(axis::Ref* sender, axis::ui::ScrollView::EventType type); + void selectedItemEvent(ax::Ref* sender, ax::ui::ListView::EventType type); + void selectedItemEventScrollView(ax::Ref* sender, ax::ui::ScrollView::EventType type); virtual void update(float dt) override; protected: - float getItemPositionYInView(axis::ui::Widget* item) const; + float getItemPositionYInView(ax::ui::Widget* item) const; void updateItem(int itemID, int templateID); - axis::ui::Text* _displayValueLabel = nullptr; + ax::ui::Text* _displayValueLabel = nullptr; // How many items we actually spawn, these items will be reused. // Should > listview.width / templateWidth + 2. int _spawnCount = 5; @@ -64,9 +64,9 @@ protected: // Use this value to detect if we are scrolling left or right float _lastContentPosY = 0.f; float _reuseItemOffset = 0.f; - axis::ui::ListView* _listView = nullptr; + ax::ui::ListView* _listView = nullptr; std::vector _array; - axis::ui::Text* _indexLabels[3] = {nullptr}; + ax::ui::Text* _indexLabels[3] = {nullptr}; }; class UIListViewTest_Horizontal : public UIScene @@ -78,14 +78,14 @@ public: ~UIListViewTest_Horizontal(); virtual bool init() override; - void selectedItemEvent(axis::Ref* sender, axis::ui::ListView::EventType type); + void selectedItemEvent(ax::Ref* sender, ax::ui::ListView::EventType type); virtual void update(float dt) override; protected: - float getItemPositionXInView(axis::ui::Widget* item) const; + float getItemPositionXInView(ax::ui::Widget* item) const; void updateItem(int itemID, int templateID); - axis::ui::Text* _displayValueLabel = nullptr; + ax::ui::Text* _displayValueLabel = nullptr; // How many items we actually spawn, these items will be reused. // Should > listview.width / templateWidth + 2. int _spawnCount = 4; @@ -99,7 +99,7 @@ protected: float _updateTimer = 0.f; float _lastContentPosX = 0.f; float _reuseItemOffset = 0.f; - axis::ui::ListView* _listView = nullptr; + ax::ui::ListView* _listView = nullptr; std::vector _array; }; @@ -125,10 +125,10 @@ class UIListViewTest_ScrollToItem : public UIScene { protected: virtual bool init() override; - virtual axis::ui::ScrollView::Direction getListViewDirection() const = 0; + virtual ax::ui::ScrollView::Direction getListViewDirection() const = 0; - axis::ui::ListView* _listView; - axis::ui::Text* _titleLabel; + ax::ui::ListView* _listView; + ax::ui::Text* _titleLabel; int _nextIndex; }; @@ -136,9 +136,9 @@ class UIListViewTest_ScrollToItemVertical : public UIListViewTest_ScrollToItem { public: CREATE_FUNC(UIListViewTest_ScrollToItemVertical); - virtual axis::ui::ScrollView::Direction getListViewDirection() const + virtual ax::ui::ScrollView::Direction getListViewDirection() const { - return axis::ui::ScrollView::Direction::VERTICAL; + return ax::ui::ScrollView::Direction::VERTICAL; } }; @@ -146,9 +146,9 @@ class UIListViewTest_ScrollToItemHorizontal : public UIListViewTest_ScrollToItem { public: CREATE_FUNC(UIListViewTest_ScrollToItemHorizontal); - virtual axis::ui::ScrollView::Direction getListViewDirection() const + virtual ax::ui::ScrollView::Direction getListViewDirection() const { - return axis::ui::ScrollView::Direction::HORIZONTAL; + return ax::ui::ScrollView::Direction::HORIZONTAL; } }; @@ -157,20 +157,20 @@ class UIListViewTest_Magnetic : public UIScene { protected: virtual bool init() override; - virtual axis::ui::ScrollView::Direction getListViewDirection() const = 0; + virtual ax::ui::ScrollView::Direction getListViewDirection() const = 0; - axis::ui::ListView* _listView; - axis::ui::Text* _titleLabel; - axis::ui::Text* _indexLabels[5]; + ax::ui::ListView* _listView; + ax::ui::Text* _titleLabel; + ax::ui::Text* _indexLabels[5]; }; class UIListViewTest_MagneticVertical : public UIListViewTest_Magnetic { public: CREATE_FUNC(UIListViewTest_MagneticVertical); - virtual axis::ui::ScrollView::Direction getListViewDirection() const + virtual ax::ui::ScrollView::Direction getListViewDirection() const { - return axis::ui::ScrollView::Direction::VERTICAL; + return ax::ui::ScrollView::Direction::VERTICAL; } }; @@ -178,9 +178,9 @@ class UIListViewTest_MagneticHorizontal : public UIListViewTest_Magnetic { public: CREATE_FUNC(UIListViewTest_MagneticHorizontal); - virtual axis::ui::ScrollView::Direction getListViewDirection() const + virtual ax::ui::ScrollView::Direction getListViewDirection() const { - return axis::ui::ScrollView::Direction::HORIZONTAL; + return ax::ui::ScrollView::Direction::HORIZONTAL; } }; @@ -189,23 +189,23 @@ class UIListViewTest_Padding : public UIScene { protected: virtual bool init() override; - virtual axis::ui::ScrollView::Direction getListViewDirection() const = 0; + virtual ax::ui::ScrollView::Direction getListViewDirection() const = 0; - void sliderEvent(axis::Ref* pSender, axis::ui::Slider::EventType type); + void sliderEvent(ax::Ref* pSender, ax::ui::Slider::EventType type); - axis::ui::ListView* _listView; - axis::ui::Text* _titleLabel; - axis::ui::Text* _indexLabels[5]; - axis::ui::Text* _paddingLabels[4]; + ax::ui::ListView* _listView; + ax::ui::Text* _titleLabel; + ax::ui::Text* _indexLabels[5]; + ax::ui::Text* _paddingLabels[4]; }; class UIListViewTest_PaddingVertical : public UIListViewTest_Padding { public: CREATE_FUNC(UIListViewTest_PaddingVertical); - virtual axis::ui::ScrollView::Direction getListViewDirection() const + virtual ax::ui::ScrollView::Direction getListViewDirection() const { - return axis::ui::ScrollView::Direction::VERTICAL; + return ax::ui::ScrollView::Direction::VERTICAL; } }; @@ -213,9 +213,9 @@ class UIListViewTest_PaddingHorizontal : public UIListViewTest_Padding { public: CREATE_FUNC(UIListViewTest_PaddingHorizontal); - virtual axis::ui::ScrollView::Direction getListViewDirection() const + virtual ax::ui::ScrollView::Direction getListViewDirection() const { - return axis::ui::ScrollView::Direction::HORIZONTAL; + return ax::ui::ScrollView::Direction::HORIZONTAL; } }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp index d05f9e4ff7..b28bcdfdab 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp @@ -126,9 +126,9 @@ void UILoadingBarTest_Left::update(float delta) loadingBarCopy->setPercent(_count); } -void UILoadingBarTest_Left::printWidgetResources(axis::Ref* sender) +void UILoadingBarTest_Left::printWidgetResources(ax::Ref* sender) { - axis::ResourceData textureFile = _loadingBar->getRenderFile(); + ax::ResourceData textureFile = _loadingBar->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h index 7b4e6c08ec..c0338b9c6d 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h @@ -39,11 +39,11 @@ public: ~UILoadingBarTest_Left(); virtual bool init() override; void update(float delta) override; - void printWidgetResources(axis::Ref* sender); + void printWidgetResources(ax::Ref* sender); protected: int _count; - axis::ui::LoadingBar* _loadingBar; + ax::ui::LoadingBar* _loadingBar; }; class UILoadingBarTest_Right : public UIScene @@ -140,7 +140,7 @@ public: protected: int _count; - axis::ui::LoadingBar* _loadingBar; + ax::ui::LoadingBar* _loadingBar; }; #endif /* defined(__TestCpp__UILoadingBarTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 00f382958d..8a8b23e214 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -104,7 +104,7 @@ bool UIPageViewTest::init() pageView->removeItem(0); pageView->scrollToItem(pageCount - 2); - axis::log("TODO in %s %s %d", __FILE__, __FUNCTION__, __LINE__); + ax::log("TODO in %s %s %d", __FILE__, __FUNCTION__, __LINE__); pageView->setIndicatorIndexNodesOpacity(255); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h index 757c6f22da..9010004ebb 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h @@ -39,10 +39,10 @@ public: ~UIPageViewTest(); virtual bool init() override; - void pageViewEvent(axis::Ref* sender, axis::ui::PageView::EventType type); + void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIPageViewButtonTest : public UIScene @@ -54,11 +54,11 @@ public: ~UIPageViewButtonTest(); virtual bool init() override; - void pageViewEvent(axis::Ref* sender, axis::ui::PageView::EventType type); - void onButtonClicked(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); + void onButtonClicked(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIPageViewTouchPropagationTest : public UIScene @@ -70,11 +70,11 @@ public: ~UIPageViewTouchPropagationTest(); virtual bool init() override; - void pageViewEvent(axis::Ref* sender, axis::ui::PageView::EventType type); - void onButtonClicked(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); + void onButtonClicked(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIPageViewDynamicAddAndRemoveTest : public UIScene @@ -86,11 +86,11 @@ public: ~UIPageViewDynamicAddAndRemoveTest(); virtual bool init() override; - void pageViewEvent(axis::Ref* sender, axis::ui::PageView::EventType type); - void onButtonClicked(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); + void onButtonClicked(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIPageViewJumpToPageTest : public UIScene @@ -103,7 +103,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIPageViewVerticalTest : public UIScene @@ -115,10 +115,10 @@ public: ~UIPageViewVerticalTest(); virtual bool init() override; - void pageViewEvent(axis::Ref* sender, axis::ui::PageView::EventType type); + void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIPageViewDisableTouchTest : public UIScene @@ -131,7 +131,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIPageViewChildSizeTest : public UIScene @@ -143,10 +143,10 @@ public: ~UIPageViewChildSizeTest(); virtual bool init() override; - void pageViewEvent(axis::Ref* sender, axis::ui::PageView::EventType type); + void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIPageViewIndicatorTest : public UIScene @@ -159,7 +159,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; #endif /* defined(__TestCpp__UIPageViewTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp index 8652053b52..4dddb44201 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp @@ -236,7 +236,7 @@ bool UIRadioButtonTwoGroupsTest::init() void UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup1(RadioButton* radioButton, int index, - axis::ui::RadioButtonGroup::EventType type) + ax::ui::RadioButtonGroup::EventType type) { AXASSERT(index == _radioButtonGroups[0]->getSelectedButtonIndex(), "The two indexes must match!"); auto text = StringUtils::format("RadioButtonGroup1 : %d", index); @@ -246,7 +246,7 @@ void UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup1(RadioButton* radioBu void UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup2(RadioButton* radioButton, int index, - axis::ui::RadioButtonGroup::EventType type) + ax::ui::RadioButtonGroup::EventType type) { AXASSERT(index == _radioButtonGroups[1]->getSelectedButtonIndex(), "The two indexes must match!"); auto text = StringUtils::format("RadioButtonGroup2 : %d", index); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.h index 3fe754705d..640fcdd6af 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.h @@ -44,8 +44,8 @@ public: void deleteRadioButton(Ref* sender); private: - axis::ui::RadioButtonGroup* _radioButtonGroup; - axis::ui::Text* _allowNoSelectionText; + ax::ui::RadioButtonGroup* _radioButtonGroup; + ax::ui::Text* _allowNoSelectionText; }; class UIRadioButtonTwoGroupsTest : public UIScene @@ -57,22 +57,22 @@ public: ~UIRadioButtonTwoGroupsTest(); virtual bool init() override; - void onChangedRadioButtonGroup1(axis::ui::RadioButton* radioButton, + void onChangedRadioButtonGroup1(ax::ui::RadioButton* radioButton, int index, - axis::ui::RadioButtonGroup::EventType type); - void onChangedRadioButtonGroup2(axis::ui::RadioButton* radioButton, + ax::ui::RadioButtonGroup::EventType type); + void onChangedRadioButtonGroup2(ax::ui::RadioButton* radioButton, int index, - axis::ui::RadioButtonGroup::EventType type); - void onChangedRadioButtonSelect(axis::ui::RadioButton* radioButton, axis::ui::RadioButton::EventType type); + ax::ui::RadioButtonGroup::EventType type); + void onChangedRadioButtonSelect(ax::ui::RadioButton* radioButton, ax::ui::RadioButton::EventType type); void clearRadioButtonGroup(Ref* sender); protected: void addLog(std::string_view log); - axis::ui::RadioButtonGroup* _radioButtonGroups[2]; - axis::ui::Text* _groupEventLabel; - axis::ui::Text* _buttonEventLabel; - axis::ui::Text* _logConsole; + ax::ui::RadioButtonGroup* _radioButtonGroups[2]; + ax::ui::Text* _groupEventLabel; + ax::ui::Text* _buttonEventLabel; + ax::ui::Text* _logConsole; int _numberOfLogLines; }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.h index c16f2e675f..f9aef0aaaa 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.h @@ -35,12 +35,12 @@ public: CREATE_FUNC(UIRichTextTest); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLBasic : public UIScene @@ -49,12 +49,12 @@ public: CREATE_FUNC(UIRichTextXMLBasic); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLSmallBig : public UIScene @@ -63,12 +63,12 @@ public: CREATE_FUNC(UIRichTextXMLSmallBig); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLColor : public UIScene @@ -77,12 +77,12 @@ public: CREATE_FUNC(UIRichTextXMLColor); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLSUIB : public UIScene @@ -91,12 +91,12 @@ public: CREATE_FUNC(UIRichTextXMLSUIB); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLSUIB2 : public UIScene @@ -105,12 +105,12 @@ public: CREATE_FUNC(UIRichTextXMLSUIB2); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLSUIB3 : public UIScene @@ -119,12 +119,12 @@ public: CREATE_FUNC(UIRichTextXMLSUIB3); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLImg : public UIScene @@ -133,12 +133,12 @@ public: CREATE_FUNC(UIRichTextXMLImg); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLUrl : public UIScene @@ -147,12 +147,12 @@ public: CREATE_FUNC(UIRichTextXMLUrl); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLUrlImg : public UIScene @@ -161,12 +161,12 @@ public: CREATE_FUNC(UIRichTextXMLUrlImg); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLFace : public UIScene @@ -175,12 +175,12 @@ public: CREATE_FUNC(UIRichTextXMLFace); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLBR : public UIScene @@ -189,12 +189,12 @@ public: CREATE_FUNC(UIRichTextXMLBR); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLInvalid : public UIScene @@ -205,7 +205,7 @@ public: bool init() override; protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLOutline : public UIScene @@ -214,12 +214,12 @@ public: CREATE_FUNC(UIRichTextXMLOutline); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLShadow : public UIScene @@ -228,12 +228,12 @@ public: CREATE_FUNC(UIRichTextXMLShadow); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLGlow : public UIScene @@ -242,12 +242,12 @@ public: CREATE_FUNC(UIRichTextXMLGlow); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLExtend : public UIScene @@ -256,12 +256,12 @@ public: CREATE_FUNC(UIRichTextXMLExtend); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; class UIRichTextXMLSpace : public UIScene @@ -270,12 +270,12 @@ public: CREATE_FUNC(UIRichTextXMLSpace); bool init() override; - void touchEvent(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchWrapMode(axis::Ref* sender, axis::ui::Widget::TouchEventType type); - void switchAlignment(axis::Ref* sender, axis::ui::Widget::TouchEventType type); + void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void switchAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); protected: - axis::ui::RichText* _richText; + ax::ui::RichText* _richText; }; #endif /* defined(__TestCpp__UIRichTextTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp index cc138ce345..3b650aa857 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp @@ -105,7 +105,7 @@ bool UIScale9SpriteTest::init() this->addChild(sp1); sp1->runAction((FiniteTimeAction*)action2); - axis::ui::Scale9Sprite* sp2 = ui::Scale9Sprite::create("cocosui/animationbuttonnormal.png"); + ax::ui::Scale9Sprite* sp2 = ui::Scale9Sprite::create("cocosui/animationbuttonnormal.png"); sp2->setPosition(350.0f, 160.0f); sp2->setPreferredSize(sp1->getContentSize() * 1.2f); sp2->setColor(Color3B::GREEN); @@ -160,7 +160,7 @@ bool UIScale9SpriteHierarchialTest::init() this->addChild(sp1); sp1->runAction((FiniteTimeAction*)action2); - axis::ui::Scale9Sprite* sp2 = ui::Scale9Sprite::create("cocosui/animationbuttonnormal.png"); + ax::ui::Scale9Sprite* sp2 = ui::Scale9Sprite::create("cocosui/animationbuttonnormal.png"); sp2->setPreferredSize(sp1->getContentSize() * 1.2f); sp2->setColor(Color3B::GREEN); sp2->setFlippedX(true); @@ -186,7 +186,7 @@ bool UIScale9SpriteTouchTest::init() Size size = Director::getInstance()->getVisibleSize(); auto containerForSprite1 = Node::create(); - auto sprite1 = axis::ui::Scale9Sprite::create("Images/CyanSquare.png"); + auto sprite1 = ax::ui::Scale9Sprite::create("Images/CyanSquare.png"); sprite1->setPosition(origin + Vec2(size.width / 2, size.height / 2) + Vec2(-80.0f, 80.0f)); containerForSprite1->addChild(sprite1); addChild(containerForSprite1, 10); @@ -1182,7 +1182,7 @@ bool UIS9GrayStateOpacityTest::init() return false; } -void UIS9GrayStateOpacityTest::sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type) +void UIS9GrayStateOpacityTest::sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h index 62466d180a..b38345ffa3 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h @@ -314,7 +314,7 @@ class UIS9GrayStateOpacityTest : public UIScene { public: CREATE_FUNC(UIS9GrayStateOpacityTest); - void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type); + void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); virtual bool init() override; }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h index 626f3446a5..4314c91bf8 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h @@ -41,9 +41,9 @@ public: virtual void onEnter() override; protected: - axis::Layer* _uiLayer; - axis::ui::Layout* _widget; - axis::ui::Text* _sceneTitle; + ax::Layer* _uiLayer; + ax::ui::Layout* _widget; + ax::ui::Text* _sceneTitle; }; #endif /* defined(__TestCpp__UIScene__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h index c846b13ac5..f345b21797 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h @@ -40,7 +40,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIScrollViewTest_Horizontal : public UIScene @@ -53,7 +53,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIScrollViewTest_Both : public UIScene @@ -66,7 +66,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIScrollViewTest_ScrollToPercentBothDirection : public UIScene @@ -79,7 +79,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIScrollViewTest_ScrollToPercentBothDirection_Bounce : public UIScene @@ -92,7 +92,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIScrollViewNestTest : public UIScene @@ -105,7 +105,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIScrollViewRotated : public UIScene @@ -118,7 +118,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIScrollViewDisableTest : public UIScene @@ -131,7 +131,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIScrollViewInnerSize : public UIScene @@ -144,7 +144,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIScrollViewTestEvents : public UIScene @@ -156,7 +156,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UIScrollViewStopScrollingTest : public UIScene @@ -170,8 +170,8 @@ public: virtual void update(float dt) override; protected: - axis::ui::Text* _displayValueLabel; - axis::ui::ScrollView* _scrollView; + ax::ui::Text* _displayValueLabel; + ax::ui::ScrollView* _scrollView; float _remainingTime; }; #endif /* defined(__TestCpp__UIScrollViewTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp index 36b24a1bbc..97b54cfd84 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp @@ -100,20 +100,20 @@ void UISliderTest::sliderEvent(Ref* pSender, Slider::EventType type) _displayValueLabel->setString(StringUtils::format("Percent %f", 10000.0 * percent / maxPercent)); } } -void UISliderTest::printWidgetResources(axis::Ref* /*sender*/) +void UISliderTest::printWidgetResources(ax::Ref* /*sender*/) { - axis::ResourceData textureFile = _slider->getBackFile(); + ax::ResourceData textureFile = _slider->getBackFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); - axis::ResourceData progressBarTextureFile = _slider->getProgressBarFile(); + ax::ResourceData progressBarTextureFile = _slider->getProgressBarFile(); AXLOG("progressBarTextureFile Name : %s, Type: %d", progressBarTextureFile.file.c_str(), progressBarTextureFile.type); - axis::ResourceData slidBallNormalTextureFile = _slider->getBallNormalFile(); + ax::ResourceData slidBallNormalTextureFile = _slider->getBallNormalFile(); AXLOG("slidBallNormalTextureFile Name : %s, Type: %d", slidBallNormalTextureFile.file.c_str(), slidBallNormalTextureFile.type); - axis::ResourceData slidBallPressedTextureFile = _slider->getBallPressedFile(); + ax::ResourceData slidBallPressedTextureFile = _slider->getBallPressedFile(); AXLOG("slidBallPressedTextureFile Name : %s, Type: %d", slidBallPressedTextureFile.file.c_str(), slidBallPressedTextureFile.type); - axis::ResourceData slidBallDisabledTextureFile = _slider->getBallDisabledFile(); + ax::ResourceData slidBallDisabledTextureFile = _slider->getBallDisabledFile(); AXLOG("slidBallDisabledTextureFile Name : %s, Type: %d", slidBallDisabledTextureFile.file.c_str(), slidBallDisabledTextureFile.type); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.h index 96e958d12c..57ea8b7624 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.h @@ -38,12 +38,12 @@ public: UISliderTest(); ~UISliderTest(); virtual bool init() override; - void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type); - void printWidgetResources(axis::Ref* sender); + void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); + void printWidgetResources(ax::Ref* sender); protected: - axis::ui::TextBMFont* _displayValueLabel; - axis::ui::Slider* _slider; + ax::ui::TextBMFont* _displayValueLabel; + ax::ui::Slider* _slider; }; class UISliderTest_Scale9 : public UIScene @@ -54,10 +54,10 @@ public: UISliderTest_Scale9(); ~UISliderTest_Scale9(); virtual bool init() override; - void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type); + void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UISliderTest_Scale9_State_Change : public UIScene @@ -68,10 +68,10 @@ public: UISliderTest_Scale9_State_Change(); ~UISliderTest_Scale9_State_Change(); virtual bool init() override; - void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type); + void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UISliderNormalDefaultTest : public UIScene @@ -84,7 +84,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UISliderDisabledDefaultTest : public UIScene @@ -97,7 +97,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UISliderNewEventCallbackTest : public UIScene @@ -110,7 +110,7 @@ public: virtual bool init() override; protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UISliderIssue12249Test : public UIScene @@ -121,9 +121,9 @@ public: UISliderIssue12249Test(); ~UISliderIssue12249Test(); virtual bool init() override; - void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type); + void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); protected: - axis::ui::TextBMFont* _displayValueLabel; + ax::ui::TextBMFont* _displayValueLabel; }; #endif /* defined(__TestCpp__UISliderTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp index de393de4f4..4e11cd2943 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp @@ -73,9 +73,9 @@ bool UITextAtlasTest::init() } return false; } -void UITextAtlasTest::printWidgetResources(axis::Ref* sender) +void UITextAtlasTest::printWidgetResources(ax::Ref* sender) { - axis::ResourceData textureFile = _textAtlas->getRenderFile(); + ax::ResourceData textureFile = _textAtlas->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } @@ -123,8 +123,8 @@ bool UITextAtlasETC1ShadowTest::init() } return false; } -void UITextAtlasETC1ShadowTest::printWidgetResources(axis::Ref* sender) +void UITextAtlasETC1ShadowTest::printWidgetResources(ax::Ref* sender) { - axis::ResourceData textureFile = _textAtlas->getRenderFile(); + ax::ResourceData textureFile = _textAtlas->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.h index 0eb74a8aa4..b0fa8ee323 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.h @@ -35,10 +35,10 @@ public: CREATE_FUNC(UITextAtlasTest); virtual bool init() override; - void printWidgetResources(axis::Ref* sender); + void printWidgetResources(ax::Ref* sender); protected: - axis::ui::TextAtlas* _textAtlas; + ax::ui::TextAtlas* _textAtlas; }; class UITextAtlasETC1ShadowTest : public UIScene @@ -47,10 +47,10 @@ public: CREATE_FUNC(UITextAtlasETC1ShadowTest); virtual bool init() override; - void printWidgetResources(axis::Ref* sender); + void printWidgetResources(ax::Ref* sender); protected: - axis::ui::TextAtlas* _textAtlas; + ax::ui::TextAtlas* _textAtlas; }; #endif /* defined(__TestCpp__UITextAtlasTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp index 5e27fecec6..0ab632219c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp @@ -66,8 +66,8 @@ bool UITextBMFontTest::init() } return false; } -void UITextBMFontTest::printWidgetResources(axis::Ref* sender) +void UITextBMFontTest::printWidgetResources(ax::Ref* sender) { - axis::ResourceData textureFile = _textBMFont->getRenderFile(); + ax::ResourceData textureFile = _textBMFont->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h index 6a550eea32..a13ee90992 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h @@ -36,10 +36,10 @@ public: CREATE_FUNC(UITextBMFontTest) virtual bool init() override; - void printWidgetResources(axis::Ref* sender); + void printWidgetResources(ax::Ref* sender); protected: - axis::ui::TextBMFont* _textBMFont; + ax::ui::TextBMFont* _textBMFont; }; #endif /* defined(__TestCpp__UITextBMFontTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h index b88a212627..bd22424449 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h @@ -38,10 +38,10 @@ public: UITextFieldTest(); ~UITextFieldTest(); virtual bool init() override; - void textFieldEvent(axis::Ref* sender, axis::ui::TextField::EventType type); + void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UITextFieldTest_MaxLength : public UIScene @@ -52,10 +52,10 @@ public: UITextFieldTest_MaxLength(); ~UITextFieldTest_MaxLength(); virtual bool init() override; - void textFieldEvent(axis::Ref* sender, axis::ui::TextField::EventType type); + void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UITextFieldTest_Password : public UIScene @@ -66,10 +66,10 @@ public: UITextFieldTest_Password(); ~UITextFieldTest_Password(); virtual bool init() override; - void textFieldEvent(axis::Ref* sender, axis::ui::TextField::EventType type); + void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UITextFieldTest_LineWrap : public UIScene @@ -80,10 +80,10 @@ public: UITextFieldTest_LineWrap(); ~UITextFieldTest_LineWrap(); virtual bool init() override; - void textFieldEvent(axis::Ref* sender, axis::ui::TextField::EventType type); + void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UITextFieldTest_TrueTypeFont : public UIScene @@ -94,10 +94,10 @@ public: UITextFieldTest_TrueTypeFont(); ~UITextFieldTest_TrueTypeFont(); virtual bool init() override; - void textFieldEvent(axis::Ref* sender, axis::ui::TextField::EventType type); + void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UITextFieldTest_BMFont : public UIScene @@ -108,10 +108,10 @@ public: UITextFieldTest_BMFont(); ~UITextFieldTest_BMFont(); virtual bool init() override; - void textFieldEvent(axis::Ref* sender, axis::ui::TextField::EventType type); + void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; class UITextFieldTest_PlaceHolderColor : public UIScene @@ -122,9 +122,9 @@ public: UITextFieldTest_PlaceHolderColor(); ~UITextFieldTest_PlaceHolderColor(); virtual bool init() override; - void textFieldEvent(axis::Ref* sender, axis::ui::TextField::EventType type); + void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); protected: - axis::ui::Text* _displayValueLabel; + ax::ui::Text* _displayValueLabel; }; #endif /* defined(__TestCpp__UITextFieldTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp index eaba8745fb..55d76a95ba 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp @@ -285,7 +285,7 @@ void VideoPlayerTest::videoEventCallback(Ref* sender, VideoPlayer::EventType eve SimpleVideoPlayerTest::SimpleVideoPlayerTest() { _videoPlayer = nullptr; - _style = axis::ui::VideoPlayer::StyleType::NONE; + _style = ax::ui::VideoPlayer::StyleType::NONE; _userInputEnabled = true; _switchUserInputEnabled = nullptr; @@ -305,12 +305,12 @@ void SimpleVideoPlayerTest::updateButtonsTexts() std::string str = " - "; switch (_style) { - case axis::ui::VideoPlayer::StyleType::NONE: + case ax::ui::VideoPlayer::StyleType::NONE: _switchUserInputEnabled->setVisible(false); str = "< NO Sytle >"; break; - case axis::ui::VideoPlayer::StyleType::DEFAULT: + case ax::ui::VideoPlayer::StyleType::DEFAULT: str = "< Default Style >"; _switchUserInputEnabled->setVisible(true); break; @@ -381,12 +381,12 @@ void SimpleVideoPlayerTest::switchStyleCallback(Ref* sender) { switch (_style) { - case axis::ui::VideoPlayer::StyleType::NONE: - _style = axis::ui::VideoPlayer::StyleType::DEFAULT; + case ax::ui::VideoPlayer::StyleType::NONE: + _style = ax::ui::VideoPlayer::StyleType::DEFAULT; break; - case axis::ui::VideoPlayer::StyleType::DEFAULT: - _style = axis::ui::VideoPlayer::StyleType::NONE; + case ax::ui::VideoPlayer::StyleType::DEFAULT: + _style = ax::ui::VideoPlayer::StyleType::NONE; break; default: diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h index f5eec92964..ce5fb55da6 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h @@ -37,22 +37,22 @@ public: virtual bool init() override; - void menuCloseCallback(axis::Ref* sender); + void menuCloseCallback(ax::Ref* sender); - void menuRatioCallback(axis::Ref* sender); - void menuResourceVideoCallback(axis::Ref* sender); - void menuOnlineVideoCallback(axis::Ref* sender); + void menuRatioCallback(ax::Ref* sender); + void menuResourceVideoCallback(ax::Ref* sender); + void menuOnlineVideoCallback(ax::Ref* sender); - void menuFullScreenCallback(axis::Ref* sender); - void menuPauseCallback(axis::Ref* sender); - void menuResumeCallback(axis::Ref* sender); - void menuStopCallback(axis::Ref* sender); - void menuHintCallback(axis::Ref* sender); - void menuLoopCallback(axis::Ref* sender); + void menuFullScreenCallback(ax::Ref* sender); + void menuPauseCallback(ax::Ref* sender); + void menuResumeCallback(ax::Ref* sender); + void menuStopCallback(ax::Ref* sender); + void menuHintCallback(ax::Ref* sender); + void menuLoopCallback(ax::Ref* sender); - void sliderCallback(axis::Ref* sender, axis::ui::Slider::EventType eventType); + void sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType eventType); - void videoEventCallback(axis::Ref* sender, axis::ui::VideoPlayer::EventType eventType); + void videoEventCallback(ax::Ref* sender, ax::ui::VideoPlayer::EventType eventType); void onEnter() override; void onExit() override; @@ -61,10 +61,10 @@ private: void createVideo(); void createSlider(); - axis::ui::VideoPlayer* _videoPlayer = nullptr; - axis::Label* _videoStateLabel; - axis::Label* _loopStatusLabel; - axis::Rect _visibleRect; + ax::ui::VideoPlayer* _videoPlayer = nullptr; + ax::Label* _videoStateLabel; + ax::Label* _loopStatusLabel; + ax::Rect _visibleRect; }; class SimpleVideoPlayerTest : public UIScene @@ -76,9 +76,9 @@ public: virtual bool init() override; - void menuCloseCallback(axis::Ref* sender); - void switchStyleCallback(axis::Ref* sender); - void switchUserInputCallback(axis::Ref* sender); + void menuCloseCallback(ax::Ref* sender); + void switchStyleCallback(ax::Ref* sender); + void switchUserInputCallback(ax::Ref* sender); void onEnter() override; void onExit() override; @@ -86,14 +86,14 @@ public: private: void createVideo(); - axis::Rect _visibleRect; - axis::ui::VideoPlayer* _videoPlayer = nullptr; + ax::Rect _visibleRect; + ax::ui::VideoPlayer* _videoPlayer = nullptr; - axis::MenuItemFont* _switchUserInputEnabled; - axis::MenuItemFont* _switchStyle; + ax::MenuItemFont* _switchUserInputEnabled; + ax::MenuItemFont* _switchStyle; bool _userInputEnabled; - axis::ui::VideoPlayer::StyleType _style; + ax::ui::VideoPlayer::StyleType _style; void updateButtonsTexts(); }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp index 706883cbc3..b4610c4609 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp @@ -39,7 +39,7 @@ bool WebViewTest::init() { Size winSize = Director::getInstance()->getVisibleSize(); - _webView = axis::ui::WebView::create(); + _webView = ax::ui::WebView::create(); _webView->setPosition(winSize / 2); _webView->setContentSize(winSize * 0.5); _webView->loadURL("https://www.baidu.com"); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.h index 7805a54357..6449f64303 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.h @@ -37,12 +37,12 @@ public: CREATE_FUNC(WebViewTest); virtual bool init() override; - bool onWebViewShouldStartLoading(axis::ui::WebView* sender, std::string_view url); - void onWebViewDidFinishLoading(axis::ui::WebView* sender, std::string_view url); - void onWebViewDidFailLoading(axis::ui::WebView* sender, std::string_view url); + bool onWebViewShouldStartLoading(ax::ui::WebView* sender, std::string_view url); + void onWebViewDidFinishLoading(ax::ui::WebView* sender, std::string_view url); + void onWebViewDidFailLoading(ax::ui::WebView* sender, std::string_view url); private: - axis::ui::WebView* _webView; + ax::ui::WebView* _webView; }; #endif /* defined(__cocos2d_tests__UIWebViewTest__) */ diff --git a/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp b/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp index 6661f9e7b7..cbf997d213 100644 --- a/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp +++ b/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp @@ -771,7 +771,7 @@ void UIHelperSubStringTest::onEnter() { UnitTestDemo::onEnter(); - using axis::ui::Helper; + using ax::ui::Helper; { // Trivial case std::string source = "abcdefghij"; @@ -884,7 +884,7 @@ void ParseIntegerListTest::onEnter() UnitTestDemo::onEnter(); { - using axis::utils::parseIntegerList; + using ax::utils::parseIntegerList; std::vector res1{}; EXPECT_EQ(res1, parseIntegerList("")); diff --git a/tests/cpp-tests/Classes/UnitTest/UnitTest.h b/tests/cpp-tests/Classes/UnitTest/UnitTest.h index f2ac54b1d6..ef41d367ee 100644 --- a/tests/cpp-tests/Classes/UnitTest/UnitTest.h +++ b/tests/cpp-tests/Classes/UnitTest/UnitTest.h @@ -43,7 +43,7 @@ public: CREATE_FUNC(TemplateVectorTest); virtual void onEnter() override; virtual std::string subtitle() const override; - void constFunc(const axis::Vector& vec) const; + void constFunc(const ax::Vector& vec) const; }; class TemplateMapTest : public UnitTestDemo @@ -52,7 +52,7 @@ public: CREATE_FUNC(TemplateMapTest); virtual void onEnter() override; virtual std::string subtitle() const override; - void constFunc(const axis::StringMap& map) const; + void constFunc(const ax::StringMap& map) const; }; class ValueTest : public UnitTestDemo @@ -61,7 +61,7 @@ public: CREATE_FUNC(ValueTest); virtual void onEnter() override; virtual std::string subtitle() const override; - void constFunc(const axis::Value& value) const; + void constFunc(const ax::Value& value) const; }; class UTFConversionTest : public UnitTestDemo diff --git a/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.h b/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.h index b88928edfe..c1f2f56276 100644 --- a/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.h +++ b/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.h @@ -41,7 +41,7 @@ public: private: void doTest(); void printValue(); - axis::Label* _label; + ax::Label* _label; }; #endif // _USERDEFAULT_TEST_H_ diff --git a/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp b/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp index 8527bf096c..663343d7d7 100644 --- a/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp +++ b/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp @@ -38,7 +38,7 @@ VibrateTests::VibrateTests() namespace { -class TextButton : public axis::Label +class TextButton : public ax::Label { public: static TextButton* create(std::string_view text, const std::function& onTriggered) diff --git a/tests/cpp-tests/Classes/VisibleRect.h b/tests/cpp-tests/Classes/VisibleRect.h index a587747c7e..9c6987b54a 100644 --- a/tests/cpp-tests/Classes/VisibleRect.h +++ b/tests/cpp-tests/Classes/VisibleRect.h @@ -30,21 +30,21 @@ class VisibleRect { public: - static axis::Rect getVisibleRect(); + static ax::Rect getVisibleRect(); - static axis::Vec2 left(); - static axis::Vec2 right(); - static axis::Vec2 top(); - static axis::Vec2 bottom(); - static axis::Vec2 center(); - static axis::Vec2 leftTop(); - static axis::Vec2 rightTop(); - static axis::Vec2 leftBottom(); - static axis::Vec2 rightBottom(); + static ax::Vec2 left(); + static ax::Vec2 right(); + static ax::Vec2 top(); + static ax::Vec2 bottom(); + static ax::Vec2 center(); + static ax::Vec2 leftTop(); + static ax::Vec2 rightTop(); + static ax::Vec2 leftBottom(); + static ax::Vec2 rightBottom(); private: static void lazyInit(); - static axis::Rect s_visibleRect; + static ax::Rect s_visibleRect; }; #endif /* __VISIBLERECT_H__ */ diff --git a/tests/cpp-tests/Classes/ZipTest/ZipTests.cpp b/tests/cpp-tests/Classes/ZipTest/ZipTests.cpp index 4cb246174c..559be53209 100644 --- a/tests/cpp-tests/Classes/ZipTest/ZipTests.cpp +++ b/tests/cpp-tests/Classes/ZipTest/ZipTests.cpp @@ -50,7 +50,7 @@ static void unzipTest(Label* label, { auto fu = FileUtils::getInstance(); - axis::Data origContent; + ax::Data origContent; const int BUFF_SIZE = 1024; char* buff = nullptr; std::vector fileData; diff --git a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.h b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.h index e6bf86bfca..7cbe1e5948 100644 --- a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.h +++ b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.h @@ -49,8 +49,8 @@ public: virtual std::string subtitle() const override; protected: - axis::Sprite* sprite1; - axis::Sprite* sprite2; + ax::Sprite* sprite1; + ax::Sprite* sprite2; int counter; }; diff --git a/tests/cpp-tests/Classes/controller.h b/tests/cpp-tests/Classes/controller.h index a73158255a..a2976e2462 100644 --- a/tests/cpp-tests/Classes/controller.h +++ b/tests/cpp-tests/Classes/controller.h @@ -60,7 +60,7 @@ public: void onEnterBackground(); void onEnterForeground(); - bool blockTouchBegan(axis::Touch* touch, axis::Event* event); + bool blockTouchBegan(ax::Touch* touch, ax::Event* event); void setCurrTestSuite(TestSuite* testSuite) { _testSuite = testSuite; } TestSuite* getCurrTestSuite() { return _testSuite; } @@ -88,8 +88,8 @@ private: std::condition_variable _sleepCondition; std::unique_lock* _sleepUniqueLock; - axis::Director* _director; - axis::EventListenerTouchOneByOne* _touchListener; + ax::Director* _director; + ax::EventListenerTouchOneByOne* _touchListener; std::string _logIndentation; }; diff --git a/tests/cpp-tests/Classes/testBasic.h b/tests/cpp-tests/Classes/testBasic.h index 97d7486e36..bdac7483f6 100644 --- a/tests/cpp-tests/Classes/testBasic.h +++ b/tests/cpp-tests/Classes/testBasic.h @@ -32,7 +32,7 @@ * TestScene is retained for compatibility with older versions. * @warning It should soon be removed. */ -class TestScene : public axis::Scene +class TestScene : public ax::Scene { public: TestScene(bool bPortrait = false, bool physics = false) {} diff --git a/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm b/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm index 9d67f19c0a..567a029f8a 100644 --- a/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm +++ b/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm @@ -42,9 +42,9 @@ static AppDelegate s_sharedApplication; - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { - axis::Application* app = axis::Application::getInstance(); + ax::Application* app = ax::Application::getInstance(); app->initGLContextAttrs(); - axis::GLViewImpl::convertAttrs(); + ax::GLViewImpl::convertAttrs(); // Override point for customization after application launch. @@ -53,12 +53,12 @@ static AppDelegate s_sharedApplication; // Init the CCEAGLView CCEAGLView* eaglView = [CCEAGLView viewWithFrame:[window bounds] - pixelFormat:(NSString*)axis::GLViewImpl::_pixelFormat - depthFormat:axis::GLViewImpl::_depthFormat + pixelFormat:(NSString*)ax::GLViewImpl::_pixelFormat + depthFormat:ax::GLViewImpl::_depthFormat preserveBackbuffer:NO sharegroup:nil - multiSampling:axis::GLViewImpl::_multisamplingCount > 0 ? YES : NO - numberOfSamples:axis::GLViewImpl::_multisamplingCount]; + multiSampling:ax::GLViewImpl::_multisamplingCount > 0 ? YES : NO + numberOfSamples:ax::GLViewImpl::_multisamplingCount]; #if !defined(AX_TARGET_OS_TVOS) [eaglView setMultipleTouchEnabled:YES]; @@ -90,8 +90,8 @@ static AppDelegate s_sharedApplication; #endif // IMPORTANT: Setting the GLView should be done after creating the RootViewController - axis::GLView* glView = axis::GLViewImpl::createWithEAGLView(eaglView); - axis::Director::getInstance()->setOpenGLView(glView); + ax::GLView* glView = ax::GLViewImpl::createWithEAGLView(eaglView); + ax::Director::getInstance()->setOpenGLView(glView); app->run(); @@ -107,7 +107,7 @@ static AppDelegate s_sharedApplication; throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ // We don't need to call this method any more. It will interrupt user defined game pause&resume logic - // axis::Director::getInstance()->pause(); + // ax::Director::getInstance()->pause(); } - (void)applicationDidBecomeActive:(UIApplication*)application @@ -117,7 +117,7 @@ static AppDelegate s_sharedApplication; previously in the background, optionally refresh the user interface. */ // We don't need to call this method any more. It will interrupt user defined game pause&resume logic - // axis::Director::getInstance()->resume(); + // ax::Director::getInstance()->resume(); } - (void)applicationDidEnterBackground:(UIApplication*)application @@ -127,7 +127,7 @@ static AppDelegate s_sharedApplication; information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - axis::Application::getInstance()->applicationDidEnterBackground(); + ax::Application::getInstance()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication*)application @@ -136,7 +136,7 @@ static AppDelegate s_sharedApplication; Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - axis::Application::getInstance()->applicationWillEnterForeground(); + ax::Application::getInstance()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication*)application diff --git a/tests/fairygui-tests/Classes/AppDelegate.cpp b/tests/fairygui-tests/Classes/AppDelegate.cpp index 24b1072004..6764864202 100644 --- a/tests/fairygui-tests/Classes/AppDelegate.cpp +++ b/tests/fairygui-tests/Classes/AppDelegate.cpp @@ -5,10 +5,10 @@ USING_NS_AX; -static axis::Size designResolutionSize = axis::Size(1136, 640); -static axis::Size smallResolutionSize = axis::Size(480, 320); -static axis::Size mediumResolutionSize = axis::Size(1024, 768); -static axis::Size largeResolutionSize = axis::Size(2048, 1536); +static ax::Size designResolutionSize = ax::Size(1136, 640); +static ax::Size smallResolutionSize = ax::Size(480, 320); +static ax::Size mediumResolutionSize = ax::Size(1024, 768); +static ax::Size largeResolutionSize = ax::Size(2048, 1536); AppDelegate::AppDelegate() { @@ -42,7 +42,7 @@ bool AppDelegate::applicationDidFinishLaunching() { auto glView = director->getOpenGLView(); if (!glView) { #if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) - glView = GLViewImpl::createWithRect("Examples", axis::Rect(0, 0, 1280, 720)); + glView = GLViewImpl::createWithRect("Examples", ax::Rect(0, 0, 1280, 720)); #else glView = GLViewImpl::create("Examples"); #endif diff --git a/tests/fairygui-tests/Classes/AppDelegate.h b/tests/fairygui-tests/Classes/AppDelegate.h index 04aa48fd89..4a63f86949 100644 --- a/tests/fairygui-tests/Classes/AppDelegate.h +++ b/tests/fairygui-tests/Classes/AppDelegate.h @@ -8,7 +8,7 @@ Private inheritance here hides part of interface from Director. */ -class AppDelegate : private axis::Application +class AppDelegate : private ax::Application { public: AppDelegate(); diff --git a/tests/fairygui-tests/Classes/BasicsScene.cpp b/tests/fairygui-tests/Classes/BasicsScene.cpp index 691849fcfc..09d56b7816 100644 --- a/tests/fairygui-tests/Classes/BasicsScene.cpp +++ b/tests/fairygui-tests/Classes/BasicsScene.cpp @@ -238,10 +238,10 @@ void BasicsScene::playDragDrop() void BasicsScene::playProgress() { GComponent* obj = _demoObjects.at("ProgressBar"); - axis::Director::getInstance()->getScheduler()->schedule( + ax::Director::getInstance()->getScheduler()->schedule( AX_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this, 0.02f, false); obj->addEventListener(UIEventType::Exit, [this](EventContext*) { - axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this); + ax::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this); }); } diff --git a/tests/fairygui-tests/Classes/BasicsScene.h b/tests/fairygui-tests/Classes/BasicsScene.h index 3aa10a2e62..67b60e3fff 100644 --- a/tests/fairygui-tests/Classes/BasicsScene.h +++ b/tests/fairygui-tests/Classes/BasicsScene.h @@ -43,7 +43,7 @@ private: PopupMenu* _pm; GComponent* _popupCom; - axis::Map _demoObjects; + ax::Map _demoObjects; }; diff --git a/tests/fairygui-tests/Classes/DemoScene.h b/tests/fairygui-tests/Classes/DemoScene.h index ec67dff181..f291258f28 100644 --- a/tests/fairygui-tests/Classes/DemoScene.h +++ b/tests/fairygui-tests/Classes/DemoScene.h @@ -6,7 +6,7 @@ USING_NS_FGUI; -class DemoScene : public axis::Scene +class DemoScene : public ax::Scene { public: bool init(); diff --git a/tests/fairygui-tests/proj.ios/AppController.mm b/tests/fairygui-tests/proj.ios/AppController.mm index d300ab4f5d..9e07a62780 100644 --- a/tests/fairygui-tests/proj.ios/AppController.mm +++ b/tests/fairygui-tests/proj.ios/AppController.mm @@ -39,9 +39,9 @@ static AppDelegate s_sharedApplication; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - axis::Application *app = axis::Application::getInstance(); + ax::Application *app = ax::Application::getInstance(); app->initGLContextAttrs(); - axis::GLViewImpl::convertAttrs(); + ax::GLViewImpl::convertAttrs(); // Override point for customization after application launch. @@ -49,12 +49,12 @@ static AppDelegate s_sharedApplication; window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: (NSString*)axis::GLViewImpl::_pixelFormat - depthFormat: axis::GLViewImpl::_depthFormat + pixelFormat: (NSString*)ax::GLViewImpl::_pixelFormat + depthFormat: ax::GLViewImpl::_depthFormat preserveBackbuffer: NO sharegroup: nil - multiSampling: axis::GLViewImpl::_multisamplingCount > 0 ? YES : NO - numberOfSamples: axis::GLViewImpl::_multisamplingCount]; + multiSampling: ax::GLViewImpl::_multisamplingCount > 0 ? YES : NO + numberOfSamples: ax::GLViewImpl::_multisamplingCount]; // Use RootViewController manage CCEAGLView @@ -85,8 +85,8 @@ static AppDelegate s_sharedApplication; } // IMPORTANT: Setting the GLView should be done after creating the RootViewController - axis::GLViewImpl *glView = axis::GLViewImpl::createWithEAGLView(eaglView); - axis::Director::getInstance()->setOpenGLView(glView); + ax::GLViewImpl *glView = ax::GLViewImpl::createWithEAGLView(eaglView); + ax::Director::getInstance()->setOpenGLView(glView); app->run(); return YES; @@ -98,14 +98,14 @@ static AppDelegate s_sharedApplication; Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ - axis::Director::getInstance()->pause(); + ax::Director::getInstance()->pause(); } - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ - axis::Director::getInstance()->resume(); + ax::Director::getInstance()->resume(); } - (void)applicationDidEnterBackground:(UIApplication *)application { @@ -113,14 +113,14 @@ static AppDelegate s_sharedApplication; Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - axis::Application::getInstance()->applicationDidEnterBackground(); + ax::Application::getInstance()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - axis::Application::getInstance()->applicationWillEnterForeground(); + ax::Application::getInstance()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication *)application { diff --git a/tests/live2d-tests/Classes/AppDelegate.cpp b/tests/live2d-tests/Classes/AppDelegate.cpp index 718c3c9008..814a23de44 100644 --- a/tests/live2d-tests/Classes/AppDelegate.cpp +++ b/tests/live2d-tests/Classes/AppDelegate.cpp @@ -25,10 +25,10 @@ using namespace CocosDenshion; USING_NS_AX; -static axis::Size designResolutionSize = axis::Size(LAppDefine::RenderTargetWidth, LAppDefine::RenderTargetHeight); -static axis::Size smallResolutionSize = axis::Size(480, 320); -static axis::Size mediumResolutionSize = axis::Size(1024, 768); -static axis::Size largeResolutionSize = axis::Size(2048, 1536); +static ax::Size designResolutionSize = ax::Size(LAppDefine::RenderTargetWidth, LAppDefine::RenderTargetHeight); +static ax::Size smallResolutionSize = ax::Size(480, 320); +static ax::Size mediumResolutionSize = ax::Size(1024, 768); +static ax::Size largeResolutionSize = ax::Size(2048, 1536); AppDelegate::AppDelegate() { @@ -72,7 +72,7 @@ bool AppDelegate::applicationDidFinishLaunching() if(!glView) { #if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) - glView = GLViewImpl::createWithRect("Demo", axis::Rect(0, 0, designResolutionSize.width, designResolutionSize.height)); + glView = GLViewImpl::createWithRect("Demo", ax::Rect(0, 0, designResolutionSize.width, designResolutionSize.height)); #else glView = GLViewImpl::create("Demo"); #endif @@ -111,7 +111,7 @@ bool AppDelegate::applicationDidFinishLaunching() _cubismOption.LoggingLevel = LAppDefine::CubismLoggingLevel; Csm::CubismFramework::StartUp(&_cubismAllocator, &_cubismOption); - _recreatedEventlistener = axis::EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) + _recreatedEventlistener = ax::EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { LAppLive2DManager::GetInstance()->RecreateRenderer(); }); diff --git a/tests/live2d-tests/Classes/AppDelegate.h b/tests/live2d-tests/Classes/AppDelegate.h index 423cd9b64b..848fec2d35 100644 --- a/tests/live2d-tests/Classes/AppDelegate.h +++ b/tests/live2d-tests/Classes/AppDelegate.h @@ -20,7 +20,7 @@ Private inheritance here hides part of interface from Director. */ -class AppDelegate : private axis::Application +class AppDelegate : private ax::Application { public: AppDelegate(); @@ -48,7 +48,7 @@ public: virtual void applicationWillEnterForeground(); private: - axis::EventListenerCustom* _recreatedEventlistener; + ax::EventListenerCustom* _recreatedEventlistener; LAppAllocator _cubismAllocator; Csm::CubismFramework::Option _cubismOption; diff --git a/tests/live2d-tests/Classes/AppMacros.h b/tests/live2d-tests/Classes/AppMacros.h index 9c2cdf82fa..9b66a7947d 100644 --- a/tests/live2d-tests/Classes/AppMacros.h +++ b/tests/live2d-tests/Classes/AppMacros.h @@ -32,25 +32,25 @@ typedef struct tagResource { - axis::CCSize size; + ax::CCSize size; char directory[100]; } Resource; -static Resource smallResource = {axis::CCSizeMake(480, 320), "iphone"}; -static Resource mediumResource = {axis::CCSizeMake(1024, 768), "ipad"}; -static Resource largeResource = {axis::CCSizeMake(2048, 1536), "ipadhd"}; +static Resource smallResource = {ax::CCSizeMake(480, 320), "iphone"}; +static Resource mediumResource = {ax::CCSizeMake(1024, 768), "ipad"}; +static Resource largeResource = {ax::CCSizeMake(2048, 1536), "ipadhd"}; #if (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_480X320) -static axis::CCSize designResolutionSize = axis::CCSizeMake(480, 320); +static ax::CCSize designResolutionSize = ax::CCSizeMake(480, 320); #elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_1024X768) -static axis::CCSize designResolutionSize = axis::CCSizeMake(1024, 768); +static ax::CCSize designResolutionSize = ax::CCSizeMake(1024, 768); #elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_2048X1536) -static axis::CCSize designResolutionSize = axis::CCSizeMake(2048, 1536); +static ax::CCSize designResolutionSize = ax::CCSizeMake(2048, 1536); #else #error unknown target design resolution! #endif // The font size 24 is designed for small resolution, so we should change it to fit for current design resolution -#define TITLE_FONT_SIZE (axis::CCEGLView::sharedOpenGLView()->getDesignResolutionSize().width / smallResource.size.width * 24) +#define TITLE_FONT_SIZE (ax::CCEGLView::sharedOpenGLView()->getDesignResolutionSize().width / smallResource.size.width * 24) #endif /* __APPMACROS_H__ */ diff --git a/tests/live2d-tests/Classes/LAppLive2DManager.cpp b/tests/live2d-tests/Classes/LAppLive2DManager.cpp index 06b2349887..5725f9b013 100644 --- a/tests/live2d-tests/Classes/LAppLive2DManager.cpp +++ b/tests/live2d-tests/Classes/LAppLive2DManager.cpp @@ -74,8 +74,8 @@ LAppLive2DManager::LAppLive2DManager() CreateShader(); - int width = static_cast(axis::Director::getInstance()->getOpenGLView()->getFrameSize().width); - int height = static_cast(axis::Director::getInstance()->getOpenGLView()->getFrameSize().height); + int width = static_cast(ax::Director::getInstance()->getOpenGLView()->getFrameSize().width); + int height = static_cast(ax::Director::getInstance()->getOpenGLView()->getFrameSize().height); // 画面全体を覆うサイズ _sprite = new LAppSprite(_program); @@ -343,7 +343,7 @@ void LAppLive2DManager::CreateShader() " gl_FragColor = vec4(gl_FragColor.rgb * gl_FragColor.a, gl_FragColor.a);" "}"; - auto program = axis::backend::Device::getInstance()->newProgram(vertexShader, fragmentShader); + auto program = ax::backend::Device::getInstance()->newProgram(vertexShader, fragmentShader); _program = program; } diff --git a/tests/live2d-tests/Classes/LAppLive2DManager.hpp b/tests/live2d-tests/Classes/LAppLive2DManager.hpp index d5ee8df191..4ce9c070f3 100644 --- a/tests/live2d-tests/Classes/LAppLive2DManager.hpp +++ b/tests/live2d-tests/Classes/LAppLive2DManager.hpp @@ -150,6 +150,6 @@ private: LAppSprite* _sprite; ///< テクスチャの単純描画クラス Csm::Rendering::CubismOffscreenFrame_Cocos2dx* _renderBuffer; ///< モードによってはCubismモデル結果をこっちにレンダリング float _clearColor[4]; ///< レンダリングターゲットのクリアカラー - axis::backend::Program* _program; + ax::backend::Program* _program; }; diff --git a/tests/live2d-tests/Classes/LAppModel.cpp b/tests/live2d-tests/Classes/LAppModel.cpp index 0fb35dd919..aa7bb43e39 100644 --- a/tests/live2d-tests/Classes/LAppModel.cpp +++ b/tests/live2d-tests/Classes/LAppModel.cpp @@ -774,7 +774,7 @@ void LAppModel::MakeRenderingTarget() Size visibleSize = Director::getInstance()->getVisibleSize(); Point origin = Director::getInstance()->getVisibleOrigin(); - _renderSprite = RenderTexture::create(frameW, frameH, axis::backend::PixelFormat::RGBA8); + _renderSprite = RenderTexture::create(frameW, frameH, ax::backend::PixelFormat::RGBA8); _renderSprite->setPosition(Point(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y)); _renderSprite->getSprite()->getTexture()->setAntiAliasTexParameters(); _renderSprite->getSprite()->setBlendFunc(BlendFunc::ALPHA_NON_PREMULTIPLIED); @@ -785,11 +785,11 @@ void LAppModel::MakeRenderingTarget() // _renderSpriteのテクスチャを作成する _renderSprite->getSprite()->getTexture()->setTexParameters( - axis::Texture2D::TexParams( - axis::backend::SamplerFilter::LINEAR, // MagFilter - axis::backend::SamplerFilter::LINEAR, // MinFilter - axis::backend::SamplerAddressMode::CLAMP_TO_EDGE, // AddressingMode S - axis::backend::SamplerAddressMode::CLAMP_TO_EDGE // AddressingMode T + ax::Texture2D::TexParams( + ax::backend::SamplerFilter::LINEAR, // MagFilter + ax::backend::SamplerFilter::LINEAR, // MinFilter + ax::backend::SamplerAddressMode::CLAMP_TO_EDGE, // AddressingMode S + ax::backend::SamplerAddressMode::CLAMP_TO_EDGE // AddressingMode T ) ); diff --git a/tests/live2d-tests/Classes/LAppModel.hpp b/tests/live2d-tests/Classes/LAppModel.hpp index 7a1ddb4e25..e5939f1377 100644 --- a/tests/live2d-tests/Classes/LAppModel.hpp +++ b/tests/live2d-tests/Classes/LAppModel.hpp @@ -204,10 +204,10 @@ private: const Csm::CubismId* _idParamEyeBallY; ///< パラメータID: ParamEyeBallXY Csm::Rendering::CubismOffscreenFrame_Cocos2dx* _renderBuffer; ///< モードによってはCubismOffscreenFrameのテクスチャを描画 - axis::RenderTexture* _renderSprite; ///< _renderBufferを描画するスプライト + ax::RenderTexture* _renderSprite; ///< _renderBufferを描画するスプライト float _clearColor[4]; ///< _renderBufferをクリアする際の色 - Csm::csmVector _loadedTextures; - axis::GroupCommand _groupCommand; + Csm::csmVector _loadedTextures; + ax::GroupCommand _groupCommand; }; diff --git a/tests/live2d-tests/Classes/LAppPal.cpp b/tests/live2d-tests/Classes/LAppPal.cpp index ce2048c939..e90326f961 100644 --- a/tests/live2d-tests/Classes/LAppPal.cpp +++ b/tests/live2d-tests/Classes/LAppPal.cpp @@ -40,7 +40,7 @@ void LAppPal::PrintLog(const csmChar* format, ...) csmChar buf[256]; va_start(args, format); vsnprintf(buf, sizeof(buf), format, args); // 標準出力でレンダリング - axis::log("%s", buf); // cocos2dのログ関数で出力 + ax::log("%s", buf); // cocos2dのログ関数で出力 va_end(args); } diff --git a/tests/live2d-tests/Classes/LAppSprite.cpp b/tests/live2d-tests/Classes/LAppSprite.cpp index 73e2a1201d..1bbbbdc315 100644 --- a/tests/live2d-tests/Classes/LAppSprite.cpp +++ b/tests/live2d-tests/Classes/LAppSprite.cpp @@ -29,14 +29,14 @@ void LAppSprite::RenderImmidiate(Csm::Rendering::CubismCommandBuffer_Cocos2dx* c backend::BlendDescriptor* blendDescriptor = drawCommandBuffer->GetCommandDraw()->GetBlendDescriptor(); backend::ProgramState* programState = pipelineDescriptor->programState; - drawCommandBuffer->GetCommandDraw()->GetCommand()->setDrawType(axis::CustomCommand::DrawType::ELEMENT); - drawCommandBuffer->GetCommandDraw()->GetCommand()->setPrimitiveType(axis::backend::PrimitiveType::TRIANGLE); + drawCommandBuffer->GetCommandDraw()->GetCommand()->setDrawType(ax::CustomCommand::DrawType::ELEMENT); + drawCommandBuffer->GetCommandDraw()->GetCommand()->setPrimitiveType(ax::backend::PrimitiveType::TRIANGLE); drawCommandBuffer->CreateVertexBuffer(sizeof(float) * 2, 4 * 2); drawCommandBuffer->CreateIndexBuffer(6); // 画面サイズを取得する - axis::Size visibleSize = axis::Director::getInstance()->getVisibleSize(); - axis::Size winSize = axis::Director::getInstance()->getWinSize(); + ax::Size visibleSize = ax::Director::getInstance()->getVisibleSize(); + ax::Size winSize = ax::Director::getInstance()->getWinSize(); // 頂点データ float positionVertex[] = @@ -59,7 +59,7 @@ void LAppSprite::RenderImmidiate(Csm::Rendering::CubismCommandBuffer_Cocos2dx* c if (!programState) { - programState = new axis::backend::ProgramState(_program); + programState = new ax::backend::ProgramState(_program); } // attribute属性を登録 @@ -73,10 +73,10 @@ void LAppSprite::RenderImmidiate(Csm::Rendering::CubismCommandBuffer_Cocos2dx* c programState->setVertexStride(sizeof(float) * 4); - blendDescriptor->sourceRGBBlendFactor = axis::backend::BlendFactor::ONE; - blendDescriptor->destinationRGBBlendFactor = axis::backend::BlendFactor::ONE_MINUS_SRC_ALPHA; - blendDescriptor->sourceAlphaBlendFactor = axis::backend::BlendFactor::ONE; - blendDescriptor->destinationAlphaBlendFactor = axis::backend::BlendFactor::ONE_MINUS_SRC_ALPHA; + blendDescriptor->sourceRGBBlendFactor = ax::backend::BlendFactor::ONE; + blendDescriptor->destinationRGBBlendFactor = ax::backend::BlendFactor::ONE_MINUS_SRC_ALPHA; + blendDescriptor->sourceAlphaBlendFactor = ax::backend::BlendFactor::ONE; + blendDescriptor->destinationAlphaBlendFactor = ax::backend::BlendFactor::ONE_MINUS_SRC_ALPHA; blendDescriptor->blendEnabled = true; pipelineDescriptor->programState = programState; diff --git a/tests/live2d-tests/Classes/LAppSprite.hpp b/tests/live2d-tests/Classes/LAppSprite.hpp index 83e5a3950e..7def54764e 100644 --- a/tests/live2d-tests/Classes/LAppSprite.hpp +++ b/tests/live2d-tests/Classes/LAppSprite.hpp @@ -71,6 +71,6 @@ private: float _spriteColor[4]; ///< 表示カラー - axis::backend::Program* _program; + ax::backend::Program* _program; }; diff --git a/tests/live2d-tests/Classes/LAppView.cpp b/tests/live2d-tests/Classes/LAppView.cpp index 612e3863f3..2adfc783f7 100644 --- a/tests/live2d-tests/Classes/LAppView.cpp +++ b/tests/live2d-tests/Classes/LAppView.cpp @@ -94,13 +94,13 @@ void LAppView::onExit() delete viewMatrix; } -void LAppView::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) +void LAppView::draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) { DrawNode::draw(renderer, transform, flags); onDraw(transform, flags); } -void LAppView::onDraw(const axis::Mat4& transform, uint32_t flags) +void LAppView::onDraw(const ax::Mat4& transform, uint32_t flags) { _commandBuffer.PushCommandGroup(); @@ -160,7 +160,7 @@ void LAppView::onTouchesMoved(const std::vector& touches, Event* event) live2DMgr->OnDrag(viewX, viewY); } -void LAppView::onTouchesEnded(const std::vector& touches, axis::Event* event) +void LAppView::onTouchesEnded(const std::vector& touches, ax::Event* event) { // タッチ終了 LAppLive2DManager* live2DMgr = LAppLive2DManager::GetInstance(); diff --git a/tests/live2d-tests/Classes/LAppView.hpp b/tests/live2d-tests/Classes/LAppView.hpp index f597425de7..7100c96ad4 100644 --- a/tests/live2d-tests/Classes/LAppView.hpp +++ b/tests/live2d-tests/Classes/LAppView.hpp @@ -16,7 +16,7 @@ #include #include "LAppLive2DManager.hpp" -class LAppView : public axis::DrawNode +class LAppView : public ax::DrawNode { public: LAppView(); @@ -25,12 +25,12 @@ public: virtual void onEnter(); virtual void onExit(); - virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags); - void onDraw(const axis::Mat4& transform, uint32_t flags); + virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags); + void onDraw(const ax::Mat4& transform, uint32_t flags); - void onTouchesBegan(const std::vector& touches, axis::Event* event); - void onTouchesMoved(const std::vector& touches, axis::Event* event); - void onTouchesEnded(const std::vector& touches, axis::Event* event); + void onTouchesBegan(const std::vector& touches, ax::Event* event); + void onTouchesMoved(const std::vector& touches, ax::Event* event); + void onTouchesEnded(const std::vector& touches, ax::Event* event); void updateViewMatrix(float dx, float dy, float cx, float cy, float scale); float transformViewX(float deviceX); diff --git a/tests/live2d-tests/Classes/SampleScene.h b/tests/live2d-tests/Classes/SampleScene.h index a58f94ab2c..bf57308f74 100644 --- a/tests/live2d-tests/Classes/SampleScene.h +++ b/tests/live2d-tests/Classes/SampleScene.h @@ -13,10 +13,10 @@ class LAppView; -class SampleScene : public axis::Scene +class SampleScene : public ax::Scene { public: - static axis::Scene* createScene(); + static ax::Scene* createScene(); static SampleScene* getInstance(); @@ -27,8 +27,8 @@ public: virtual void onExit() override; // a selector callback - void menuCloseCallback(axis::Ref* pSender); - void menuChangeCallback(axis::Ref* pSender); + void menuCloseCallback(ax::Ref* pSender); + void menuChangeCallback(ax::Ref* pSender); // implement the "static create()" method manually CREATE_FUNC(SampleScene); @@ -39,8 +39,8 @@ public: private: LAppView* _pView; - axis::MenuItemImage* _changeItem; - axis::MenuItemImage* _closeItem; + ax::MenuItemImage* _changeItem; + ax::MenuItemImage* _closeItem; }; #endif // __SAMPLE_SCENE_H__ diff --git a/tests/live2d-tests/Classes/TouchManager.cpp b/tests/live2d-tests/Classes/TouchManager.cpp index 78432cf59a..b8a1a2d88b 100644 --- a/tests/live2d-tests/Classes/TouchManager.cpp +++ b/tests/live2d-tests/Classes/TouchManager.cpp @@ -63,7 +63,7 @@ void TouchManager::touchesBegan(float x1, float y1, float x2, float y2) touchSingle = false; } -void TouchManager::touchesMoved(axis::Point touches[], int num) +void TouchManager::touchesMoved(ax::Point touches[], int num) { // 前回のクリック位置に最も近いものを選びだす // pt1、pt2の両点への距離の和が最小となる点の組み合わせを総当たりで探す @@ -72,13 +72,13 @@ void TouchManager::touchesMoved(axis::Point touches[], int num) index2 = 1; for (int i1 = 0; i1 < num; i1 ++) { - axis::Point pp1 = touches[i1]; + ax::Point pp1 = touches[i1]; for (int i2 = 0; i2 < num; i2++) { if (i1 == i2) continue ; - axis::Point pp2 = touches[i2]; + ax::Point pp2 = touches[i2]; int distTotal = ((lastX1 - pp1.x) * (lastX1 - pp1.x) + (lastY1 - pp1.y) * (lastY1 - pp1.y)) + ((lastX2 - pp2.x) * (lastX2 - pp2.x) + (lastY2 - pp2.y) * (lastY2 - pp2.y)); @@ -94,8 +94,8 @@ void TouchManager::touchesMoved(axis::Point touches[], int num) if (minDist2 > 70 * 70 * 2 && num > 2) return; // 処理しない // pt2に一番近い点 - axis::Point pt1 = touches[index1]; - axis::Point pt2 = touches[index2]; + ax::Point pt1 = touches[index1]; + ax::Point pt2 = touches[index2]; touchesMoved(pt1.x, pt1.y, pt2.x, pt2.y); } diff --git a/tests/live2d-tests/Classes/TouchManager.h b/tests/live2d-tests/Classes/TouchManager.h index 8784874d18..b488421b52 100644 --- a/tests/live2d-tests/Classes/TouchManager.h +++ b/tests/live2d-tests/Classes/TouchManager.h @@ -53,7 +53,7 @@ public: void touchesBegan(float deviceX, float deviceY); void touchesBegan(float deviceX1, float deviceY1, float deviceX2, float deviceY2); - void touchesMoved(axis::Point touches[], int num); + void touchesMoved(ax::Point touches[], int num); void touchesMoved(float deviceX, float deviceY); void touchesMoved(float deviceX1, float deviceY1, float deviceX2, float deviceY2); float getFlickDistance(); diff --git a/tests/live2d-tests/proj.ios_mac/ios/AppController.mm b/tests/live2d-tests/proj.ios_mac/ios/AppController.mm index 3ffe805524..e68990bcff 100644 --- a/tests/live2d-tests/proj.ios_mac/ios/AppController.mm +++ b/tests/live2d-tests/proj.ios_mac/ios/AppController.mm @@ -42,11 +42,11 @@ static AppDelegate s_sharedApplication; - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { - axis::Application* app = axis::Application::getInstance(); + ax::Application* app = ax::Application::getInstance(); // Initialize the GLView attributes app->initGLContextAttrs(); - axis::GLViewImpl::convertAttrs(); + ax::GLViewImpl::convertAttrs(); // Override point for customization after application launch. @@ -84,8 +84,8 @@ static AppDelegate s_sharedApplication; } // IMPORTANT: Setting the GLView should be done after creating the RootViewController - axis::GLView* glView = axis::GLViewImpl::createWithEAGLView((__bridge void*)_viewController.view); - axis::Director::getInstance()->setOpenGLView(glView); + ax::GLView* glView = ax::GLViewImpl::createWithEAGLView((__bridge void*)_viewController.view); + ax::Director::getInstance()->setOpenGLView(glView); // run the cocos2d-x game scene app->run(); @@ -102,7 +102,7 @@ static AppDelegate s_sharedApplication; throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ // We don't need to call this method any more. It will interrupt user defined game pause&resume logic - /* axis::Director::getInstance()->pause(); */ + /* ax::Director::getInstance()->pause(); */ } - (void)applicationDidBecomeActive:(UIApplication*)application @@ -112,7 +112,7 @@ static AppDelegate s_sharedApplication; previously in the background, optionally refresh the user interface. */ // We don't need to call this method any more. It will interrupt user defined game pause&resume logic - /* axis::Director::getInstance()->resume(); */ + /* ax::Director::getInstance()->resume(); */ } - (void)applicationDidEnterBackground:(UIApplication*)application @@ -122,7 +122,7 @@ static AppDelegate s_sharedApplication; information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - axis::Application::getInstance()->applicationDidEnterBackground(); + ax::Application::getInstance()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication*)application @@ -131,7 +131,7 @@ static AppDelegate s_sharedApplication; Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - axis::Application::getInstance()->applicationWillEnterForeground(); + ax::Application::getInstance()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication*)application diff --git a/tests/live2d-tests/proj.ios_mac/ios/RootViewController.mm b/tests/live2d-tests/proj.ios_mac/ios/RootViewController.mm index 7afae07746..32a8b28f9d 100644 --- a/tests/live2d-tests/proj.ios_mac/ios/RootViewController.mm +++ b/tests/live2d-tests/proj.ios_mac/ios/RootViewController.mm @@ -46,12 +46,12 @@ customization that is not appropriate for viewDidLoad. { // Initialize the CCEAGLView CCEAGLView* eaglView = [CCEAGLView viewWithFrame:[UIScreen mainScreen].bounds - pixelFormat:(__bridge NSString*)axis::GLViewImpl::_pixelFormat - depthFormat:axis::GLViewImpl::_depthFormat + pixelFormat:(__bridge NSString*)ax::GLViewImpl::_pixelFormat + depthFormat:ax::GLViewImpl::_depthFormat preserveBackbuffer:NO sharegroup:nil - multiSampling:axis::GLViewImpl::_multisamplingCount > 0 ? YES : NO - numberOfSamples:axis::GLViewImpl::_multisamplingCount]; + multiSampling:ax::GLViewImpl::_multisamplingCount > 0 ? YES : NO + numberOfSamples:ax::GLViewImpl::_multisamplingCount]; // Enable or disable multiple touches #if !defined(AX_TARGET_OS_TVOS) @@ -95,7 +95,7 @@ customization that is not appropriate for viewDidLoad. { [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; - auto glView = axis::Director::getInstance()->getOpenGLView(); + auto glView = ax::Director::getInstance()->getOpenGLView(); if (glView) { @@ -104,7 +104,7 @@ customization that is not appropriate for viewDidLoad. if (eaglView) { CGSize s = CGSizeMake([eaglView getWidth], [eaglView getHeight]); - axis::Application::getInstance()->applicationScreenSizeChanged((int)s.width, (int)s.height); + ax::Application::getInstance()->applicationScreenSizeChanged((int)s.width, (int)s.height); } } } diff --git a/tests/lua-tests/project/Classes/AppDelegate.h b/tests/lua-tests/project/Classes/AppDelegate.h index 17fd7a9d38..ea374f9f8e 100644 --- a/tests/lua-tests/project/Classes/AppDelegate.h +++ b/tests/lua-tests/project/Classes/AppDelegate.h @@ -32,7 +32,7 @@ Private inheritance here hides part of interface from Director. */ -class AppDelegate : private axis::Application +class AppDelegate : private ax::Application { public: AppDelegate(); diff --git a/tests/lua-tests/project/Classes/lua_test_bindings.cpp b/tests/lua-tests/project/Classes/lua_test_bindings.cpp index 6b89338f75..c529c185a5 100644 --- a/tests/lua-tests/project/Classes/lua_test_bindings.cpp +++ b/tests/lua-tests/project/Classes/lua_test_bindings.cpp @@ -333,7 +333,7 @@ NS_AX_END int lua_cocos2dx_DrawNode3D_getBlendFunc(lua_State* L) { int argc = 0; - axis::DrawNode3D* cobj = nullptr; + ax::DrawNode3D* cobj = nullptr; bool ok = true; #if _AX_DEBUG >= 1 @@ -345,7 +345,7 @@ int lua_cocos2dx_DrawNode3D_getBlendFunc(lua_State* L) goto tolua_lerror; #endif - cobj = (axis::DrawNode3D*)tolua_tousertype(L, 1, 0); + cobj = (ax::DrawNode3D*)tolua_tousertype(L, 1, 0); #if _AX_DEBUG >= 1 if (!cobj) @@ -360,7 +360,7 @@ int lua_cocos2dx_DrawNode3D_getBlendFunc(lua_State* L) { if (!ok) return 0; - const axis::BlendFunc& ret = cobj->getBlendFunc(); + const ax::BlendFunc& ret = cobj->getBlendFunc(); blendfunc_to_luaval(L, ret); return 1; } @@ -378,7 +378,7 @@ tolua_lerror: int lua_cocos2dx_DrawNode3D_setBlendFunc(lua_State* L) { int argc = 0; - axis::DrawNode3D* cobj = nullptr; + ax::DrawNode3D* cobj = nullptr; bool ok = true; #if _AX_DEBUG >= 1 @@ -390,7 +390,7 @@ int lua_cocos2dx_DrawNode3D_setBlendFunc(lua_State* L) goto tolua_lerror; #endif - cobj = (axis::DrawNode3D*)tolua_tousertype(L, 1, 0); + cobj = (ax::DrawNode3D*)tolua_tousertype(L, 1, 0); #if _AX_DEBUG >= 1 if (!cobj) @@ -403,7 +403,7 @@ int lua_cocos2dx_DrawNode3D_setBlendFunc(lua_State* L) argc = lua_gettop(L) - 1; if (argc == 1) { - axis::BlendFunc arg0; + ax::BlendFunc arg0; ok &= luaval_to_blendfunc(L, 2, &arg0, "ax.Sprite3D:setBlendFunc"); if (!ok) @@ -429,7 +429,7 @@ tolua_lerror: int lua_cocos2dx_DrawNode3D_drawLine(lua_State* L) { int argc = 0; - axis::DrawNode3D* cobj = nullptr; + ax::DrawNode3D* cobj = nullptr; bool ok = true; #if _AX_DEBUG >= 1 @@ -441,7 +441,7 @@ int lua_cocos2dx_DrawNode3D_drawLine(lua_State* L) goto tolua_lerror; #endif - cobj = (axis::DrawNode3D*)tolua_tousertype(L, 1, 0); + cobj = (ax::DrawNode3D*)tolua_tousertype(L, 1, 0); #if _AX_DEBUG >= 1 if (!cobj) @@ -454,9 +454,9 @@ int lua_cocos2dx_DrawNode3D_drawLine(lua_State* L) argc = lua_gettop(L) - 1; if (argc == 3) { - axis::Vec3 arg0; - axis::Vec3 arg1; - axis::Color4F arg2; + ax::Vec3 arg0; + ax::Vec3 arg1; + ax::Color4F arg2; ok &= luaval_to_vec3(L, 2, &arg0, "ax.DrawNode3D:drawLine"); @@ -482,7 +482,7 @@ tolua_lerror: int lua_cocos2dx_DrawNode3D_clear(lua_State* L) { int argc = 0; - axis::DrawNode3D* cobj = nullptr; + ax::DrawNode3D* cobj = nullptr; bool ok = true; #if _AX_DEBUG >= 1 @@ -494,7 +494,7 @@ int lua_cocos2dx_DrawNode3D_clear(lua_State* L) goto tolua_lerror; #endif - cobj = (axis::DrawNode3D*)tolua_tousertype(L, 1, 0); + cobj = (ax::DrawNode3D*)tolua_tousertype(L, 1, 0); #if _AX_DEBUG >= 1 if (!cobj) @@ -526,7 +526,7 @@ tolua_lerror: int lua_cocos2dx_DrawNode3D_drawCube(lua_State* L) { int argc = 0; - axis::DrawNode3D* cobj = nullptr; + ax::DrawNode3D* cobj = nullptr; bool ok = true; #if _AX_DEBUG >= 1 @@ -538,7 +538,7 @@ int lua_cocos2dx_DrawNode3D_drawCube(lua_State* L) goto tolua_lerror; #endif - cobj = (axis::DrawNode3D*)tolua_tousertype(L, 1, 0); + cobj = (ax::DrawNode3D*)tolua_tousertype(L, 1, 0); #if _AX_DEBUG >= 1 if (!cobj) @@ -551,8 +551,8 @@ int lua_cocos2dx_DrawNode3D_drawCube(lua_State* L) argc = lua_gettop(L) - 1; if (argc == 2) { - std::vector arg0; - axis::Color4F arg1; + std::vector arg0; + ax::Color4F arg1; Vec3 vec3; #if _AX_DEBUG >= 1 if (!tolua_istable(L, 2, 0, &tolua_err)) @@ -621,8 +621,8 @@ int lua_cocos2dx_DrawNode3D_create(lua_State* L) { if (!ok) return 0; - axis::DrawNode3D* ret = axis::DrawNode3D::create(); - object_to_luaval(L, "ax.DrawNode3D", (axis::DrawNode3D*)ret); + ax::DrawNode3D* ret = ax::DrawNode3D::create(); + object_to_luaval(L, "ax.DrawNode3D", (ax::DrawNode3D*)ret); return 1; } AXLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ax.DrawNode3D:create", argc, 0); @@ -646,7 +646,7 @@ int lua_register_cocos2dx_DrawNode3D(lua_State* L) tolua_function(L, "drawCube", lua_cocos2dx_DrawNode3D_drawCube); tolua_function(L, "create", lua_cocos2dx_DrawNode3D_create); tolua_endmodule(L); - auto typeName = typeid(axis::DrawNode3D).name(); + auto typeName = typeid(ax::DrawNode3D).name(); g_luaType[reinterpret_cast(typeName)] = "ax.DrawNode3D"; g_typeCast[typeName] = "ax.DrawNode3D"; return 1; @@ -670,13 +670,13 @@ int lua_cocos2dx_ValueTypeJudgeInTable_create(lua_State* L) if (argc == 1) { - axis::ValueMap arg0; + ax::ValueMap arg0; ok &= luaval_to_ccvaluemap(L, 2, &arg0, "ax.ValueTypeJudgeInTable:create"); if (!ok) return 0; - axis::ValueTypeJudgeInTable* ret = axis::ValueTypeJudgeInTable::create(arg0); - object_to_luaval(L, "ax.ValueTypeJudgeInTable", - (axis::ValueTypeJudgeInTable*)ret); + ax::ValueTypeJudgeInTable* ret = ax::ValueTypeJudgeInTable::create(arg0); + object_to_luaval(L, "ax.ValueTypeJudgeInTable", + (ax::ValueTypeJudgeInTable*)ret); return 1; } AXLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ax.ValueTypeJudgeInTable:create", argc, 1); @@ -696,7 +696,7 @@ int lua_register_cocos2dx_ValueTypeJudgeInTable(lua_State* L) tolua_beginmodule(L, "ValueTypeJudgeInTable"); tolua_function(L, "create", lua_cocos2dx_ValueTypeJudgeInTable_create); tolua_endmodule(L); - auto typeName = typeid(axis::ValueTypeJudgeInTable).name(); + auto typeName = typeid(ax::ValueTypeJudgeInTable).name(); g_luaType[reinterpret_cast(typeName)] = "ax.ValueTypeJudgeInTable"; g_typeCast[typeName] = "ax.ValueTypeJudgeInTable"; return 1; diff --git a/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm b/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm index 99cfee170e..1c4037611d 100644 --- a/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm +++ b/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm @@ -41,20 +41,20 @@ static AppDelegate s_sharedApplication; - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { - axis::Application* app = axis::Application::getInstance(); + ax::Application* app = ax::Application::getInstance(); app->initGLContextAttrs(); - axis::GLViewImpl::convertAttrs(); + ax::GLViewImpl::convertAttrs(); // Override point for customization after application launch. // Add the view controller's view to the window and display. window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; CCEAGLView* eaglView = [CCEAGLView viewWithFrame:[window bounds] - pixelFormat:(NSString*)axis::GLViewImpl::_pixelFormat - depthFormat:axis::GLViewImpl::_depthFormat + pixelFormat:(NSString*)ax::GLViewImpl::_pixelFormat + depthFormat:ax::GLViewImpl::_depthFormat preserveBackbuffer:NO sharegroup:nil - multiSampling:axis::GLViewImpl::_multisamplingCount > 0 ? YES : NO - numberOfSamples:axis::GLViewImpl::_multisamplingCount]; + multiSampling:ax::GLViewImpl::_multisamplingCount > 0 ? YES : NO + numberOfSamples:ax::GLViewImpl::_multisamplingCount]; #if !defined(AX_TARGET_OS_TVOS) [eaglView setMultipleTouchEnabled:YES]; @@ -92,8 +92,8 @@ static AppDelegate s_sharedApplication; } // IMPORTANT: Setting the GLView should be done after creating the RootViewController - axis::GLView* glView = axis::GLViewImpl::createWithEAGLView(eaglView); - axis::Director::getInstance()->setOpenGLView(glView); + ax::GLView* glView = ax::GLViewImpl::createWithEAGLView(eaglView); + ax::Director::getInstance()->setOpenGLView(glView); app->run(); return YES; @@ -107,7 +107,7 @@ static AppDelegate s_sharedApplication; it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ - axis::Director::getInstance()->pause(); + ax::Director::getInstance()->pause(); } - (void)applicationDidBecomeActive:(UIApplication*)application @@ -116,7 +116,7 @@ static AppDelegate s_sharedApplication; Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ - axis::Director::getInstance()->resume(); + ax::Director::getInstance()->resume(); } - (void)applicationDidEnterBackground:(UIApplication*)application @@ -126,7 +126,7 @@ static AppDelegate s_sharedApplication; information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - axis::Application::getInstance()->applicationDidEnterBackground(); + ax::Application::getInstance()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication*)application @@ -135,7 +135,7 @@ static AppDelegate s_sharedApplication; Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - axis::Application::getInstance()->applicationWillEnterForeground(); + ax::Application::getInstance()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication*)application @@ -155,7 +155,7 @@ static AppDelegate s_sharedApplication; Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. */ - axis::Director::getInstance()->purgeCachedData(); + ax::Director::getInstance()->purgeCachedData(); } - (void)dealloc