From 7f1d61185fbb0cfd7fc1a637ea5f8fc8672f425a Mon Sep 17 00:00:00 2001 From: aismann Date: Tue, 14 Mar 2023 00:56:07 +0100 Subject: [PATCH] add axmol_ext.h (#1117) --- extensions/ExtensionExport.h | 6 +-- extensions/axmol-ext.h | 49 +++++++++++++++++++ extensions/cocos-ext.h | 21 +------- .../auto/axlua_extension_auto.cpp | 2 +- .../extension/axlua_extension_manual.cpp | 2 +- tests/cpp-tests/Source/AppDelegate.cpp | 2 +- tests/cpp-tests/Source/BaseTest.h | 2 +- .../cpp-tests/Source/Box2DTest/Box2dTest.cpp | 2 +- tests/cpp-tests/Source/Box2DTest/Box2dTest.h | 2 +- .../Source/Box2DTestBed/Box2DTestBed.cpp | 2 +- tests/cpp-tests/Source/Box2DTestBed/test.cpp | 2 +- .../Source/Box2DTestBed/tests/car.cpp | 2 +- .../Source/Box2DTestBed/tests/test.h | 2 +- .../Source/ChipmunkTest/ChipmunkTest.h | 3 +- .../Source/ChipmunkTestBed/ChipmunkTestBed.h | 2 +- .../AssetsManagerExTest/AssetsManagerExTest.h | 2 +- .../TableViewTest/CustomTableViewCell.h | 2 +- .../TableViewTest/TableViewTestScene.h | 2 +- .../cpp-tests/Source/LabelTest/LabelTestNew.h | 2 +- .../HttpClientTest/HttpClientTest.h | 2 +- .../Source/SchedulerTest/SchedulerTest.h | 2 +- .../cpp-tests/Source/ShaderTest/ShaderTest.h | 2 +- .../cpp-tests/Source/ShaderTest/ShaderTest2.h | 2 +- .../UITest/CocoStudioGUITest/UIScene.cpp | 2 +- .../Source/UITest/CocoStudioGUITest/UIScene.h | 2 +- .../Source/lua_assetsmanager_test_sample.cpp | 2 +- 26 files changed, 77 insertions(+), 46 deletions(-) create mode 100644 extensions/axmol-ext.h diff --git a/extensions/ExtensionExport.h b/extensions/ExtensionExport.h index 9b02be92fb..7f5680ee45 100644 --- a/extensions/ExtensionExport.h +++ b/extensions/ExtensionExport.h @@ -22,8 +22,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CCEXTENSIONEXPORT_H__ -#define __CCEXTENSIONEXPORT_H__ +#ifndef __EXTENSIONEXPORT_H__ +#define __EXTENSIONEXPORT_H__ #if (defined(WIN32) && defined(_WINDOWS)) || defined(WINRT) || defined(WP8) # ifdef __MINGW32__ @@ -54,4 +54,4 @@ # define AX_EX_DLL #endif -#endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file +#endif /* __EXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/extensions/axmol-ext.h b/extensions/axmol-ext.h new file mode 100644 index 0000000000..3e725dffc1 --- /dev/null +++ b/extensions/axmol-ext.h @@ -0,0 +1,49 @@ +/**************************************************************************** + Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + + https://axmolengine.github.io/ + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __AXMOL_EXT_H__ +#define __AXMOL_EXT_H__ + +#include "ExtensionMacros.h" + +// Physics integration +#include "physics-nodes/CCPhysicsDebugNode.h" +#include "physics-nodes/CCPhysicsDebugNodeBox2D.h" +#include "physics-nodes/CCPhysicsDebugNodeChipmunk2D.h" +#include "physics-nodes/CCPhysicsSprite.h" +#include "physics-nodes/CCPhysicsSpriteBox2D.h" +#include "physics-nodes/CCPhysicsSpriteChipmunk2D.h" + +#include "assets-manager/AssetsManager.h" +#include "assets-manager/AssetsManagerEx.h" +#include "assets-manager/CCEventAssetsManagerEx.h" +#include "assets-manager/CCEventListenerAssetsManagerEx.h" +#include "assets-manager/Manifest.h" + +// Particle System, include Particle Universe Particle System +#include "Particle3D/CCParticle3DRender.h" +#include "Particle3D/CCParticleSystem3D.h" +#include "Particle3D/PU/CCPUParticleSystem3D.h" + +#endif /* __AXMOL_EXT_H__ */ diff --git a/extensions/cocos-ext.h b/extensions/cocos-ext.h index 0dfc5c7710..56cf979850 100644 --- a/extensions/cocos-ext.h +++ b/extensions/cocos-ext.h @@ -25,25 +25,6 @@ #ifndef __COCOS2D_EXT_H__ #define __COCOS2D_EXT_H__ -#include "ExtensionMacros.h" - -// Physics integration -#include "physics-nodes/CCPhysicsDebugNode.h" -#include "physics-nodes/CCPhysicsDebugNodeBox2D.h" -#include "physics-nodes/CCPhysicsDebugNodeChipmunk2D.h" -#include "physics-nodes/CCPhysicsSprite.h" -#include "physics-nodes/CCPhysicsSpriteBox2D.h" -#include "physics-nodes/CCPhysicsSpriteChipmunk2D.h" - -#include "assets-manager/AssetsManager.h" -#include "assets-manager/AssetsManagerEx.h" -#include "assets-manager/CCEventAssetsManagerEx.h" -#include "assets-manager/CCEventListenerAssetsManagerEx.h" -#include "assets-manager/Manifest.h" - -// Particle System, include Particle Universe Particle System -#include "Particle3D/CCParticle3DRender.h" -#include "Particle3D/CCParticleSystem3D.h" -#include "Particle3D/PU/CCPUParticleSystem3D.h" +#include "axmol-ext.h" #endif /* __COCOS2D_EXT_H__ */ diff --git a/extensions/scripting/lua-bindings/auto/axlua_extension_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_extension_auto.cpp index e6654d5f28..4209a3f93e 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_extension_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_extension_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/axlua_extension_auto.hpp" -#include "cocos-ext.h" +#include "axmol-ext.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" diff --git a/extensions/scripting/lua-bindings/manual/extension/axlua_extension_manual.cpp b/extensions/scripting/lua-bindings/manual/extension/axlua_extension_manual.cpp index 7c67d29646..0129c49849 100644 --- a/extensions/scripting/lua-bindings/manual/extension/axlua_extension_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/extension/axlua_extension_manual.cpp @@ -28,7 +28,7 @@ #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" #include "scripting/lua-bindings/manual/CCLuaValue.h" -#include "cocos-ext.h" +#include "axmol-ext.h" #include "scripting/lua-bindings/manual/CCLuaEngine.h" #include "scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.h" diff --git a/tests/cpp-tests/Source/AppDelegate.cpp b/tests/cpp-tests/Source/AppDelegate.cpp index 24e14e9f50..6a0388e3a3 100644 --- a/tests/cpp-tests/Source/AppDelegate.cpp +++ b/tests/cpp-tests/Source/AppDelegate.cpp @@ -30,7 +30,7 @@ #include "axmol.h" #include "controller.h" #include "BaseTest.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" USING_NS_AX; diff --git a/tests/cpp-tests/Source/BaseTest.h b/tests/cpp-tests/Source/BaseTest.h index e3bdae5434..88b7e7ad90 100644 --- a/tests/cpp-tests/Source/BaseTest.h +++ b/tests/cpp-tests/Source/BaseTest.h @@ -27,7 +27,7 @@ #define _CPPTESTS_BASETEST_H__ #include "axmol.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "GUI/CCControlExtension/CCControlExtensions.h" #include "GUI/CCScrollView/CCScrollView.h" #include "GUI/CCScrollView/CCTableView.h" diff --git a/tests/cpp-tests/Source/Box2DTest/Box2dTest.cpp b/tests/cpp-tests/Source/Box2DTest/Box2dTest.cpp index 91177d79be..09dc7d73d3 100644 --- a/tests/cpp-tests/Source/Box2DTest/Box2dTest.cpp +++ b/tests/cpp-tests/Source/Box2DTest/Box2dTest.cpp @@ -25,7 +25,7 @@ #include "Box2dTest.h" #include "../testResource.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "renderer/CCRenderer.h" #include "renderer/CCCustomCommand.h" diff --git a/tests/cpp-tests/Source/Box2DTest/Box2dTest.h b/tests/cpp-tests/Source/Box2DTest/Box2dTest.h index 682c4fccf0..626ec2d597 100644 --- a/tests/cpp-tests/Source/Box2DTest/Box2dTest.h +++ b/tests/cpp-tests/Source/Box2DTest/Box2dTest.h @@ -29,7 +29,7 @@ #include "axmol.h" #include "box2d/box2d.h" #include "../BaseTest.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" DEFINE_TEST_SUITE(Box2DTests); diff --git a/tests/cpp-tests/Source/Box2DTestBed/Box2DTestBed.cpp b/tests/cpp-tests/Source/Box2DTestBed/Box2DTestBed.cpp index 5373568068..3cd131300a 100644 --- a/tests/cpp-tests/Source/Box2DTestBed/Box2DTestBed.cpp +++ b/tests/cpp-tests/Source/Box2DTestBed/Box2DTestBed.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "ImGui/ImGuiPresenter.h" #include "axmol.h" diff --git a/tests/cpp-tests/Source/Box2DTestBed/test.cpp b/tests/cpp-tests/Source/Box2DTestBed/test.cpp index 47bdf9e69b..8921378a3e 100644 --- a/tests/cpp-tests/Source/Box2DTestBed/test.cpp +++ b/tests/cpp-tests/Source/Box2DTestBed/test.cpp @@ -19,7 +19,7 @@ #include "tests/test.h" #include "tests/settings.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "axmol.h" #include diff --git a/tests/cpp-tests/Source/Box2DTestBed/tests/car.cpp b/tests/cpp-tests/Source/Box2DTestBed/tests/car.cpp index a6aaf83463..2051641bde 100644 --- a/tests/cpp-tests/Source/Box2DTestBed/tests/car.cpp +++ b/tests/cpp-tests/Source/Box2DTestBed/tests/car.cpp @@ -22,7 +22,7 @@ // SOFTWARE. #include "test.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" USING_NS_AX_EXT; diff --git a/tests/cpp-tests/Source/Box2DTestBed/tests/test.h b/tests/cpp-tests/Source/Box2DTestBed/tests/test.h index 7cf97d5842..680a6226c4 100644 --- a/tests/cpp-tests/Source/Box2DTestBed/tests/test.h +++ b/tests/cpp-tests/Source/Box2DTestBed/tests/test.h @@ -20,7 +20,7 @@ #define TEST_H #include "box2d/box2d.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include diff --git a/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.h b/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.h index c67d681a11..479afcbb92 100644 --- a/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.h +++ b/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.h @@ -32,7 +32,7 @@ #include "axmol.h" #include "chipmunk/chipmunk.h" #include "../BaseTest.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" class ChipmunkTest : public TestCase { @@ -58,6 +58,7 @@ private: cpSpace* _space; // strong ref cpShape* _walls[4]; + ax::DrawNode* drawNode; }; DEFINE_TEST_SUITE(ChipmunkTests); diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.h b/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.h index 45f73a1f4f..6eba6ad607 100644 --- a/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.h +++ b/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.h @@ -29,7 +29,7 @@ #include "axmol.h" #include "chipmunk/chipmunk.h" #include "../BaseTest.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "demo/ChipmunkDemo.h" diff --git a/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h b/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h index 5f4719c2c0..5d57f0f882 100644 --- a/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h +++ b/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h @@ -25,7 +25,7 @@ #ifndef __AssetsManagerEx_Test_H__ #define __AssetsManagerEx_Test_H__ -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "../../BaseTest.h" DEFINE_TEST_SUITE(AssetsManagerExTests); diff --git a/tests/cpp-tests/Source/ExtensionsTest/TableViewTest/CustomTableViewCell.h b/tests/cpp-tests/Source/ExtensionsTest/TableViewTest/CustomTableViewCell.h index 64a752d717..05e04648ea 100644 --- a/tests/cpp-tests/Source/ExtensionsTest/TableViewTest/CustomTableViewCell.h +++ b/tests/cpp-tests/Source/ExtensionsTest/TableViewTest/CustomTableViewCell.h @@ -26,7 +26,7 @@ #define __CUSTOMTABELVIEWCELL_H__ #include "axmol.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "GUI/CCControlExtension/CCControlExtensions.h" #include "GUI/CCScrollView/CCScrollView.h" #include "GUI/CCScrollView/CCTableView.h" diff --git a/tests/cpp-tests/Source/ExtensionsTest/TableViewTest/TableViewTestScene.h b/tests/cpp-tests/Source/ExtensionsTest/TableViewTest/TableViewTestScene.h index dac78fac60..42c63559c0 100644 --- a/tests/cpp-tests/Source/ExtensionsTest/TableViewTest/TableViewTestScene.h +++ b/tests/cpp-tests/Source/ExtensionsTest/TableViewTest/TableViewTestScene.h @@ -26,7 +26,7 @@ #define __TABLEVIEWTESTSCENE_H__ #include "axmol.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "BaseTest.h" DEFINE_TEST_SUITE(TableViewTests); diff --git a/tests/cpp-tests/Source/LabelTest/LabelTestNew.h b/tests/cpp-tests/Source/LabelTest/LabelTestNew.h index 9ade9be1d0..a5ef2488f4 100644 --- a/tests/cpp-tests/Source/LabelTest/LabelTestNew.h +++ b/tests/cpp-tests/Source/LabelTest/LabelTestNew.h @@ -28,7 +28,7 @@ #include "../BaseTest.h" #include "renderer/CCCustomCommand.h" #include "ui/CocosGUI.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "cocostudio/LocalizationManager.h" DEFINE_TEST_SUITE(NewLabelTests); diff --git a/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.h b/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.h index c5c40c0ef8..7bd8fcf29f 100644 --- a/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.h +++ b/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.h @@ -26,7 +26,7 @@ #define __HTTP_CLIENT_H__ #include "axmol.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "network/HttpClient.h" #include "BaseTest.h" diff --git a/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.h b/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.h index 29d16669c1..139e9e7c12 100644 --- a/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.h +++ b/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.h @@ -26,7 +26,7 @@ #define _SCHEDULER_TEST_H_ #include "axmol.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "../BaseTest.h" DEFINE_TEST_SUITE(SchedulerTests); diff --git a/tests/cpp-tests/Source/ShaderTest/ShaderTest.h b/tests/cpp-tests/Source/ShaderTest/ShaderTest.h index 27c5b869e0..29a22eed45 100644 --- a/tests/cpp-tests/Source/ShaderTest/ShaderTest.h +++ b/tests/cpp-tests/Source/ShaderTest/ShaderTest.h @@ -26,7 +26,7 @@ #include "ui/CocosGUI.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "../BaseTest.h" DEFINE_TEST_SUITE(ShaderTests); diff --git a/tests/cpp-tests/Source/ShaderTest/ShaderTest2.h b/tests/cpp-tests/Source/ShaderTest/ShaderTest2.h index 9e14628635..bb15dadc23 100644 --- a/tests/cpp-tests/Source/ShaderTest/ShaderTest2.h +++ b/tests/cpp-tests/Source/ShaderTest/ShaderTest2.h @@ -25,7 +25,7 @@ #ifndef _SHADER_TEST2_H_ #define _SHADER_TEST2_H_ -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "../BaseTest.h" DEFINE_TEST_SUITE(Shader2Tests); diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScene.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScene.cpp index 5c46dc6e22..b3e2742460 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScene.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScene.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "UIScene.h" #include "UISceneManager.h" #include "cocostudio/CCSGUIReader.h" diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScene.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScene.h index 4314c91bf8..31c4c684c0 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScene.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScene.h @@ -27,7 +27,7 @@ #define __TestCpp__UIScene__ #include "axmol.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #include "ui/CocosGUI.h" #include "BaseTest.h" diff --git a/tests/lua-tests/Source/lua_assetsmanager_test_sample.cpp b/tests/lua-tests/Source/lua_assetsmanager_test_sample.cpp index 06cfd4d637..f184749e86 100644 --- a/tests/lua-tests/Source/lua_assetsmanager_test_sample.cpp +++ b/tests/lua-tests/Source/lua_assetsmanager_test_sample.cpp @@ -27,7 +27,7 @@ #include "scripting/lua-bindings/manual/tolua_fix.h" #include "cocos2d.h" -#include "extensions/cocos-ext.h" +#include "extensions/axmol-ext.h" #if !defined(_WIN32) # include