mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3
This commit is contained in:
commit
82eb6eeff9
13
AUTHORS
13
AUTHORS
|
@ -811,6 +811,7 @@ Developers:
|
||||||
Added Node::stopAllActionsByTag && ActionManager::removeAllActionsByTag
|
Added Node::stopAllActionsByTag && ActionManager::removeAllActionsByTag
|
||||||
Added getAllTouches() in GLViewProtocol
|
Added getAllTouches() in GLViewProtocol
|
||||||
Precompiled headers improvements
|
Precompiled headers improvements
|
||||||
|
Added Application::openUrl for all supported platforms ecept WP8 and WinRT
|
||||||
|
|
||||||
youknowone
|
youknowone
|
||||||
Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView
|
Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView
|
||||||
|
@ -1011,6 +1012,18 @@ Developers:
|
||||||
wohaaitinciu
|
wohaaitinciu
|
||||||
WebView support on windows
|
WebView support on windows
|
||||||
|
|
||||||
|
guykogus
|
||||||
|
Implemented Application::openUrl for WP8 and WinRT
|
||||||
|
|
||||||
|
tttreal
|
||||||
|
Fixed Label::getStringNumLines()
|
||||||
|
|
||||||
|
hongliang-goudou
|
||||||
|
Fixed the bug that UI animation playing crash if GUI JSON file is loaded again
|
||||||
|
|
||||||
|
yestein
|
||||||
|
Add Cocostudio Armature getOffsetPoints API for Lua
|
||||||
|
|
||||||
Retired Core Developers:
|
Retired Core Developers:
|
||||||
WenSheng Yang
|
WenSheng Yang
|
||||||
Author of windows port, CCTextField,
|
Author of windows port, CCTextField,
|
||||||
|
|
|
@ -1,9 +1,17 @@
|
||||||
cocos2d-x-3.3
|
cocos2d-x-3.3
|
||||||
[NEW] Audio: new audio supports Mac OS X
|
[NEW] Audio: new audio supports Mac OS X
|
||||||
|
[NEW] Application: added openUrl()
|
||||||
|
[NEW] Armature: added getOffsetPoints()
|
||||||
[NEW] Rect: added merge()
|
[NEW] Rect: added merge()
|
||||||
[NEW] Utils: added getCascadeBoundingBox()
|
[NEW] Utils: added getCascadeBoundingBox()
|
||||||
[NEW] UI: `WebView` support on windows
|
[NEW] UI: `WebView` support on windows
|
||||||
|
|
||||||
|
[FIX] Accelerometer: using Accelerometer will freeze app and then crash on WP8
|
||||||
|
[FIX] C++: remove armv7s in VALID_ARCHS for Xcode projects
|
||||||
|
[FIX] Cocos Studio: UI animation playing crash if GUI JSON file is loaded again
|
||||||
|
[FIX] EditBox: view rendereed in wrong position if click EditBox on iOS 8
|
||||||
|
[FIX] Label: getStringNumLines() may returns wrong result if label is dirty
|
||||||
|
[FIX] Lua-binding: may crash if passing two-dimensional table from lua to c++
|
||||||
[FIX] TextFieldTTF: will get wrong characters if using Chinese input method on WP8
|
[FIX] TextFieldTTF: will get wrong characters if using Chinese input method on WP8
|
||||||
|
|
||||||
cocos2d-x-3.3 Sep.20 2014
|
cocos2d-x-3.3 Sep.20 2014
|
||||||
|
|
|
@ -6834,6 +6834,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/chipmunk/include/chipmunk";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/chipmunk/include/chipmunk";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -6866,6 +6867,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/chipmunk/include/chipmunk";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/chipmunk/include/chipmunk";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|
|
@ -939,6 +939,8 @@
|
||||||
A07A52BF1783AF210073F6A7 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };
|
A07A52BF1783AF210073F6A7 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };
|
||||||
A07A52C01783AF250073F6A7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };
|
A07A52C01783AF250073F6A7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };
|
||||||
A07A52C31783B02C0073F6A7 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };
|
A07A52C31783B02C0073F6A7 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };
|
||||||
|
A5030C3519D059DA000E78E7 /* OpenURLTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5030C3319D059DA000E78E7 /* OpenURLTest.cpp */; };
|
||||||
|
A5030C3619D059DA000E78E7 /* OpenURLTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5030C3319D059DA000E78E7 /* OpenURLTest.cpp */; };
|
||||||
B2507B6B192589AF00FA4972 /* Shaders3D in Resources */ = {isa = PBXBuildFile; fileRef = B2507B6A192589AF00FA4972 /* Shaders3D */; };
|
B2507B6B192589AF00FA4972 /* Shaders3D in Resources */ = {isa = PBXBuildFile; fileRef = B2507B6A192589AF00FA4972 /* Shaders3D */; };
|
||||||
B2507B6C192589AF00FA4972 /* Shaders3D in Resources */ = {isa = PBXBuildFile; fileRef = B2507B6A192589AF00FA4972 /* Shaders3D */; };
|
B2507B6C192589AF00FA4972 /* Shaders3D in Resources */ = {isa = PBXBuildFile; fileRef = B2507B6A192589AF00FA4972 /* Shaders3D */; };
|
||||||
B609E67319C18DAD003D0074 /* BillBoardTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B609E67119C18DAD003D0074 /* BillBoardTest.cpp */; };
|
B609E67319C18DAD003D0074 /* BillBoardTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B609E67119C18DAD003D0074 /* BillBoardTest.cpp */; };
|
||||||
|
@ -2963,6 +2965,8 @@
|
||||||
A07A52B91783AE900073F6A7 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };
|
A07A52B91783AE900073F6A7 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };
|
||||||
A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; };
|
A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; };
|
||||||
A07A52C11783B01F0073F6A7 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; };
|
A07A52C11783B01F0073F6A7 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; };
|
||||||
|
A5030C3319D059DA000E78E7 /* OpenURLTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OpenURLTest.cpp; path = OpenURLTest/OpenURLTest.cpp; sourceTree = "<group>"; };
|
||||||
|
A5030C3419D059DA000E78E7 /* OpenURLTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenURLTest.h; path = OpenURLTest/OpenURLTest.h; sourceTree = "<group>"; };
|
||||||
B2507B6A192589AF00FA4972 /* Shaders3D */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Shaders3D; path = "../tests/cpp-tests/Resources/Shaders3D"; sourceTree = "<group>"; };
|
B2507B6A192589AF00FA4972 /* Shaders3D */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Shaders3D; path = "../tests/cpp-tests/Resources/Shaders3D"; sourceTree = "<group>"; };
|
||||||
B609E67119C18DAD003D0074 /* BillBoardTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BillBoardTest.cpp; path = BillBoardTest/BillBoardTest.cpp; sourceTree = "<group>"; };
|
B609E67119C18DAD003D0074 /* BillBoardTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BillBoardTest.cpp; path = BillBoardTest/BillBoardTest.cpp; sourceTree = "<group>"; };
|
||||||
B609E67219C18DAD003D0074 /* BillBoardTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BillBoardTest.h; path = BillBoardTest/BillBoardTest.h; sourceTree = "<group>"; };
|
B609E67219C18DAD003D0074 /* BillBoardTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BillBoardTest.h; path = BillBoardTest/BillBoardTest.h; sourceTree = "<group>"; };
|
||||||
|
@ -5510,6 +5514,7 @@
|
||||||
1AC35B1718CECF0C00F37B72 /* UserDefaultTest */,
|
1AC35B1718CECF0C00F37B72 /* UserDefaultTest */,
|
||||||
1AC35B1A18CECF0C00F37B72 /* VisibleRect.cpp */,
|
1AC35B1A18CECF0C00F37B72 /* VisibleRect.cpp */,
|
||||||
1AC35B1B18CECF0C00F37B72 /* VisibleRect.h */,
|
1AC35B1B18CECF0C00F37B72 /* VisibleRect.h */,
|
||||||
|
A5030C3219D059AB000E78E7 /* OpenURLTest */,
|
||||||
1AC35B1C18CECF0C00F37B72 /* ZwoptexTest */,
|
1AC35B1C18CECF0C00F37B72 /* ZwoptexTest */,
|
||||||
);
|
);
|
||||||
name = Classes;
|
name = Classes;
|
||||||
|
@ -7156,6 +7161,15 @@
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
A5030C3219D059AB000E78E7 /* OpenURLTest */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
A5030C3319D059DA000E78E7 /* OpenURLTest.cpp */,
|
||||||
|
A5030C3419D059DA000E78E7 /* OpenURLTest.h */,
|
||||||
|
);
|
||||||
|
name = OpenURLTest;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
B609E67019C18D90003D0074 /* BillBoardTest */ = {
|
B609E67019C18D90003D0074 /* BillBoardTest */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
@ -8006,6 +8020,7 @@
|
||||||
1AC35B2918CECF0C00F37B72 /* AppDelegate.cpp in Sources */,
|
1AC35B2918CECF0C00F37B72 /* AppDelegate.cpp in Sources */,
|
||||||
29080DA1191B595E0066F8DF /* GUIEditorTest.cpp in Sources */,
|
29080DA1191B595E0066F8DF /* GUIEditorTest.cpp in Sources */,
|
||||||
1AC35B3718CECF0C00F37B72 /* Bug-1159.cpp in Sources */,
|
1AC35B3718CECF0C00F37B72 /* Bug-1159.cpp in Sources */,
|
||||||
|
A5030C3519D059DA000E78E7 /* OpenURLTest.cpp in Sources */,
|
||||||
29080D1C191B574B0066F8DF /* UITest.cpp in Sources */,
|
29080D1C191B574B0066F8DF /* UITest.cpp in Sources */,
|
||||||
1AC35C3118CECF0C00F37B72 /* PerformanceRendererTest.cpp in Sources */,
|
1AC35C3118CECF0C00F37B72 /* PerformanceRendererTest.cpp in Sources */,
|
||||||
1AC35C4518CECF0C00F37B72 /* SceneTest.cpp in Sources */,
|
1AC35C4518CECF0C00F37B72 /* SceneTest.cpp in Sources */,
|
||||||
|
@ -8234,6 +8249,7 @@
|
||||||
1AC35C6018CECF0C00F37B72 /* Paddle.cpp in Sources */,
|
1AC35C6018CECF0C00F37B72 /* Paddle.cpp in Sources */,
|
||||||
29080DBE191B595E0066F8DF /* UIPageViewTest.cpp in Sources */,
|
29080DBE191B595E0066F8DF /* UIPageViewTest.cpp in Sources */,
|
||||||
1AC35BDC18CECF0C00F37B72 /* SceneEditorTest.cpp in Sources */,
|
1AC35BDC18CECF0C00F37B72 /* SceneEditorTest.cpp in Sources */,
|
||||||
|
A5030C3619D059DA000E78E7 /* OpenURLTest.cpp in Sources */,
|
||||||
1AC35B4C18CECF0C00F37B72 /* BugsTest.cpp in Sources */,
|
1AC35B4C18CECF0C00F37B72 /* BugsTest.cpp in Sources */,
|
||||||
1AC35C5218CECF0C00F37B72 /* testBasic.cpp in Sources */,
|
1AC35C5218CECF0C00F37B72 /* testBasic.cpp in Sources */,
|
||||||
1AC35B7A18CECF0C00F37B72 /* EnemyController.cpp in Sources */,
|
1AC35B7A18CECF0C00F37B72 /* EnemyController.cpp in Sources */,
|
||||||
|
@ -8577,6 +8593,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto $(SRCROOT)/../cocos/base";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto $(SRCROOT)/../cocos/base";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -8603,6 +8620,7 @@
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto $(SRCROOT)/../cocos/base";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto $(SRCROOT)/../cocos/base";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
@ -8687,6 +8705,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -8704,6 +8723,7 @@
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
@ -8724,6 +8744,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -8745,6 +8766,7 @@
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
@ -8804,6 +8826,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -8825,6 +8848,7 @@
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
@ -8874,6 +8898,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -8893,6 +8918,7 @@
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
@ -8915,6 +8941,7 @@
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
COMPRESS_PNG_FILES = NO;
|
COMPRESS_PNG_FILES = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -8923,6 +8950,7 @@
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
COMPRESS_PNG_FILES = NO;
|
COMPRESS_PNG_FILES = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
@ -8946,6 +8974,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -8970,6 +8999,7 @@
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1226,6 +1226,15 @@ void Label::computeStringNumLines()
|
||||||
_currNumLines = quantityOfLines;
|
_currNumLines = quantityOfLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Label::getStringNumLines() const {
|
||||||
|
if (_contentDirty)
|
||||||
|
{
|
||||||
|
const_cast<Label*>(this)->updateContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _currNumLines;
|
||||||
|
}
|
||||||
|
|
||||||
int Label::getStringLength() const
|
int Label::getStringLength() const
|
||||||
{
|
{
|
||||||
return static_cast<int>(_currentUTF16String.length());
|
return static_cast<int>(_currentUTF16String.length());
|
||||||
|
|
|
@ -235,7 +235,7 @@ public:
|
||||||
float getAdditionalKerning() const;
|
float getAdditionalKerning() const;
|
||||||
|
|
||||||
// string related stuff
|
// string related stuff
|
||||||
int getStringNumLines() const { return _currNumLines;}
|
int getStringNumLines() const;
|
||||||
int getStringLength() const;
|
int getStringLength() const;
|
||||||
|
|
||||||
FontAtlas* getFontAtlas() { return _fontAtlas; }
|
FontAtlas* getFontAtlas() { return _fontAtlas; }
|
||||||
|
|
|
@ -30,6 +30,7 @@ THE SOFTWARE.
|
||||||
#include "base/CCCamera.h"
|
#include "base/CCCamera.h"
|
||||||
#include "base/CCEventDispatcher.h"
|
#include "base/CCEventDispatcher.h"
|
||||||
#include "base/CCEventListenerCustom.h"
|
#include "base/CCEventListenerCustom.h"
|
||||||
|
#include "renderer/CCRenderer.h"
|
||||||
#include "deprecated/CCString.h"
|
#include "deprecated/CCString.h"
|
||||||
|
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
@ -124,6 +125,44 @@ void Scene::onProjectionChanged(EventCustom* event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Scene::render(Renderer* renderer)
|
||||||
|
{
|
||||||
|
auto director = Director::getInstance();
|
||||||
|
Camera* defaultCamera = nullptr;
|
||||||
|
for (const auto& camera : _cameras)
|
||||||
|
{
|
||||||
|
Camera::_visitingCamera = camera;
|
||||||
|
if (Camera::_visitingCamera->getCameraFlag() == CameraFlag::DEFAULT)
|
||||||
|
{
|
||||||
|
defaultCamera = Camera::_visitingCamera;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||||
|
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix());
|
||||||
|
|
||||||
|
//visit the scene
|
||||||
|
visit(renderer, Mat4::IDENTITY, 0);
|
||||||
|
renderer->render();
|
||||||
|
|
||||||
|
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||||
|
}
|
||||||
|
//draw with default camera
|
||||||
|
if (defaultCamera)
|
||||||
|
{
|
||||||
|
Camera::_visitingCamera = defaultCamera;
|
||||||
|
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||||
|
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix());
|
||||||
|
|
||||||
|
//visit the scene
|
||||||
|
visit(renderer, Mat4::IDENTITY, 0);
|
||||||
|
renderer->render();
|
||||||
|
|
||||||
|
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||||
|
}
|
||||||
|
Camera::_visitingCamera = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
void Scene::addChild(Node* child, int zOrder, int tag)
|
void Scene::addChild(Node* child, int zOrder, int tag)
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,6 +34,7 @@ THE SOFTWARE.
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
class Camera;
|
class Camera;
|
||||||
|
class Renderer;
|
||||||
class EventListenerCustom;
|
class EventListenerCustom;
|
||||||
class EventCustom;
|
class EventCustom;
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
@ -72,6 +73,9 @@ public:
|
||||||
/** get all cameras */
|
/** get all cameras */
|
||||||
const std::vector<Camera*>& getCameras() const { return _cameras; }
|
const std::vector<Camera*>& getCameras() const { return _cameras; }
|
||||||
|
|
||||||
|
/** render the scene */
|
||||||
|
void render(Renderer* renderer);
|
||||||
|
|
||||||
CC_CONSTRUCTOR_ACCESS:
|
CC_CONSTRUCTOR_ACCESS:
|
||||||
Scene();
|
Scene();
|
||||||
virtual ~Scene();
|
virtual ~Scene();
|
||||||
|
@ -86,7 +90,6 @@ protected:
|
||||||
friend class ProtectedNode;
|
friend class ProtectedNode;
|
||||||
friend class SpriteBatchNode;
|
friend class SpriteBatchNode;
|
||||||
friend class Camera;
|
friend class Camera;
|
||||||
friend class Director;
|
|
||||||
friend class Renderer;
|
friend class Renderer;
|
||||||
|
|
||||||
std::vector<Camera*> _cameras; //weak ref to Camera
|
std::vector<Camera*> _cameras; //weak ref to Camera
|
||||||
|
|
|
@ -30,6 +30,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "2d/CCNode.h"
|
#include "2d/CCNode.h"
|
||||||
|
#include "2d/CCDrawNode.h"
|
||||||
#include "base/CCProtocols.h"
|
#include "base/CCProtocols.h"
|
||||||
#include "renderer/CCTextureAtlas.h"
|
#include "renderer/CCTextureAtlas.h"
|
||||||
#include "renderer/CCQuadCommand.h"
|
#include "renderer/CCQuadCommand.h"
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<ItemDefinitionGroup>
|
<ItemDefinitionGroup>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PreprocessorDefinitions>_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<CompileAsWinRT>true</CompileAsWinRT>
|
<CompileAsWinRT>true</CompileAsWinRT>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<MinimalRebuild>false</MinimalRebuild>
|
<MinimalRebuild>false</MinimalRebuild>
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||||
<DisableSpecificWarnings>4056;4996;</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4056;4996;4244;</DisableSpecificWarnings>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
|
|
@ -54,19 +54,19 @@
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Import Project="cocos2d_wp8_headers.props" />
|
<Import Project="cocos2d_wp8_headers.props" />
|
||||||
<Import Project="cocos2dx.props" />
|
<Import Project="cocos2d_winrt.props" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
<Import Project="cocos2d_wp8_headers.props" />
|
<Import Project="cocos2d_wp8_headers.props" />
|
||||||
<Import Project="cocos2dx.props" />
|
<Import Project="cocos2d_winrt.props" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<Import Project="cocos2d_wp8_headers.props" />
|
<Import Project="cocos2d_wp8_headers.props" />
|
||||||
<Import Project="cocos2dx.props" />
|
<Import Project="cocos2d_winrt.props" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||||
<Import Project="cocos2d_wp8_headers.props" />
|
<Import Project="cocos2d_wp8_headers.props" />
|
||||||
<Import Project="cocos2dx.props" />
|
<Import Project="cocos2d_winrt.props" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
@ -706,7 +706,4 @@
|
||||||
<None Include="..\renderer\ccShader_Position_uColor.frag" />
|
<None Include="..\renderer\ccShader_Position_uColor.frag" />
|
||||||
<None Include="..\renderer\ccShader_Position_uColor.vert" />
|
<None Include="..\renderer\ccShader_Position_uColor.vert" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Text Include="..\renderer\CMakeLists.txt" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
|
@ -1454,9 +1454,4 @@
|
||||||
<Filter>renderer\shaders</Filter>
|
<Filter>renderer\shaders</Filter>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Text Include="..\renderer\CMakeLists.txt">
|
|
||||||
<Filter>renderer</Filter>
|
|
||||||
</Text>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
|
@ -162,7 +162,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
||||||
<AdditionalDependencies>sqlite3.lib;libcurl_imp.lib;websockets.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>sqlite3.lib;libcurl_imp.lib;websockets.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<IgnoreSpecificDefaultLibraries> ;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
<IgnoreSpecificDefaultLibraries>LIBCMTD.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
@ -404,7 +404,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
||||||
<ClCompile Include="..\renderer\CCVertexIndexData.cpp" />
|
<ClCompile Include="..\renderer\CCVertexIndexData.cpp" />
|
||||||
<ClCompile Include="..\storage\local-storage\LocalStorage.cpp" />
|
<ClCompile Include="..\storage\local-storage\LocalStorage.cpp" />
|
||||||
<ClCompile Include="..\ui\CocosGUI.cpp" />
|
<ClCompile Include="..\ui\CocosGUI.cpp" />
|
||||||
<ClCompile Include="..\ui\proj.win32\Win32InputBox.cpp" />
|
|
||||||
<ClCompile Include="..\ui\UIButton.cpp" />
|
<ClCompile Include="..\ui\UIButton.cpp" />
|
||||||
<ClCompile Include="..\ui\UICheckBox.cpp" />
|
<ClCompile Include="..\ui\UICheckBox.cpp" />
|
||||||
<ClCompile Include="..\ui\UIDeprecated.cpp" />
|
<ClCompile Include="..\ui\UIDeprecated.cpp" />
|
||||||
|
@ -783,7 +782,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
||||||
<ClInclude Include="..\storage\local-storage\LocalStorage.h" />
|
<ClInclude Include="..\storage\local-storage\LocalStorage.h" />
|
||||||
<ClInclude Include="..\ui\CocosGUI.h" />
|
<ClInclude Include="..\ui\CocosGUI.h" />
|
||||||
<ClInclude Include="..\ui\GUIExport.h" />
|
<ClInclude Include="..\ui\GUIExport.h" />
|
||||||
<ClInclude Include="..\ui\proj.win32\Win32InputBox.h" />
|
|
||||||
<ClInclude Include="..\ui\UIButton.h" />
|
<ClInclude Include="..\ui\UIButton.h" />
|
||||||
<ClInclude Include="..\ui\UICheckBox.h" />
|
<ClInclude Include="..\ui\UICheckBox.h" />
|
||||||
<ClInclude Include="..\ui\UIDeprecated.h" />
|
<ClInclude Include="..\ui\UIDeprecated.h" />
|
||||||
|
|
|
@ -1144,9 +1144,6 @@
|
||||||
<ClCompile Include="..\..\extensions\GUI\CCControlExtension\CCInvocation.cpp">
|
<ClCompile Include="..\..\extensions\GUI\CCControlExtension\CCInvocation.cpp">
|
||||||
<Filter>extension\GUI\CCControlExtensions</Filter>
|
<Filter>extension\GUI\CCControlExtensions</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\ui\proj.win32\Win32InputBox.cpp">
|
|
||||||
<Filter>ui\UIWidgets\EditBox</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\platform\win32\CCApplication-win32.cpp">
|
<ClCompile Include="..\platform\win32\CCApplication-win32.cpp">
|
||||||
<Filter>platform\win32</Filter>
|
<Filter>platform\win32</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -2278,9 +2275,6 @@
|
||||||
<ClInclude Include="..\..\extensions\GUI\CCControlExtension\CCInvocation.h">
|
<ClInclude Include="..\..\extensions\GUI\CCControlExtension\CCInvocation.h">
|
||||||
<Filter>extension\GUI\CCControlExtensions</Filter>
|
<Filter>extension\GUI\CCControlExtensions</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\ui\proj.win32\Win32InputBox.h">
|
|
||||||
<Filter>ui\UIWidgets\EditBox</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\platform\win32\CCApplication-win32.h">
|
<ClInclude Include="..\platform\win32\CCApplication-win32.h">
|
||||||
<Filter>platform\win32</Filter>
|
<Filter>platform\win32</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
|
@ -227,6 +227,10 @@ LOCAL_CPPFLAGS := -Wno-deprecated-declarations -Wno-extern-c-compat
|
||||||
LOCAL_EXPORT_CFLAGS := -DUSE_FILE32API
|
LOCAL_EXPORT_CFLAGS := -DUSE_FILE32API
|
||||||
LOCAL_EXPORT_CPPFLAGS := -Wno-deprecated-declarations -Wno-extern-c-compat
|
LOCAL_EXPORT_CPPFLAGS := -Wno-deprecated-declarations -Wno-extern-c-compat
|
||||||
|
|
||||||
|
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||||
|
LOCAL_ARM_NEON := true
|
||||||
|
endif
|
||||||
|
|
||||||
include $(BUILD_STATIC_LIBRARY)
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
#==============================================================
|
#==============================================================
|
||||||
|
@ -234,7 +238,6 @@ include $(BUILD_STATIC_LIBRARY)
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_MODULE := cocos2dx_static
|
LOCAL_MODULE := cocos2dx_static
|
||||||
|
|
||||||
LOCAL_MODULE_FILENAME := libcocos2d
|
LOCAL_MODULE_FILENAME := libcocos2d
|
||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES := cocostudio_static
|
LOCAL_STATIC_LIBRARIES := cocostudio_static
|
||||||
|
|
|
@ -287,41 +287,8 @@ void Director::drawScene()
|
||||||
//clear draw stats
|
//clear draw stats
|
||||||
_renderer->clearDrawStats();
|
_renderer->clearDrawStats();
|
||||||
|
|
||||||
Camera* defaultCamera = nullptr;
|
//render the scene
|
||||||
const auto& cameras = _runningScene->_cameras;
|
_runningScene->render(_renderer);
|
||||||
//draw with camera
|
|
||||||
for (size_t i = 0; i < cameras.size(); i++)
|
|
||||||
{
|
|
||||||
Camera::_visitingCamera = cameras[i];
|
|
||||||
if (Camera::_visitingCamera->getCameraFlag() == CameraFlag::DEFAULT)
|
|
||||||
{
|
|
||||||
defaultCamera = Camera::_visitingCamera;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
|
||||||
loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix());
|
|
||||||
|
|
||||||
//visit the scene
|
|
||||||
_runningScene->visit(_renderer, Mat4::IDENTITY, 0);
|
|
||||||
_renderer->render();
|
|
||||||
|
|
||||||
popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
|
||||||
}
|
|
||||||
//draw with default camera
|
|
||||||
if (defaultCamera)
|
|
||||||
{
|
|
||||||
Camera::_visitingCamera = defaultCamera;
|
|
||||||
pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
|
||||||
loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix());
|
|
||||||
|
|
||||||
//visit the scene
|
|
||||||
_runningScene->visit(_renderer, Mat4::IDENTITY, 0);
|
|
||||||
_renderer->render();
|
|
||||||
|
|
||||||
popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
|
||||||
}
|
|
||||||
Camera::_visitingCamera = nullptr;
|
|
||||||
|
|
||||||
_eventDispatcher->dispatchEvent(_eventAfterVisit);
|
_eventDispatcher->dispatchEvent(_eventAfterVisit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,13 +28,13 @@ THE SOFTWARE.
|
||||||
#include "base/ccMacros.h"
|
#include "base/ccMacros.h"
|
||||||
#include "base/CCScriptSupport.h"
|
#include "base/CCScriptSupport.h"
|
||||||
|
|
||||||
#if CC_USE_MEM_LEAK_DETECTION
|
#if CC_REF_LEAK_DETECTION
|
||||||
#include <algorithm> // std::find
|
#include <algorithm> // std::find
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
#if CC_USE_MEM_LEAK_DETECTION
|
#if CC_REF_LEAK_DETECTION
|
||||||
static void trackRef(Ref* ref);
|
static void trackRef(Ref* ref);
|
||||||
static void untrackRef(Ref* ref);
|
static void untrackRef(Ref* ref);
|
||||||
#endif
|
#endif
|
||||||
|
@ -49,7 +49,7 @@ Ref::Ref()
|
||||||
_scriptObject = nullptr;
|
_scriptObject = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CC_USE_MEM_LEAK_DETECTION
|
#if CC_REF_LEAK_DETECTION
|
||||||
trackRef(this);
|
trackRef(this);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ Ref::~Ref()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if CC_USE_MEM_LEAK_DETECTION
|
#if CC_REF_LEAK_DETECTION
|
||||||
if (_referenceCount != 0)
|
if (_referenceCount != 0)
|
||||||
untrackRef(this);
|
untrackRef(this);
|
||||||
#endif
|
#endif
|
||||||
|
@ -127,7 +127,7 @@ void Ref::release()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CC_USE_MEM_LEAK_DETECTION
|
#if CC_REF_LEAK_DETECTION
|
||||||
untrackRef(this);
|
untrackRef(this);
|
||||||
#endif
|
#endif
|
||||||
delete this;
|
delete this;
|
||||||
|
@ -145,7 +145,7 @@ unsigned int Ref::getReferenceCount() const
|
||||||
return _referenceCount;
|
return _referenceCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CC_USE_MEM_LEAK_DETECTION
|
#if CC_REF_LEAK_DETECTION
|
||||||
|
|
||||||
static std::list<Ref*> __refAllocationList;
|
static std::list<Ref*> __refAllocationList;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
#include "platform/CCPlatformMacros.h"
|
#include "platform/CCPlatformMacros.h"
|
||||||
#include "base/ccConfig.h"
|
#include "base/ccConfig.h"
|
||||||
|
|
||||||
#define CC_USE_MEM_LEAK_DETECTION 0
|
#define CC_REF_LEAK_DETECTION 0
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::V
|
||||||
action->initWithDictionary(actionDic,root);
|
action->initWithDictionary(actionDic,root);
|
||||||
actionList.pushBack(action);
|
actionList.pushBack(action);
|
||||||
}
|
}
|
||||||
_actionDic.insert(std::pair<std::string, cocos2d::Vector<ActionObject*>>(fileName, actionList));
|
_actionDic[fileName] = actionList;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionManagerEx::initWithBinary(const char* file,
|
void ActionManagerEx::initWithBinary(const char* file,
|
||||||
|
@ -108,7 +108,7 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::V
|
||||||
actionList.pushBack(action);
|
actionList.pushBack(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_actionDic.insert(std::pair<std::string, cocos2d::Vector<ActionObject*>>(fileName, actionList));
|
_actionDic[fileName] = actionList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -352,6 +352,11 @@ const Vec2& Armature::getAnchorPointInPoints() const
|
||||||
return _realAnchorPointInPoints;
|
return _realAnchorPointInPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Vec2& Armature::getOffsetPoints() const
|
||||||
|
{
|
||||||
|
return _offsetPoint;
|
||||||
|
}
|
||||||
|
|
||||||
void Armature::setAnimation(ArmatureAnimation *animation)
|
void Armature::setAnimation(ArmatureAnimation *animation)
|
||||||
{
|
{
|
||||||
_animation = animation;
|
_animation = animation;
|
||||||
|
|
|
@ -184,6 +184,7 @@ public:
|
||||||
virtual void updateOffsetPoint();
|
virtual void updateOffsetPoint();
|
||||||
virtual void setAnchorPoint(const cocos2d::Vec2& point) override;
|
virtual void setAnchorPoint(const cocos2d::Vec2& point) override;
|
||||||
virtual const cocos2d::Vec2& getAnchorPointInPoints() const override;
|
virtual const cocos2d::Vec2& getAnchorPointInPoints() const override;
|
||||||
|
virtual const cocos2d::Vec2& getOffsetPoints() const;
|
||||||
|
|
||||||
virtual void setAnimation(ArmatureAnimation *animation);
|
virtual void setAnimation(ArmatureAnimation *animation);
|
||||||
virtual ArmatureAnimation *getAnimation() const;
|
virtual ArmatureAnimation *getAnimation() const;
|
||||||
|
|
|
@ -210,53 +210,53 @@ namespace cocostudio
|
||||||
int ecb;
|
int ecb;
|
||||||
|
|
||||||
if (dynamic_cast<ui::PageView*>(widget)) {
|
if (dynamic_cast<ui::PageView*>(widget)) {
|
||||||
cr = DICTOOL->getIntValue_json(options, "bgColorR",150);
|
cr = DICTOOL->getIntValue_json(options, P_BgColorR,150);
|
||||||
cg = DICTOOL->getIntValue_json(options, "bgColorG",150);
|
cg = DICTOOL->getIntValue_json(options, P_BgColorG,150);
|
||||||
cb = DICTOOL->getIntValue_json(options, "bgColorB",100);
|
cb = DICTOOL->getIntValue_json(options, P_BgColorB,100);
|
||||||
|
|
||||||
scr = DICTOOL->getIntValue_json(options, "bgStartColorR",255);
|
scr = DICTOOL->getIntValue_json(options, P_BgStartColorR,255);
|
||||||
scg = DICTOOL->getIntValue_json(options, "bgStartColorG",255);
|
scg = DICTOOL->getIntValue_json(options, P_BgStartColorG,255);
|
||||||
scb = DICTOOL->getIntValue_json(options, "bgStartColorB",255);
|
scb = DICTOOL->getIntValue_json(options, P_BgStartColorB,255);
|
||||||
|
|
||||||
ecr = DICTOOL->getIntValue_json(options, "bgEndColorR",255);
|
ecr = DICTOOL->getIntValue_json(options, P_BgEndColorR,255);
|
||||||
ecg = DICTOOL->getIntValue_json(options, "bgEndColorG",150);
|
ecg = DICTOOL->getIntValue_json(options, P_BgEndColorG,150);
|
||||||
ecb = DICTOOL->getIntValue_json(options, "bgEndColorB",100);
|
ecb = DICTOOL->getIntValue_json(options, P_BgEndColorB,100);
|
||||||
}else if(dynamic_cast<ui::ListView*>(widget)){
|
}else if(dynamic_cast<ui::ListView*>(widget)){
|
||||||
cr = DICTOOL->getIntValue_json(options, "bgColorR",150);
|
cr = DICTOOL->getIntValue_json(options, P_BgColorR,150);
|
||||||
cg = DICTOOL->getIntValue_json(options, "bgColorG",150);
|
cg = DICTOOL->getIntValue_json(options, P_BgColorG,150);
|
||||||
cb = DICTOOL->getIntValue_json(options, "bgColorB",255);
|
cb = DICTOOL->getIntValue_json(options, P_BgColorB,255);
|
||||||
|
|
||||||
scr = DICTOOL->getIntValue_json(options, "bgStartColorR",255);
|
scr = DICTOOL->getIntValue_json(options, P_BgStartColorR,255);
|
||||||
scg = DICTOOL->getIntValue_json(options, "bgStartColorG",255);
|
scg = DICTOOL->getIntValue_json(options, P_BgStartColorG,255);
|
||||||
scb = DICTOOL->getIntValue_json(options, "bgStartColorB",255);
|
scb = DICTOOL->getIntValue_json(options, P_BgStartColorB,255);
|
||||||
|
|
||||||
ecr = DICTOOL->getIntValue_json(options, "bgEndColorR",150);
|
ecr = DICTOOL->getIntValue_json(options, P_BgEndColorR,150);
|
||||||
ecg = DICTOOL->getIntValue_json(options, "bgEndColorG",150);
|
ecg = DICTOOL->getIntValue_json(options, P_BgEndColorG,150);
|
||||||
ecb = DICTOOL->getIntValue_json(options, "bgEndColorB",255);
|
ecb = DICTOOL->getIntValue_json(options, P_BgEndColorB,255);
|
||||||
}else if(dynamic_cast<ui::ScrollView*>(widget)){
|
}else if(dynamic_cast<ui::ScrollView*>(widget)){
|
||||||
cr = DICTOOL->getIntValue_json(options, "bgColorR",255);
|
cr = DICTOOL->getIntValue_json(options, P_BgColorR,255);
|
||||||
cg = DICTOOL->getIntValue_json(options, "bgColorG",150);
|
cg = DICTOOL->getIntValue_json(options, P_BgColorG,150);
|
||||||
cb = DICTOOL->getIntValue_json(options, "bgColorB",100);
|
cb = DICTOOL->getIntValue_json(options, P_BgColorB,100);
|
||||||
|
|
||||||
scr = DICTOOL->getIntValue_json(options, "bgStartColorR",255);
|
scr = DICTOOL->getIntValue_json(options, P_BgStartColorR,255);
|
||||||
scg = DICTOOL->getIntValue_json(options, "bgStartColorG",255);
|
scg = DICTOOL->getIntValue_json(options, P_BgStartColorG,255);
|
||||||
scb = DICTOOL->getIntValue_json(options, "bgStartColorB",255);
|
scb = DICTOOL->getIntValue_json(options, P_BgStartColorB,255);
|
||||||
|
|
||||||
ecr = DICTOOL->getIntValue_json(options, "bgEndColorR",255);
|
ecr = DICTOOL->getIntValue_json(options, P_BgEndColorR,255);
|
||||||
ecg = DICTOOL->getIntValue_json(options, "bgEndColorG",150);
|
ecg = DICTOOL->getIntValue_json(options, P_BgEndColorG,150);
|
||||||
ecb = DICTOOL->getIntValue_json(options, "bgEndColorB",100);
|
ecb = DICTOOL->getIntValue_json(options, P_BgEndColorB,100);
|
||||||
}else{
|
}else{
|
||||||
cr = DICTOOL->getIntValue_json(options, "bgColorR",150);
|
cr = DICTOOL->getIntValue_json(options, P_BgColorR,150);
|
||||||
cg = DICTOOL->getIntValue_json(options, "bgColorG",200);
|
cg = DICTOOL->getIntValue_json(options, P_BgColorG,200);
|
||||||
cb = DICTOOL->getIntValue_json(options, "bgColorB",255);
|
cb = DICTOOL->getIntValue_json(options, P_BgColorB,255);
|
||||||
|
|
||||||
scr = DICTOOL->getIntValue_json(options, "bgStartColorR",255);
|
scr = DICTOOL->getIntValue_json(options, P_BgStartColorR,255);
|
||||||
scg = DICTOOL->getIntValue_json(options, "bgStartColorG",255);
|
scg = DICTOOL->getIntValue_json(options, P_BgStartColorG,255);
|
||||||
scb = DICTOOL->getIntValue_json(options, "bgStartColorB",255);
|
scb = DICTOOL->getIntValue_json(options, P_BgStartColorB,255);
|
||||||
|
|
||||||
ecr = DICTOOL->getIntValue_json(options, "bgEndColorR",150);
|
ecr = DICTOOL->getIntValue_json(options, P_BgEndColorR,150);
|
||||||
ecg = DICTOOL->getIntValue_json(options, "bgEndColorG",200);
|
ecg = DICTOOL->getIntValue_json(options, P_BgEndColorG,200);
|
||||||
ecb = DICTOOL->getIntValue_json(options, "bgEndColorB",255);
|
ecb = DICTOOL->getIntValue_json(options, P_BgEndColorB,255);
|
||||||
}
|
}
|
||||||
|
|
||||||
float bgcv1 = DICTOOL->getFloatValue_json(options, P_VectorX);
|
float bgcv1 = DICTOOL->getFloatValue_json(options, P_VectorX);
|
||||||
|
@ -295,7 +295,7 @@ namespace cocostudio
|
||||||
int bgimgcb = DICTOOL->getIntValue_json(options, P_ColorB,255);
|
int bgimgcb = DICTOOL->getIntValue_json(options, P_ColorB,255);
|
||||||
panel->setBackGroundImageColor(Color3B(bgimgcr, bgimgcg, bgimgcb));
|
panel->setBackGroundImageColor(Color3B(bgimgcr, bgimgcg, bgimgcb));
|
||||||
|
|
||||||
int bgimgopacity = DICTOOL->getIntValue_json(options, "opacity",255);
|
int bgimgopacity = DICTOOL->getIntValue_json(options, P_Opacity, 255);
|
||||||
panel->setBackGroundImageOpacity(bgimgopacity);
|
panel->setBackGroundImageOpacity(bgimgopacity);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,56 @@ This file was modified to fit the cocos2d-x project
|
||||||
#include "MathUtil.h"
|
#include "MathUtil.h"
|
||||||
#include "base/ccMacros.h"
|
#include "base/ccMacros.h"
|
||||||
|
|
||||||
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||||
|
#include <cpu-features.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//#define USE_NEON32 : neon 32 code will be used
|
||||||
|
//#define USE_NEON64 : neon 64 code will be used
|
||||||
|
//#define INCLUDE_NEON32 : neon 32 code included
|
||||||
|
//#define INCLUDE_NEON64 : neon 64 code included
|
||||||
|
//#define USE_SSE : SSE code used
|
||||||
|
//#define INCLUDE_SSE : SSE code included
|
||||||
|
|
||||||
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||||
|
#if defined (__arm64__)
|
||||||
|
#define USE_NEON64
|
||||||
|
#define INCLUDE_NEON64
|
||||||
|
#elif defined (__ARM_NEON__)
|
||||||
|
#define USE_NEON32
|
||||||
|
#define INCLUDE_NEON32
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||||
|
#if defined (__arm64__)
|
||||||
|
#define INCLUDE_NEON64
|
||||||
|
#elif defined (__ARM_NEON__)
|
||||||
|
#define INCLUDE_NEON32
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (__SSE__)
|
||||||
|
#define USE_SSE
|
||||||
|
#define INCLUDE_SSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef INCLUDE_NEON32
|
||||||
|
#include "MathUtilNeon.inl"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef INCLUDE_NEON64
|
||||||
|
#include "MathUtilNeon64.inl"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef INCLUDE_SSE
|
||||||
|
#include "MathUtilSSE.inl"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "MathUtil.inl"
|
||||||
|
|
||||||
NS_CC_MATH_BEGIN
|
NS_CC_MATH_BEGIN
|
||||||
|
|
||||||
void MathUtil::smooth(float* x, float target, float elapsedTime, float responseTime)
|
void MathUtil::smooth(float* x, float target, float elapsedTime, float responseTime)
|
||||||
|
@ -44,4 +94,179 @@ void MathUtil::smooth(float* x, float target, float elapsedTime, float riseTime,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MathUtil::isNeon32Enabled()
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
return true;
|
||||||
|
#elif (defined (INCLUDE_NEON32) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) )
|
||||||
|
class AnrdoidNeonChecker
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AnrdoidNeonChecker()
|
||||||
|
{
|
||||||
|
if (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM && (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0)
|
||||||
|
_isNeonEnabled = true;
|
||||||
|
else
|
||||||
|
_isNeonEnabled = false;
|
||||||
|
}
|
||||||
|
bool isNeonEnabled() const { return _isNeonEnabled; }
|
||||||
|
private:
|
||||||
|
bool _isNeonEnabled;
|
||||||
|
};
|
||||||
|
static AnrdoidNeonChecker checker;
|
||||||
|
return checker.isNeonEnabled();
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MathUtil::isNeon64Enabled()
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON64
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MathUtil::addMatrix(const float* m, float scalar, float* dst)
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
MathUtilNeon::addMatrix(m, scalar, dst);
|
||||||
|
#elif defined (USE_NEON64)
|
||||||
|
MathUtilNeon64::addMatrix(m, scalar, dst);
|
||||||
|
#elif defined (INCLUDE_NEON32)
|
||||||
|
if(isNeon32Enabled()) MathUtilNeon::addMatrix(m, scalar, dst);
|
||||||
|
else MathUtilC::addMatrix(m, scalar, dst);
|
||||||
|
#else
|
||||||
|
MathUtilC::addMatrix(m, scalar, dst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MathUtil::addMatrix(const float* m1, const float* m2, float* dst)
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
MathUtilNeon::addMatrix(m1, m2, dst);
|
||||||
|
#elif defined (USE_NEON64)
|
||||||
|
MathUtilNeon64::addMatrix(m1, m2, dst);
|
||||||
|
#elif defined (INCLUDE_NEON32)
|
||||||
|
if(isNeon32Enabled()) MathUtilNeon::addMatrix(m1, m2, dst);
|
||||||
|
else MathUtilC::addMatrix(m1, m2, dst);
|
||||||
|
#else
|
||||||
|
MathUtilC::addMatrix(m1, m2, dst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MathUtil::subtractMatrix(const float* m1, const float* m2, float* dst)
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
MathUtilNeon::subtractMatrix(m1, m2, dst);
|
||||||
|
#elif defined (USE_NEON64)
|
||||||
|
MathUtilNeon64::subtractMatrix(m1, m2, dst);
|
||||||
|
#elif defined (INCLUDE_NEON32)
|
||||||
|
if(isNeon32Enabled()) MathUtilNeon::subtractMatrix(m1, m2, dst);
|
||||||
|
else MathUtilC::subtractMatrix(m1, m2, dst);
|
||||||
|
#else
|
||||||
|
MathUtilC::subtractMatrix(m1, m2, dst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MathUtil::multiplyMatrix(const float* m, float scalar, float* dst)
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
MathUtilNeon::multiplyMatrix(m, scalar, dst);
|
||||||
|
#elif defined (USE_NEON64)
|
||||||
|
MathUtilNeon64::multiplyMatrix(m, scalar, dst);
|
||||||
|
#elif defined (INCLUDE_NEON32)
|
||||||
|
if(isNeon32Enabled()) MathUtilNeon::multiplyMatrix(m, scalar, dst);
|
||||||
|
else MathUtilC::multiplyMatrix(m, scalar, dst);
|
||||||
|
#else
|
||||||
|
MathUtilC::multiplyMatrix(m, scalar, dst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MathUtil::multiplyMatrix(const float* m1, const float* m2, float* dst)
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
MathUtilNeon::multiplyMatrix(m1, m2, dst);
|
||||||
|
#elif defined (USE_NEON64)
|
||||||
|
MathUtilNeon64::multiplyMatrix(m1, m2, dst);
|
||||||
|
#elif defined (INCLUDE_NEON32)
|
||||||
|
if(isNeon32Enabled()) MathUtilNeon::multiplyMatrix(m1, m2, dst);
|
||||||
|
else MathUtilC::multiplyMatrix(m1, m2, dst);
|
||||||
|
#else
|
||||||
|
MathUtilC::multiplyMatrix(m1, m2, dst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MathUtil::negateMatrix(const float* m, float* dst)
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
MathUtilNeon::negateMatrix(m, dst);
|
||||||
|
#elif defined (USE_NEON64)
|
||||||
|
MathUtilNeon64::negateMatrix(m, dst);
|
||||||
|
#elif defined (INCLUDE_NEON32)
|
||||||
|
if(isNeon32Enabled()) MathUtilNeon::negateMatrix(m, dst);
|
||||||
|
else MathUtilC::negateMatrix(m, dst);
|
||||||
|
#else
|
||||||
|
MathUtilC::negateMatrix(m, dst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MathUtil::transposeMatrix(const float* m, float* dst)
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
MathUtilNeon::transposeMatrix(m, dst);
|
||||||
|
#elif defined (USE_NEON64)
|
||||||
|
MathUtilNeon64::transposeMatrix(m, dst);
|
||||||
|
#elif defined (INCLUDE_NEON32)
|
||||||
|
if(isNeon32Enabled()) MathUtilNeon::transposeMatrix(m, dst);
|
||||||
|
else MathUtilC::transposeMatrix(m, dst);
|
||||||
|
#else
|
||||||
|
MathUtilC::transposeMatrix(m, dst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MathUtil::transformVec4(const float* m, float x, float y, float z, float w, float* dst)
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
MathUtilNeon::transformVec4(m, x, y, z, w, dst);
|
||||||
|
#elif defined (USE_NEON64)
|
||||||
|
MathUtilNeon64::transformVec4(m, x, y, z, w, dst);
|
||||||
|
#elif defined (INCLUDE_NEON32)
|
||||||
|
if(isNeon32Enabled()) MathUtilNeon::transformVec4(m, x, y, z, w, dst);
|
||||||
|
else MathUtilC::transformVec4(m, x, y, z, w, dst);
|
||||||
|
#else
|
||||||
|
MathUtilC::transformVec4(m, x, y, z, w, dst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MathUtil::transformVec4(const float* m, const float* v, float* dst)
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
MathUtilNeon::transformVec4(m, v, dst);
|
||||||
|
#elif defined (USE_NEON64)
|
||||||
|
MathUtilNeon64::transformVec4(m, v, dst);
|
||||||
|
#elif defined (INCLUDE_NEON32)
|
||||||
|
if(isNeon32Enabled()) MathUtilNeon::transformVec4(m, v, dst);
|
||||||
|
else MathUtilC::transformVec4(m, v, dst);
|
||||||
|
#else
|
||||||
|
MathUtilC::transformVec4(m, v, dst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MathUtil::crossVec3(const float* v1, const float* v2, float* dst)
|
||||||
|
{
|
||||||
|
#ifdef USE_NEON32
|
||||||
|
MathUtilNeon::crossVec3(v1, v2, dst);
|
||||||
|
#elif defined (USE_NEON64)
|
||||||
|
MathUtilNeon64::crossVec3(v1, v2, dst);
|
||||||
|
#elif defined (INCLUDE_NEON32)
|
||||||
|
if(isNeon32Enabled()) MathUtilNeon::crossVec3(v1, v2, dst);
|
||||||
|
else MathUtilC::crossVec3(v1, v2, dst);
|
||||||
|
#else
|
||||||
|
MathUtilC::crossVec3(v1, v2, dst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
NS_CC_MATH_END
|
NS_CC_MATH_END
|
||||||
|
|
|
@ -69,59 +69,52 @@ public:
|
||||||
* @param fallTime response time for falling slope (in the same units as elapsedTime).
|
* @param fallTime response time for falling slope (in the same units as elapsedTime).
|
||||||
*/
|
*/
|
||||||
static void smooth(float* x, float target, float elapsedTime, float riseTime, float fallTime);
|
static void smooth(float* x, float target, float elapsedTime, float riseTime, float fallTime);
|
||||||
|
private:
|
||||||
|
//Indicates that if neon is enabled
|
||||||
|
static bool isNeon32Enabled();
|
||||||
|
static bool isNeon64Enabled();
|
||||||
private:
|
private:
|
||||||
#ifdef __SSE__
|
#ifdef __SSE__
|
||||||
inline static void addMatrix(const __m128 m[4], float scalar, __m128 dst[4]);
|
static void addMatrix(const __m128 m[4], float scalar, __m128 dst[4]);
|
||||||
|
|
||||||
inline static void addMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4]);
|
static void addMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4]);
|
||||||
|
|
||||||
inline static void subtractMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4]);
|
static void subtractMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4]);
|
||||||
|
|
||||||
inline static void multiplyMatrix(const __m128 m[4], float scalar, __m128 dst[4]);
|
static void multiplyMatrix(const __m128 m[4], float scalar, __m128 dst[4]);
|
||||||
|
|
||||||
inline static void multiplyMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4]);
|
static void multiplyMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4]);
|
||||||
|
|
||||||
inline static void negateMatrix(const __m128 m[4], __m128 dst[4]);
|
static void negateMatrix(const __m128 m[4], __m128 dst[4]);
|
||||||
|
|
||||||
inline static void transposeMatrix(const __m128 m[4], __m128 dst[4]);
|
static void transposeMatrix(const __m128 m[4], __m128 dst[4]);
|
||||||
|
|
||||||
inline static void transformVec4(const __m128 m[4], const __m128& v, __m128& dst);
|
static void transformVec4(const __m128 m[4], const __m128& v, __m128& dst);
|
||||||
#endif
|
#endif
|
||||||
inline static void addMatrix(const float* m, float scalar, float* dst);
|
static void addMatrix(const float* m, float scalar, float* dst);
|
||||||
|
|
||||||
inline static void addMatrix(const float* m1, const float* m2, float* dst);
|
static void addMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
inline static void subtractMatrix(const float* m1, const float* m2, float* dst);
|
static void subtractMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
inline static void multiplyMatrix(const float* m, float scalar, float* dst);
|
static void multiplyMatrix(const float* m, float scalar, float* dst);
|
||||||
|
|
||||||
inline static void multiplyMatrix(const float* m1, const float* m2, float* dst);
|
static void multiplyMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
inline static void negateMatrix(const float* m, float* dst);
|
static void negateMatrix(const float* m, float* dst);
|
||||||
|
|
||||||
inline static void transposeMatrix(const float* m, float* dst);
|
static void transposeMatrix(const float* m, float* dst);
|
||||||
|
|
||||||
inline static void transformVec4(const float* m, float x, float y, float z, float w, float* dst);
|
static void transformVec4(const float* m, float x, float y, float z, float w, float* dst);
|
||||||
|
|
||||||
inline static void transformVec4(const float* m, const float* v, float* dst);
|
static void transformVec4(const float* m, const float* v, float* dst);
|
||||||
|
|
||||||
inline static void crossVec3(const float* v1, const float* v2, float* dst);
|
static void crossVec3(const float* v1, const float* v2, float* dst);
|
||||||
|
|
||||||
MathUtil();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_CC_MATH_END
|
NS_CC_MATH_END
|
||||||
|
|
||||||
#define MATRIX_SIZE ( sizeof(float) * 16)
|
#define MATRIX_SIZE ( sizeof(float) * 16)
|
||||||
|
|
||||||
#ifdef USE_NEON
|
|
||||||
#include "MathUtilNeon.inl"
|
|
||||||
#else
|
|
||||||
#include "MathUtil.inl"
|
|
||||||
#if defined(__SSE__)
|
|
||||||
#include "MathUtilSSE.inl"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -20,7 +20,31 @@
|
||||||
|
|
||||||
NS_CC_MATH_BEGIN
|
NS_CC_MATH_BEGIN
|
||||||
|
|
||||||
inline void MathUtil::addMatrix(const float* m, float scalar, float* dst)
|
class MathUtilC
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline static void addMatrix(const float* m, float scalar, float* dst);
|
||||||
|
|
||||||
|
inline static void addMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
|
inline static void subtractMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
|
inline static void multiplyMatrix(const float* m, float scalar, float* dst);
|
||||||
|
|
||||||
|
inline static void multiplyMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
|
inline static void negateMatrix(const float* m, float* dst);
|
||||||
|
|
||||||
|
inline static void transposeMatrix(const float* m, float* dst);
|
||||||
|
|
||||||
|
inline static void transformVec4(const float* m, float x, float y, float z, float w, float* dst);
|
||||||
|
|
||||||
|
inline static void transformVec4(const float* m, const float* v, float* dst);
|
||||||
|
|
||||||
|
inline static void crossVec3(const float* v1, const float* v2, float* dst);
|
||||||
|
};
|
||||||
|
|
||||||
|
inline void MathUtilC::addMatrix(const float* m, float scalar, float* dst)
|
||||||
{
|
{
|
||||||
dst[0] = m[0] + scalar;
|
dst[0] = m[0] + scalar;
|
||||||
dst[1] = m[1] + scalar;
|
dst[1] = m[1] + scalar;
|
||||||
|
@ -40,7 +64,7 @@ inline void MathUtil::addMatrix(const float* m, float scalar, float* dst)
|
||||||
dst[15] = m[15] + scalar;
|
dst[15] = m[15] + scalar;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::addMatrix(const float* m1, const float* m2, float* dst)
|
inline void MathUtilC::addMatrix(const float* m1, const float* m2, float* dst)
|
||||||
{
|
{
|
||||||
dst[0] = m1[0] + m2[0];
|
dst[0] = m1[0] + m2[0];
|
||||||
dst[1] = m1[1] + m2[1];
|
dst[1] = m1[1] + m2[1];
|
||||||
|
@ -60,7 +84,7 @@ inline void MathUtil::addMatrix(const float* m1, const float* m2, float* dst)
|
||||||
dst[15] = m1[15] + m2[15];
|
dst[15] = m1[15] + m2[15];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::subtractMatrix(const float* m1, const float* m2, float* dst)
|
inline void MathUtilC::subtractMatrix(const float* m1, const float* m2, float* dst)
|
||||||
{
|
{
|
||||||
dst[0] = m1[0] - m2[0];
|
dst[0] = m1[0] - m2[0];
|
||||||
dst[1] = m1[1] - m2[1];
|
dst[1] = m1[1] - m2[1];
|
||||||
|
@ -80,7 +104,7 @@ inline void MathUtil::subtractMatrix(const float* m1, const float* m2, float* ds
|
||||||
dst[15] = m1[15] - m2[15];
|
dst[15] = m1[15] - m2[15];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::multiplyMatrix(const float* m, float scalar, float* dst)
|
inline void MathUtilC::multiplyMatrix(const float* m, float scalar, float* dst)
|
||||||
{
|
{
|
||||||
dst[0] = m[0] * scalar;
|
dst[0] = m[0] * scalar;
|
||||||
dst[1] = m[1] * scalar;
|
dst[1] = m[1] * scalar;
|
||||||
|
@ -100,7 +124,7 @@ inline void MathUtil::multiplyMatrix(const float* m, float scalar, float* dst)
|
||||||
dst[15] = m[15] * scalar;
|
dst[15] = m[15] * scalar;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::multiplyMatrix(const float* m1, const float* m2, float* dst)
|
inline void MathUtilC::multiplyMatrix(const float* m1, const float* m2, float* dst)
|
||||||
{
|
{
|
||||||
// Support the case where m1 or m2 is the same array as dst.
|
// Support the case where m1 or m2 is the same array as dst.
|
||||||
float product[16];
|
float product[16];
|
||||||
|
@ -128,7 +152,7 @@ inline void MathUtil::multiplyMatrix(const float* m1, const float* m2, float* ds
|
||||||
memcpy(dst, product, MATRIX_SIZE);
|
memcpy(dst, product, MATRIX_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::negateMatrix(const float* m, float* dst)
|
inline void MathUtilC::negateMatrix(const float* m, float* dst)
|
||||||
{
|
{
|
||||||
dst[0] = -m[0];
|
dst[0] = -m[0];
|
||||||
dst[1] = -m[1];
|
dst[1] = -m[1];
|
||||||
|
@ -148,7 +172,7 @@ inline void MathUtil::negateMatrix(const float* m, float* dst)
|
||||||
dst[15] = -m[15];
|
dst[15] = -m[15];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::transposeMatrix(const float* m, float* dst)
|
inline void MathUtilC::transposeMatrix(const float* m, float* dst)
|
||||||
{
|
{
|
||||||
float t[16] = {
|
float t[16] = {
|
||||||
m[0], m[4], m[8], m[12],
|
m[0], m[4], m[8], m[12],
|
||||||
|
@ -159,14 +183,14 @@ inline void MathUtil::transposeMatrix(const float* m, float* dst)
|
||||||
memcpy(dst, t, MATRIX_SIZE);
|
memcpy(dst, t, MATRIX_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::transformVec4(const float* m, float x, float y, float z, float w, float* dst)
|
inline void MathUtilC::transformVec4(const float* m, float x, float y, float z, float w, float* dst)
|
||||||
{
|
{
|
||||||
dst[0] = x * m[0] + y * m[4] + z * m[8] + w * m[12];
|
dst[0] = x * m[0] + y * m[4] + z * m[8] + w * m[12];
|
||||||
dst[1] = x * m[1] + y * m[5] + z * m[9] + w * m[13];
|
dst[1] = x * m[1] + y * m[5] + z * m[9] + w * m[13];
|
||||||
dst[2] = x * m[2] + y * m[6] + z * m[10] + w * m[14];
|
dst[2] = x * m[2] + y * m[6] + z * m[10] + w * m[14];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::transformVec4(const float* m, const float* v, float* dst)
|
inline void MathUtilC::transformVec4(const float* m, const float* v, float* dst)
|
||||||
{
|
{
|
||||||
// Handle case where v == dst.
|
// Handle case where v == dst.
|
||||||
float x = v[0] * m[0] + v[1] * m[4] + v[2] * m[8] + v[3] * m[12];
|
float x = v[0] * m[0] + v[1] * m[4] + v[2] * m[8] + v[3] * m[12];
|
||||||
|
@ -180,7 +204,7 @@ inline void MathUtil::transformVec4(const float* m, const float* v, float* dst)
|
||||||
dst[3] = w;
|
dst[3] = w;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::crossVec3(const float* v1, const float* v2, float* dst)
|
inline void MathUtilC::crossVec3(const float* v1, const float* v2, float* dst)
|
||||||
{
|
{
|
||||||
float x = (v1[1] * v2[2]) - (v1[2] * v2[1]);
|
float x = (v1[1] * v2[2]) - (v1[2] * v2[1]);
|
||||||
float y = (v1[2] * v2[0]) - (v1[0] * v2[2]);
|
float y = (v1[2] * v2[0]) - (v1[0] * v2[2]);
|
||||||
|
|
|
@ -17,232 +17,255 @@
|
||||||
|
|
||||||
This file was modified to fit the cocos2d-x project
|
This file was modified to fit the cocos2d-x project
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NS_CC_MATH_BEGIN
|
NS_CC_MATH_BEGIN
|
||||||
|
|
||||||
inline void MathUtil::addMatrix(const float* m, float scalar, float* dst)
|
class MathUtilNeon
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline static void addMatrix(const float* m, float scalar, float* dst);
|
||||||
|
|
||||||
|
inline static void addMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
|
inline static void subtractMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
|
inline static void multiplyMatrix(const float* m, float scalar, float* dst);
|
||||||
|
|
||||||
|
inline static void multiplyMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
|
inline static void negateMatrix(const float* m, float* dst);
|
||||||
|
|
||||||
|
inline static void transposeMatrix(const float* m, float* dst);
|
||||||
|
|
||||||
|
inline static void transformVec4(const float* m, float x, float y, float z, float w, float* dst);
|
||||||
|
|
||||||
|
inline static void transformVec4(const float* m, const float* v, float* dst);
|
||||||
|
|
||||||
|
inline static void crossVec3(const float* v1, const float* v2, float* dst);
|
||||||
|
};
|
||||||
|
|
||||||
|
inline void MathUtilNeon::addMatrix(const float* m, float scalar, float* dst)
|
||||||
{
|
{
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vld1.32 {q0, q1}, [%1]! \n\t" // M[m0-m7]
|
"vld1.32 {q0, q1}, [%1]! \n\t" // M[m0-m7]
|
||||||
"vld1.32 {q2, q3}, [%1] \n\t" // M[m8-m15]
|
"vld1.32 {q2, q3}, [%1] \n\t" // M[m8-m15]
|
||||||
"vld1.32 {d8[0]}, [%2] \n\t" // s
|
"vld1.32 {d8[0]}, [%2] \n\t" // s
|
||||||
"vmov.f32 s17, s16 \n\t" // s
|
"vmov.f32 s17, s16 \n\t" // s
|
||||||
"vmov.f32 s18, s16 \n\t" // s
|
"vmov.f32 s18, s16 \n\t" // s
|
||||||
"vmov.f32 s19, s16 \n\t" // s
|
"vmov.f32 s19, s16 \n\t" // s
|
||||||
|
|
||||||
"vadd.f32 q8, q0, q4 \n\t" // DST->M[m0-m3] = M[m0-m3] + s
|
"vadd.f32 q8, q0, q4 \n\t" // DST->M[m0-m3] = M[m0-m3] + s
|
||||||
"vadd.f32 q9, q1, q4 \n\t" // DST->M[m4-m7] = M[m4-m7] + s
|
"vadd.f32 q9, q1, q4 \n\t" // DST->M[m4-m7] = M[m4-m7] + s
|
||||||
"vadd.f32 q10, q2, q4 \n\t" // DST->M[m8-m11] = M[m8-m11] + s
|
"vadd.f32 q10, q2, q4 \n\t" // DST->M[m8-m11] = M[m8-m11] + s
|
||||||
"vadd.f32 q11, q3, q4 \n\t" // DST->M[m12-m15] = M[m12-m15] + s
|
"vadd.f32 q11, q3, q4 \n\t" // DST->M[m12-m15] = M[m12-m15] + s
|
||||||
|
|
||||||
"vst1.32 {q8, q9}, [%0]! \n\t" // DST->M[m0-m7]
|
"vst1.32 {q8, q9}, [%0]! \n\t" // DST->M[m0-m7]
|
||||||
"vst1.32 {q10, q11}, [%0] \n\t" // DST->M[m8-m15]
|
"vst1.32 {q10, q11}, [%0] \n\t" // DST->M[m8-m15]
|
||||||
:
|
:
|
||||||
: "r"(dst), "r"(m), "r"(&scalar)
|
: "r"(dst), "r"(m), "r"(&scalar)
|
||||||
: "q0", "q1", "q2", "q3", "q4", "q8", "q9", "q10", "q11", "memory"
|
: "q0", "q1", "q2", "q3", "q4", "q8", "q9", "q10", "q11", "memory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::addMatrix(const float* m1, const float* m2, float* dst)
|
inline void MathUtilNeon::addMatrix(const float* m1, const float* m2, float* dst)
|
||||||
{
|
{
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vld1.32 {q0, q1}, [%1]! \n\t" // M1[m0-m7]
|
"vld1.32 {q0, q1}, [%1]! \n\t" // M1[m0-m7]
|
||||||
"vld1.32 {q2, q3}, [%1] \n\t" // M1[m8-m15]
|
"vld1.32 {q2, q3}, [%1] \n\t" // M1[m8-m15]
|
||||||
"vld1.32 {q8, q9}, [%2]! \n\t" // M2[m0-m7]
|
"vld1.32 {q8, q9}, [%2]! \n\t" // M2[m0-m7]
|
||||||
"vld1.32 {q10, q11}, [%2] \n\t" // M2[m8-m15]
|
"vld1.32 {q10, q11}, [%2] \n\t" // M2[m8-m15]
|
||||||
|
|
||||||
"vadd.f32 q12, q0, q8 \n\t" // DST->M[m0-m3] = M1[m0-m3] + M2[m0-m3]
|
"vadd.f32 q12, q0, q8 \n\t" // DST->M[m0-m3] = M1[m0-m3] + M2[m0-m3]
|
||||||
"vadd.f32 q13, q1, q9 \n\t" // DST->M[m4-m7] = M1[m4-m7] + M2[m4-m7]
|
"vadd.f32 q13, q1, q9 \n\t" // DST->M[m4-m7] = M1[m4-m7] + M2[m4-m7]
|
||||||
"vadd.f32 q14, q2, q10 \n\t" // DST->M[m8-m11] = M1[m8-m11] + M2[m8-m11]
|
"vadd.f32 q14, q2, q10 \n\t" // DST->M[m8-m11] = M1[m8-m11] + M2[m8-m11]
|
||||||
"vadd.f32 q15, q3, q11 \n\t" // DST->M[m12-m15] = M1[m12-m15] + M2[m12-m15]
|
"vadd.f32 q15, q3, q11 \n\t" // DST->M[m12-m15] = M1[m12-m15] + M2[m12-m15]
|
||||||
|
|
||||||
"vst1.32 {q12, q13}, [%0]! \n\t" // DST->M[m0-m7]
|
"vst1.32 {q12, q13}, [%0]! \n\t" // DST->M[m0-m7]
|
||||||
"vst1.32 {q14, q15}, [%0] \n\t" // DST->M[m8-m15]
|
"vst1.32 {q14, q15}, [%0] \n\t" // DST->M[m8-m15]
|
||||||
:
|
:
|
||||||
: "r"(dst), "r"(m1), "r"(m2)
|
: "r"(dst), "r"(m1), "r"(m2)
|
||||||
: "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15", "memory"
|
: "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15", "memory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::subtractMatrix(const float* m1, const float* m2, float* dst)
|
inline void MathUtilNeon::subtractMatrix(const float* m1, const float* m2, float* dst)
|
||||||
{
|
{
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vld1.32 {q0, q1}, [%1]! \n\t" // M1[m0-m7]
|
"vld1.32 {q0, q1}, [%1]! \n\t" // M1[m0-m7]
|
||||||
"vld1.32 {q2, q3}, [%1] \n\t" // M1[m8-m15]
|
"vld1.32 {q2, q3}, [%1] \n\t" // M1[m8-m15]
|
||||||
"vld1.32 {q8, q9}, [%2]! \n\t" // M2[m0-m7]
|
"vld1.32 {q8, q9}, [%2]! \n\t" // M2[m0-m7]
|
||||||
"vld1.32 {q10, q11}, [%2] \n\t" // M2[m8-m15]
|
"vld1.32 {q10, q11}, [%2] \n\t" // M2[m8-m15]
|
||||||
|
|
||||||
"vsub.f32 q12, q0, q8 \n\t" // DST->M[m0-m3] = M1[m0-m3] - M2[m0-m3]
|
"vsub.f32 q12, q0, q8 \n\t" // DST->M[m0-m3] = M1[m0-m3] - M2[m0-m3]
|
||||||
"vsub.f32 q13, q1, q9 \n\t" // DST->M[m4-m7] = M1[m4-m7] - M2[m4-m7]
|
"vsub.f32 q13, q1, q9 \n\t" // DST->M[m4-m7] = M1[m4-m7] - M2[m4-m7]
|
||||||
"vsub.f32 q14, q2, q10 \n\t" // DST->M[m8-m11] = M1[m8-m11] - M2[m8-m11]
|
"vsub.f32 q14, q2, q10 \n\t" // DST->M[m8-m11] = M1[m8-m11] - M2[m8-m11]
|
||||||
"vsub.f32 q15, q3, q11 \n\t" // DST->M[m12-m15] = M1[m12-m15] - M2[m12-m15]
|
"vsub.f32 q15, q3, q11 \n\t" // DST->M[m12-m15] = M1[m12-m15] - M2[m12-m15]
|
||||||
|
|
||||||
"vst1.32 {q12, q13}, [%0]! \n\t" // DST->M[m0-m7]
|
"vst1.32 {q12, q13}, [%0]! \n\t" // DST->M[m0-m7]
|
||||||
"vst1.32 {q14, q15}, [%0] \n\t" // DST->M[m8-m15]
|
"vst1.32 {q14, q15}, [%0] \n\t" // DST->M[m8-m15]
|
||||||
:
|
:
|
||||||
: "r"(dst), "r"(m1), "r"(m2)
|
: "r"(dst), "r"(m1), "r"(m2)
|
||||||
: "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15", "memory"
|
: "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15", "memory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::multiplyMatrix(const float* m, float scalar, float* dst)
|
inline void MathUtilNeon::multiplyMatrix(const float* m, float scalar, float* dst)
|
||||||
{
|
{
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vld1.32 {d0[0]}, [%2] \n\t" // M[m0-m7]
|
"vld1.32 {d0[0]}, [%2] \n\t" // M[m0-m7]
|
||||||
"vld1.32 {q4-q5}, [%1]! \n\t" // M[m8-m15]
|
"vld1.32 {q4-q5}, [%1]! \n\t" // M[m8-m15]
|
||||||
"vld1.32 {q6-q7}, [%1] \n\t" // s
|
"vld1.32 {q6-q7}, [%1] \n\t" // s
|
||||||
|
|
||||||
"vmul.f32 q8, q4, d0[0] \n\t" // DST->M[m0-m3] = M[m0-m3] * s
|
"vmul.f32 q8, q4, d0[0] \n\t" // DST->M[m0-m3] = M[m0-m3] * s
|
||||||
"vmul.f32 q9, q5, d0[0] \n\t" // DST->M[m4-m7] = M[m4-m7] * s
|
"vmul.f32 q9, q5, d0[0] \n\t" // DST->M[m4-m7] = M[m4-m7] * s
|
||||||
"vmul.f32 q10, q6, d0[0] \n\t" // DST->M[m8-m11] = M[m8-m11] * s
|
"vmul.f32 q10, q6, d0[0] \n\t" // DST->M[m8-m11] = M[m8-m11] * s
|
||||||
"vmul.f32 q11, q7, d0[0] \n\t" // DST->M[m12-m15] = M[m12-m15] * s
|
"vmul.f32 q11, q7, d0[0] \n\t" // DST->M[m12-m15] = M[m12-m15] * s
|
||||||
|
|
||||||
"vst1.32 {q8-q9}, [%0]! \n\t" // DST->M[m0-m7]
|
"vst1.32 {q8-q9}, [%0]! \n\t" // DST->M[m0-m7]
|
||||||
"vst1.32 {q10-q11}, [%0] \n\t" // DST->M[m8-m15]
|
"vst1.32 {q10-q11}, [%0] \n\t" // DST->M[m8-m15]
|
||||||
:
|
:
|
||||||
: "r"(dst), "r"(m), "r"(&scalar)
|
: "r"(dst), "r"(m), "r"(&scalar)
|
||||||
: "q0", "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11", "memory"
|
: "q0", "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11", "memory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::multiplyMatrix(const float* m1, const float* m2, float* dst)
|
inline void MathUtilNeon::multiplyMatrix(const float* m1, const float* m2, float* dst)
|
||||||
{
|
{
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vld1.32 {d16 - d19}, [%1]! \n\t" // M1[m0-m7]
|
"vld1.32 {d16 - d19}, [%1]! \n\t" // M1[m0-m7]
|
||||||
"vld1.32 {d20 - d23}, [%1] \n\t" // M1[m8-m15]
|
"vld1.32 {d20 - d23}, [%1] \n\t" // M1[m8-m15]
|
||||||
"vld1.32 {d0 - d3}, [%2]! \n\t" // M2[m0-m7]
|
"vld1.32 {d0 - d3}, [%2]! \n\t" // M2[m0-m7]
|
||||||
"vld1.32 {d4 - d7}, [%2] \n\t" // M2[m8-m15]
|
"vld1.32 {d4 - d7}, [%2] \n\t" // M2[m8-m15]
|
||||||
|
|
||||||
"vmul.f32 q12, q8, d0[0] \n\t" // DST->M[m0-m3] = M1[m0-m3] * M2[m0]
|
"vmul.f32 q12, q8, d0[0] \n\t" // DST->M[m0-m3] = M1[m0-m3] * M2[m0]
|
||||||
"vmul.f32 q13, q8, d2[0] \n\t" // DST->M[m4-m7] = M1[m4-m7] * M2[m4]
|
"vmul.f32 q13, q8, d2[0] \n\t" // DST->M[m4-m7] = M1[m4-m7] * M2[m4]
|
||||||
"vmul.f32 q14, q8, d4[0] \n\t" // DST->M[m8-m11] = M1[m8-m11] * M2[m8]
|
"vmul.f32 q14, q8, d4[0] \n\t" // DST->M[m8-m11] = M1[m8-m11] * M2[m8]
|
||||||
"vmul.f32 q15, q8, d6[0] \n\t" // DST->M[m12-m15] = M1[m12-m15] * M2[m12]
|
"vmul.f32 q15, q8, d6[0] \n\t" // DST->M[m12-m15] = M1[m12-m15] * M2[m12]
|
||||||
|
|
||||||
"vmla.f32 q12, q9, d0[1] \n\t" // DST->M[m0-m3] += M1[m0-m3] * M2[m1]
|
"vmla.f32 q12, q9, d0[1] \n\t" // DST->M[m0-m3] += M1[m0-m3] * M2[m1]
|
||||||
"vmla.f32 q13, q9, d2[1] \n\t" // DST->M[m4-m7] += M1[m4-m7] * M2[m5]
|
"vmla.f32 q13, q9, d2[1] \n\t" // DST->M[m4-m7] += M1[m4-m7] * M2[m5]
|
||||||
"vmla.f32 q14, q9, d4[1] \n\t" // DST->M[m8-m11] += M1[m8-m11] * M2[m9]
|
"vmla.f32 q14, q9, d4[1] \n\t" // DST->M[m8-m11] += M1[m8-m11] * M2[m9]
|
||||||
"vmla.f32 q15, q9, d6[1] \n\t" // DST->M[m12-m15] += M1[m12-m15] * M2[m13]
|
"vmla.f32 q15, q9, d6[1] \n\t" // DST->M[m12-m15] += M1[m12-m15] * M2[m13]
|
||||||
|
|
||||||
"vmla.f32 q12, q10, d1[0] \n\t" // DST->M[m0-m3] += M1[m0-m3] * M2[m2]
|
"vmla.f32 q12, q10, d1[0] \n\t" // DST->M[m0-m3] += M1[m0-m3] * M2[m2]
|
||||||
"vmla.f32 q13, q10, d3[0] \n\t" // DST->M[m4-m7] += M1[m4-m7] * M2[m6]
|
"vmla.f32 q13, q10, d3[0] \n\t" // DST->M[m4-m7] += M1[m4-m7] * M2[m6]
|
||||||
"vmla.f32 q14, q10, d5[0] \n\t" // DST->M[m8-m11] += M1[m8-m11] * M2[m10]
|
"vmla.f32 q14, q10, d5[0] \n\t" // DST->M[m8-m11] += M1[m8-m11] * M2[m10]
|
||||||
"vmla.f32 q15, q10, d7[0] \n\t" // DST->M[m12-m15] += M1[m12-m15] * M2[m14]
|
"vmla.f32 q15, q10, d7[0] \n\t" // DST->M[m12-m15] += M1[m12-m15] * M2[m14]
|
||||||
|
|
||||||
"vmla.f32 q12, q11, d1[1] \n\t" // DST->M[m0-m3] += M1[m0-m3] * M2[m3]
|
"vmla.f32 q12, q11, d1[1] \n\t" // DST->M[m0-m3] += M1[m0-m3] * M2[m3]
|
||||||
"vmla.f32 q13, q11, d3[1] \n\t" // DST->M[m4-m7] += M1[m4-m7] * M2[m7]
|
"vmla.f32 q13, q11, d3[1] \n\t" // DST->M[m4-m7] += M1[m4-m7] * M2[m7]
|
||||||
"vmla.f32 q14, q11, d5[1] \n\t" // DST->M[m8-m11] += M1[m8-m11] * M2[m11]
|
"vmla.f32 q14, q11, d5[1] \n\t" // DST->M[m8-m11] += M1[m8-m11] * M2[m11]
|
||||||
"vmla.f32 q15, q11, d7[1] \n\t" // DST->M[m12-m15] += M1[m12-m15] * M2[m15]
|
"vmla.f32 q15, q11, d7[1] \n\t" // DST->M[m12-m15] += M1[m12-m15] * M2[m15]
|
||||||
|
|
||||||
"vst1.32 {d24 - d27}, [%0]! \n\t" // DST->M[m0-m7]
|
"vst1.32 {d24 - d27}, [%0]! \n\t" // DST->M[m0-m7]
|
||||||
"vst1.32 {d28 - d31}, [%0] \n\t" // DST->M[m8-m15]
|
"vst1.32 {d28 - d31}, [%0] \n\t" // DST->M[m8-m15]
|
||||||
|
|
||||||
: // output
|
: // output
|
||||||
: "r"(dst), "r"(m1), "r"(m2) // input - note *value* of pointer doesn't change.
|
: "r"(dst), "r"(m1), "r"(m2) // input - note *value* of pointer doesn't change.
|
||||||
: "memory", "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15"
|
: "memory", "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::negateMatrix(const float* m, float* dst)
|
inline void MathUtilNeon::negateMatrix(const float* m, float* dst)
|
||||||
{
|
{
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vld1.32 {q0-q1}, [%1]! \n\t" // load m0-m7
|
"vld1.32 {q0-q1}, [%1]! \n\t" // load m0-m7
|
||||||
"vld1.32 {q2-q3}, [%1] \n\t" // load m8-m15
|
"vld1.32 {q2-q3}, [%1] \n\t" // load m8-m15
|
||||||
|
|
||||||
"vneg.f32 q4, q0 \n\t" // negate m0-m3
|
"vneg.f32 q4, q0 \n\t" // negate m0-m3
|
||||||
"vneg.f32 q5, q1 \n\t" // negate m4-m7
|
"vneg.f32 q5, q1 \n\t" // negate m4-m7
|
||||||
"vneg.f32 q6, q2 \n\t" // negate m8-m15
|
"vneg.f32 q6, q2 \n\t" // negate m8-m15
|
||||||
"vneg.f32 q7, q3 \n\t" // negate m8-m15
|
"vneg.f32 q7, q3 \n\t" // negate m8-m15
|
||||||
|
|
||||||
"vst1.32 {q4-q5}, [%0]! \n\t" // store m0-m7
|
"vst1.32 {q4-q5}, [%0]! \n\t" // store m0-m7
|
||||||
"vst1.32 {q6-q7}, [%0] \n\t" // store m8-m15
|
"vst1.32 {q6-q7}, [%0] \n\t" // store m8-m15
|
||||||
:
|
:
|
||||||
: "r"(dst), "r"(m)
|
: "r"(dst), "r"(m)
|
||||||
: "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "memory"
|
: "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "memory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::transposeMatrix(const float* m, float* dst)
|
inline void MathUtilNeon::transposeMatrix(const float* m, float* dst)
|
||||||
{
|
{
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vld4.32 {d0[0], d2[0], d4[0], d6[0]}, [%1]! \n\t" // DST->M[m0, m4, m8, m12] = M[m0-m3]
|
"vld4.32 {d0[0], d2[0], d4[0], d6[0]}, [%1]! \n\t" // DST->M[m0, m4, m8, m12] = M[m0-m3]
|
||||||
"vld4.32 {d0[1], d2[1], d4[1], d6[1]}, [%1]! \n\t" // DST->M[m1, m5, m9, m12] = M[m4-m7]
|
"vld4.32 {d0[1], d2[1], d4[1], d6[1]}, [%1]! \n\t" // DST->M[m1, m5, m9, m12] = M[m4-m7]
|
||||||
"vld4.32 {d1[0], d3[0], d5[0], d7[0]}, [%1]! \n\t" // DST->M[m2, m6, m10, m12] = M[m8-m11]
|
"vld4.32 {d1[0], d3[0], d5[0], d7[0]}, [%1]! \n\t" // DST->M[m2, m6, m10, m12] = M[m8-m11]
|
||||||
"vld4.32 {d1[1], d3[1], d5[1], d7[1]}, [%1] \n\t" // DST->M[m3, m7, m11, m12] = M[m12-m15]
|
"vld4.32 {d1[1], d3[1], d5[1], d7[1]}, [%1] \n\t" // DST->M[m3, m7, m11, m12] = M[m12-m15]
|
||||||
|
|
||||||
"vst1.32 {q0-q1}, [%0]! \n\t" // DST->M[m0-m7]
|
"vst1.32 {q0-q1}, [%0]! \n\t" // DST->M[m0-m7]
|
||||||
"vst1.32 {q2-q3}, [%0] \n\t" // DST->M[m8-m15]
|
"vst1.32 {q2-q3}, [%0] \n\t" // DST->M[m8-m15]
|
||||||
:
|
:
|
||||||
: "r"(dst), "r"(m)
|
: "r"(dst), "r"(m)
|
||||||
: "q0", "q1", "q2", "q3", "memory"
|
: "q0", "q1", "q2", "q3", "memory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::transformVec4(const float* m, float x, float y, float z, float w, float* dst)
|
inline void MathUtilNeon::transformVec4(const float* m, float x, float y, float z, float w, float* dst)
|
||||||
{
|
{
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vld1.32 {d0[0]}, [%1] \n\t" // V[x]
|
"vld1.32 {d0[0]}, [%1] \n\t" // V[x]
|
||||||
"vld1.32 {d0[1]}, [%2] \n\t" // V[y]
|
"vld1.32 {d0[1]}, [%2] \n\t" // V[y]
|
||||||
"vld1.32 {d1[0]}, [%3] \n\t" // V[z]
|
"vld1.32 {d1[0]}, [%3] \n\t" // V[z]
|
||||||
"vld1.32 {d1[1]}, [%4] \n\t" // V[w]
|
"vld1.32 {d1[1]}, [%4] \n\t" // V[w]
|
||||||
"vld1.32 {d18 - d21}, [%5]! \n\t" // M[m0-m7]
|
"vld1.32 {d18 - d21}, [%5]! \n\t" // M[m0-m7]
|
||||||
"vld1.32 {d22 - d25}, [%5] \n\t" // M[m8-m15]
|
"vld1.32 {d22 - d25}, [%5] \n\t" // M[m8-m15]
|
||||||
|
|
||||||
"vmul.f32 q13, q9, d0[0] \n\t" // DST->V = M[m0-m3] * V[x]
|
"vmul.f32 q13, q9, d0[0] \n\t" // DST->V = M[m0-m3] * V[x]
|
||||||
"vmla.f32 q13, q10, d0[1] \n\t" // DST->V += M[m4-m7] * V[y]
|
"vmla.f32 q13, q10, d0[1] \n\t" // DST->V += M[m4-m7] * V[y]
|
||||||
"vmla.f32 q13, q11, d1[0] \n\t" // DST->V += M[m8-m11] * V[z]
|
"vmla.f32 q13, q11, d1[0] \n\t" // DST->V += M[m8-m11] * V[z]
|
||||||
"vmla.f32 q13, q12, d1[1] \n\t" // DST->V += M[m12-m15] * V[w]
|
"vmla.f32 q13, q12, d1[1] \n\t" // DST->V += M[m12-m15] * V[w]
|
||||||
|
|
||||||
"vst1.32 {d26}, [%0]! \n\t" // DST->V[x, y]
|
"vst1.32 {d26}, [%0]! \n\t" // DST->V[x, y]
|
||||||
"vst1.32 {d27[0]}, [%0] \n\t" // DST->V[z]
|
"vst1.32 {d27[0]}, [%0] \n\t" // DST->V[z]
|
||||||
:
|
:
|
||||||
: "r"(dst), "r"(&x), "r"(&y), "r"(&z), "r"(&w), "r"(m)
|
: "r"(dst), "r"(&x), "r"(&y), "r"(&z), "r"(&w), "r"(m)
|
||||||
: "q0", "q9", "q10","q11", "q12", "q13", "memory"
|
: "q0", "q9", "q10","q11", "q12", "q13", "memory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::transformVec4(const float* m, const float* v, float* dst)
|
inline void MathUtilNeon::transformVec4(const float* m, const float* v, float* dst)
|
||||||
{
|
{
|
||||||
asm volatile
|
asm volatile
|
||||||
(
|
(
|
||||||
"vld1.32 {d0, d1}, [%1] \n\t" // V[x, y, z, w]
|
"vld1.32 {d0, d1}, [%1] \n\t" // V[x, y, z, w]
|
||||||
"vld1.32 {d18 - d21}, [%2]! \n\t" // M[m0-m7]
|
"vld1.32 {d18 - d21}, [%2]! \n\t" // M[m0-m7]
|
||||||
"vld1.32 {d22 - d25}, [%2] \n\t" // M[m8-m15]
|
"vld1.32 {d22 - d25}, [%2] \n\t" // M[m8-m15]
|
||||||
|
|
||||||
"vmul.f32 q13, q9, d0[0] \n\t" // DST->V = M[m0-m3] * V[x]
|
"vmul.f32 q13, q9, d0[0] \n\t" // DST->V = M[m0-m3] * V[x]
|
||||||
"vmla.f32 q13, q10, d0[1] \n\t" // DST->V = M[m4-m7] * V[y]
|
"vmla.f32 q13, q10, d0[1] \n\t" // DST->V = M[m4-m7] * V[y]
|
||||||
"vmla.f32 q13, q11, d1[0] \n\t" // DST->V = M[m8-m11] * V[z]
|
"vmla.f32 q13, q11, d1[0] \n\t" // DST->V = M[m8-m11] * V[z]
|
||||||
"vmla.f32 q13, q12, d1[1] \n\t" // DST->V = M[m12-m15] * V[w]
|
"vmla.f32 q13, q12, d1[1] \n\t" // DST->V = M[m12-m15] * V[w]
|
||||||
|
|
||||||
"vst1.32 {d26, d27}, [%0] \n\t" // DST->V
|
"vst1.32 {d26, d27}, [%0] \n\t" // DST->V
|
||||||
:
|
:
|
||||||
: "r"(dst), "r"(v), "r"(m)
|
: "r"(dst), "r"(v), "r"(m)
|
||||||
: "q0", "q9", "q10","q11", "q12", "q13", "memory"
|
: "q0", "q9", "q10","q11", "q12", "q13", "memory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::crossVec3(const float* v1, const float* v2, float* dst)
|
inline void MathUtilNeon::crossVec3(const float* v1, const float* v2, float* dst)
|
||||||
{
|
{
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vld1.32 {d1[1]}, [%1] \n\t" //
|
"vld1.32 {d1[1]}, [%1] \n\t" //
|
||||||
"vld1.32 {d0}, [%2] \n\t" //
|
"vld1.32 {d0}, [%2] \n\t" //
|
||||||
"vmov.f32 s2, s1 \n\t" // q0 = (v1y, v1z, v1z, v1x)
|
"vmov.f32 s2, s1 \n\t" // q0 = (v1y, v1z, v1z, v1x)
|
||||||
|
|
||||||
"vld1.32 {d2[1]}, [%3] \n\t" //
|
"vld1.32 {d2[1]}, [%3] \n\t" //
|
||||||
"vld1.32 {d3}, [%4] \n\t" //
|
"vld1.32 {d3}, [%4] \n\t" //
|
||||||
"vmov.f32 s4, s7 \n\t" // q1 = (v2z, v2x, v2y, v2z)
|
"vmov.f32 s4, s7 \n\t" // q1 = (v2z, v2x, v2y, v2z)
|
||||||
|
|
||||||
"vmul.f32 d4, d0, d2 \n\t" // x = v1y * v2z, y = v1z * v2x
|
"vmul.f32 d4, d0, d2 \n\t" // x = v1y * v2z, y = v1z * v2x
|
||||||
"vmls.f32 d4, d1, d3 \n\t" // x -= v1z * v2y, y-= v1x - v2z
|
"vmls.f32 d4, d1, d3 \n\t" // x -= v1z * v2y, y-= v1x - v2z
|
||||||
|
|
||||||
"vmul.f32 d5, d3, d1[1] \n\t" // z = v1x * v2y
|
"vmul.f32 d5, d3, d1[1] \n\t" // z = v1x * v2y
|
||||||
"vmls.f32 d5, d0, d2[1] \n\t" // z-= v1y * vx
|
"vmls.f32 d5, d0, d2[1] \n\t" // z-= v1y * vx
|
||||||
|
|
||||||
"vst1.32 {d4}, [%0]! \n\t" // V[x, y]
|
"vst1.32 {d4}, [%0]! \n\t" // V[x, y]
|
||||||
"vst1.32 {d5[0]}, [%0] \n\t" // V[z]
|
"vst1.32 {d5[0]}, [%0] \n\t" // V[z]
|
||||||
:
|
:
|
||||||
: "r"(dst), "r"(v1), "r"((v1+1)), "r"(v2), "r"((v2+1))
|
: "r"(dst), "r"(v1), "r"((v1+1)), "r"(v2), "r"((v2+1))
|
||||||
: "q0", "q1", "q2", "memory"
|
: "q0", "q1", "q2", "memory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_MATH_END
|
NS_CC_MATH_END
|
||||||
|
|
|
@ -0,0 +1,218 @@
|
||||||
|
/**
|
||||||
|
Copyright 2013 BlackBerry Inc.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
Original file from GamePlay3D: http://gameplay3d.org
|
||||||
|
|
||||||
|
This file was modified to fit the cocos2d-x project
|
||||||
|
*/
|
||||||
|
|
||||||
|
NS_CC_MATH_BEGIN
|
||||||
|
|
||||||
|
class MathUtilNeon64
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline static void addMatrix(const float* m, float scalar, float* dst);
|
||||||
|
|
||||||
|
inline static void addMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
|
inline static void subtractMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
|
inline static void multiplyMatrix(const float* m, float scalar, float* dst);
|
||||||
|
|
||||||
|
inline static void multiplyMatrix(const float* m1, const float* m2, float* dst);
|
||||||
|
|
||||||
|
inline static void negateMatrix(const float* m, float* dst);
|
||||||
|
|
||||||
|
inline static void transposeMatrix(const float* m, float* dst);
|
||||||
|
|
||||||
|
inline static void transformVec4(const float* m, float x, float y, float z, float w, float* dst);
|
||||||
|
|
||||||
|
inline static void transformVec4(const float* m, const float* v, float* dst);
|
||||||
|
|
||||||
|
inline static void crossVec3(const float* v1, const float* v2, float* dst);
|
||||||
|
};
|
||||||
|
|
||||||
|
inline void MathUtilNeon64::addMatrix(const float* m, float scalar, float* dst)
|
||||||
|
{
|
||||||
|
dst[0] = m[0] + scalar;
|
||||||
|
dst[1] = m[1] + scalar;
|
||||||
|
dst[2] = m[2] + scalar;
|
||||||
|
dst[3] = m[3] + scalar;
|
||||||
|
dst[4] = m[4] + scalar;
|
||||||
|
dst[5] = m[5] + scalar;
|
||||||
|
dst[6] = m[6] + scalar;
|
||||||
|
dst[7] = m[7] + scalar;
|
||||||
|
dst[8] = m[8] + scalar;
|
||||||
|
dst[9] = m[9] + scalar;
|
||||||
|
dst[10] = m[10] + scalar;
|
||||||
|
dst[11] = m[11] + scalar;
|
||||||
|
dst[12] = m[12] + scalar;
|
||||||
|
dst[13] = m[13] + scalar;
|
||||||
|
dst[14] = m[14] + scalar;
|
||||||
|
dst[15] = m[15] + scalar;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MathUtilNeon64::addMatrix(const float* m1, const float* m2, float* dst)
|
||||||
|
{
|
||||||
|
dst[0] = m1[0] + m2[0];
|
||||||
|
dst[1] = m1[1] + m2[1];
|
||||||
|
dst[2] = m1[2] + m2[2];
|
||||||
|
dst[3] = m1[3] + m2[3];
|
||||||
|
dst[4] = m1[4] + m2[4];
|
||||||
|
dst[5] = m1[5] + m2[5];
|
||||||
|
dst[6] = m1[6] + m2[6];
|
||||||
|
dst[7] = m1[7] + m2[7];
|
||||||
|
dst[8] = m1[8] + m2[8];
|
||||||
|
dst[9] = m1[9] + m2[9];
|
||||||
|
dst[10] = m1[10] + m2[10];
|
||||||
|
dst[11] = m1[11] + m2[11];
|
||||||
|
dst[12] = m1[12] + m2[12];
|
||||||
|
dst[13] = m1[13] + m2[13];
|
||||||
|
dst[14] = m1[14] + m2[14];
|
||||||
|
dst[15] = m1[15] + m2[15];
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MathUtilNeon64::subtractMatrix(const float* m1, const float* m2, float* dst)
|
||||||
|
{
|
||||||
|
dst[0] = m1[0] - m2[0];
|
||||||
|
dst[1] = m1[1] - m2[1];
|
||||||
|
dst[2] = m1[2] - m2[2];
|
||||||
|
dst[3] = m1[3] - m2[3];
|
||||||
|
dst[4] = m1[4] - m2[4];
|
||||||
|
dst[5] = m1[5] - m2[5];
|
||||||
|
dst[6] = m1[6] - m2[6];
|
||||||
|
dst[7] = m1[7] - m2[7];
|
||||||
|
dst[8] = m1[8] - m2[8];
|
||||||
|
dst[9] = m1[9] - m2[9];
|
||||||
|
dst[10] = m1[10] - m2[10];
|
||||||
|
dst[11] = m1[11] - m2[11];
|
||||||
|
dst[12] = m1[12] - m2[12];
|
||||||
|
dst[13] = m1[13] - m2[13];
|
||||||
|
dst[14] = m1[14] - m2[14];
|
||||||
|
dst[15] = m1[15] - m2[15];
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MathUtilNeon64::multiplyMatrix(const float* m, float scalar, float* dst)
|
||||||
|
{
|
||||||
|
dst[0] = m[0] * scalar;
|
||||||
|
dst[1] = m[1] * scalar;
|
||||||
|
dst[2] = m[2] * scalar;
|
||||||
|
dst[3] = m[3] * scalar;
|
||||||
|
dst[4] = m[4] * scalar;
|
||||||
|
dst[5] = m[5] * scalar;
|
||||||
|
dst[6] = m[6] * scalar;
|
||||||
|
dst[7] = m[7] * scalar;
|
||||||
|
dst[8] = m[8] * scalar;
|
||||||
|
dst[9] = m[9] * scalar;
|
||||||
|
dst[10] = m[10] * scalar;
|
||||||
|
dst[11] = m[11] * scalar;
|
||||||
|
dst[12] = m[12] * scalar;
|
||||||
|
dst[13] = m[13] * scalar;
|
||||||
|
dst[14] = m[14] * scalar;
|
||||||
|
dst[15] = m[15] * scalar;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MathUtilNeon64::multiplyMatrix(const float* m1, const float* m2, float* dst)
|
||||||
|
{
|
||||||
|
// Support the case where m1 or m2 is the same array as dst.
|
||||||
|
float product[16];
|
||||||
|
|
||||||
|
product[0] = m1[0] * m2[0] + m1[4] * m2[1] + m1[8] * m2[2] + m1[12] * m2[3];
|
||||||
|
product[1] = m1[1] * m2[0] + m1[5] * m2[1] + m1[9] * m2[2] + m1[13] * m2[3];
|
||||||
|
product[2] = m1[2] * m2[0] + m1[6] * m2[1] + m1[10] * m2[2] + m1[14] * m2[3];
|
||||||
|
product[3] = m1[3] * m2[0] + m1[7] * m2[1] + m1[11] * m2[2] + m1[15] * m2[3];
|
||||||
|
|
||||||
|
product[4] = m1[0] * m2[4] + m1[4] * m2[5] + m1[8] * m2[6] + m1[12] * m2[7];
|
||||||
|
product[5] = m1[1] * m2[4] + m1[5] * m2[5] + m1[9] * m2[6] + m1[13] * m2[7];
|
||||||
|
product[6] = m1[2] * m2[4] + m1[6] * m2[5] + m1[10] * m2[6] + m1[14] * m2[7];
|
||||||
|
product[7] = m1[3] * m2[4] + m1[7] * m2[5] + m1[11] * m2[6] + m1[15] * m2[7];
|
||||||
|
|
||||||
|
product[8] = m1[0] * m2[8] + m1[4] * m2[9] + m1[8] * m2[10] + m1[12] * m2[11];
|
||||||
|
product[9] = m1[1] * m2[8] + m1[5] * m2[9] + m1[9] * m2[10] + m1[13] * m2[11];
|
||||||
|
product[10] = m1[2] * m2[8] + m1[6] * m2[9] + m1[10] * m2[10] + m1[14] * m2[11];
|
||||||
|
product[11] = m1[3] * m2[8] + m1[7] * m2[9] + m1[11] * m2[10] + m1[15] * m2[11];
|
||||||
|
|
||||||
|
product[12] = m1[0] * m2[12] + m1[4] * m2[13] + m1[8] * m2[14] + m1[12] * m2[15];
|
||||||
|
product[13] = m1[1] * m2[12] + m1[5] * m2[13] + m1[9] * m2[14] + m1[13] * m2[15];
|
||||||
|
product[14] = m1[2] * m2[12] + m1[6] * m2[13] + m1[10] * m2[14] + m1[14] * m2[15];
|
||||||
|
product[15] = m1[3] * m2[12] + m1[7] * m2[13] + m1[11] * m2[14] + m1[15] * m2[15];
|
||||||
|
|
||||||
|
memcpy(dst, product, MATRIX_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MathUtilNeon64::negateMatrix(const float* m, float* dst)
|
||||||
|
{
|
||||||
|
dst[0] = -m[0];
|
||||||
|
dst[1] = -m[1];
|
||||||
|
dst[2] = -m[2];
|
||||||
|
dst[3] = -m[3];
|
||||||
|
dst[4] = -m[4];
|
||||||
|
dst[5] = -m[5];
|
||||||
|
dst[6] = -m[6];
|
||||||
|
dst[7] = -m[7];
|
||||||
|
dst[8] = -m[8];
|
||||||
|
dst[9] = -m[9];
|
||||||
|
dst[10] = -m[10];
|
||||||
|
dst[11] = -m[11];
|
||||||
|
dst[12] = -m[12];
|
||||||
|
dst[13] = -m[13];
|
||||||
|
dst[14] = -m[14];
|
||||||
|
dst[15] = -m[15];
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MathUtilNeon64::transposeMatrix(const float* m, float* dst)
|
||||||
|
{
|
||||||
|
float t[16] = {
|
||||||
|
m[0], m[4], m[8], m[12],
|
||||||
|
m[1], m[5], m[9], m[13],
|
||||||
|
m[2], m[6], m[10], m[14],
|
||||||
|
m[3], m[7], m[11], m[15]
|
||||||
|
};
|
||||||
|
memcpy(dst, t, MATRIX_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MathUtilNeon64::transformVec4(const float* m, float x, float y, float z, float w, float* dst)
|
||||||
|
{
|
||||||
|
dst[0] = x * m[0] + y * m[4] + z * m[8] + w * m[12];
|
||||||
|
dst[1] = x * m[1] + y * m[5] + z * m[9] + w * m[13];
|
||||||
|
dst[2] = x * m[2] + y * m[6] + z * m[10] + w * m[14];
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MathUtilNeon64::transformVec4(const float* m, const float* v, float* dst)
|
||||||
|
{
|
||||||
|
// Handle case where v == dst.
|
||||||
|
float x = v[0] * m[0] + v[1] * m[4] + v[2] * m[8] + v[3] * m[12];
|
||||||
|
float y = v[0] * m[1] + v[1] * m[5] + v[2] * m[9] + v[3] * m[13];
|
||||||
|
float z = v[0] * m[2] + v[1] * m[6] + v[2] * m[10] + v[3] * m[14];
|
||||||
|
float w = v[0] * m[3] + v[1] * m[7] + v[2] * m[11] + v[3] * m[15];
|
||||||
|
|
||||||
|
dst[0] = x;
|
||||||
|
dst[1] = y;
|
||||||
|
dst[2] = z;
|
||||||
|
dst[3] = w;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MathUtilNeon64::crossVec3(const float* v1, const float* v2, float* dst)
|
||||||
|
{
|
||||||
|
float x = (v1[1] * v2[2]) - (v1[2] * v2[1]);
|
||||||
|
float y = (v1[2] * v2[0]) - (v1[0] * v2[2]);
|
||||||
|
float z = (v1[0] * v2[1]) - (v1[1] * v2[0]);
|
||||||
|
|
||||||
|
dst[0] = x;
|
||||||
|
dst[1] = y;
|
||||||
|
dst[2] = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_CC_MATH_END
|
|
@ -1,6 +1,8 @@
|
||||||
NS_CC_MATH_BEGIN
|
NS_CC_MATH_BEGIN
|
||||||
|
|
||||||
inline void MathUtil::addMatrix(const __m128 m[4], float scalar, __m128 dst[4])
|
#ifdef __SSE__
|
||||||
|
|
||||||
|
void MathUtil::addMatrix(const __m128 m[4], float scalar, __m128 dst[4])
|
||||||
{
|
{
|
||||||
__m128 s = _mm_set1_ps(scalar);
|
__m128 s = _mm_set1_ps(scalar);
|
||||||
dst[0] = _mm_add_ps(m[0], s);
|
dst[0] = _mm_add_ps(m[0], s);
|
||||||
|
@ -9,7 +11,7 @@ inline void MathUtil::addMatrix(const __m128 m[4], float scalar, __m128 dst[4])
|
||||||
dst[3] = _mm_add_ps(m[3], s);
|
dst[3] = _mm_add_ps(m[3], s);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::addMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4])
|
void MathUtil::addMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4])
|
||||||
{
|
{
|
||||||
dst[0] = _mm_add_ps(m1[0], m2[0]);
|
dst[0] = _mm_add_ps(m1[0], m2[0]);
|
||||||
dst[1] = _mm_add_ps(m1[1], m2[1]);
|
dst[1] = _mm_add_ps(m1[1], m2[1]);
|
||||||
|
@ -17,7 +19,7 @@ inline void MathUtil::addMatrix(const __m128 m1[4], const __m128 m2[4], __m128 d
|
||||||
dst[3] = _mm_add_ps(m1[3], m2[3]);
|
dst[3] = _mm_add_ps(m1[3], m2[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::subtractMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4])
|
void MathUtil::subtractMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4])
|
||||||
{
|
{
|
||||||
dst[0] = _mm_sub_ps(m1[0], m2[0]);
|
dst[0] = _mm_sub_ps(m1[0], m2[0]);
|
||||||
dst[1] = _mm_sub_ps(m1[1], m2[1]);
|
dst[1] = _mm_sub_ps(m1[1], m2[1]);
|
||||||
|
@ -25,7 +27,7 @@ inline void MathUtil::subtractMatrix(const __m128 m1[4], const __m128 m2[4], __m
|
||||||
dst[3] = _mm_sub_ps(m1[3], m2[3]);
|
dst[3] = _mm_sub_ps(m1[3], m2[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::multiplyMatrix(const __m128 m[4], float scalar, __m128 dst[4])
|
void MathUtil::multiplyMatrix(const __m128 m[4], float scalar, __m128 dst[4])
|
||||||
{
|
{
|
||||||
__m128 s = _mm_set1_ps(scalar);
|
__m128 s = _mm_set1_ps(scalar);
|
||||||
dst[0] = _mm_mul_ps(m[0], s);
|
dst[0] = _mm_mul_ps(m[0], s);
|
||||||
|
@ -34,7 +36,7 @@ inline void MathUtil::multiplyMatrix(const __m128 m[4], float scalar, __m128 dst
|
||||||
dst[3] = _mm_mul_ps(m[3], s);
|
dst[3] = _mm_mul_ps(m[3], s);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::multiplyMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4])
|
void MathUtil::multiplyMatrix(const __m128 m1[4], const __m128 m2[4], __m128 dst[4])
|
||||||
{
|
{
|
||||||
__m128 dst0, dst1, dst2, dst3;
|
__m128 dst0, dst1, dst2, dst3;
|
||||||
{
|
{
|
||||||
|
@ -114,7 +116,7 @@ inline void MathUtil::multiplyMatrix(const __m128 m1[4], const __m128 m2[4], __m
|
||||||
dst[3] = dst3;
|
dst[3] = dst3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::negateMatrix(const __m128 m[4], __m128 dst[4])
|
void MathUtil::negateMatrix(const __m128 m[4], __m128 dst[4])
|
||||||
{
|
{
|
||||||
__m128 z = _mm_setzero_ps();
|
__m128 z = _mm_setzero_ps();
|
||||||
dst[0] = _mm_sub_ps(z, m[0]);
|
dst[0] = _mm_sub_ps(z, m[0]);
|
||||||
|
@ -123,7 +125,7 @@ inline void MathUtil::negateMatrix(const __m128 m[4], __m128 dst[4])
|
||||||
dst[3] = _mm_sub_ps(z, m[3]);
|
dst[3] = _mm_sub_ps(z, m[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::transposeMatrix(const __m128 m[4], __m128 dst[4])
|
void MathUtil::transposeMatrix(const __m128 m[4], __m128 dst[4])
|
||||||
{
|
{
|
||||||
__m128 tmp0 = _mm_shuffle_ps(m[0], m[1], 0x44);
|
__m128 tmp0 = _mm_shuffle_ps(m[0], m[1], 0x44);
|
||||||
__m128 tmp2 = _mm_shuffle_ps(m[0], m[1], 0xEE);
|
__m128 tmp2 = _mm_shuffle_ps(m[0], m[1], 0xEE);
|
||||||
|
@ -136,7 +138,7 @@ inline void MathUtil::transposeMatrix(const __m128 m[4], __m128 dst[4])
|
||||||
dst[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD);
|
dst[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void MathUtil::transformVec4(const __m128 m[4], const __m128& v, __m128& dst)
|
void MathUtil::transformVec4(const __m128 m[4], const __m128& v, __m128& dst)
|
||||||
{
|
{
|
||||||
__m128 col1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0));
|
__m128 col1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0));
|
||||||
__m128 col2 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1));
|
__m128 col2 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1));
|
||||||
|
@ -144,9 +146,12 @@ inline void MathUtil::transformVec4(const __m128 m[4], const __m128& v, __m128&
|
||||||
__m128 col4 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(3, 3, 3, 3));
|
__m128 col4 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(3, 3, 3, 3));
|
||||||
|
|
||||||
dst = _mm_add_ps(
|
dst = _mm_add_ps(
|
||||||
_mm_add_ps(_mm_mul_ps(m[0], col1), _mm_mul_ps(m[1], col2)),
|
_mm_add_ps(_mm_mul_ps(m[0], col1), _mm_mul_ps(m[1], col2)),
|
||||||
_mm_add_ps(_mm_mul_ps(m[2], col3), _mm_mul_ps(m[3], col4))
|
_mm_add_ps(_mm_mul_ps(m[2], col3), _mm_mul_ps(m[3], col4))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
NS_CC_MATH_END
|
NS_CC_MATH_END
|
||||||
|
|
|
@ -133,6 +133,15 @@ public:
|
||||||
* @lua NA
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
virtual Platform getTargetPlatform() = 0;
|
virtual Platform getTargetPlatform() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Open url in default browser
|
||||||
|
@param String with url to open.
|
||||||
|
@return true if the resource located by the URL was successfully opened; otherwise false.
|
||||||
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
|
virtual bool openURL(const std::string &url) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of platform group
|
// end of platform group
|
||||||
|
|
|
@ -947,23 +947,15 @@ bool FileUtils::isAbsolutePath(const std::string& path) const
|
||||||
|
|
||||||
bool FileUtils::isDirectoryExistInternal(const std::string& dirPath) const
|
bool FileUtils::isDirectoryExistInternal(const std::string& dirPath) const
|
||||||
{
|
{
|
||||||
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||||
struct stat st;
|
WIN32_FILE_ATTRIBUTE_DATA wfad;
|
||||||
if (stat(dirPath.c_str(), &st) == 0)
|
std::wstring wdirPath(dirPath.begin(), dirPath.end());
|
||||||
{
|
if (GetFileAttributesEx(wdirPath.c_str(), GetFileExInfoStandard, &wfad))
|
||||||
return S_ISDIR(st.st_mode);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
|
||||||
WIN32_FILE_ATTRIBUTE_DATA wfad;
|
|
||||||
if (GetFileAttributesExA(dirPath.c_str(), GetFileExInfoStandard, &wfad))
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
|
||||||
unsigned long fAttrib = GetFileAttributesA(dirPath.c_str());
|
unsigned long fAttrib = GetFileAttributesA(dirPath.c_str());
|
||||||
if (fAttrib != INVALID_FILE_ATTRIBUTES &&
|
if (fAttrib != INVALID_FILE_ATTRIBUTES &&
|
||||||
(fAttrib & FILE_ATTRIBUTE_DIRECTORY))
|
(fAttrib & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
|
@ -971,7 +963,16 @@ bool FileUtils::isDirectoryExistInternal(const std::string& dirPath) const
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
#else
|
||||||
|
struct stat st;
|
||||||
|
if (stat(dirPath.c_str(), &st) == 0)
|
||||||
|
{
|
||||||
|
return S_ISDIR(st.st_mode);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FileUtils::isDirectoryExist(const std::string& dirPath)
|
bool FileUtils::isDirectoryExist(const std::string& dirPath)
|
||||||
|
@ -1041,7 +1042,47 @@ bool FileUtils::createDirectory(const std::string& path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
|
|
||||||
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||||
|
WIN32_FILE_ATTRIBUTE_DATA wfad;
|
||||||
|
std::wstring wpath(path.begin(), path.end());
|
||||||
|
if (!(GetFileAttributesEx(wpath.c_str(), GetFileExInfoStandard, &wfad)))
|
||||||
|
{
|
||||||
|
subpath = "";
|
||||||
|
for(int i = 0 ; i < dirs.size() ; ++i)
|
||||||
|
{
|
||||||
|
subpath += dirs[i];
|
||||||
|
if (i > 0 && !isDirectoryExist(subpath))
|
||||||
|
{
|
||||||
|
std::wstring wsubpath(subpath.begin(), subpath.end());
|
||||||
|
BOOL ret = CreateDirectory(wsubpath.c_str(), NULL);
|
||||||
|
if (!ret && ERROR_ALREADY_EXISTS != GetLastError())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
|
if ((GetFileAttributesA(path.c_str())) == INVALID_FILE_ATTRIBUTES)
|
||||||
|
{
|
||||||
|
subpath = "";
|
||||||
|
for (int i = 0; i < dirs.size(); ++i)
|
||||||
|
{
|
||||||
|
subpath += dirs[i];
|
||||||
|
if (!isDirectoryExist(subpath))
|
||||||
|
{
|
||||||
|
BOOL ret = CreateDirectoryA(subpath.c_str(), NULL);
|
||||||
|
if (!ret && ERROR_ALREADY_EXISTS != GetLastError())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
DIR *dir = NULL;
|
DIR *dir = NULL;
|
||||||
|
|
||||||
// Create path recursively
|
// Create path recursively
|
||||||
|
@ -1060,45 +1101,6 @@ bool FileUtils::createDirectory(const std::string& path)
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
|
||||||
WIN32_FILE_ATTRIBUTE_DATA wfad;
|
|
||||||
if (!(GetFileAttributesExA(path.c_str(), GetFileExInfoStandard, &wfad)))
|
|
||||||
{
|
|
||||||
subpath = "";
|
|
||||||
for(int i = 0 ; i < dirs.size() ; ++i)
|
|
||||||
{
|
|
||||||
subpath += dirs[i];
|
|
||||||
if (i > 0 && !isDirectoryExist(subpath))
|
|
||||||
{
|
|
||||||
BOOL ret = CreateDirectoryA(subpath.c_str(), NULL);
|
|
||||||
if (!ret && ERROR_ALREADY_EXISTS != GetLastError())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
|
||||||
if ((GetFileAttributesA(path.c_str())) == INVALID_FILE_ATTRIBUTES)
|
|
||||||
{
|
|
||||||
subpath = "";
|
|
||||||
for (int i = 0; i < dirs.size(); ++i)
|
|
||||||
{
|
|
||||||
subpath += dirs[i];
|
|
||||||
if (!isDirectoryExist(subpath))
|
|
||||||
{
|
|
||||||
BOOL ret = CreateDirectoryA(subpath.c_str(), NULL);
|
|
||||||
if (!ret && ERROR_ALREADY_EXISTS != GetLastError())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FileUtils::removeDirectory(const std::string& path)
|
bool FileUtils::removeDirectory(const std::string& path)
|
||||||
|
@ -1110,21 +1112,13 @@ bool FileUtils::removeDirectory(const std::string& path)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove downloaded files
|
// Remove downloaded files
|
||||||
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
|
|
||||||
std::string command = "rm -r ";
|
|
||||||
// Path may include space.
|
|
||||||
command += "\"" + path + "\"";
|
|
||||||
if (system(command.c_str()) >= 0)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||||
std::string Files = path + "*.*";
|
std::wstring wpath = std::wstring(path.begin(), path.end());
|
||||||
|
std::wstring files = wpath + L"*.*";
|
||||||
WIN32_FIND_DATA wfd;
|
WIN32_FIND_DATA wfd;
|
||||||
HANDLE search = FindFirstFileEx(Files.c_str(), FindExInfoStandard, &wfd, FindExSearchNameMatch, NULL, 0);
|
HANDLE search = FindFirstFileEx(files.c_str(), FindExInfoStandard, &wfd, FindExSearchNameMatch, NULL, 0);
|
||||||
bool ret=true;
|
bool ret=true;
|
||||||
std::string Tmp;
|
|
||||||
if (search!=INVALID_HANDLE_VALUE)
|
if (search!=INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
bool find=true;
|
bool find=true;
|
||||||
|
@ -1133,16 +1127,16 @@ bool FileUtils::removeDirectory(const std::string& path)
|
||||||
//. ..
|
//. ..
|
||||||
if(wfd.cFileName[0]!='.')
|
if(wfd.cFileName[0]!='.')
|
||||||
{
|
{
|
||||||
Tmp = path + wfd.cFileName;
|
std::wstring temp = wpath + wfd.cFileName;
|
||||||
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
{
|
{
|
||||||
Tmp += '/';
|
temp += '/';
|
||||||
ret = ret && this->removeDirectory(Tmp);
|
ret = ret && this->removeDirectory(std::string(temp.begin(), temp.end()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetFileAttributes(Tmp.c_str(), FILE_ATTRIBUTE_NORMAL);
|
SetFileAttributes(temp.c_str(), FILE_ATTRIBUTE_NORMAL);
|
||||||
ret = ret && DeleteFile(Tmp.c_str());
|
ret = ret && DeleteFile(temp.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
find = FindNextFile(search, &wfd);
|
find = FindNextFile(search, &wfd);
|
||||||
|
@ -1150,10 +1144,9 @@ bool FileUtils::removeDirectory(const std::string& path)
|
||||||
FindClose(search);
|
FindClose(search);
|
||||||
}
|
}
|
||||||
if (ret)
|
if (ret)
|
||||||
return RemoveDirectoryA(path.c_str());
|
return RemoveDirectory(wpath.c_str());
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
|
||||||
std::string command = "cmd /c rd /s /q ";
|
std::string command = "cmd /c rd /s /q ";
|
||||||
// Path may include space.
|
// Path may include space.
|
||||||
command += "\"" + path + "\"";
|
command += "\"" + path + "\"";
|
||||||
|
@ -1162,14 +1155,8 @@ bool FileUtils::removeDirectory(const std::string& path)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#else
|
||||||
}
|
std::string command = "rm -r ";
|
||||||
|
|
||||||
bool FileUtils::removeFile(const std::string &path)
|
|
||||||
{
|
|
||||||
// Remove downloaded file
|
|
||||||
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
|
|
||||||
std::string command = "rm -f ";
|
|
||||||
// Path may include space.
|
// Path may include space.
|
||||||
command += "\"" + path + "\"";
|
command += "\"" + path + "\"";
|
||||||
if (system(command.c_str()) >= 0)
|
if (system(command.c_str()) >= 0)
|
||||||
|
@ -1177,14 +1164,20 @@ bool FileUtils::removeFile(const std::string &path)
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FileUtils::removeFile(const std::string &path)
|
||||||
|
{
|
||||||
|
// Remove downloaded file
|
||||||
|
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||||
if (DeleteFileA(path.c_str()))
|
std::wstring wpath(path.begin(), path.end());
|
||||||
|
if (DeleteFile(wpath.c_str()))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
|
||||||
std::string command = "cmd /c del /q ";
|
std::string command = "cmd /c del /q ";
|
||||||
std::string win32path = path;
|
std::string win32path = path;
|
||||||
int len = win32path.length();
|
int len = win32path.length();
|
||||||
|
@ -1201,6 +1194,14 @@ bool FileUtils::removeFile(const std::string &path)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
#else
|
||||||
|
std::string command = "rm -f ";
|
||||||
|
// Path may include space.
|
||||||
|
command += "\"" + path + "\"";
|
||||||
|
if (system(command.c_str()) >= 0)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,11 @@ Application::Platform Application::getTargetPlatform()
|
||||||
return Platform::OS_ANDROID;
|
return Platform::OS_ANDROID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Application::openURL(const std::string &url)
|
||||||
|
{
|
||||||
|
return openURLJNI(url.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
void Application::applicationScreenSizeChanged(int newWidth, int newHeight) {
|
void Application::applicationScreenSizeChanged(int newWidth, int newHeight) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,13 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual Platform getTargetPlatform();
|
virtual Platform getTargetPlatform();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Open url in default browser
|
||||||
|
@param String with url to open.
|
||||||
|
@return true if the resource located by the URL was successfully opened; otherwise false.
|
||||||
|
*/
|
||||||
|
virtual bool openURL(const std::string &url);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief This function will be called when the application screen size is changed.
|
@brief This function will be called when the application screen size is changed.
|
||||||
@param new width
|
@param new width
|
||||||
|
|
|
@ -32,9 +32,11 @@ import java.lang.Runnable;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.preference.PreferenceManager.OnActivityResultListener;
|
import android.preference.PreferenceManager.OnActivityResultListener;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
|
@ -171,6 +173,18 @@ public class Cocos2dxHelper {
|
||||||
((Cocos2dxActivity)sActivity).setKeepScreenOn(value);
|
((Cocos2dxActivity)sActivity).setKeepScreenOn(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean openURL(String url) {
|
||||||
|
boolean ret = false;
|
||||||
|
try {
|
||||||
|
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||||
|
i.setData(Uri.parse(url));
|
||||||
|
sActivity.startActivity(i);
|
||||||
|
ret = true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public static void preloadBackgroundMusic(final String pPath) {
|
public static void preloadBackgroundMusic(final String pPath) {
|
||||||
Cocos2dxHelper.sCocos2dMusic.preloadBackgroundMusic(pPath);
|
Cocos2dxHelper.sCocos2dMusic.preloadBackgroundMusic(pPath);
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,6 +219,20 @@ void setKeepScreenOnJni(bool value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern bool openURLJNI(const char* url) {
|
||||||
|
JniMethodInfo t;
|
||||||
|
|
||||||
|
bool ret = false;
|
||||||
|
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "openURL", "(Ljava/lang/String;)Z")) {
|
||||||
|
jstring stringArg = t.env->NewStringUTF(url);
|
||||||
|
ret = t.env->CallStaticBooleanMethod(t.classID, t.methodID, stringArg);
|
||||||
|
|
||||||
|
t.env->DeleteLocalRef(t.classID);
|
||||||
|
t.env->DeleteLocalRef(stringArg);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
// functions for UserDefault
|
// functions for UserDefault
|
||||||
bool getBoolForKeyJNI(const char* key, bool defaultValue)
|
bool getBoolForKeyJNI(const char* key, bool defaultValue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,6 +40,7 @@ extern void enableAccelerometerJni();
|
||||||
extern void disableAccelerometerJni();
|
extern void disableAccelerometerJni();
|
||||||
extern void setAccelerometerIntervalJni(float interval);
|
extern void setAccelerometerIntervalJni(float interval);
|
||||||
extern void setKeepScreenOnJni(bool value);
|
extern void setKeepScreenOnJni(bool value);
|
||||||
|
extern bool openURLJNI(const char* url);
|
||||||
// functions for UserDefault
|
// functions for UserDefault
|
||||||
extern bool getBoolForKeyJNI(const char* key, bool defaultValue);
|
extern bool getBoolForKeyJNI(const char* key, bool defaultValue);
|
||||||
extern int getIntegerForKeyJNI(const char* key, int defaultValue);
|
extern int getIntegerForKeyJNI(const char* key, int defaultValue);
|
||||||
|
|
|
@ -86,6 +86,13 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual Platform getTargetPlatform();
|
virtual Platform getTargetPlatform();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Open url in default browser
|
||||||
|
@param String with url to open.
|
||||||
|
@return true if the resource located by the URL was successfully opened; otherwise false.
|
||||||
|
*/
|
||||||
|
virtual bool openURL(const std::string &url);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief This function will be called when the application screen size is changed.
|
@brief This function will be called when the application screen size is changed.
|
||||||
@param new width
|
@param new width
|
||||||
|
|
|
@ -167,6 +167,13 @@ Application::Platform Application::getTargetPlatform()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Application::openURL(const std::string &url)
|
||||||
|
{
|
||||||
|
NSString* msg = [NSString stringWithCString:url.c_str() encoding:NSUTF8StringEncoding];
|
||||||
|
NSURL* nsUrl = [NSURL URLWithString:msg];
|
||||||
|
return [[UIApplication sharedApplication] openURL:nsUrl];
|
||||||
|
}
|
||||||
|
|
||||||
void Application::applicationScreenSizeChanged(int newWidth, int newHeight) {
|
void Application::applicationScreenSizeChanged(int newWidth, int newHeight) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -731,7 +731,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
|
||||||
CGSize viewSize = self.frame.size;
|
CGSize viewSize = self.frame.size;
|
||||||
CGFloat tmp;
|
CGFloat tmp;
|
||||||
|
|
||||||
switch ([[UIApplication sharedApplication] statusBarOrientation])
|
switch (getFixedOrientation([[UIApplication sharedApplication] statusBarOrientation]))
|
||||||
{
|
{
|
||||||
case UIInterfaceOrientationPortrait:
|
case UIInterfaceOrientationPortrait:
|
||||||
begin.origin.y = viewSize.height - begin.origin.y - begin.size.height;
|
begin.origin.y = viewSize.height - begin.origin.y - begin.size.height;
|
||||||
|
@ -744,15 +744,9 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UIInterfaceOrientationLandscapeLeft:
|
case UIInterfaceOrientationLandscapeLeft:
|
||||||
tmp = begin.size.width;
|
std::swap(begin.size.width, begin.size.height);
|
||||||
begin.size.width = begin.size.height;
|
std::swap(end.size.width, end.size.height);
|
||||||
begin.size.height = tmp;
|
std::swap(viewSize.width, viewSize.height);
|
||||||
tmp = end.size.width;
|
|
||||||
end.size.width = end.size.height;
|
|
||||||
end.size.height = tmp;
|
|
||||||
tmp = viewSize.width;
|
|
||||||
viewSize.width = viewSize.height;
|
|
||||||
viewSize.height = tmp;
|
|
||||||
|
|
||||||
tmp = begin.origin.x;
|
tmp = begin.origin.x;
|
||||||
begin.origin.x = begin.origin.y;
|
begin.origin.x = begin.origin.y;
|
||||||
|
@ -763,15 +757,9 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UIInterfaceOrientationLandscapeRight:
|
case UIInterfaceOrientationLandscapeRight:
|
||||||
tmp = begin.size.width;
|
std::swap(begin.size.width, begin.size.height);
|
||||||
begin.size.width = begin.size.height;
|
std::swap(end.size.width, end.size.height);
|
||||||
begin.size.height = tmp;
|
std::swap(viewSize.width, viewSize.height);
|
||||||
tmp = end.size.width;
|
|
||||||
end.size.width = end.size.height;
|
|
||||||
end.size.height = tmp;
|
|
||||||
tmp = viewSize.width;
|
|
||||||
viewSize.width = viewSize.height;
|
|
||||||
viewSize.height = tmp;
|
|
||||||
|
|
||||||
tmp = begin.origin.x;
|
tmp = begin.origin.x;
|
||||||
begin.origin.x = begin.origin.y;
|
begin.origin.x = begin.origin.y;
|
||||||
|
@ -850,6 +838,15 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrientation)
|
||||||
|
{
|
||||||
|
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
|
||||||
|
{
|
||||||
|
statusBarOrientation = UIInterfaceOrientationPortrait;
|
||||||
|
}
|
||||||
|
return statusBarOrientation;
|
||||||
|
}
|
||||||
|
|
||||||
-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)dis
|
-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)dis
|
||||||
{
|
{
|
||||||
[UIView beginAnimations:nil context:nullptr];
|
[UIView beginAnimations:nil context:nullptr];
|
||||||
|
@ -869,7 +866,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
|
||||||
dis /= 2.0f;
|
dis /= 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ([[UIApplication sharedApplication] statusBarOrientation])
|
switch (getFixedOrientation([[UIApplication sharedApplication] statusBarOrientation]))
|
||||||
{
|
{
|
||||||
case UIInterfaceOrientationPortrait:
|
case UIInterfaceOrientationPortrait:
|
||||||
self.frame = CGRectMake(originalRect_.origin.x, originalRect_.origin.y - dis, originalRect_.size.width, originalRect_.size.height);
|
self.frame = CGRectMake(originalRect_.origin.x, originalRect_.origin.y - dis, originalRect_.size.width, originalRect_.size.height);
|
||||||
|
|
|
@ -136,6 +136,12 @@ Application::Platform Application::getTargetPlatform()
|
||||||
return Platform::OS_LINUX;
|
return Platform::OS_LINUX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Application::openURL(const std::string &url)
|
||||||
|
{
|
||||||
|
std::string op = std::string("open ").append(url);
|
||||||
|
return system(op.c_str())!=-1;
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// static member function
|
// static member function
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -78,6 +78,13 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual const char * getCurrentLanguageCode();
|
virtual const char * getCurrentLanguageCode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Open url in default browser
|
||||||
|
@param String with url to open.
|
||||||
|
@return true if the resource located by the URL was successfully opened; otherwise false.
|
||||||
|
*/
|
||||||
|
virtual bool openURL(const std::string &url);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the Resource root path.
|
* Sets the Resource root path.
|
||||||
|
|
|
@ -91,6 +91,13 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual Platform getTargetPlatform();
|
virtual Platform getTargetPlatform();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Open url in default browser
|
||||||
|
@param String with url to open.
|
||||||
|
@return true if the resource located by the URL was successfully opened; otherwise false.
|
||||||
|
*/
|
||||||
|
virtual bool openURL(const std::string &url);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the Resource root path.
|
* Sets the Resource root path.
|
||||||
* @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead.
|
* @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead.
|
||||||
|
|
|
@ -213,6 +213,13 @@ LanguageType Application::getCurrentLanguage()
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Application::openURL(const std::string &url)
|
||||||
|
{
|
||||||
|
NSString* msg = [NSString stringWithCString:url.c_str() encoding:NSUTF8StringEncoding];
|
||||||
|
NSURL* nsUrl = [NSURL URLWithString:msg];
|
||||||
|
return [[NSWorkspace sharedWorkspace] openURL:nsUrl];
|
||||||
|
}
|
||||||
|
|
||||||
void Application::setResourceRootPath(const std::string& rootResDir)
|
void Application::setResourceRootPath(const std::string& rootResDir)
|
||||||
{
|
{
|
||||||
_resourceRootPath = rootResDir;
|
_resourceRootPath = rootResDir;
|
||||||
|
|
|
@ -30,6 +30,7 @@ THE SOFTWARE.
|
||||||
#include "base/CCDirector.h"
|
#include "base/CCDirector.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "platform/CCFileUtils.h"
|
#include "platform/CCFileUtils.h"
|
||||||
|
#include <shellapi.h>
|
||||||
/**
|
/**
|
||||||
@brief This function change the PVRFrame show/hide setting in register.
|
@brief This function change the PVRFrame show/hide setting in register.
|
||||||
@param bEnable If true show the PVRFrame window, otherwise hide.
|
@param bEnable If true show the PVRFrame window, otherwise hide.
|
||||||
|
@ -206,6 +207,15 @@ Application::Platform Application::getTargetPlatform()
|
||||||
return Platform::OS_WINDOWS;
|
return Platform::OS_WINDOWS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Application::openURL(const std::string &url)
|
||||||
|
{
|
||||||
|
WCHAR *temp = new WCHAR[url.size() + 1];
|
||||||
|
int wchars_num = MultiByteToWideChar(CP_UTF8, 0, url.c_str(), url.size() + 1, temp, url.size() + 1);
|
||||||
|
HINSTANCE r = ShellExecuteW(NULL, L"open", temp, NULL, NULL, SW_SHOWNORMAL);
|
||||||
|
delete[] temp;
|
||||||
|
return (int)r>32;
|
||||||
|
}
|
||||||
|
|
||||||
void Application::setResourceRootPath(const std::string& rootResDir)
|
void Application::setResourceRootPath(const std::string& rootResDir)
|
||||||
{
|
{
|
||||||
_resourceRootPath = rootResDir;
|
_resourceRootPath = rootResDir;
|
||||||
|
|
|
@ -75,6 +75,13 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual Platform getTargetPlatform();
|
virtual Platform getTargetPlatform();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Open url in default browser
|
||||||
|
@param String with url to open.
|
||||||
|
@return true if the resource located by the URL was successfully opened; otherwise false.
|
||||||
|
*/
|
||||||
|
virtual bool openURL(const std::string &url);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the Resource root path.
|
* Sets the Resource root path.
|
||||||
* @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead.
|
* @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead.
|
||||||
|
|
|
@ -54,7 +54,8 @@ Application * Application::sm_pSharedApplication = 0;
|
||||||
// sharedApplication pointer
|
// sharedApplication pointer
|
||||||
Application * s_pSharedApplication = 0;
|
Application * s_pSharedApplication = 0;
|
||||||
|
|
||||||
Application::Application()
|
Application::Application() :
|
||||||
|
m_openURLDelegate(nullptr)
|
||||||
{
|
{
|
||||||
m_nAnimationInterval.QuadPart = 0;
|
m_nAnimationInterval.QuadPart = 0;
|
||||||
CC_ASSERT(! sm_pSharedApplication);
|
CC_ASSERT(! sm_pSharedApplication);
|
||||||
|
@ -177,6 +178,19 @@ Application::Platform Application::getTargetPlatform()
|
||||||
return Platform::OS_WP8;
|
return Platform::OS_WP8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Application::openURL(const std::string &url)
|
||||||
|
{
|
||||||
|
if (m_openURLDelegate)
|
||||||
|
{
|
||||||
|
m_openURLDelegate(PlatformStringFromString(url));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Application::setResourceRootPath(const std::string& rootResDir)
|
void Application::setResourceRootPath(const std::string& rootResDir)
|
||||||
{
|
{
|
||||||
m_resourceRootPath = rootResDir;
|
m_resourceRootPath = rootResDir;
|
||||||
|
|
|
@ -31,6 +31,7 @@ THE SOFTWARE.
|
||||||
#include "platform/CCStdC.h"
|
#include "platform/CCStdC.h"
|
||||||
#include "platform/CCCommon.h"
|
#include "platform/CCCommon.h"
|
||||||
#include "platform/CCApplicationProtocol.h"
|
#include "platform/CCApplicationProtocol.h"
|
||||||
|
#include "platform/winrt/InputEvent.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
@ -63,6 +64,22 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual Platform getTargetPlatform() override;
|
virtual Platform getTargetPlatform() override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Open url in default browser
|
||||||
|
@param String with url to open.
|
||||||
|
@return true if the resource located by the URL was successfully opened; otherwise false.
|
||||||
|
*/
|
||||||
|
virtual bool openURL(const std::string &url);
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Set the callback responsible for opening a URL.
|
||||||
|
@param del The delegate that will handle opening a URL. We can't pass back a Platform::String due to name clash.
|
||||||
|
*/
|
||||||
|
void SetXamlOpenURLDelegate(const std::function<void(::Platform::String^)>& del)
|
||||||
|
{
|
||||||
|
m_openURLDelegate = del;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the Resource root path.
|
* Sets the Resource root path.
|
||||||
* @deprecated Please use CCFileUtils::sharedFileUtils()->setSearchPaths() instead.
|
* @deprecated Please use CCFileUtils::sharedFileUtils()->setSearchPaths() instead.
|
||||||
|
@ -87,6 +104,8 @@ protected:
|
||||||
std::string m_resourceRootPath;
|
std::string m_resourceRootPath;
|
||||||
std::string m_startupScriptFilename;
|
std::string m_startupScriptFilename;
|
||||||
|
|
||||||
|
std::function<void(::Platform::String^)> m_openURLDelegate;
|
||||||
|
|
||||||
static Application * sm_pSharedApplication;
|
static Application * sm_pSharedApplication;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,14 @@ void Device::setAccelerometerEnabled(bool isEnabled)
|
||||||
static Windows::Foundation::EventRegistrationToken sToken;
|
static Windows::Foundation::EventRegistrationToken sToken;
|
||||||
static bool sEnabled = false;
|
static bool sEnabled = false;
|
||||||
|
|
||||||
|
// we always need to reset the accelerometer
|
||||||
|
if (sAccelerometer)
|
||||||
|
{
|
||||||
|
sAccelerometer->ReadingChanged -= sToken;
|
||||||
|
sAccelerometer = nullptr;
|
||||||
|
sEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (isEnabled)
|
if (isEnabled)
|
||||||
{
|
{
|
||||||
sAccelerometer = Accelerometer::GetDefault();
|
sAccelerometer = Accelerometer::GetDefault();
|
||||||
|
@ -118,17 +126,6 @@ void Device::setAccelerometerEnabled(bool isEnabled)
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(event);
|
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (sAccelerometer)
|
|
||||||
{
|
|
||||||
sAccelerometer->ReadingChanged -= sToken;
|
|
||||||
sAccelerometer = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
sEnabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Device::setAccelerometerInterval(float interval)
|
void Device::setAccelerometerInterval(float interval)
|
||||||
|
|
|
@ -94,12 +94,14 @@ typedef SSIZE_T ssize_t;
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
|
#ifdef WINRT_NO_WINSOCK
|
||||||
#undef timeval
|
#undef timeval
|
||||||
struct timeval
|
struct timeval
|
||||||
{
|
{
|
||||||
long tv_sec; // seconds
|
long tv_sec; // seconds
|
||||||
long tv_usec; // microSeconds
|
long tv_usec; // microSeconds
|
||||||
};
|
};
|
||||||
|
#endif // WINRT_NO_WINSOCK
|
||||||
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WP8
|
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WP8
|
||||||
|
|
||||||
struct timezone
|
struct timezone
|
||||||
|
|
|
@ -95,6 +95,12 @@ std::string PlatformStringToString(Platform::String^ s) {
|
||||||
return std::string(t.begin(),t.end());
|
return std::string(t.begin(),t.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Platform::String^ PlatformStringFromString(const std::string& s)
|
||||||
|
{
|
||||||
|
std::wstring ws(CCUtf8ToUnicode(s.c_str()));
|
||||||
|
return ref new Platform::String(ws.data(), ws.length());
|
||||||
|
}
|
||||||
|
|
||||||
// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
|
// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
|
||||||
float ConvertDipsToPixels(float dips)
|
float ConvertDipsToPixels(float dips)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,6 +41,7 @@ NS_CC_BEGIN
|
||||||
std::wstring CC_DLL CCUtf8ToUnicode(const char * pszUtf8Str, unsigned len = -1);
|
std::wstring CC_DLL CCUtf8ToUnicode(const char * pszUtf8Str, unsigned len = -1);
|
||||||
std::string CC_DLL CCUnicodeToUtf8(const wchar_t* pwszStr);
|
std::string CC_DLL CCUnicodeToUtf8(const wchar_t* pwszStr);
|
||||||
std::string PlatformStringToString(Platform::String^ s);
|
std::string PlatformStringToString(Platform::String^ s);
|
||||||
|
Platform::String^ PlatformStringFromString(const std::string& s);
|
||||||
|
|
||||||
// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
|
// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
|
||||||
float ConvertDipsToPixels(float dips);
|
float ConvertDipsToPixels(float dips);
|
||||||
|
|
|
@ -36,6 +36,7 @@ namespace PhoneDirect3DXamlAppComponent
|
||||||
public delegate void Cocos2dEventDelegate(Cocos2dEvent event, Platform::String^ text);
|
public delegate void Cocos2dEventDelegate(Cocos2dEvent event, Platform::String^ text);
|
||||||
public delegate void Cocos2dMessageBoxDelegate(Platform::String^ title, Platform::String^ text);
|
public delegate void Cocos2dMessageBoxDelegate(Platform::String^ title, Platform::String^ text);
|
||||||
public delegate void Cocos2dEditBoxDelegate(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler);
|
public delegate void Cocos2dEditBoxDelegate(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler);
|
||||||
|
public delegate void Cocos2dOpenURLDelegate(Platform::String^ url);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
|
@ -181,7 +181,12 @@ void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Coco
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Cocos2dRenderer::SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate)
|
||||||
|
{
|
||||||
|
m_openURLDelegate = delegate;
|
||||||
|
Application* app = Application::getInstance();
|
||||||
|
if (app)
|
||||||
|
{
|
||||||
|
app->SetXamlOpenURLDelegate(delegate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ public:
|
||||||
void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate);
|
void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate);
|
||||||
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate);
|
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate);
|
||||||
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate);
|
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate);
|
||||||
|
void SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate);
|
||||||
|
|
||||||
Windows::Foundation::IAsyncAction^ OnSuspending();
|
Windows::Foundation::IAsyncAction^ OnSuspending();
|
||||||
void Connect();
|
void Connect();
|
||||||
|
@ -61,6 +62,7 @@ private:
|
||||||
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
|
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
|
||||||
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
||||||
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
||||||
|
PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ m_openURLDelegate;
|
||||||
|
|
||||||
// The AppDelegate for the Cocos2D app
|
// The AppDelegate for the Cocos2D app
|
||||||
AppDelegate* mApp;
|
AppDelegate* mApp;
|
||||||
|
|
|
@ -129,6 +129,11 @@ void Direct3DInterop::OnCocos2dEditboxEvent(Object^ sender, Platform::String^ ar
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e);
|
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Direct3DInterop::OnCocos2dOpenURL(Platform::String^ url)
|
||||||
|
{
|
||||||
|
m_openURLDelegate->Invoke(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -174,6 +179,12 @@ void Direct3DInterop::SetCocos2dEditBoxDelegate(Cocos2dEditBoxDelegate ^ delegat
|
||||||
m_renderer->SetXamlEditBoxDelegate(delegate);
|
m_renderer->SetXamlEditBoxDelegate(delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Direct3DInterop::SetCocos2dOpenURLDelegate(Cocos2dOpenURLDelegate ^ delegate)
|
||||||
|
{
|
||||||
|
m_openURLDelegate = delegate;
|
||||||
|
m_renderer->SetXamlOpenURLDelegate(delegate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Direct3DInterop::SendCocos2dEvent(Cocos2dEvent event)
|
bool Direct3DInterop::SendCocos2dEvent(Cocos2dEvent event)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
void OnCocos2dKeyEvent(Cocos2dKeyEvent key);
|
void OnCocos2dKeyEvent(Cocos2dKeyEvent key);
|
||||||
void OnCocos2dKeyEvent(Cocos2dKeyEvent key, Platform::String^ text);
|
void OnCocos2dKeyEvent(Cocos2dKeyEvent key, Platform::String^ text);
|
||||||
void OnCocos2dEditboxEvent(Platform::Object^ sender, Platform::String^ args, Windows::Foundation::EventHandler<Platform::String^>^ handler);
|
void OnCocos2dEditboxEvent(Platform::Object^ sender, Platform::String^ args, Windows::Foundation::EventHandler<Platform::String^>^ handler);
|
||||||
|
void OnCocos2dOpenURL(Platform::String^ url);
|
||||||
|
|
||||||
property Windows::Graphics::Display::DisplayOrientations WindowOrientation;
|
property Windows::Graphics::Display::DisplayOrientations WindowOrientation;
|
||||||
property Windows::Foundation::Size WindowBounds;
|
property Windows::Foundation::Size WindowBounds;
|
||||||
|
@ -67,6 +68,7 @@ public:
|
||||||
void SetCocos2dEventDelegate(Cocos2dEventDelegate^ delegate);
|
void SetCocos2dEventDelegate(Cocos2dEventDelegate^ delegate);
|
||||||
void SetCocos2dMessageBoxDelegate(Cocos2dMessageBoxDelegate ^ delegate);
|
void SetCocos2dMessageBoxDelegate(Cocos2dMessageBoxDelegate ^ delegate);
|
||||||
void SetCocos2dEditBoxDelegate(Cocos2dEditBoxDelegate ^ delegate);
|
void SetCocos2dEditBoxDelegate(Cocos2dEditBoxDelegate ^ delegate);
|
||||||
|
void SetCocos2dOpenURLDelegate(Cocos2dOpenURLDelegate ^ delegate);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -90,6 +92,7 @@ private:
|
||||||
Cocos2dEventDelegate^ m_delegate;
|
Cocos2dEventDelegate^ m_delegate;
|
||||||
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
||||||
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
||||||
|
Cocos2dOpenURLDelegate^ m_openURLDelegate;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ using Windows.UI.Input;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Microsoft.Phone.Info;
|
using Microsoft.Phone.Info;
|
||||||
using Windows.Graphics.Display;
|
using Windows.Graphics.Display;
|
||||||
|
using Microsoft.Phone.Tasks;
|
||||||
|
|
||||||
namespace PhoneDirect3DXamlAppInterop
|
namespace PhoneDirect3DXamlAppInterop
|
||||||
{
|
{
|
||||||
|
@ -93,6 +94,7 @@ namespace PhoneDirect3DXamlAppInterop
|
||||||
m_d3dInterop.SetCocos2dEventDelegate(OnCocos2dEvent);
|
m_d3dInterop.SetCocos2dEventDelegate(OnCocos2dEvent);
|
||||||
m_d3dInterop.SetCocos2dMessageBoxDelegate(OnCocos2dMessageBoxEvent);
|
m_d3dInterop.SetCocos2dMessageBoxDelegate(OnCocos2dMessageBoxEvent);
|
||||||
m_d3dInterop.SetCocos2dEditBoxDelegate(OpenEditBox);
|
m_d3dInterop.SetCocos2dEditBoxDelegate(OpenEditBox);
|
||||||
|
m_d3dInterop.SetCocos2dOpenURLDelegate(OpenURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,6 +208,13 @@ namespace PhoneDirect3DXamlAppInterop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OpenURL(String url)
|
||||||
|
{
|
||||||
|
WebBrowserTask webBrowserTask = new WebBrowserTask();
|
||||||
|
webBrowserTask.Uri = new Uri(url, UriKind.Absolute);
|
||||||
|
webBrowserTask.Show();
|
||||||
|
}
|
||||||
|
|
||||||
private void StartTimer()
|
private void StartTimer()
|
||||||
{
|
{
|
||||||
m_timer = new DispatcherTimer();
|
m_timer = new DispatcherTimer();
|
||||||
|
|
|
@ -86,7 +86,7 @@ const unsigned char s_133478C5A874C1E6F59B418CE6C7C39F1AE0F873[] = {
|
||||||
120, 116, 117, 114, 101, 48, 0, 0,
|
120, 116, 117, 114, 101, 48, 0, 0,
|
||||||
0, 0, 1, 0, 0, 0, 248, 3,
|
0, 0, 1, 0, 0, 0, 248, 3,
|
||||||
0, 0, 4, 5, 0, 0, 0, 0,
|
0, 0, 4, 5, 0, 0, 0, 0,
|
||||||
0, 0, 221, 144, 0, 0, 0, 0,
|
0, 0, 194, 137, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 68, 88, 66, 67, 11, 95,
|
0, 0, 68, 88, 66, 67, 11, 95,
|
||||||
74, 206, 145, 124, 32, 219, 67, 19,
|
74, 206, 145, 124, 32, 219, 67, 19,
|
||||||
|
@ -456,7 +456,7 @@ const unsigned char s_13E33F532157A58EC77EDE3B3112560A89D272B2[] = {
|
||||||
116, 114, 105, 120, 0, 0, 0, 0,
|
116, 114, 105, 120, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 204, 2, 0, 0,
|
0, 0, 0, 0, 204, 2, 0, 0,
|
||||||
164, 4, 0, 0, 0, 0, 0, 0,
|
164, 4, 0, 0, 0, 0, 0, 0,
|
||||||
221, 144, 0, 0, 0, 0, 0, 0,
|
194, 137, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
68, 88, 66, 67, 127, 145, 81, 72,
|
68, 88, 66, 67, 127, 145, 81, 72,
|
||||||
216, 190, 16, 61, 245, 231, 235, 249,
|
216, 190, 16, 61, 245, 231, 235, 249,
|
||||||
|
@ -800,7 +800,7 @@ const unsigned char s_1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE[] = {
|
||||||
116, 67, 111, 108, 111, 114, 0, 0,
|
116, 67, 111, 108, 111, 114, 0, 0,
|
||||||
0, 0, 3, 0, 0, 0, 208, 7,
|
0, 0, 3, 0, 0, 0, 208, 7,
|
||||||
0, 0, 4, 5, 0, 0, 0, 0,
|
0, 0, 4, 5, 0, 0, 0, 0,
|
||||||
0, 0, 221, 144, 0, 0, 0, 0,
|
0, 0, 194, 137, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 68, 88, 66, 67, 65, 106,
|
0, 0, 68, 88, 66, 67, 65, 106,
|
||||||
69, 173, 111, 248, 97, 165, 186, 90,
|
69, 173, 111, 248, 97, 165, 186, 90,
|
||||||
|
@ -1301,7 +1301,7 @@ const unsigned char s_53938AB67AD93ABA0DDB87F3C9889304284E011E[] = {
|
||||||
120, 116, 117, 114, 101, 48, 0, 0,
|
120, 116, 117, 114, 101, 48, 0, 0,
|
||||||
0, 0, 1, 0, 0, 0, 24, 4,
|
0, 0, 1, 0, 0, 0, 24, 4,
|
||||||
0, 0, 4, 5, 0, 0, 0, 0,
|
0, 0, 4, 5, 0, 0, 0, 0,
|
||||||
0, 0, 221, 144, 0, 0, 0, 0,
|
0, 0, 194, 137, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 68, 88, 66, 67, 200, 5,
|
0, 0, 68, 88, 66, 67, 200, 5,
|
||||||
103, 205, 248, 30, 69, 65, 32, 117,
|
103, 205, 248, 30, 69, 65, 32, 117,
|
||||||
|
@ -1675,7 +1675,7 @@ const unsigned char s_67837675F2BB48C0E926316F505FC1538228E0FA[] = {
|
||||||
86, 80, 77, 97, 116, 114, 105, 120,
|
86, 80, 77, 97, 116, 114, 105, 120,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
16, 4, 0, 0, 48, 5, 0, 0,
|
16, 4, 0, 0, 48, 5, 0, 0,
|
||||||
0, 0, 0, 0, 221, 144, 0, 0,
|
0, 0, 0, 0, 194, 137, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 68, 88, 66, 67,
|
0, 0, 0, 0, 68, 88, 66, 67,
|
||||||
79, 226, 72, 124, 94, 252, 37, 157,
|
79, 226, 72, 124, 94, 252, 37, 157,
|
||||||
|
@ -2070,7 +2070,7 @@ const unsigned char s_78250E25D1929D4A842050738140787BE42541C6[] = {
|
||||||
108, 112, 104, 97, 95, 118, 97, 108,
|
108, 112, 104, 97, 95, 118, 97, 108,
|
||||||
117, 101, 0, 0, 0, 0, 2, 0,
|
117, 101, 0, 0, 0, 0, 2, 0,
|
||||||
0, 0, 36, 5, 0, 0, 4, 5,
|
0, 0, 36, 5, 0, 0, 4, 5,
|
||||||
0, 0, 0, 0, 0, 0, 221, 144,
|
0, 0, 0, 0, 0, 0, 194, 137,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 68, 88,
|
0, 0, 0, 0, 0, 0, 68, 88,
|
||||||
66, 67, 100, 113, 175, 29, 164, 71,
|
66, 67, 100, 113, 175, 29, 164, 71,
|
||||||
|
@ -2485,7 +2485,7 @@ const unsigned char s_7B67DD242152D35ACC079265FAD9D03DC98182DE[] = {
|
||||||
67, 95, 84, 101, 120, 116, 117, 114,
|
67, 95, 84, 101, 120, 116, 117, 114,
|
||||||
101, 48, 0, 0, 0, 0, 1, 0,
|
101, 48, 0, 0, 0, 0, 1, 0,
|
||||||
0, 0, 248, 3, 0, 0, 0, 5,
|
0, 0, 248, 3, 0, 0, 0, 5,
|
||||||
0, 0, 0, 0, 0, 0, 221, 144,
|
0, 0, 0, 0, 0, 0, 194, 137,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 68, 88,
|
0, 0, 0, 0, 0, 0, 68, 88,
|
||||||
66, 67, 11, 95, 74, 206, 145, 124,
|
66, 67, 11, 95, 74, 206, 145, 124,
|
||||||
|
@ -2869,7 +2869,7 @@ const unsigned char s_7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D[] = {
|
||||||
99, 111, 108, 111, 114, 0, 0, 0,
|
99, 111, 108, 111, 114, 0, 0, 0,
|
||||||
0, 2, 0, 0, 0, 96, 4, 0,
|
0, 2, 0, 0, 0, 96, 4, 0,
|
||||||
0, 192, 4, 0, 0, 0, 0, 0,
|
0, 192, 4, 0, 0, 0, 0, 0,
|
||||||
0, 221, 144, 0, 0, 0, 0, 0,
|
0, 194, 137, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 68, 88, 66, 67, 157, 116, 105,
|
0, 68, 88, 66, 67, 157, 116, 105,
|
||||||
89, 118, 135, 249, 239, 42, 226, 184,
|
89, 118, 135, 249, 239, 42, 226, 184,
|
||||||
|
@ -3250,7 +3250,7 @@ const unsigned char s_7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C[] = {
|
||||||
117, 95, 99, 111, 108, 111, 114, 0,
|
117, 95, 99, 111, 108, 111, 114, 0,
|
||||||
0, 0, 0, 1, 0, 0, 0, 52,
|
0, 0, 0, 1, 0, 0, 0, 52,
|
||||||
3, 0, 0, 40, 4, 0, 0, 0,
|
3, 0, 0, 40, 4, 0, 0, 0,
|
||||||
0, 0, 0, 221, 144, 0, 0, 0,
|
0, 0, 0, 194, 137, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 68, 88, 66, 67, 153,
|
0, 0, 0, 68, 88, 66, 67, 153,
|
||||||
8, 62, 201, 202, 170, 111, 182, 149,
|
8, 62, 201, 202, 170, 111, 182, 149,
|
||||||
|
@ -3584,7 +3584,7 @@ const unsigned char s_847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5[] = {
|
||||||
111, 108, 111, 114, 0, 0, 0, 0,
|
111, 108, 111, 114, 0, 0, 0, 0,
|
||||||
2, 0, 0, 0, 240, 4, 0, 0,
|
2, 0, 0, 0, 240, 4, 0, 0,
|
||||||
4, 5, 0, 0, 0, 0, 0, 0,
|
4, 5, 0, 0, 0, 0, 0, 0,
|
||||||
221, 144, 0, 0, 0, 0, 0, 0,
|
194, 137, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
68, 88, 66, 67, 134, 66, 128, 226,
|
68, 88, 66, 67, 134, 66, 128, 226,
|
||||||
107, 172, 247, 161, 241, 207, 89, 240,
|
107, 172, 247, 161, 241, 207, 89, 240,
|
||||||
|
@ -4001,7 +4001,7 @@ const unsigned char s_92BE325B516F887D2C928EDE20ADF428DB01C038[] = {
|
||||||
95, 118, 97, 108, 117, 101, 0, 0,
|
95, 118, 97, 108, 117, 101, 0, 0,
|
||||||
0, 0, 2, 0, 0, 0, 36, 5,
|
0, 0, 2, 0, 0, 0, 36, 5,
|
||||||
0, 0, 0, 5, 0, 0, 0, 0,
|
0, 0, 0, 5, 0, 0, 0, 0,
|
||||||
0, 0, 221, 144, 0, 0, 0, 0,
|
0, 0, 194, 137, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 68, 88, 66, 67, 100, 113,
|
0, 0, 68, 88, 66, 67, 100, 113,
|
||||||
175, 29, 164, 71, 177, 78, 120, 99,
|
175, 29, 164, 71, 177, 78, 120, 99,
|
||||||
|
@ -5038,7 +5038,7 @@ const unsigned char s_976D0E98457C40DFC2F0FBD00E30607C9E4CFDAE[] = {
|
||||||
99, 111, 108, 111, 114, 0, 0, 0,
|
99, 111, 108, 111, 114, 0, 0, 0,
|
||||||
0, 3, 0, 0, 0, 96, 4, 0,
|
0, 3, 0, 0, 0, 96, 4, 0,
|
||||||
0, 148, 13, 0, 0, 0, 0, 0,
|
0, 148, 13, 0, 0, 0, 0, 0,
|
||||||
0, 221, 144, 0, 0, 0, 0, 0,
|
0, 194, 137, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 68, 88, 66, 67, 157, 116, 105,
|
0, 68, 88, 66, 67, 157, 116, 105,
|
||||||
89, 118, 135, 249, 239, 42, 226, 184,
|
89, 118, 135, 249, 239, 42, 226, 184,
|
||||||
|
@ -5709,7 +5709,7 @@ const unsigned char s_A2377A827972A5466DA8637681045D32DA8A817D[] = {
|
||||||
99, 111, 108, 111, 114, 0, 0, 0,
|
99, 111, 108, 111, 114, 0, 0, 0,
|
||||||
0, 2, 0, 0, 0, 96, 4, 0,
|
0, 2, 0, 0, 0, 96, 4, 0,
|
||||||
0, 144, 4, 0, 0, 0, 0, 0,
|
0, 144, 4, 0, 0, 0, 0, 0,
|
||||||
0, 221, 144, 0, 0, 0, 0, 0,
|
0, 194, 137, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 68, 88, 66, 67, 157, 116, 105,
|
0, 68, 88, 66, 67, 157, 116, 105,
|
||||||
89, 118, 135, 249, 239, 42, 226, 184,
|
89, 118, 135, 249, 239, 42, 226, 184,
|
||||||
|
@ -6094,7 +6094,7 @@ const unsigned char s_B5E27B4F3CF7236633255B28CBA530D6EE5CED86[] = {
|
||||||
111, 108, 111, 114, 0, 0, 0, 0,
|
111, 108, 111, 114, 0, 0, 0, 0,
|
||||||
2, 0, 0, 0, 240, 5, 0, 0,
|
2, 0, 0, 0, 240, 5, 0, 0,
|
||||||
4, 5, 0, 0, 0, 0, 0, 0,
|
4, 5, 0, 0, 0, 0, 0, 0,
|
||||||
221, 144, 0, 0, 0, 0, 0, 0,
|
194, 137, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
68, 88, 66, 67, 223, 173, 203, 80,
|
68, 88, 66, 67, 223, 173, 203, 80,
|
||||||
172, 13, 170, 215, 168, 128, 228, 5,
|
172, 13, 170, 215, 168, 128, 228, 5,
|
||||||
|
@ -6526,7 +6526,7 @@ const unsigned char s_E2C7CE1244DE9C76688EFA9463B2A130B6A08893[] = {
|
||||||
77, 97, 116, 114, 105, 120, 0, 0,
|
77, 97, 116, 114, 105, 120, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 204, 2,
|
0, 0, 0, 0, 0, 0, 204, 2,
|
||||||
0, 0, 144, 4, 0, 0, 0, 0,
|
0, 0, 144, 4, 0, 0, 0, 0,
|
||||||
0, 0, 221, 144, 0, 0, 0, 0,
|
0, 0, 194, 137, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 68, 88, 66, 67, 127, 145,
|
0, 0, 68, 88, 66, 67, 127, 145,
|
||||||
81, 72, 216, 190, 16, 61, 245, 231,
|
81, 72, 216, 190, 16, 61, 245, 231,
|
||||||
|
@ -6856,8 +6856,8 @@ const unsigned char s_E2D56227712263272BD5218FEA117CD06180F81B[] = {
|
||||||
117, 95, 112, 111, 105, 110, 116, 83,
|
117, 95, 112, 111, 105, 110, 116, 83,
|
||||||
105, 122, 101, 0, 0, 0, 0, 2,
|
105, 122, 101, 0, 0, 0, 0, 2,
|
||||||
0, 0, 0, 204, 2, 0, 0, 208,
|
0, 0, 0, 204, 2, 0, 0, 208,
|
||||||
4, 0, 0, 0, 0, 0, 0, 221,
|
4, 0, 0, 0, 0, 0, 0, 194,
|
||||||
144, 0, 0, 0, 0, 0, 0, 0,
|
137, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 68,
|
0, 0, 0, 0, 0, 0, 0, 68,
|
||||||
88, 66, 67, 127, 145, 81, 72, 216,
|
88, 66, 67, 127, 145, 81, 72, 216,
|
||||||
190, 16, 61, 245, 231, 235, 249, 125,
|
190, 16, 61, 245, 231, 235, 249, 125,
|
||||||
|
@ -7207,7 +7207,7 @@ const unsigned char s_F46558C274182079784898CF4968CF431593D5E2[] = {
|
||||||
116, 67, 111, 108, 111, 114, 0, 0,
|
116, 67, 111, 108, 111, 114, 0, 0,
|
||||||
0, 0, 3, 0, 0, 0, 108, 6,
|
0, 0, 3, 0, 0, 0, 108, 6,
|
||||||
0, 0, 4, 5, 0, 0, 0, 0,
|
0, 0, 4, 5, 0, 0, 0, 0,
|
||||||
0, 0, 221, 144, 0, 0, 0, 0,
|
0, 0, 194, 137, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 68, 88, 66, 67, 47, 220,
|
0, 0, 68, 88, 66, 67, 47, 220,
|
||||||
115, 183, 137, 174, 141, 96, 204, 60,
|
115, 183, 137, 174, 141, 96, 204, 60,
|
||||||
|
@ -7663,7 +7663,7 @@ const unsigned char s_F6BA4519AF2653A53D57FB5D5508F0D8617105D6[] = {
|
||||||
101, 120, 116, 117, 114, 101, 48, 0,
|
101, 120, 116, 117, 114, 101, 48, 0,
|
||||||
0, 0, 0, 1, 0, 0, 0, 156,
|
0, 0, 0, 1, 0, 0, 0, 156,
|
||||||
3, 0, 0, 144, 4, 0, 0, 0,
|
3, 0, 0, 144, 4, 0, 0, 0,
|
||||||
0, 0, 0, 221, 144, 0, 0, 0,
|
0, 0, 0, 194, 137, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 68, 88, 66, 67, 203,
|
0, 0, 0, 68, 88, 66, 67, 203,
|
||||||
117, 183, 110, 154, 52, 220, 70, 125,
|
117, 183, 110, 154, 52, 220, 70, 125,
|
||||||
|
|
|
@ -3,12 +3,28 @@
|
||||||
-- @module Application
|
-- @module Application
|
||||||
-- @parent_module cc
|
-- @parent_module cc
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- brief Open url in default browser<br>
|
||||||
|
-- param String with url to open.<br>
|
||||||
|
-- return true if the resource located by the URL was successfully opened; otherwise false.
|
||||||
|
-- @function [parent=#Application] openURL
|
||||||
|
-- @param self
|
||||||
|
-- @param #string url
|
||||||
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Get target platform
|
-- brief Get target platform
|
||||||
-- @function [parent=#Application] getTargetPlatform
|
-- @function [parent=#Application] getTargetPlatform
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return int#int ret (return value: int)
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- brief Get current language config<br>
|
||||||
|
-- return Current language config
|
||||||
|
-- @function [parent=#Application] getCurrentLanguage
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Get current language iso 639-1 code<br>
|
-- brief Get current language iso 639-1 code<br>
|
||||||
-- return Current language iso 639-1 code
|
-- return Current language iso 639-1 code
|
||||||
|
@ -16,13 +32,6 @@
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return char#char ret (return value: char)
|
-- @return char#char ret (return value: char)
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
-- brief Get current language config<br>
|
|
||||||
-- return Current language config
|
|
||||||
-- @function [parent=#Application] getCurrentLanguage
|
|
||||||
-- @param self
|
|
||||||
-- @return int#int ret (return value: int)
|
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Callback by Director to limit FPS.<br>
|
-- brief Callback by Director to limit FPS.<br>
|
||||||
-- param interval The time, expressed in seconds, between current frame and next.
|
-- param interval The time, expressed in seconds, between current frame and next.
|
||||||
|
|
|
@ -133,6 +133,12 @@
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return ArmatureAnimation#ArmatureAnimation ret (return value: ccs.ArmatureAnimation)
|
-- @return ArmatureAnimation#ArmatureAnimation ret (return value: ccs.ArmatureAnimation)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
--
|
||||||
|
-- @function [parent=#Armature] getOffsetPoints
|
||||||
|
-- @param self
|
||||||
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Get Armature's bone dictionary<br>
|
-- Get Armature's bone dictionary<br>
|
||||||
-- return Armature's bone dictionary
|
-- return Armature's bone dictionary
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module Device
|
||||||
|
-- @parent_module cc
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- To enable or disable accelerometer.
|
||||||
|
-- @function [parent=#Device] setAccelerometerEnabled
|
||||||
|
-- @param self
|
||||||
|
-- @param #bool isEnabled
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
--
|
||||||
|
-- @function [parent=#Device] setKeepScreenOn
|
||||||
|
-- @param self
|
||||||
|
-- @param #bool value
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- Sets the interval of accelerometer.
|
||||||
|
-- @function [parent=#Device] setAccelerometerInterval
|
||||||
|
-- @param self
|
||||||
|
-- @param #float interval
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- Gets the DPI of device<br>
|
||||||
|
-- return The DPI of device.
|
||||||
|
-- @function [parent=#Device] getDPI
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
return nil
|
|
@ -10,6 +10,12 @@
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return PhysicsWorld#PhysicsWorld ret (return value: cc.PhysicsWorld)
|
-- @return PhysicsWorld#PhysicsWorld ret (return value: cc.PhysicsWorld)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- render the scene
|
||||||
|
-- @function [parent=#Scene] render
|
||||||
|
-- @param self
|
||||||
|
-- @param #cc.Renderer renderer
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- creates a new Scene object with a predefined Size
|
-- creates a new Scene object with a predefined Size
|
||||||
-- @function [parent=#Scene] createWithSize
|
-- @function [parent=#Scene] createWithSize
|
||||||
|
|
|
@ -1146,6 +1146,11 @@
|
||||||
-- @field [parent=#cc] TextureCache#TextureCache TextureCache preloaded module
|
-- @field [parent=#cc] TextureCache#TextureCache TextureCache preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the cc Device
|
||||||
|
-- @field [parent=#cc] Device#Device Device preloaded module
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------
|
--------------------------------------------------------
|
||||||
-- the cc Application
|
-- the cc Application
|
||||||
-- @field [parent=#cc] Application#Application Application preloaded module
|
-- @field [parent=#cc] Application#Application Application preloaded module
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "lua_cocos2dx_audioengine_auto.hpp"
|
#include "lua_cocos2dx_audioengine_auto.hpp"
|
||||||
|
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC
|
||||||
#include "AudioEngine.h"
|
#include "AudioEngine.h"
|
||||||
#include "tolua_fix.h"
|
#include "tolua_fix.h"
|
||||||
#include "LuaBasicConversions.h"
|
#include "LuaBasicConversions.h"
|
||||||
|
@ -907,3 +908,4 @@ TOLUA_API int register_all_cocos2dx_audioengine(lua_State* tolua_S)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "base/ccConfig.h"
|
#include "base/ccConfig.h"
|
||||||
|
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC
|
||||||
#ifndef __cocos2dx_audioengine_h__
|
#ifndef __cocos2dx_audioengine_h__
|
||||||
#define __cocos2dx_audioengine_h__
|
#define __cocos2dx_audioengine_h__
|
||||||
|
|
||||||
|
@ -39,3 +40,4 @@ int register_all_cocos2dx_audioengine(lua_State* tolua_S);
|
||||||
|
|
||||||
|
|
||||||
#endif // __cocos2dx_audioengine_h__
|
#endif // __cocos2dx_audioengine_h__
|
||||||
|
#endif //#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC
|
||||||
|
|
|
@ -9039,6 +9039,52 @@ int lua_cocos2dx_Scene_getPhysicsWorld(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int lua_cocos2dx_Scene_render(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
cocos2d::Scene* cobj = nullptr;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertype(tolua_S,1,"cc.Scene",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cobj = (cocos2d::Scene*)tolua_tousertype(tolua_S,1,0);
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!cobj)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Scene_render'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S)-1;
|
||||||
|
if (argc == 1)
|
||||||
|
{
|
||||||
|
cocos2d::Renderer* arg0;
|
||||||
|
|
||||||
|
ok &= luaval_to_object<cocos2d::Renderer>(tolua_S, 2, "cc.Renderer",&arg0);
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
cobj->render(arg0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scene:render",argc, 1);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Scene_render'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int lua_cocos2dx_Scene_createWithSize(lua_State* tolua_S)
|
int lua_cocos2dx_Scene_createWithSize(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -9147,6 +9193,7 @@ int lua_register_cocos2dx_Scene(lua_State* tolua_S)
|
||||||
|
|
||||||
tolua_beginmodule(tolua_S,"Scene");
|
tolua_beginmodule(tolua_S,"Scene");
|
||||||
tolua_function(tolua_S,"getPhysicsWorld",lua_cocos2dx_Scene_getPhysicsWorld);
|
tolua_function(tolua_S,"getPhysicsWorld",lua_cocos2dx_Scene_getPhysicsWorld);
|
||||||
|
tolua_function(tolua_S,"render",lua_cocos2dx_Scene_render);
|
||||||
tolua_function(tolua_S,"createWithSize", lua_cocos2dx_Scene_createWithSize);
|
tolua_function(tolua_S,"createWithSize", lua_cocos2dx_Scene_createWithSize);
|
||||||
tolua_function(tolua_S,"create", lua_cocos2dx_Scene_create);
|
tolua_function(tolua_S,"create", lua_cocos2dx_Scene_create);
|
||||||
tolua_function(tolua_S,"createWithPhysics", lua_cocos2dx_Scene_createWithPhysics);
|
tolua_function(tolua_S,"createWithPhysics", lua_cocos2dx_Scene_createWithPhysics);
|
||||||
|
@ -58962,6 +59009,203 @@ int lua_register_cocos2dx_TextureCache(lua_State* tolua_S)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int lua_cocos2dx_Device_setAccelerometerEnabled(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertable(tolua_S,1,"cc.Device",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S) - 1;
|
||||||
|
|
||||||
|
if (argc == 1)
|
||||||
|
{
|
||||||
|
bool arg0;
|
||||||
|
ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Device:setAccelerometerEnabled");
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
cocos2d::Device::setAccelerometerEnabled(arg0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Device:setAccelerometerEnabled",argc, 1);
|
||||||
|
return 0;
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Device_setAccelerometerEnabled'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int lua_cocos2dx_Device_setKeepScreenOn(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertable(tolua_S,1,"cc.Device",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S) - 1;
|
||||||
|
|
||||||
|
if (argc == 1)
|
||||||
|
{
|
||||||
|
bool arg0;
|
||||||
|
ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Device:setKeepScreenOn");
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
cocos2d::Device::setKeepScreenOn(arg0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Device:setKeepScreenOn",argc, 1);
|
||||||
|
return 0;
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Device_setKeepScreenOn'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int lua_cocos2dx_Device_setAccelerometerInterval(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertable(tolua_S,1,"cc.Device",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S) - 1;
|
||||||
|
|
||||||
|
if (argc == 1)
|
||||||
|
{
|
||||||
|
double arg0;
|
||||||
|
ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Device:setAccelerometerInterval");
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
cocos2d::Device::setAccelerometerInterval(arg0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Device:setAccelerometerInterval",argc, 1);
|
||||||
|
return 0;
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Device_setAccelerometerInterval'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int lua_cocos2dx_Device_getDPI(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertable(tolua_S,1,"cc.Device",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S) - 1;
|
||||||
|
|
||||||
|
if (argc == 0)
|
||||||
|
{
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
int ret = cocos2d::Device::getDPI();
|
||||||
|
tolua_pushnumber(tolua_S,(lua_Number)ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Device:getDPI",argc, 0);
|
||||||
|
return 0;
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Device_getDPI'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
static int lua_cocos2dx_Device_finalize(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
printf("luabindings: finalizing LUA object (Device)");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int lua_register_cocos2dx_Device(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
tolua_usertype(tolua_S,"cc.Device");
|
||||||
|
tolua_cclass(tolua_S,"Device","cc.Device","",nullptr);
|
||||||
|
|
||||||
|
tolua_beginmodule(tolua_S,"Device");
|
||||||
|
tolua_function(tolua_S,"setAccelerometerEnabled", lua_cocos2dx_Device_setAccelerometerEnabled);
|
||||||
|
tolua_function(tolua_S,"setKeepScreenOn", lua_cocos2dx_Device_setKeepScreenOn);
|
||||||
|
tolua_function(tolua_S,"setAccelerometerInterval", lua_cocos2dx_Device_setAccelerometerInterval);
|
||||||
|
tolua_function(tolua_S,"getDPI", lua_cocos2dx_Device_getDPI);
|
||||||
|
tolua_endmodule(tolua_S);
|
||||||
|
std::string typeName = typeid(cocos2d::Device).name();
|
||||||
|
g_luaType[typeName] = "cc.Device";
|
||||||
|
g_typeCast["Device"] = "cc.Device";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int lua_cocos2dx_Application_openURL(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
cocos2d::Application* cobj = nullptr;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertype(tolua_S,1,"cc.Application",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!cobj)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Application_openURL'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S)-1;
|
||||||
|
if (argc == 1)
|
||||||
|
{
|
||||||
|
std::string arg0;
|
||||||
|
|
||||||
|
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Application:openURL");
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
bool ret = cobj->openURL(arg0);
|
||||||
|
tolua_pushboolean(tolua_S,(bool)ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:openURL",argc, 1);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Application_openURL'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int lua_cocos2dx_Application_getTargetPlatform(lua_State* tolua_S)
|
int lua_cocos2dx_Application_getTargetPlatform(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -59006,50 +59250,6 @@ int lua_cocos2dx_Application_getTargetPlatform(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int lua_cocos2dx_Application_getCurrentLanguageCode(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
cocos2d::Application* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"cc.Application",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Application_getCurrentLanguageCode'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
|
||||||
if (argc == 0)
|
|
||||||
{
|
|
||||||
if(!ok)
|
|
||||||
return 0;
|
|
||||||
const char* ret = cobj->getCurrentLanguageCode();
|
|
||||||
tolua_pushstring(tolua_S,(const char*)ret);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:getCurrentLanguageCode",argc, 0);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Application_getCurrentLanguageCode'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_cocos2dx_Application_getCurrentLanguage(lua_State* tolua_S)
|
int lua_cocos2dx_Application_getCurrentLanguage(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -59094,6 +59294,50 @@ int lua_cocos2dx_Application_getCurrentLanguage(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int lua_cocos2dx_Application_getCurrentLanguageCode(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
cocos2d::Application* cobj = nullptr;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertype(tolua_S,1,"cc.Application",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!cobj)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Application_getCurrentLanguageCode'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S)-1;
|
||||||
|
if (argc == 0)
|
||||||
|
{
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
const char* ret = cobj->getCurrentLanguageCode();
|
||||||
|
tolua_pushstring(tolua_S,(const char*)ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:getCurrentLanguageCode",argc, 0);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Application_getCurrentLanguageCode'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int lua_cocos2dx_Application_setAnimationInterval(lua_State* tolua_S)
|
int lua_cocos2dx_Application_setAnimationInterval(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -59183,9 +59427,10 @@ int lua_register_cocos2dx_Application(lua_State* tolua_S)
|
||||||
tolua_cclass(tolua_S,"Application","cc.Application","",nullptr);
|
tolua_cclass(tolua_S,"Application","cc.Application","",nullptr);
|
||||||
|
|
||||||
tolua_beginmodule(tolua_S,"Application");
|
tolua_beginmodule(tolua_S,"Application");
|
||||||
|
tolua_function(tolua_S,"openURL",lua_cocos2dx_Application_openURL);
|
||||||
tolua_function(tolua_S,"getTargetPlatform",lua_cocos2dx_Application_getTargetPlatform);
|
tolua_function(tolua_S,"getTargetPlatform",lua_cocos2dx_Application_getTargetPlatform);
|
||||||
tolua_function(tolua_S,"getCurrentLanguageCode",lua_cocos2dx_Application_getCurrentLanguageCode);
|
|
||||||
tolua_function(tolua_S,"getCurrentLanguage",lua_cocos2dx_Application_getCurrentLanguage);
|
tolua_function(tolua_S,"getCurrentLanguage",lua_cocos2dx_Application_getCurrentLanguage);
|
||||||
|
tolua_function(tolua_S,"getCurrentLanguageCode",lua_cocos2dx_Application_getCurrentLanguageCode);
|
||||||
tolua_function(tolua_S,"setAnimationInterval",lua_cocos2dx_Application_setAnimationInterval);
|
tolua_function(tolua_S,"setAnimationInterval",lua_cocos2dx_Application_setAnimationInterval);
|
||||||
tolua_function(tolua_S,"getInstance", lua_cocos2dx_Application_getInstance);
|
tolua_function(tolua_S,"getInstance", lua_cocos2dx_Application_getInstance);
|
||||||
tolua_endmodule(tolua_S);
|
tolua_endmodule(tolua_S);
|
||||||
|
@ -65523,6 +65768,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S)
|
||||||
lua_register_cocos2dx_TransitionTurnOffTiles(tolua_S);
|
lua_register_cocos2dx_TransitionTurnOffTiles(tolua_S);
|
||||||
lua_register_cocos2dx_RotateTo(tolua_S);
|
lua_register_cocos2dx_RotateTo(tolua_S);
|
||||||
lua_register_cocos2dx_TransitionSplitRows(tolua_S);
|
lua_register_cocos2dx_TransitionSplitRows(tolua_S);
|
||||||
|
lua_register_cocos2dx_Device(tolua_S);
|
||||||
lua_register_cocos2dx_TransitionProgressRadialCCW(tolua_S);
|
lua_register_cocos2dx_TransitionProgressRadialCCW(tolua_S);
|
||||||
lua_register_cocos2dx_EventListenerFocus(tolua_S);
|
lua_register_cocos2dx_EventListenerFocus(tolua_S);
|
||||||
lua_register_cocos2dx_TransitionPageTurn(tolua_S);
|
lua_register_cocos2dx_TransitionPageTurn(tolua_S);
|
||||||
|
|
|
@ -1567,6 +1567,13 @@ int register_all_cocos2dx(lua_State* tolua_S);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10782,6 +10782,50 @@ int lua_cocos2dx_studio_Armature_getAnimation(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int lua_cocos2dx_studio_Armature_getOffsetPoints(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
cocostudio::Armature* cobj = nullptr;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertype(tolua_S,1,"ccs.Armature",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!cobj)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getOffsetPoints'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S)-1;
|
||||||
|
if (argc == 0)
|
||||||
|
{
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
const cocos2d::Vec2& ret = cobj->getOffsetPoints();
|
||||||
|
vec2_to_luaval(tolua_S, ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.Armature:getOffsetPoints",argc, 0);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_Armature_getOffsetPoints'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int lua_cocos2dx_studio_Armature_getBoneDic(lua_State* tolua_S)
|
int lua_cocos2dx_studio_Armature_getBoneDic(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -10953,6 +10997,7 @@ int lua_register_cocos2dx_studio_Armature(lua_State* tolua_S)
|
||||||
tolua_function(tolua_S,"getArmatureData",lua_cocos2dx_studio_Armature_getArmatureData);
|
tolua_function(tolua_S,"getArmatureData",lua_cocos2dx_studio_Armature_getArmatureData);
|
||||||
tolua_function(tolua_S,"getVersion",lua_cocos2dx_studio_Armature_getVersion);
|
tolua_function(tolua_S,"getVersion",lua_cocos2dx_studio_Armature_getVersion);
|
||||||
tolua_function(tolua_S,"getAnimation",lua_cocos2dx_studio_Armature_getAnimation);
|
tolua_function(tolua_S,"getAnimation",lua_cocos2dx_studio_Armature_getAnimation);
|
||||||
|
tolua_function(tolua_S,"getOffsetPoints",lua_cocos2dx_studio_Armature_getOffsetPoints);
|
||||||
tolua_function(tolua_S,"getBoneDic",lua_cocos2dx_studio_Armature_getBoneDic);
|
tolua_function(tolua_S,"getBoneDic",lua_cocos2dx_studio_Armature_getBoneDic);
|
||||||
tolua_function(tolua_S,"create", lua_cocos2dx_studio_Armature_create);
|
tolua_function(tolua_S,"create", lua_cocos2dx_studio_Armature_create);
|
||||||
tolua_endmodule(tolua_S);
|
tolua_endmodule(tolua_S);
|
||||||
|
|
|
@ -490,6 +490,7 @@ int register_all_cocos2dx_studio(lua_State* tolua_S);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __cocos2dx_studio_h__
|
#endif // __cocos2dx_studio_h__
|
||||||
|
|
|
@ -1534,7 +1534,7 @@ bool luaval_to_ccvaluemap(lua_State* L, int lo, cocos2d::ValueMap* ret, const ch
|
||||||
{
|
{
|
||||||
lua_pop(L,1);
|
lua_pop(L,1);
|
||||||
ValueMap dictVal;
|
ValueMap dictVal;
|
||||||
if (luaval_to_ccvaluemap(L, -1, &dictVal))
|
if (luaval_to_ccvaluemap(L, lua_gettop(L), &dictVal))
|
||||||
{
|
{
|
||||||
dict[stringKey] = Value(dictVal);
|
dict[stringKey] = Value(dictVal);
|
||||||
}
|
}
|
||||||
|
@ -1543,7 +1543,7 @@ bool luaval_to_ccvaluemap(lua_State* L, int lo, cocos2d::ValueMap* ret, const ch
|
||||||
{
|
{
|
||||||
lua_pop(L,1);
|
lua_pop(L,1);
|
||||||
ValueVector arrVal;
|
ValueVector arrVal;
|
||||||
if (luaval_to_ccvaluevector(L, -1, &arrVal))
|
if (luaval_to_ccvaluevector(L, lua_gettop(L), &arrVal))
|
||||||
{
|
{
|
||||||
dict[stringKey] = Value(arrVal);
|
dict[stringKey] = Value(arrVal);
|
||||||
}
|
}
|
||||||
|
@ -1622,7 +1622,7 @@ bool luaval_to_ccvaluemapintkey(lua_State* L, int lo, cocos2d::ValueMapIntKey* r
|
||||||
{
|
{
|
||||||
lua_pop(L,1);
|
lua_pop(L,1);
|
||||||
ValueMap dictVal;
|
ValueMap dictVal;
|
||||||
if (luaval_to_ccvaluemap(L, -1, &dictVal))
|
if (luaval_to_ccvaluemap(L, lua_gettop(L), &dictVal))
|
||||||
{
|
{
|
||||||
dict[intKey] = Value(dictVal);
|
dict[intKey] = Value(dictVal);
|
||||||
}
|
}
|
||||||
|
@ -1631,7 +1631,7 @@ bool luaval_to_ccvaluemapintkey(lua_State* L, int lo, cocos2d::ValueMapIntKey* r
|
||||||
{
|
{
|
||||||
lua_pop(L,1);
|
lua_pop(L,1);
|
||||||
ValueVector arrVal;
|
ValueVector arrVal;
|
||||||
if (luaval_to_ccvaluevector(L, -1, &arrVal))
|
if (luaval_to_ccvaluevector(L, lua_gettop(L), &arrVal))
|
||||||
{
|
{
|
||||||
dict[intKey] = Value(arrVal);
|
dict[intKey] = Value(arrVal);
|
||||||
}
|
}
|
||||||
|
@ -1703,7 +1703,7 @@ bool luaval_to_ccvaluevector(lua_State* L, int lo, cocos2d::ValueVector* ret, co
|
||||||
{
|
{
|
||||||
lua_pop(L,1);
|
lua_pop(L,1);
|
||||||
ValueMap dictVal;
|
ValueMap dictVal;
|
||||||
if (luaval_to_ccvaluemap(L, -1, &dictVal))
|
if (luaval_to_ccvaluemap(L, lua_gettop(L), &dictVal))
|
||||||
{
|
{
|
||||||
ret->push_back(Value(dictVal));
|
ret->push_back(Value(dictVal));
|
||||||
}
|
}
|
||||||
|
@ -1712,7 +1712,7 @@ bool luaval_to_ccvaluevector(lua_State* L, int lo, cocos2d::ValueVector* ret, co
|
||||||
{
|
{
|
||||||
lua_pop(L,1);
|
lua_pop(L,1);
|
||||||
ValueVector arrVal;
|
ValueVector arrVal;
|
||||||
if(luaval_to_ccvaluevector(L, -1, &arrVal))
|
if(luaval_to_ccvaluevector(L, lua_gettop(L), &arrVal))
|
||||||
{
|
{
|
||||||
ret->push_back(Value(arrVal));
|
ret->push_back(Value(arrVal));
|
||||||
}
|
}
|
||||||
|
|
|
@ -407,6 +407,61 @@ static void extendBone(lua_State* L)
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int lua_cocos2dx_extension_Armature_getOffsetPoints(lua_State* L)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
cocostudio::Armature* cobj = nullptr;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertype(L,1,"ccs.Armature",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cobj = (cocostudio::Armature*)tolua_tousertype(L,1,0);
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!cobj)
|
||||||
|
{
|
||||||
|
tolua_error(L, "invalid 'cobj' in function 'lua_cocos2dx_extension_Armature_getOffsetPoints'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(L)-1;
|
||||||
|
if (argc == 0)
|
||||||
|
{
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
const cocos2d::Vec2& ret = cobj->getOffsetPoints();
|
||||||
|
vec2_to_luaval(L, ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffsetPoints", argc, 0);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(L,"#ferror in function 'lua_cocos2dx_extension_Armature_getOffsetPoints'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void extendArmature(lua_State* L)
|
||||||
|
{
|
||||||
|
lua_pushstring(L, "ccs.Armature");
|
||||||
|
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||||
|
if (lua_istable(L,-1))
|
||||||
|
{
|
||||||
|
tolua_function(L, "getOffsetPoints", lua_cocos2dx_extension_Armature_getOffsetPoints);
|
||||||
|
}
|
||||||
|
lua_pop(L, 1);
|
||||||
|
}
|
||||||
int lua_cocos2dx_studio_NodeReader_getInstance(lua_State* L)
|
int lua_cocos2dx_studio_NodeReader_getInstance(lua_State* L)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -607,6 +662,7 @@ int register_all_cocos2dx_coco_studio_manual(lua_State* L)
|
||||||
{
|
{
|
||||||
if (nullptr == L)
|
if (nullptr == L)
|
||||||
return 0;
|
return 0;
|
||||||
|
extendArmature(L);
|
||||||
extendArmatureAnimation(L);
|
extendArmatureAnimation(L);
|
||||||
extendArmatureDataManager(L);
|
extendArmatureDataManager(L);
|
||||||
extendBone(L);
|
extendBone(L);
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
150906F019D556C5002C4D97 /* lua_cocos2dx_audioengine_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E2BDB0319C5E5FE0055CDCD /* lua_cocos2dx_audioengine_auto.cpp */; };
|
||||||
|
150906F119D556C8002C4D97 /* lua_cocos2dx_audioengine_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3E2BDB0419C5E5FE0055CDCD /* lua_cocos2dx_audioengine_auto.hpp */; };
|
||||||
|
150906F219D556CE002C4D97 /* lua_cocos2dx_audioengine_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E2BDB0819C5E6100055CDCD /* lua_cocos2dx_audioengine_manual.cpp */; };
|
||||||
|
150906F319D556D1002C4D97 /* lua_cocos2dx_audioengine_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E2BDB0919C5E6100055CDCD /* lua_cocos2dx_audioengine_manual.h */; };
|
||||||
15415A7019A71768004F1E71 /* lua_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE74C18BC45C200215002 /* lua_cocos2dx_extension_auto.cpp */; };
|
15415A7019A71768004F1E71 /* lua_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE74C18BC45C200215002 /* lua_cocos2dx_extension_auto.cpp */; };
|
||||||
15415A7119A71782004F1E71 /* lua_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE74C18BC45C200215002 /* lua_cocos2dx_extension_auto.cpp */; };
|
15415A7119A71782004F1E71 /* lua_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE74C18BC45C200215002 /* lua_cocos2dx_extension_auto.cpp */; };
|
||||||
15415A7219A718FB004F1E71 /* lua_cocos2dx_3d_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1516227F19A0F3E3006099B8 /* lua_cocos2dx_3d_auto.cpp */; };
|
15415A7219A718FB004F1E71 /* lua_cocos2dx_3d_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1516227F19A0F3E3006099B8 /* lua_cocos2dx_3d_auto.cpp */; };
|
||||||
|
@ -749,6 +753,7 @@
|
||||||
15AC69E01987711400D17520 /* luaconf.h in Headers */,
|
15AC69E01987711400D17520 /* luaconf.h in Headers */,
|
||||||
155C7DF819A71C4400F08B25 /* lua_cocos2dx_cocosdenshion_manual.h in Headers */,
|
155C7DF819A71C4400F08B25 /* lua_cocos2dx_cocosdenshion_manual.h in Headers */,
|
||||||
15415AAF19A71A53004F1E71 /* except.h in Headers */,
|
15415AAF19A71A53004F1E71 /* except.h in Headers */,
|
||||||
|
150906F319D556D1002C4D97 /* lua_cocos2dx_audioengine_manual.h in Headers */,
|
||||||
155C7E0419A71C6D00F08B25 /* lua_cocos2dx_cocosbuilder_manual.h in Headers */,
|
155C7E0419A71C6D00F08B25 /* lua_cocos2dx_cocosbuilder_manual.h in Headers */,
|
||||||
15415ACB19A71A53004F1E71 /* socket.h in Headers */,
|
15415ACB19A71A53004F1E71 /* socket.h in Headers */,
|
||||||
15415ADF19A71A53004F1E71 /* usocket.h in Headers */,
|
15415ADF19A71A53004F1E71 /* usocket.h in Headers */,
|
||||||
|
@ -784,6 +789,7 @@
|
||||||
15415AC719A71A53004F1E71 /* select.h in Headers */,
|
15415AC719A71A53004F1E71 /* select.h in Headers */,
|
||||||
155C7E1C19A71CC200F08B25 /* lua_cocos2dx_spine_manual.hpp in Headers */,
|
155C7E1C19A71CC200F08B25 /* lua_cocos2dx_spine_manual.hpp in Headers */,
|
||||||
15C1C2D41987499F00A46ACC /* lua_cocos2dx_auto.hpp in Headers */,
|
15C1C2D41987499F00A46ACC /* lua_cocos2dx_auto.hpp in Headers */,
|
||||||
|
150906F119D556C8002C4D97 /* lua_cocos2dx_audioengine_auto.hpp in Headers */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
@ -921,6 +927,7 @@
|
||||||
files = (
|
files = (
|
||||||
15415A7219A718FB004F1E71 /* lua_cocos2dx_3d_auto.cpp in Sources */,
|
15415A7219A718FB004F1E71 /* lua_cocos2dx_3d_auto.cpp in Sources */,
|
||||||
15415A7319A718FB004F1E71 /* lua_cocos2dx_cocosbuilder_auto.cpp in Sources */,
|
15415A7319A718FB004F1E71 /* lua_cocos2dx_cocosbuilder_auto.cpp in Sources */,
|
||||||
|
150906F219D556CE002C4D97 /* lua_cocos2dx_audioengine_manual.cpp in Sources */,
|
||||||
15415A7519A718FB004F1E71 /* lua_cocos2dx_experimental_video_auto.cpp in Sources */,
|
15415A7519A718FB004F1E71 /* lua_cocos2dx_experimental_video_auto.cpp in Sources */,
|
||||||
15415A7619A718FB004F1E71 /* lua_cocos2dx_ui_auto.cpp in Sources */,
|
15415A7619A718FB004F1E71 /* lua_cocos2dx_ui_auto.cpp in Sources */,
|
||||||
15415A7719A718FB004F1E71 /* lua_cocos2dx_spine_auto.cpp in Sources */,
|
15415A7719A718FB004F1E71 /* lua_cocos2dx_spine_auto.cpp in Sources */,
|
||||||
|
@ -962,6 +969,7 @@
|
||||||
15C1C2CE1987498B00A46ACC /* LuaOpengl.cpp in Sources */,
|
15C1C2CE1987498B00A46ACC /* LuaOpengl.cpp in Sources */,
|
||||||
566F015F19B5EB0F00FCA620 /* CustomGUIReader.cpp in Sources */,
|
566F015F19B5EB0F00FCA620 /* CustomGUIReader.cpp in Sources */,
|
||||||
15415AC119A71A53004F1E71 /* options.c in Sources */,
|
15415AC119A71A53004F1E71 /* options.c in Sources */,
|
||||||
|
150906F019D556C5002C4D97 /* lua_cocos2dx_audioengine_auto.cpp in Sources */,
|
||||||
155C7E0A19A71C8B00F08B25 /* lua_cocos2dx_network_manual.cpp in Sources */,
|
155C7E0A19A71C8B00F08B25 /* lua_cocos2dx_network_manual.cpp in Sources */,
|
||||||
15415AD119A71A53004F1E71 /* timeout.c in Sources */,
|
15415AD119A71A53004F1E71 /* timeout.c in Sources */,
|
||||||
15C1C2CF1987498B00A46ACC /* lua_cocos2dx_deprecated.cpp in Sources */,
|
15C1C2CF1987498B00A46ACC /* lua_cocos2dx_deprecated.cpp in Sources */,
|
||||||
|
|
|
@ -28,7 +28,463 @@
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
|
|
||||||
#include "UIEditBox.h"
|
#include "UIEditBox.h"
|
||||||
#include "ui/proj.win32/Win32InputBox.h"
|
#include <windows.h>
|
||||||
|
#include <tchar.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "2d/CCLabel.h"
|
||||||
|
#include "base/CCDirector.h"
|
||||||
|
#include "base/ccUTF8.h"
|
||||||
|
|
||||||
|
#pragma warning (disable: 4312)
|
||||||
|
|
||||||
|
class CWin32InputBox;
|
||||||
|
|
||||||
|
// Structure used to orient the inputbox behavior
|
||||||
|
struct WIN32INPUTBOX_PARAM
|
||||||
|
{
|
||||||
|
friend class CWin32InputBox;
|
||||||
|
|
||||||
|
//
|
||||||
|
IN OPTIONAL bool bMultiline;
|
||||||
|
|
||||||
|
// Pass this as none zero so to use this memory dlg template
|
||||||
|
IN OPTIONAL LPVOID DlgTemplateData;
|
||||||
|
|
||||||
|
// Pass this as none ZERO so to load DLGTEMPLATE from resources
|
||||||
|
IN OPTIONAL LPCSTR DlgTemplateName;
|
||||||
|
|
||||||
|
// passing both "DlgTemplateName" and "DlgTemplateData" ZERO will cause
|
||||||
|
// the dialog to use his default embedded resource
|
||||||
|
|
||||||
|
// Center on monitor or owner window?
|
||||||
|
IN OPTIONAL bool bCenter;
|
||||||
|
|
||||||
|
// Want to add more styles to the dialog?
|
||||||
|
IN OPTIONAL DWORD dwStylesPlus, dwStylesMinus;
|
||||||
|
IN OPTIONAL DWORD dwExStylesPlus, dwExStylesMinus;
|
||||||
|
|
||||||
|
IN LPCSTR szTitle, szPrompt;
|
||||||
|
|
||||||
|
// Return buffer
|
||||||
|
OUT LPSTR szResult;
|
||||||
|
IN DWORD nResultSize;
|
||||||
|
|
||||||
|
// Owner window
|
||||||
|
HWND hwndOwner;
|
||||||
|
HINSTANCE hInstance;
|
||||||
|
|
||||||
|
short xPos, yPos;
|
||||||
|
|
||||||
|
WIN32INPUTBOX_PARAM();
|
||||||
|
private:
|
||||||
|
HWND hDlg;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CWin32InputBox
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
WIN32INPUTBOX_PARAM *_param;
|
||||||
|
static LRESULT CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
HWND _hwndEditCtrl;
|
||||||
|
|
||||||
|
void InitDialog();
|
||||||
|
void SetParam(WIN32INPUTBOX_PARAM *);
|
||||||
|
WIN32INPUTBOX_PARAM * GetParam();
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
CWin32InputBox(WIN32INPUTBOX_PARAM *);
|
||||||
|
~CWin32InputBox();
|
||||||
|
|
||||||
|
static INT_PTR InputBoxEx(WIN32INPUTBOX_PARAM *);
|
||||||
|
static INT_PTR InputBox(
|
||||||
|
LPCSTR szTitle,
|
||||||
|
LPCSTR szPrompt,
|
||||||
|
LPSTR szResult,
|
||||||
|
DWORD nResultSize,
|
||||||
|
bool bMultiLine = false,
|
||||||
|
HWND hwndParent = 0);
|
||||||
|
|
||||||
|
static std::string AnsiToUtf8(std::string strAnsi);
|
||||||
|
static std::string Utf8ToAnsi(std::string strUTF8);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _MSDN_DLGTEMPLATEEX
|
||||||
|
{
|
||||||
|
WORD dlgVer;
|
||||||
|
WORD signature;
|
||||||
|
DWORD helpID;
|
||||||
|
DWORD exStyle;
|
||||||
|
DWORD style;
|
||||||
|
WORD cDlgItems;
|
||||||
|
short x;
|
||||||
|
short y;
|
||||||
|
short cx;
|
||||||
|
short cy;
|
||||||
|
BYTE _rest[1]; // rest of structure
|
||||||
|
} MSDN_DLGTEMPLATEEX;
|
||||||
|
|
||||||
|
static bool IsDlgTemplateExtended(DLGTEMPLATE *dlgTemplate)
|
||||||
|
{
|
||||||
|
MSDN_DLGTEMPLATEEX *dgExTemplate = (MSDN_DLGTEMPLATEEX *)dlgTemplate;
|
||||||
|
|
||||||
|
// MSDN excerpt:
|
||||||
|
//* dlgVer
|
||||||
|
// Specifies the version number of the extended dialog box template. This member must be 1.
|
||||||
|
//* signature
|
||||||
|
// Indicates whether a template is an extended dialog box template.
|
||||||
|
// If signature is 0xFFFF, this is an extended dialog box template.
|
||||||
|
// In this case, the dlgVer member specifies the template version number.
|
||||||
|
// If signature is any value other than 0xFFFF, this is a standard dialog box template that uses the DLGTEMPLATE and DLGITEMTEMPLATE structures.
|
||||||
|
|
||||||
|
return (dgExTemplate->dlgVer == 1) && (dgExTemplate->signature == 0xFFFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use alignment if supported by the compiler
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if _MSC_VER > 1200
|
||||||
|
__declspec(align(4))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// per the MSDN, the DLGTEMPLATE must be DWORD aligned
|
||||||
|
// this was generated by the DlgResToDlgTemplate tool
|
||||||
|
static unsigned char definputbox_dlg[] =
|
||||||
|
{
|
||||||
|
0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0xc8, 0x00, 0x06,
|
||||||
|
0x00, 0x16, 0x00, 0x11, 0x00, 0xe7, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x69,
|
||||||
|
0x00, 0x6e, 0x00, 0x33, 0x00, 0x32, 0x00, 0x49, 0x00, 0x6e, 0x00, 0x70, 0x00, 0x75, 0x00, 0x74,
|
||||||
|
0x00, 0x42, 0x00, 0x6f, 0x00, 0x78, 0x00, 0x00, 0x00, 0x08, 0x00, 0xbc, 0x02, 0x00, 0x00, 0x4d,
|
||||||
|
0x00, 0x53, 0x00, 0x20, 0x00, 0x53, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20,
|
||||||
|
0x00, 0x44, 0x00, 0x6c, 0x00, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x80, 0x00, 0x02, 0x50, 0x06, 0x00, 0x04, 0x00, 0x9d, 0x00, 0x21, 0x00, 0xe8,
|
||||||
|
0x03, 0x00, 0x00, 0xff, 0xff, 0x82, 0x00, 0x50, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70,
|
||||||
|
0x00, 0x74, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x80, 0x00, 0x81, 0x50, 0x06, 0x00, 0x25, 0x00, 0xd8, 0x00, 0x0e, 0x00, 0xe9,
|
||||||
|
0x03, 0x00, 0x00, 0xff, 0xff, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x84, 0x10, 0xa1, 0x50, 0x06, 0x00, 0x37, 0x00, 0xd8, 0x00, 0x31, 0x00, 0xea,
|
||||||
|
0x03, 0x00, 0x00, 0xff, 0xff, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x50, 0xab, 0x00, 0x04, 0x00, 0x33, 0x00, 0x0e, 0x00, 0x01,
|
||||||
|
0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x00, 0x4f, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x50, 0xab, 0x00, 0x15, 0x00, 0x33,
|
||||||
|
0x00, 0x0e, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x00, 0x43, 0x00, 0x41, 0x00, 0x4e,
|
||||||
|
0x00, 0x43, 0x00, 0x45, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x27, 0x00, 0x08, 0x00, 0x08, 0x00, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||||
|
};
|
||||||
|
|
||||||
|
static LPCTSTR definputbox_buttonnames[] = { _T("OK"), _T("CANCEL") };
|
||||||
|
static const INT_PTR definputbox_buttonids[] = { IDOK, IDCANCEL };
|
||||||
|
|
||||||
|
static const INT
|
||||||
|
definputbox_id_prompt = 1000,
|
||||||
|
definputbox_id_edit1 = 1001,
|
||||||
|
definputbox_id_edit2 = 1002;
|
||||||
|
|
||||||
|
WIN32INPUTBOX_PARAM::WIN32INPUTBOX_PARAM()
|
||||||
|
{
|
||||||
|
bMultiline = false;
|
||||||
|
hwndOwner = 0;
|
||||||
|
DlgTemplateName = 0;
|
||||||
|
hInstance = (HINSTANCE) ::GetModuleHandle(0);
|
||||||
|
DlgTemplateData = definputbox_dlg;
|
||||||
|
|
||||||
|
bCenter = true;
|
||||||
|
|
||||||
|
dwStylesPlus = 0;
|
||||||
|
dwExStylesPlus = 0;
|
||||||
|
dwStylesMinus = 0xFFFFFFFF;
|
||||||
|
dwExStylesMinus = 0xFFFFFFFF;
|
||||||
|
|
||||||
|
xPos = yPos = -1;
|
||||||
|
|
||||||
|
szResult = 0;
|
||||||
|
nResultSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
CWin32InputBox::CWin32InputBox(WIN32INPUTBOX_PARAM *param)
|
||||||
|
{
|
||||||
|
_param = param;
|
||||||
|
}
|
||||||
|
|
||||||
|
CWin32InputBox::~CWin32InputBox()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWin32InputBox::SetParam(WIN32INPUTBOX_PARAM *param)
|
||||||
|
{
|
||||||
|
_param = param;
|
||||||
|
}
|
||||||
|
|
||||||
|
WIN32INPUTBOX_PARAM *CWin32InputBox::GetParam()
|
||||||
|
{
|
||||||
|
return _param;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT_PTR CWin32InputBox::InputBoxEx(WIN32INPUTBOX_PARAM *param)
|
||||||
|
{
|
||||||
|
// Check mandatory parameters
|
||||||
|
if (param->szResult == 0)
|
||||||
|
{
|
||||||
|
::SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
LPDLGTEMPLATE dlgTemplate;
|
||||||
|
|
||||||
|
if (param->DlgTemplateName != 0)
|
||||||
|
{
|
||||||
|
HMODULE hModule = (HMODULE)param->hInstance;
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
HRSRC rcDlg = ::FindResource(hModule, (LPWSTR)(ULONG_PTR)(size_t)(param->DlgTemplateName), RT_DIALOG);
|
||||||
|
#else
|
||||||
|
HRSRC rcDlg = ::FindResource(hModule, MAKEINTRESOURCE(param->DlgTemplateName), RT_DIALOG);
|
||||||
|
#endif
|
||||||
|
if (rcDlg == nullptr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
HGLOBAL hglobalDlg = ::LoadResource(hModule, rcDlg);
|
||||||
|
if (hglobalDlg == nullptr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
dlgTemplate = (LPDLGTEMPLATE)hglobalDlg;
|
||||||
|
}
|
||||||
|
else if (param->DlgTemplateData != 0)
|
||||||
|
{
|
||||||
|
dlgTemplate = (LPDLGTEMPLATE)param->DlgTemplateData;
|
||||||
|
}
|
||||||
|
|
||||||
|
MSDN_DLGTEMPLATEEX *dlgTemplateEx =
|
||||||
|
IsDlgTemplateExtended((LPDLGTEMPLATE)dlgTemplate) ? (MSDN_DLGTEMPLATEEX *)dlgTemplate : 0;
|
||||||
|
|
||||||
|
if (dlgTemplateEx != 0)
|
||||||
|
{
|
||||||
|
dlgTemplateEx->exStyle |= param->dwExStylesPlus;
|
||||||
|
dlgTemplateEx->style |= param->dwStylesPlus;
|
||||||
|
dlgTemplateEx->exStyle &= param->dwExStylesMinus;
|
||||||
|
dlgTemplateEx->style &= param->dwStylesMinus;
|
||||||
|
|
||||||
|
if (param->bCenter)
|
||||||
|
dlgTemplateEx->style |= DS_CENTER;
|
||||||
|
|
||||||
|
if (param->xPos != -1)
|
||||||
|
dlgTemplateEx->x = param->xPos;
|
||||||
|
if (param->yPos != -1)
|
||||||
|
dlgTemplateEx->y = param->yPos;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dlgTemplate->dwExtendedStyle |= param->dwExStylesPlus;
|
||||||
|
dlgTemplate->style |= param->dwStylesPlus;
|
||||||
|
dlgTemplate->dwExtendedStyle &= param->dwExStylesMinus;
|
||||||
|
dlgTemplate->style &= param->dwStylesMinus;
|
||||||
|
|
||||||
|
if (param->bCenter)
|
||||||
|
dlgTemplate->style |= DS_CENTER;
|
||||||
|
|
||||||
|
if (param->xPos != -1)
|
||||||
|
dlgTemplate->x = param->xPos;
|
||||||
|
|
||||||
|
if (param->yPos != -1)
|
||||||
|
dlgTemplate->y = param->yPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
CWin32InputBox inputbox(param);
|
||||||
|
|
||||||
|
// Resize dialog and SHOW or HIDE multiline
|
||||||
|
INT_PTR r = ::DialogBoxIndirectParam(param->hInstance, dlgTemplate, param->hwndOwner, (DLGPROC)DlgProc, (LPARAM)&inputbox);
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT_PTR CWin32InputBox::InputBox(
|
||||||
|
LPCSTR szTitle,
|
||||||
|
LPCSTR szPrompt,
|
||||||
|
LPSTR szResult,
|
||||||
|
DWORD nResultSize,
|
||||||
|
bool bMultiLine,
|
||||||
|
HWND hwndParent)
|
||||||
|
{
|
||||||
|
WIN32INPUTBOX_PARAM param;
|
||||||
|
|
||||||
|
param.szTitle = szTitle;
|
||||||
|
param.szPrompt = szPrompt;
|
||||||
|
param.szResult = szResult;
|
||||||
|
param.nResultSize = nResultSize;
|
||||||
|
param.bMultiline = bMultiLine;
|
||||||
|
param.hwndOwner = hwndParent;
|
||||||
|
return InputBoxEx(¶m);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWin32InputBox::InitDialog()
|
||||||
|
{
|
||||||
|
// Set the button captions
|
||||||
|
for (size_t i = 0; i<sizeof(definputbox_buttonids) / sizeof(definputbox_buttonids[0]); i++)
|
||||||
|
::SetDlgItemText(_param->hDlg, (int)definputbox_buttonids[i], definputbox_buttonnames[i]);
|
||||||
|
|
||||||
|
// Set other controls
|
||||||
|
::SetWindowTextA(_param->hDlg, Utf8ToAnsi(_param->szTitle).c_str());
|
||||||
|
::SetDlgItemTextA(_param->hDlg, definputbox_id_prompt, Utf8ToAnsi(_param->szPrompt).c_str());
|
||||||
|
|
||||||
|
HWND hwndEdit1 = ::GetDlgItem(_param->hDlg, definputbox_id_edit1);
|
||||||
|
HWND hwndEdit2 = ::GetDlgItem(_param->hDlg, definputbox_id_edit2);
|
||||||
|
|
||||||
|
if (_param->bMultiline)
|
||||||
|
_hwndEditCtrl = hwndEdit2;
|
||||||
|
else
|
||||||
|
_hwndEditCtrl = hwndEdit1;
|
||||||
|
|
||||||
|
::SetWindowTextA(_hwndEditCtrl, Utf8ToAnsi(_param->szResult).c_str());
|
||||||
|
|
||||||
|
RECT rectDlg, rectEdit1, rectEdit2;
|
||||||
|
|
||||||
|
::GetWindowRect(_param->hDlg, &rectDlg);
|
||||||
|
::GetWindowRect(hwndEdit1, &rectEdit1);
|
||||||
|
::GetWindowRect(hwndEdit2, &rectEdit2);
|
||||||
|
|
||||||
|
if (_param->bMultiline)
|
||||||
|
{
|
||||||
|
::ShowWindow(hwndEdit1, SW_HIDE);
|
||||||
|
::SetWindowPos(
|
||||||
|
hwndEdit2,
|
||||||
|
HWND_NOTOPMOST,
|
||||||
|
rectEdit1.left - rectDlg.left,
|
||||||
|
(rectEdit1.top - rectDlg.top) - (rectEdit1.bottom - rectEdit1.top),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
SWP_NOSIZE | SWP_NOZORDER);
|
||||||
|
|
||||||
|
::SetWindowPos(
|
||||||
|
_param->hDlg,
|
||||||
|
HWND_NOTOPMOST,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
rectDlg.right - rectDlg.left,
|
||||||
|
rectDlg.bottom - rectDlg.top - (rectEdit1.bottom - rectEdit1.top),
|
||||||
|
SWP_NOMOVE);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::SetWindowPos(
|
||||||
|
_param->hDlg,
|
||||||
|
HWND_NOTOPMOST,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
rectDlg.right - rectDlg.left,
|
||||||
|
rectEdit1.bottom - rectDlg.top + 5,
|
||||||
|
SWP_NOMOVE);
|
||||||
|
|
||||||
|
::ShowWindow(hwndEdit2, SW_HIDE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Message handler for about box.
|
||||||
|
LRESULT CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
CWin32InputBox *_this = (CWin32InputBox *) ::GetWindowLongPtr(hDlg, GWLP_USERDATA);
|
||||||
|
WIN32INPUTBOX_PARAM *param = _this ? _this->GetParam() : 0;
|
||||||
|
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
{
|
||||||
|
SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)lParam);
|
||||||
|
|
||||||
|
_this = (CWin32InputBox *)lParam;
|
||||||
|
_this->_param->hDlg = hDlg;
|
||||||
|
_this->InitDialog();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
case WM_COMMAND:
|
||||||
|
{
|
||||||
|
#ifdef _MY_DEBUG
|
||||||
|
CHAR buf[1024];
|
||||||
|
static int i = 0;
|
||||||
|
sprintf(buf, "WM_COMMAND: %09d wParam=%08X lParam=%08X\n", i++, wParam, lParam);
|
||||||
|
OutputDebugString(buf);
|
||||||
|
#endif
|
||||||
|
INT_PTR buttonId = LOWORD(wParam);
|
||||||
|
for (size_t i = 0;
|
||||||
|
i<sizeof(definputbox_buttonids) / sizeof(definputbox_buttonids[0]);
|
||||||
|
i++)
|
||||||
|
{
|
||||||
|
if (buttonId == definputbox_buttonids[i])
|
||||||
|
{
|
||||||
|
::GetWindowTextA(
|
||||||
|
_this->_hwndEditCtrl,
|
||||||
|
_this->_param->szResult,
|
||||||
|
_this->_param->nResultSize);
|
||||||
|
|
||||||
|
std::string strUtf8 = AnsiToUtf8(_this->_param->szResult);
|
||||||
|
|
||||||
|
memset(_this->_param->szResult, 0, _this->_param->nResultSize);
|
||||||
|
strncpy(_this->_param->szResult, strUtf8.c_str(), _this->_param->nResultSize - 1);
|
||||||
|
|
||||||
|
::EndDialog(hDlg, buttonId);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string CWin32InputBox::AnsiToUtf8(std::string strAnsi)
|
||||||
|
{
|
||||||
|
std::string ret;
|
||||||
|
if (strAnsi.length() > 0)
|
||||||
|
{
|
||||||
|
int nWideStrLength = MultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, nullptr, 0);
|
||||||
|
WCHAR* pwszBuf = (WCHAR*)malloc((nWideStrLength + 1)*sizeof(WCHAR));
|
||||||
|
memset(pwszBuf, 0, (nWideStrLength + 1)*sizeof(WCHAR));
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, pwszBuf, (nWideStrLength + 1)*sizeof(WCHAR));
|
||||||
|
|
||||||
|
int nUtf8Length = WideCharToMultiByte(CP_UTF8, 0, pwszBuf, -1, nullptr, 0, nullptr, FALSE);
|
||||||
|
char* pszUtf8Buf = (char*)malloc((nUtf8Length + 1)*sizeof(char));
|
||||||
|
memset(pszUtf8Buf, 0, (nUtf8Length + 1)*sizeof(char));
|
||||||
|
|
||||||
|
WideCharToMultiByte(CP_UTF8, 0, pwszBuf, -1, pszUtf8Buf, (nUtf8Length + 1)*sizeof(char), nullptr, FALSE);
|
||||||
|
ret = pszUtf8Buf;
|
||||||
|
|
||||||
|
free(pszUtf8Buf);
|
||||||
|
free(pwszBuf);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string CWin32InputBox::Utf8ToAnsi(std::string strUTF8)
|
||||||
|
{
|
||||||
|
std::string ret;
|
||||||
|
if (strUTF8.length() > 0)
|
||||||
|
{
|
||||||
|
int nWideStrLength = MultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, nullptr, 0);
|
||||||
|
WCHAR* pwszBuf = (WCHAR*)malloc((nWideStrLength + 1)*sizeof(WCHAR));
|
||||||
|
memset(pwszBuf, 0, (nWideStrLength + 1)*sizeof(WCHAR));
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, pwszBuf, (nWideStrLength + 1)*sizeof(WCHAR));
|
||||||
|
|
||||||
|
int nAnsiStrLength = WideCharToMultiByte(CP_ACP, 0, pwszBuf, -1, nullptr, 0, nullptr, FALSE);
|
||||||
|
char* pszAnsiBuf = (char*)malloc((nAnsiStrLength + 1)*sizeof(char));
|
||||||
|
memset(pszAnsiBuf, 0, (nAnsiStrLength + 1)*sizeof(char));
|
||||||
|
|
||||||
|
WideCharToMultiByte(CP_ACP, 0, pwszBuf, -1, pszAnsiBuf, (nAnsiStrLength + 1)*sizeof(char), nullptr, FALSE);
|
||||||
|
ret = pszAnsiBuf;
|
||||||
|
|
||||||
|
free(pszAnsiBuf);
|
||||||
|
free(pwszBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
@ -162,7 +618,7 @@ void EditBoxImplWin::setText(const char* pText)
|
||||||
|
|
||||||
if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag)
|
if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag)
|
||||||
{
|
{
|
||||||
long length = cc_utf8_strlen(_text.c_str(), -1);
|
long length = StringUtils::getCharacterCountInUTF8String(_text);
|
||||||
for (long i = 0; i < length; i++)
|
for (long i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
strToShow.append("*");
|
strToShow.append("*");
|
||||||
|
|
|
@ -1,383 +0,0 @@
|
||||||
#include "Win32InputBox.h"
|
|
||||||
|
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#pragma warning (disable: 4312)
|
|
||||||
|
|
||||||
typedef struct _MSDN_DLGTEMPLATEEX
|
|
||||||
{
|
|
||||||
WORD dlgVer;
|
|
||||||
WORD signature;
|
|
||||||
DWORD helpID;
|
|
||||||
DWORD exStyle;
|
|
||||||
DWORD style;
|
|
||||||
WORD cDlgItems;
|
|
||||||
short x;
|
|
||||||
short y;
|
|
||||||
short cx;
|
|
||||||
short cy;
|
|
||||||
BYTE _rest[1]; // rest of structure
|
|
||||||
} MSDN_DLGTEMPLATEEX;
|
|
||||||
|
|
||||||
static bool IsDlgTemplateExtended(DLGTEMPLATE *dlgTemplate)
|
|
||||||
{
|
|
||||||
MSDN_DLGTEMPLATEEX *dgExTemplate = (MSDN_DLGTEMPLATEEX *) dlgTemplate;
|
|
||||||
|
|
||||||
// MSDN excerpt:
|
|
||||||
//* dlgVer
|
|
||||||
// Specifies the version number of the extended dialog box template. This member must be 1.
|
|
||||||
//* signature
|
|
||||||
// Indicates whether a template is an extended dialog box template.
|
|
||||||
// If signature is 0xFFFF, this is an extended dialog box template.
|
|
||||||
// In this case, the dlgVer member specifies the template version number.
|
|
||||||
// If signature is any value other than 0xFFFF, this is a standard dialog box template that uses the DLGTEMPLATE and DLGITEMTEMPLATE structures.
|
|
||||||
|
|
||||||
return (dgExTemplate->dlgVer == 1) && (dgExTemplate->signature == 0xFFFF);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use alignment if supported by the compiler
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#if _MSC_VER > 1200
|
|
||||||
__declspec(align(4))
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// per the MSDN, the DLGTEMPLATE must be DWORD aligned
|
|
||||||
// this was generated by the DlgResToDlgTemplate tool
|
|
||||||
static unsigned char definputbox_dlg[] =
|
|
||||||
{
|
|
||||||
0x01,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc8,0x00,0xc8,0x00,0x06,
|
|
||||||
0x00,0x16,0x00,0x11,0x00,0xe7,0x00,0x6d,0x00,0x00,0x00,0x00,0x00,0x57,0x00,0x69,
|
|
||||||
0x00,0x6e,0x00,0x33,0x00,0x32,0x00,0x49,0x00,0x6e,0x00,0x70,0x00,0x75,0x00,0x74,
|
|
||||||
0x00,0x42,0x00,0x6f,0x00,0x78,0x00,0x00,0x00,0x08,0x00,0xbc,0x02,0x00,0x00,0x4d,
|
|
||||||
0x00,0x53,0x00,0x20,0x00,0x53,0x00,0x68,0x00,0x65,0x00,0x6c,0x00,0x6c,0x00,0x20,
|
|
||||||
0x00,0x44,0x00,0x6c,0x00,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x80,0x00,0x02,0x50,0x06,0x00,0x04,0x00,0x9d,0x00,0x21,0x00,0xe8,
|
|
||||||
0x03,0x00,0x00,0xff,0xff,0x82,0x00,0x50,0x00,0x72,0x00,0x6f,0x00,0x6d,0x00,0x70,
|
|
||||||
0x00,0x74,0x00,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x80,0x00,0x81,0x50,0x06,0x00,0x25,0x00,0xd8,0x00,0x0e,0x00,0xe9,
|
|
||||||
0x03,0x00,0x00,0xff,0xff,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x84,0x10,0xa1,0x50,0x06,0x00,0x37,0x00,0xd8,0x00,0x31,0x00,0xea,
|
|
||||||
0x03,0x00,0x00,0xff,0xff,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x01,0x00,0x03,0x50,0xab,0x00,0x04,0x00,0x33,0x00,0x0e,0x00,0x01,
|
|
||||||
0x00,0x00,0x00,0xff,0xff,0x80,0x00,0x4f,0x00,0x4b,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x50,0xab,0x00,0x15,0x00,0x33,
|
|
||||||
0x00,0x0e,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0x80,0x00,0x43,0x00,0x41,0x00,0x4e,
|
|
||||||
0x00,0x43,0x00,0x45,0x00,0x4c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x27,0x00,0x08,0x00,0x08,0x00,0xff,
|
|
||||||
0xff,0xff,0xff,0xff,0xff,0x82,0x00,0x00,0x00,0x00,0x00
|
|
||||||
};
|
|
||||||
|
|
||||||
static LPCTSTR definputbox_buttonnames[] = { _T("OK"), _T("CANCEL") };
|
|
||||||
static const INT_PTR definputbox_buttonids[] = { IDOK, IDCANCEL };
|
|
||||||
|
|
||||||
static const INT
|
|
||||||
definputbox_id_prompt = 1000,
|
|
||||||
definputbox_id_edit1 = 1001,
|
|
||||||
definputbox_id_edit2 = 1002;
|
|
||||||
|
|
||||||
WIN32INPUTBOX_PARAM::WIN32INPUTBOX_PARAM()
|
|
||||||
{
|
|
||||||
bMultiline = false;
|
|
||||||
hwndOwner = 0;
|
|
||||||
DlgTemplateName = 0;
|
|
||||||
hInstance = (HINSTANCE) ::GetModuleHandle(0);
|
|
||||||
DlgTemplateData = definputbox_dlg;
|
|
||||||
|
|
||||||
bCenter = true;
|
|
||||||
|
|
||||||
dwStylesPlus = 0;
|
|
||||||
dwExStylesPlus = 0;
|
|
||||||
dwStylesMinus = 0xFFFFFFFF;
|
|
||||||
dwExStylesMinus = 0xFFFFFFFF;
|
|
||||||
|
|
||||||
xPos = yPos = -1;
|
|
||||||
|
|
||||||
szResult = 0;
|
|
||||||
nResultSize = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
CWin32InputBox::CWin32InputBox(WIN32INPUTBOX_PARAM *param)
|
|
||||||
{
|
|
||||||
_param = param;
|
|
||||||
}
|
|
||||||
|
|
||||||
CWin32InputBox::~CWin32InputBox()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void CWin32InputBox::SetParam(WIN32INPUTBOX_PARAM *param)
|
|
||||||
{
|
|
||||||
_param = param;
|
|
||||||
}
|
|
||||||
|
|
||||||
WIN32INPUTBOX_PARAM *CWin32InputBox::GetParam()
|
|
||||||
{
|
|
||||||
return _param;
|
|
||||||
}
|
|
||||||
|
|
||||||
INT_PTR CWin32InputBox::InputBoxEx(WIN32INPUTBOX_PARAM *param)
|
|
||||||
{
|
|
||||||
// Check mandatory parameters
|
|
||||||
if (param->szResult == 0)
|
|
||||||
{
|
|
||||||
::SetLastError(ERROR_INVALID_PARAMETER);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
LPDLGTEMPLATE dlgTemplate;
|
|
||||||
|
|
||||||
if (param->DlgTemplateName != 0)
|
|
||||||
{
|
|
||||||
HMODULE hModule = (HMODULE)param->hInstance;
|
|
||||||
#ifdef __MINGW32__
|
|
||||||
HRSRC rcDlg = ::FindResource(hModule, (LPWSTR)(ULONG_PTR)(size_t)(param->DlgTemplateName), RT_DIALOG);
|
|
||||||
#else
|
|
||||||
HRSRC rcDlg = ::FindResource(hModule, MAKEINTRESOURCE(param->DlgTemplateName), RT_DIALOG);
|
|
||||||
#endif
|
|
||||||
if (rcDlg == nullptr)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
HGLOBAL hglobalDlg = ::LoadResource(hModule, rcDlg);
|
|
||||||
if (hglobalDlg == nullptr)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
dlgTemplate = (LPDLGTEMPLATE) hglobalDlg;
|
|
||||||
}
|
|
||||||
else if (param->DlgTemplateData != 0)
|
|
||||||
{
|
|
||||||
dlgTemplate = (LPDLGTEMPLATE) param->DlgTemplateData;
|
|
||||||
}
|
|
||||||
|
|
||||||
MSDN_DLGTEMPLATEEX *dlgTemplateEx =
|
|
||||||
IsDlgTemplateExtended((LPDLGTEMPLATE) dlgTemplate) ? (MSDN_DLGTEMPLATEEX *) dlgTemplate : 0;
|
|
||||||
|
|
||||||
if (dlgTemplateEx != 0)
|
|
||||||
{
|
|
||||||
dlgTemplateEx->exStyle |= param->dwExStylesPlus;
|
|
||||||
dlgTemplateEx->style |= param->dwStylesPlus;
|
|
||||||
dlgTemplateEx->exStyle &= param->dwExStylesMinus;
|
|
||||||
dlgTemplateEx->style &= param->dwStylesMinus;
|
|
||||||
|
|
||||||
if (param->bCenter)
|
|
||||||
dlgTemplateEx->style |= DS_CENTER;
|
|
||||||
|
|
||||||
if (param->xPos != -1)
|
|
||||||
dlgTemplateEx->x = param->xPos;
|
|
||||||
if (param->yPos != -1)
|
|
||||||
dlgTemplateEx->y = param->yPos;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dlgTemplate->dwExtendedStyle |= param->dwExStylesPlus;
|
|
||||||
dlgTemplate->style |= param->dwStylesPlus;
|
|
||||||
dlgTemplate->dwExtendedStyle &= param->dwExStylesMinus;
|
|
||||||
dlgTemplate->style &= param->dwStylesMinus;
|
|
||||||
|
|
||||||
if (param->bCenter)
|
|
||||||
dlgTemplate->style |= DS_CENTER;
|
|
||||||
|
|
||||||
if (param->xPos != -1)
|
|
||||||
dlgTemplate->x = param->xPos;
|
|
||||||
|
|
||||||
if (param->yPos != -1)
|
|
||||||
dlgTemplate->y = param->yPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
CWin32InputBox inputbox(param);
|
|
||||||
|
|
||||||
// Resize dialog and SHOW or HIDE multiline
|
|
||||||
INT_PTR r = ::DialogBoxIndirectParam(param->hInstance, dlgTemplate, param->hwndOwner, (DLGPROC)DlgProc, (LPARAM)&inputbox);
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
INT_PTR CWin32InputBox::InputBox(
|
|
||||||
LPCSTR szTitle,
|
|
||||||
LPCSTR szPrompt,
|
|
||||||
LPSTR szResult,
|
|
||||||
DWORD nResultSize,
|
|
||||||
bool bMultiLine,
|
|
||||||
HWND hwndParent)
|
|
||||||
{
|
|
||||||
WIN32INPUTBOX_PARAM param;
|
|
||||||
|
|
||||||
param.szTitle = szTitle;
|
|
||||||
param.szPrompt = szPrompt;
|
|
||||||
param.szResult = szResult;
|
|
||||||
param.nResultSize = nResultSize;
|
|
||||||
param.bMultiline = bMultiLine;
|
|
||||||
param.hwndOwner = hwndParent;
|
|
||||||
return InputBoxEx(¶m);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CWin32InputBox::InitDialog()
|
|
||||||
{
|
|
||||||
// Set the button captions
|
|
||||||
for (size_t i=0;i<sizeof(definputbox_buttonids)/sizeof(definputbox_buttonids[0]);i++)
|
|
||||||
::SetDlgItemText(_param->hDlg, (int) definputbox_buttonids[i], definputbox_buttonnames[i]);
|
|
||||||
|
|
||||||
// Set other controls
|
|
||||||
::SetWindowTextA(_param->hDlg, Utf8ToAnsi(_param->szTitle).c_str());
|
|
||||||
::SetDlgItemTextA(_param->hDlg, definputbox_id_prompt, Utf8ToAnsi(_param->szPrompt).c_str());
|
|
||||||
|
|
||||||
HWND hwndEdit1 = ::GetDlgItem(_param->hDlg, definputbox_id_edit1);
|
|
||||||
HWND hwndEdit2 = ::GetDlgItem(_param->hDlg, definputbox_id_edit2);
|
|
||||||
|
|
||||||
if (_param->bMultiline)
|
|
||||||
_hwndEditCtrl = hwndEdit2;
|
|
||||||
else
|
|
||||||
_hwndEditCtrl = hwndEdit1;
|
|
||||||
|
|
||||||
::SetWindowTextA(_hwndEditCtrl, Utf8ToAnsi(_param->szResult).c_str());
|
|
||||||
|
|
||||||
RECT rectDlg, rectEdit1, rectEdit2;
|
|
||||||
|
|
||||||
::GetWindowRect(_param->hDlg, &rectDlg);
|
|
||||||
::GetWindowRect(hwndEdit1, &rectEdit1);
|
|
||||||
::GetWindowRect(hwndEdit2, &rectEdit2);
|
|
||||||
|
|
||||||
if (_param->bMultiline)
|
|
||||||
{
|
|
||||||
::ShowWindow(hwndEdit1, SW_HIDE);
|
|
||||||
::SetWindowPos(
|
|
||||||
hwndEdit2,
|
|
||||||
HWND_NOTOPMOST,
|
|
||||||
rectEdit1.left - rectDlg.left,
|
|
||||||
(rectEdit1.top - rectDlg.top) - (rectEdit1.bottom - rectEdit1.top),
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
SWP_NOSIZE | SWP_NOZORDER);
|
|
||||||
|
|
||||||
::SetWindowPos(
|
|
||||||
_param->hDlg,
|
|
||||||
HWND_NOTOPMOST,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
rectDlg.right - rectDlg.left,
|
|
||||||
rectDlg.bottom - rectDlg.top - (rectEdit1.bottom - rectEdit1.top),
|
|
||||||
SWP_NOMOVE);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
::SetWindowPos(
|
|
||||||
_param->hDlg,
|
|
||||||
HWND_NOTOPMOST,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
rectDlg.right - rectDlg.left,
|
|
||||||
rectEdit1.bottom - rectDlg.top + 5,
|
|
||||||
SWP_NOMOVE);
|
|
||||||
|
|
||||||
::ShowWindow(hwndEdit2, SW_HIDE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Message handler for about box.
|
|
||||||
LRESULT CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|
||||||
{
|
|
||||||
CWin32InputBox *_this = (CWin32InputBox *) ::GetWindowLongPtr(hDlg, GWLP_USERDATA);
|
|
||||||
WIN32INPUTBOX_PARAM *param = _this ? _this->GetParam() : 0;
|
|
||||||
|
|
||||||
switch (message)
|
|
||||||
{
|
|
||||||
case WM_INITDIALOG:
|
|
||||||
{
|
|
||||||
SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR) lParam);
|
|
||||||
|
|
||||||
_this = (CWin32InputBox *) lParam;
|
|
||||||
_this->_param->hDlg = hDlg;
|
|
||||||
_this->InitDialog();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
case WM_COMMAND:
|
|
||||||
{
|
|
||||||
#ifdef _MY_DEBUG
|
|
||||||
CHAR buf[1024];
|
|
||||||
static int i=0;
|
|
||||||
sprintf(buf, "WM_COMMAND: %09d wParam=%08X lParam=%08X\n", i++, wParam, lParam);
|
|
||||||
OutputDebugString(buf);
|
|
||||||
#endif
|
|
||||||
INT_PTR buttonId = LOWORD(wParam);
|
|
||||||
for (size_t i=0;
|
|
||||||
i<sizeof(definputbox_buttonids)/sizeof(definputbox_buttonids[0]);
|
|
||||||
i++)
|
|
||||||
{
|
|
||||||
if (buttonId == definputbox_buttonids[i])
|
|
||||||
{
|
|
||||||
::GetWindowTextA(
|
|
||||||
_this->_hwndEditCtrl,
|
|
||||||
_this->_param->szResult,
|
|
||||||
_this->_param->nResultSize);
|
|
||||||
|
|
||||||
std::string strUtf8 = AnsiToUtf8(_this->_param->szResult);
|
|
||||||
|
|
||||||
memset(_this->_param->szResult, 0, _this->_param->nResultSize);
|
|
||||||
strncpy(_this->_param->szResult, strUtf8.c_str(), _this->_param->nResultSize-1);
|
|
||||||
|
|
||||||
::EndDialog(hDlg, buttonId);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::string CWin32InputBox::AnsiToUtf8(std::string strAnsi)
|
|
||||||
{
|
|
||||||
std::string ret;
|
|
||||||
if (strAnsi.length() > 0)
|
|
||||||
{
|
|
||||||
int nWideStrLength = MultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, nullptr, 0);
|
|
||||||
WCHAR* pwszBuf = (WCHAR*)malloc((nWideStrLength+1)*sizeof(WCHAR));
|
|
||||||
memset(pwszBuf, 0, (nWideStrLength+1)*sizeof(WCHAR));
|
|
||||||
MultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, pwszBuf, (nWideStrLength+1)*sizeof(WCHAR));
|
|
||||||
|
|
||||||
int nUtf8Length = WideCharToMultiByte( CP_UTF8,0,pwszBuf,-1,nullptr,0,nullptr,FALSE );
|
|
||||||
char* pszUtf8Buf = (char*)malloc((nUtf8Length+1)*sizeof(char));
|
|
||||||
memset(pszUtf8Buf, 0, (nUtf8Length+1)*sizeof(char));
|
|
||||||
|
|
||||||
WideCharToMultiByte(CP_UTF8, 0, pwszBuf, -1, pszUtf8Buf, (nUtf8Length+1)*sizeof(char), nullptr, FALSE);
|
|
||||||
ret = pszUtf8Buf;
|
|
||||||
|
|
||||||
free(pszUtf8Buf);
|
|
||||||
free(pwszBuf);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CWin32InputBox::Utf8ToAnsi(std::string strUTF8)
|
|
||||||
{
|
|
||||||
std::string ret;
|
|
||||||
if (strUTF8.length() > 0)
|
|
||||||
{
|
|
||||||
int nWideStrLength = MultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, nullptr, 0);
|
|
||||||
WCHAR* pwszBuf = (WCHAR*)malloc((nWideStrLength+1)*sizeof(WCHAR));
|
|
||||||
memset(pwszBuf, 0, (nWideStrLength+1)*sizeof(WCHAR));
|
|
||||||
MultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, pwszBuf, (nWideStrLength+1)*sizeof(WCHAR));
|
|
||||||
|
|
||||||
int nAnsiStrLength = WideCharToMultiByte( CP_ACP,0,pwszBuf,-1,nullptr,0,nullptr,FALSE );
|
|
||||||
char* pszAnsiBuf = (char*)malloc((nAnsiStrLength+1)*sizeof(char));
|
|
||||||
memset(pszAnsiBuf, 0, (nAnsiStrLength+1)*sizeof(char));
|
|
||||||
|
|
||||||
WideCharToMultiByte(CP_ACP, 0, pwszBuf, -1, pszAnsiBuf, (nAnsiStrLength+1)*sizeof(char), nullptr, FALSE);
|
|
||||||
ret = pszAnsiBuf;
|
|
||||||
|
|
||||||
free(pszAnsiBuf);
|
|
||||||
free(pwszBuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */
|
|
|
@ -1,106 +0,0 @@
|
||||||
#ifndef __03022006__WIN32INPUTBOX__
|
|
||||||
#define __03022006__WIN32INPUTBOX__
|
|
||||||
|
|
||||||
#include "cocos2d.h"
|
|
||||||
|
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
|
||||||
/*
|
|
||||||
|
|
||||||
This library is (c) Elias Bachaalany aka lallous <lallousx86@yahoo.com>
|
|
||||||
You may use this library under the following license agreement:
|
|
||||||
|
|
||||||
The zlib/libpng License.
|
|
||||||
---------------------------
|
|
||||||
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose, including commercial applications,
|
|
||||||
and to alter it and redistribute it freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented;
|
|
||||||
you must not claim that you wrote the original software.
|
|
||||||
If you use this software in a product, an acknowledgment in the product
|
|
||||||
documentation would be appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such,
|
|
||||||
and must not be misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
#include <tchar.h>
|
|
||||||
|
|
||||||
class CWin32InputBox;
|
|
||||||
|
|
||||||
// Structure used to orient the inputbox behavior
|
|
||||||
struct WIN32INPUTBOX_PARAM
|
|
||||||
{
|
|
||||||
friend class CWin32InputBox;
|
|
||||||
|
|
||||||
//
|
|
||||||
IN OPTIONAL bool bMultiline;
|
|
||||||
|
|
||||||
// Pass this as none zero so to use this memory dlg template
|
|
||||||
IN OPTIONAL LPVOID DlgTemplateData;
|
|
||||||
|
|
||||||
// Pass this as none ZERO so to load DLGTEMPLATE from resources
|
|
||||||
IN OPTIONAL LPCSTR DlgTemplateName;
|
|
||||||
|
|
||||||
// passing both "DlgTemplateName" and "DlgTemplateData" ZERO will cause
|
|
||||||
// the dialog to use his default embedded resource
|
|
||||||
|
|
||||||
// Center on monitor or owner window?
|
|
||||||
IN OPTIONAL bool bCenter;
|
|
||||||
|
|
||||||
// Want to add more styles to the dialog?
|
|
||||||
IN OPTIONAL DWORD dwStylesPlus, dwStylesMinus;
|
|
||||||
IN OPTIONAL DWORD dwExStylesPlus, dwExStylesMinus;
|
|
||||||
|
|
||||||
IN LPCSTR szTitle, szPrompt;
|
|
||||||
|
|
||||||
// Return buffer
|
|
||||||
OUT LPSTR szResult;
|
|
||||||
IN DWORD nResultSize;
|
|
||||||
|
|
||||||
// Owner window
|
|
||||||
HWND hwndOwner;
|
|
||||||
HINSTANCE hInstance;
|
|
||||||
|
|
||||||
short xPos, yPos;
|
|
||||||
|
|
||||||
WIN32INPUTBOX_PARAM();
|
|
||||||
private:
|
|
||||||
HWND hDlg;
|
|
||||||
};
|
|
||||||
|
|
||||||
class CWin32InputBox
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
WIN32INPUTBOX_PARAM *_param;
|
|
||||||
static LRESULT CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);
|
|
||||||
HWND _hwndEditCtrl;
|
|
||||||
|
|
||||||
void InitDialog();
|
|
||||||
void SetParam(WIN32INPUTBOX_PARAM *);
|
|
||||||
WIN32INPUTBOX_PARAM * GetParam();
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
CWin32InputBox(WIN32INPUTBOX_PARAM *);
|
|
||||||
~CWin32InputBox();
|
|
||||||
|
|
||||||
static INT_PTR InputBoxEx(WIN32INPUTBOX_PARAM *);
|
|
||||||
static INT_PTR InputBox(
|
|
||||||
LPCSTR szTitle,
|
|
||||||
LPCSTR szPrompt,
|
|
||||||
LPSTR szResult,
|
|
||||||
DWORD nResultSize,
|
|
||||||
bool bMultiLine = false,
|
|
||||||
HWND hwndParent = 0);
|
|
||||||
|
|
||||||
static std::string AnsiToUtf8(std::string strAnsi);
|
|
||||||
static std::string Utf8ToAnsi(std::string strUTF8);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#include "CCPhysicsSprite.h"
|
#include "CCPhysicsSprite.h"
|
||||||
|
|
||||||
|
#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION)
|
||||||
|
|
||||||
#if (CC_ENABLE_CHIPMUNK_INTEGRATION && CC_ENABLE_BOX2D_INTEGRATION)
|
#if (CC_ENABLE_CHIPMUNK_INTEGRATION && CC_ENABLE_BOX2D_INTEGRATION)
|
||||||
#error "Either Chipmunk or Box2d should be enabled, but not both at the same time"
|
#error "Either Chipmunk or Box2d should be enabled, but not both at the same time"
|
||||||
#endif
|
#endif
|
||||||
|
@ -300,6 +302,8 @@ float PhysicsSprite::getRotation() const
|
||||||
|
|
||||||
return (_ignoreBodyRotation ? Sprite::getRotation() :
|
return (_ignoreBodyRotation ? Sprite::getRotation() :
|
||||||
CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle()));
|
CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle()));
|
||||||
|
#else
|
||||||
|
return 0.0f;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -408,3 +412,5 @@ void PhysicsSprite::draw(Renderer *renderer, const Mat4 &transform, uint32_t fla
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_EXT_END
|
NS_CC_EXT_END
|
||||||
|
|
||||||
|
#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#include "extensions/ExtensionMacros.h"
|
#include "extensions/ExtensionMacros.h"
|
||||||
#include "extensions/ExtensionExport.h"
|
#include "extensions/ExtensionExport.h"
|
||||||
|
|
||||||
|
#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION)
|
||||||
|
|
||||||
struct cpBody;
|
struct cpBody;
|
||||||
class b2Body;
|
class b2Body;
|
||||||
|
|
||||||
|
@ -135,4 +137,6 @@ protected:
|
||||||
|
|
||||||
NS_CC_EXT_END
|
NS_CC_EXT_END
|
||||||
|
|
||||||
|
#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION
|
||||||
|
|
||||||
#endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__
|
#endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__
|
||||||
|
|
|
@ -673,6 +673,7 @@
|
||||||
"cocos/math/MathUtil.h",
|
"cocos/math/MathUtil.h",
|
||||||
"cocos/math/MathUtil.inl",
|
"cocos/math/MathUtil.inl",
|
||||||
"cocos/math/MathUtilNeon.inl",
|
"cocos/math/MathUtilNeon.inl",
|
||||||
|
"cocos/math/MathUtilNeon64.inl",
|
||||||
"cocos/math/MathUtilSSE.inl",
|
"cocos/math/MathUtilSSE.inl",
|
||||||
"cocos/math/Quaternion.cpp",
|
"cocos/math/Quaternion.cpp",
|
||||||
"cocos/math/Quaternion.h",
|
"cocos/math/Quaternion.h",
|
||||||
|
@ -1083,8 +1084,6 @@
|
||||||
"cocos/ui/UIWebViewImpl-win32.h",
|
"cocos/ui/UIWebViewImpl-win32.h",
|
||||||
"cocos/ui/UIWidget.cpp",
|
"cocos/ui/UIWidget.cpp",
|
||||||
"cocos/ui/UIWidget.h",
|
"cocos/ui/UIWidget.h",
|
||||||
"cocos/ui/proj.win32/Win32InputBox.cpp",
|
|
||||||
"cocos/ui/proj.win32/Win32InputBox.h",
|
|
||||||
"cocos/ui/proj.win32/libui.vcxproj",
|
"cocos/ui/proj.win32/libui.vcxproj",
|
||||||
"cocos/ui/proj.win32/libui.vcxproj.filters",
|
"cocos/ui/proj.win32/libui.vcxproj.filters",
|
||||||
"cocos/ui/proj.wp8/libGUI.vcxproj",
|
"cocos/ui/proj.wp8/libGUI.vcxproj",
|
||||||
|
@ -3635,6 +3634,7 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/ControlSwitch.lua",
|
"cocos/scripting/lua-bindings/auto/api/ControlSwitch.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Controller.lua",
|
"cocos/scripting/lua-bindings/auto/api/Controller.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/DelayTime.lua",
|
"cocos/scripting/lua-bindings/auto/api/DelayTime.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/Device.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Director.lua",
|
"cocos/scripting/lua-bindings/auto/api/Director.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/DisplayData.lua",
|
"cocos/scripting/lua-bindings/auto/api/DisplayData.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/DisplayManager.lua",
|
"cocos/scripting/lua-bindings/auto/api/DisplayManager.lua",
|
||||||
|
|
|
@ -541,6 +541,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "";
|
USER_HEADER_SEARCH_PATHS = "";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -570,6 +571,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "";
|
USER_HEADER_SEARCH_PATHS = "";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "../src/AppDelegate.h"
|
#include "../Classes/AppDelegate.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -25,6 +25,7 @@ using Windows.UI.Input;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Microsoft.Phone.Info;
|
using Microsoft.Phone.Info;
|
||||||
using Windows.Graphics.Display;
|
using Windows.Graphics.Display;
|
||||||
|
using Microsoft.Phone.Tasks;
|
||||||
|
|
||||||
namespace PhoneDirect3DXamlAppInterop
|
namespace PhoneDirect3DXamlAppInterop
|
||||||
{
|
{
|
||||||
|
@ -93,6 +94,7 @@ namespace PhoneDirect3DXamlAppInterop
|
||||||
m_d3dInterop.SetCocos2dEventDelegate(OnCocos2dEvent);
|
m_d3dInterop.SetCocos2dEventDelegate(OnCocos2dEvent);
|
||||||
m_d3dInterop.SetCocos2dMessageBoxDelegate(OnCocos2dMessageBoxEvent);
|
m_d3dInterop.SetCocos2dMessageBoxDelegate(OnCocos2dMessageBoxEvent);
|
||||||
m_d3dInterop.SetCocos2dEditBoxDelegate(OpenEditBox);
|
m_d3dInterop.SetCocos2dEditBoxDelegate(OpenEditBox);
|
||||||
|
m_d3dInterop.SetCocos2dOpenURLDelegate(OpenURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,6 +208,13 @@ namespace PhoneDirect3DXamlAppInterop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OpenURL(String url)
|
||||||
|
{
|
||||||
|
WebBrowserTask webBrowserTask = new WebBrowserTask();
|
||||||
|
webBrowserTask.Uri = new Uri(url, UriKind.Absolute);
|
||||||
|
webBrowserTask.Show();
|
||||||
|
}
|
||||||
|
|
||||||
private void StartTimer()
|
private void StartTimer()
|
||||||
{
|
{
|
||||||
m_timer = new DispatcherTimer();
|
m_timer = new DispatcherTimer();
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
#include "Cocos2dRenderer.h"
|
#include "Cocos2dRenderer.h"
|
||||||
#include "cocos2d.h"
|
#include "cocos2d.h"
|
||||||
#include "CCApplication.h"
|
#include "CCApplication.h"
|
||||||
#include "CCGLView.h"
|
#include "CCGLViewImpl.h"
|
||||||
#include "AppDelegate.h"
|
#include "AppDelegate.h"
|
||||||
#include <ppltasks.h>
|
#include <ppltasks.h>
|
||||||
|
|
||||||
|
@ -181,7 +181,12 @@ void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Coco
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Cocos2dRenderer::SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate)
|
||||||
|
{
|
||||||
|
m_openURLDelegate = delegate;
|
||||||
|
Application* app = Application::getInstance();
|
||||||
|
if (app)
|
||||||
|
{
|
||||||
|
app->SetXamlOpenURLDelegate(delegate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ public:
|
||||||
void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate);
|
void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate);
|
||||||
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate);
|
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate);
|
||||||
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate);
|
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate);
|
||||||
|
void SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate);
|
||||||
|
|
||||||
Windows::Foundation::IAsyncAction^ OnSuspending();
|
Windows::Foundation::IAsyncAction^ OnSuspending();
|
||||||
void Connect();
|
void Connect();
|
||||||
|
@ -61,6 +62,7 @@ private:
|
||||||
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
|
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
|
||||||
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
||||||
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
||||||
|
PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ m_openURLDelegate;
|
||||||
|
|
||||||
// The AppDelegate for the Cocos2D app
|
// The AppDelegate for the Cocos2D app
|
||||||
AppDelegate* mApp;
|
AppDelegate* mApp;
|
||||||
|
|
|
@ -129,6 +129,11 @@ void Direct3DInterop::OnCocos2dEditboxEvent(Object^ sender, Platform::String^ ar
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e);
|
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Direct3DInterop::OnCocos2dOpenURL(Platform::String^ url)
|
||||||
|
{
|
||||||
|
m_openURLDelegate->Invoke(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -174,13 +179,19 @@ void Direct3DInterop::SetCocos2dEditBoxDelegate(Cocos2dEditBoxDelegate ^ delegat
|
||||||
m_renderer->SetXamlEditBoxDelegate(delegate);
|
m_renderer->SetXamlEditBoxDelegate(delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Direct3DInterop::SetCocos2dOpenURLDelegate(Cocos2dOpenURLDelegate ^ delegate)
|
||||||
|
{
|
||||||
|
m_openURLDelegate = delegate;
|
||||||
|
m_renderer->SetXamlOpenURLDelegate(delegate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Direct3DInterop::SendCocos2dEvent(Cocos2dEvent event)
|
bool Direct3DInterop::SendCocos2dEvent(Cocos2dEvent event)
|
||||||
{
|
{
|
||||||
std::string str;
|
Platform::String^ str;
|
||||||
if(m_delegate)
|
if(m_delegate)
|
||||||
{
|
{
|
||||||
m_delegate->Invoke(event, stringToPlatformString(str));
|
m_delegate->Invoke(event, str);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
void OnCocos2dKeyEvent(Cocos2dKeyEvent key);
|
void OnCocos2dKeyEvent(Cocos2dKeyEvent key);
|
||||||
void OnCocos2dKeyEvent(Cocos2dKeyEvent key, Platform::String^ text);
|
void OnCocos2dKeyEvent(Cocos2dKeyEvent key, Platform::String^ text);
|
||||||
void OnCocos2dEditboxEvent(Platform::Object^ sender, Platform::String^ args, Windows::Foundation::EventHandler<Platform::String^>^ handler);
|
void OnCocos2dEditboxEvent(Platform::Object^ sender, Platform::String^ args, Windows::Foundation::EventHandler<Platform::String^>^ handler);
|
||||||
|
void OnCocos2dOpenURL(Platform::String^ url);
|
||||||
|
|
||||||
property Windows::Graphics::Display::DisplayOrientations WindowOrientation;
|
property Windows::Graphics::Display::DisplayOrientations WindowOrientation;
|
||||||
property Windows::Foundation::Size WindowBounds;
|
property Windows::Foundation::Size WindowBounds;
|
||||||
|
@ -67,6 +68,7 @@ public:
|
||||||
void SetCocos2dEventDelegate(Cocos2dEventDelegate^ delegate);
|
void SetCocos2dEventDelegate(Cocos2dEventDelegate^ delegate);
|
||||||
void SetCocos2dMessageBoxDelegate(Cocos2dMessageBoxDelegate ^ delegate);
|
void SetCocos2dMessageBoxDelegate(Cocos2dMessageBoxDelegate ^ delegate);
|
||||||
void SetCocos2dEditBoxDelegate(Cocos2dEditBoxDelegate ^ delegate);
|
void SetCocos2dEditBoxDelegate(Cocos2dEditBoxDelegate ^ delegate);
|
||||||
|
void SetCocos2dOpenURLDelegate(Cocos2dOpenURLDelegate ^ delegate);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -90,6 +92,7 @@ private:
|
||||||
Cocos2dEventDelegate^ m_delegate;
|
Cocos2dEventDelegate^ m_delegate;
|
||||||
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
||||||
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
||||||
|
Cocos2dOpenURLDelegate^ m_openURLDelegate;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -925,6 +925,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/ios";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/ios";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -947,6 +948,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/ios";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/ios";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1246,6 +1246,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/ios";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/ios";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -1268,6 +1269,7 @@
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/ios";
|
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/ios";
|
||||||
|
VALID_ARCHS = "arm64 armv7";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|
|
@ -140,6 +140,7 @@ set(TESTS_SRC
|
||||||
Classes/MotionStreakTest/MotionStreakTest.cpp
|
Classes/MotionStreakTest/MotionStreakTest.cpp
|
||||||
Classes/MutiTouchTest/MutiTouchTest.cpp
|
Classes/MutiTouchTest/MutiTouchTest.cpp
|
||||||
Classes/NodeTest/NodeTest.cpp
|
Classes/NodeTest/NodeTest.cpp
|
||||||
|
Classes/OpenURLTest/OpenURLTest.cpp
|
||||||
Classes/ParallaxTest/ParallaxTest.cpp
|
Classes/ParallaxTest/ParallaxTest.cpp
|
||||||
Classes/ParticleTest/ParticleTest.cpp
|
Classes/ParticleTest/ParticleTest.cpp
|
||||||
Classes/PerformanceTest/PerformanceAllocTest.cpp
|
Classes/PerformanceTest/PerformanceAllocTest.cpp
|
||||||
|
|
|
@ -29,7 +29,7 @@ void SceneController::onEnter()
|
||||||
ComController::onEnter();
|
ComController::onEnter();
|
||||||
_fAddTargetTime = 1.0f;
|
_fAddTargetTime = 1.0f;
|
||||||
|
|
||||||
static_cast<ComAudio*>(_owner->getComponent("Audio"))->playBackgroundMusic("background-music-aac.wav", true);
|
static_cast<ComAudio*>(_owner->getComponent("Audio"))->playBackgroundMusic("background.wav", true);
|
||||||
static_cast<ComAttribute*>(_owner->getComponent("CCComAttribute"))->setInt("KillCount", 0);
|
static_cast<ComAttribute*>(_owner->getComponent("CCComAttribute"))->setInt("KillCount", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
#include "OpenURLTest.h"
|
||||||
|
|
||||||
|
OpenURLTest::OpenURLTest()
|
||||||
|
{
|
||||||
|
auto label = Label::createWithTTF("Open URL Test", "fonts/arial.ttf", 28);
|
||||||
|
addChild(label, 0);
|
||||||
|
label->setPosition(VisibleRect::center().x, VisibleRect::top().y - 50);
|
||||||
|
|
||||||
|
auto listener = EventListenerTouchAllAtOnce::create();
|
||||||
|
listener->onTouchesEnded = CC_CALLBACK_2(OpenURLTest::onTouchesEnded, this);
|
||||||
|
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||||
|
|
||||||
|
// create a label to display the tip string
|
||||||
|
_label = Label::createWithTTF("Touch the screen to open\nthe cocos2d-x home page", "fonts/arial.ttf", 22);
|
||||||
|
_label->setPosition(VisibleRect::center());
|
||||||
|
addChild(_label, 0);
|
||||||
|
|
||||||
|
_label->retain();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OpenURLTest::onTouchesEnded(const std::vector<Touch*>& touches, Event *event)
|
||||||
|
{
|
||||||
|
Application::getInstance()->openURL("http://www.cocos2d-x.org/");
|
||||||
|
}
|
||||||
|
|
||||||
|
OpenURLTest::~OpenURLTest()
|
||||||
|
{
|
||||||
|
_label->release();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OpenURLTestScene::runThisTest()
|
||||||
|
{
|
||||||
|
auto layer = new (std::nothrow) OpenURLTest();
|
||||||
|
addChild(layer);
|
||||||
|
|
||||||
|
Director::getInstance()->replaceScene(this);
|
||||||
|
layer->release();
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
#ifndef _OPEN_URL_TEST_H_
|
||||||
|
#define _OPEN_URL_TEST_H_
|
||||||
|
|
||||||
|
#include "cocos2d.h"
|
||||||
|
#include "../testBasic.h"
|
||||||
|
|
||||||
|
class OpenURLTest : public Layer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OpenURLTest();
|
||||||
|
~OpenURLTest();
|
||||||
|
|
||||||
|
void onTouchesEnded(const std::vector<Touch*>& touches, cocos2d::Event *event);
|
||||||
|
private:
|
||||||
|
cocos2d::Label* _label;
|
||||||
|
};
|
||||||
|
|
||||||
|
class OpenURLTestScene : public TestScene
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void runThisTest();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _OPEN_URL_TEST_H_
|
|
@ -104,7 +104,8 @@ Controller g_aTestNames[] = {
|
||||||
{ "Touches", [](){return new PongScene();} },
|
{ "Touches", [](){return new PongScene();} },
|
||||||
{ "Transitions", [](){return new TransitionsTestScene();} },
|
{ "Transitions", [](){return new TransitionsTestScene();} },
|
||||||
{ "Unit Test", []() { return new UnitTestScene(); }},
|
{ "Unit Test", []() { return new UnitTestScene(); }},
|
||||||
{ "UserDefault", []() { return new UserDefaultTestScene(); } },
|
{ "URL Open Test", []() { return new OpenURLTestScene(); } },
|
||||||
|
{ "UserDefault", []() { return new UserDefaultTestScene(); } },
|
||||||
{ "Zwoptex", []() { return new ZwoptexTestScene(); } },
|
{ "Zwoptex", []() { return new ZwoptexTestScene(); } },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -75,4 +75,6 @@
|
||||||
#include "Camera3DTest/Camera3DTest.h"
|
#include "Camera3DTest/Camera3DTest.h"
|
||||||
#include "BillBoardTest/BillBoardTest.h"
|
#include "BillBoardTest/BillBoardTest.h"
|
||||||
|
|
||||||
|
#include "OpenURLTest/OpenURLTest.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -186,6 +186,7 @@ LOCAL_SRC_FILES := main.cpp \
|
||||||
../../Classes/UnitTest/UnitTest.cpp \
|
../../Classes/UnitTest/UnitTest.cpp \
|
||||||
../../Classes/UITest/UITest.cpp \
|
../../Classes/UITest/UITest.cpp \
|
||||||
../../Classes/UserDefaultTest/UserDefaultTest.cpp \
|
../../Classes/UserDefaultTest/UserDefaultTest.cpp \
|
||||||
|
../../Classes/OpenURLTest/OpenURLTest.cpp \
|
||||||
../../Classes/ZwoptexTest/ZwoptexTest.cpp
|
../../Classes/ZwoptexTest/ZwoptexTest.cpp
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
|
||||||
|
|
|
@ -275,6 +275,7 @@
|
||||||
<ClCompile Include="..\Classes\PerformanceTest\PerformanceTextureTest.cpp" />
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceTextureTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\PerformanceTest\PerformanceTouchesTest.cpp" />
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceTouchesTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\PerformanceTest\PerformanceCallbackTest.cpp" />
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceCallbackTest.cpp" />
|
||||||
|
<ClCompile Include="..\Classes\OpenURLTest\OpenURLTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ZwoptexTest\ZwoptexTest.cpp" />
|
<ClCompile Include="..\Classes\ZwoptexTest\ZwoptexTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\CurlTest\CurlTest.cpp" />
|
<ClCompile Include="..\Classes\CurlTest\CurlTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\TextInputTest\TextInputTest.cpp" />
|
<ClCompile Include="..\Classes\TextInputTest\TextInputTest.cpp" />
|
||||||
|
@ -466,6 +467,7 @@
|
||||||
<ClInclude Include="..\Classes\PerformanceTest\PerformanceTextureTest.h" />
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceTextureTest.h" />
|
||||||
<ClInclude Include="..\Classes\PerformanceTest\PerformanceTouchesTest.h" />
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceTouchesTest.h" />
|
||||||
<ClInclude Include="..\Classes\PerformanceTest\PerformanceCallbackTest.h" />
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceCallbackTest.h" />
|
||||||
|
<ClInclude Include="..\Classes\OpenURLTest\OpenURLTest.h" />
|
||||||
<ClInclude Include="..\Classes\ZwoptexTest\ZwoptexTest.h" />
|
<ClInclude Include="..\Classes\ZwoptexTest\ZwoptexTest.h" />
|
||||||
<ClInclude Include="..\Classes\CurlTest\CurlTest.h" />
|
<ClInclude Include="..\Classes\CurlTest\CurlTest.h" />
|
||||||
<ClInclude Include="..\Classes\TextInputTest\TextInputTest.h" />
|
<ClInclude Include="..\Classes\TextInputTest\TextInputTest.h" />
|
||||||
|
|
|
@ -444,6 +444,9 @@
|
||||||
<ClCompile Include="..\Classes\PerformanceTest\PerformanceCallbackTest.cpp">
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceCallbackTest.cpp">
|
||||||
<Filter>Classes\PerformanceTest</Filter>
|
<Filter>Classes\PerformanceTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Classes\OpenURLTest\OpenURLTest.cpp">
|
||||||
|
<Filter>Classes\OpenURLTest</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\Classes\ZwoptexTest\ZwoptexTest.cpp">
|
<ClCompile Include="..\Classes\ZwoptexTest\ZwoptexTest.cpp">
|
||||||
<Filter>Classes\ZwoptexTest</Filter>
|
<Filter>Classes\ZwoptexTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -989,6 +992,9 @@
|
||||||
<ClInclude Include="..\Classes\PerformanceTest\PerformanceCallbackTest.h">
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceCallbackTest.h">
|
||||||
<Filter>Classes\PerformanceTest</Filter>
|
<Filter>Classes\PerformanceTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Classes\OpenURLTest\OpenURLTest.h">
|
||||||
|
<Filter>Classes\OpenURLTest</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="..\Classes\ZwoptexTest\ZwoptexTest.h">
|
<ClInclude Include="..\Classes\ZwoptexTest\ZwoptexTest.h">
|
||||||
<Filter>Classes\ZwoptexTest</Filter>
|
<Filter>Classes\ZwoptexTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
|
@ -218,6 +218,7 @@
|
||||||
<ClCompile Include="..\..\Classes\LabelTest\LabelTestNew.cpp" />
|
<ClCompile Include="..\..\Classes\LabelTest\LabelTestNew.cpp" />
|
||||||
<ClCompile Include="..\..\Classes\NewEventDispatcherTest\NewEventDispatcherTest.cpp" />
|
<ClCompile Include="..\..\Classes\NewEventDispatcherTest\NewEventDispatcherTest.cpp" />
|
||||||
<ClCompile Include="..\..\Classes\NewRendererTest\NewRendererTest.cpp" />
|
<ClCompile Include="..\..\Classes\NewRendererTest\NewRendererTest.cpp" />
|
||||||
|
<ClCompile Include="..\..\Classes\OpenURLTest\OpenURLTest.cpp" />
|
||||||
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceAllocTest.cpp" />
|
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceAllocTest.cpp" />
|
||||||
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceContainerTest.cpp" />
|
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceContainerTest.cpp" />
|
||||||
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceEventDispatcherTest.cpp" />
|
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceEventDispatcherTest.cpp" />
|
||||||
|
@ -421,6 +422,7 @@
|
||||||
<ClInclude Include="..\..\Classes\LabelTest\LabelTestNew.h" />
|
<ClInclude Include="..\..\Classes\LabelTest\LabelTestNew.h" />
|
||||||
<ClInclude Include="..\..\Classes\NewEventDispatcherTest\NewEventDispatcherTest.h" />
|
<ClInclude Include="..\..\Classes\NewEventDispatcherTest\NewEventDispatcherTest.h" />
|
||||||
<ClInclude Include="..\..\Classes\NewRendererTest\NewRendererTest.h" />
|
<ClInclude Include="..\..\Classes\NewRendererTest\NewRendererTest.h" />
|
||||||
|
<ClInclude Include="..\..\Classes\OpenURLTest\OpenURLTest.h" />
|
||||||
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceAllocTest.h" />
|
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceAllocTest.h" />
|
||||||
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceContainerTest.h" />
|
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceContainerTest.h" />
|
||||||
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceEventDispatcherTest.h" />
|
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceEventDispatcherTest.h" />
|
||||||
|
|
|
@ -325,6 +325,9 @@
|
||||||
<Filter Include="Classes\BillBoardTest">
|
<Filter Include="Classes\BillBoardTest">
|
||||||
<UniqueIdentifier>{4dadf399-3bf1-4d35-85d1-d8def766fe0f}</UniqueIdentifier>
|
<UniqueIdentifier>{4dadf399-3bf1-4d35-85d1-d8def766fe0f}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Classes\OpenURLTest">
|
||||||
|
<UniqueIdentifier>{f3b97ed6-a90e-4abc-b916-f91da5de888d}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\Classes\AppDelegate.cpp">
|
<ClCompile Include="..\..\Classes\AppDelegate.cpp">
|
||||||
|
@ -862,6 +865,9 @@
|
||||||
<ClCompile Include="..\..\Classes\BillBoardTest\BillBoardTest.cpp">
|
<ClCompile Include="..\..\Classes\BillBoardTest\BillBoardTest.cpp">
|
||||||
<Filter>Classes\BillBoardTest</Filter>
|
<Filter>Classes\BillBoardTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\Classes\OpenURLTest\OpenURLTest.cpp">
|
||||||
|
<Filter>Classes\OpenURLTest</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\Classes\AppDelegate.h">
|
<ClInclude Include="..\..\Classes\AppDelegate.h">
|
||||||
|
@ -1598,6 +1604,9 @@
|
||||||
<ClInclude Include="..\..\Classes\BillBoardTest\BillBoardTest.h">
|
<ClInclude Include="..\..\Classes\BillBoardTest\BillBoardTest.h">
|
||||||
<Filter>Classes\BillBoardTest</Filter>
|
<Filter>Classes\BillBoardTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\Classes\OpenURLTest\OpenURLTest.h">
|
||||||
|
<Filter>Classes\OpenURLTest</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\..\..\..\external\curl\prebuilt\wp8\arm\libcurl.dll" />
|
<None Include="..\..\..\..\external\curl\prebuilt\wp8\arm\libcurl.dll" />
|
||||||
|
|
|
@ -350,7 +350,7 @@ function AudioProfileTest.create()
|
||||||
AudioProfileTest._files = {}
|
AudioProfileTest._files = {}
|
||||||
AudioProfileTest._files[1] = "background.mp3"
|
AudioProfileTest._files[1] = "background.mp3"
|
||||||
local targetPlatform = cc.Application:getInstance():getTargetPlatform()
|
local targetPlatform = cc.Application:getInstance():getTargetPlatform()
|
||||||
if (cc.PLATFORM_OS_MAC == currPlatform or cc.PLATFORM_OS_IPHONE == targetPlatform or cc.PLATFORM_OS_IPAD == targetPlatform) then
|
if (cc.PLATFORM_OS_MAC == targetPlatform or cc.PLATFORM_OS_IPHONE == targetPlatform or cc.PLATFORM_OS_IPAD == targetPlatform) then
|
||||||
AudioProfileTest._files[2] = "background.caf"
|
AudioProfileTest._files[2] = "background.caf"
|
||||||
elseif (cc.PLATFORM_OS_ANDROID == targetPlatform) then
|
elseif (cc.PLATFORM_OS_ANDROID == targetPlatform) then
|
||||||
AudioProfileTest._files[2] = "background.ogg"
|
AudioProfileTest._files[2] = "background.ogg"
|
||||||
|
@ -490,7 +490,7 @@ function LargeAudioFileTest.create()
|
||||||
local layerSize = layer:getContentSize()
|
local layerSize = layer:getContentSize()
|
||||||
|
|
||||||
local function playAudio(tag, sender)
|
local function playAudio(tag, sender)
|
||||||
ccexp.AudioEngine:play2d("audio/Chee Lai(Arise).mp3")
|
ccexp.AudioEngine:play2d("audio/LuckyDay.mp3")
|
||||||
end
|
end
|
||||||
|
|
||||||
local playItem = cc.MenuItemFont:create("play large audio file")
|
local playItem = cc.MenuItemFont:create("play large audio file")
|
||||||
|
|
|
@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/2d/CCProtectedNode.h
|
||||||
|
|
||||||
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
||||||
# expression, it will be enclosed in "^$", like this: "^Menu*$".
|
# expression, it will be enclosed in "^$", like this: "^Menu*$".
|
||||||
classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* .*TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewImpl GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console GLProgramCache GLProgramState Camera
|
classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* .*TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewImpl GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console GLProgramCache GLProgramState Camera Device
|
||||||
|
|
||||||
# what should we skip? in the format ClassName::[function function]
|
# what should we skip? in the format ClassName::[function function]
|
||||||
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
|
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
|
||||||
|
@ -137,6 +137,7 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS
|
||||||
Sprite3DMaterialCache::[*],
|
Sprite3DMaterialCache::[*],
|
||||||
Sprite3DCache::[*],
|
Sprite3DCache::[*],
|
||||||
Bone3D::[*],
|
Bone3D::[*],
|
||||||
|
Device::[getTextureDataForText],
|
||||||
BillBoard::[*]
|
BillBoard::[*]
|
||||||
|
|
||||||
rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame],
|
rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame],
|
||||||
|
|
|
@ -7,6 +7,8 @@ prefix = cocos2dx_audioengine
|
||||||
# all classes will be embedded in that namespace
|
# all classes will be embedded in that namespace
|
||||||
target_namespace = ccexp
|
target_namespace = ccexp
|
||||||
|
|
||||||
|
macro_judgement = #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC
|
||||||
|
|
||||||
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include
|
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include
|
||||||
android_flags = -D_SIZE_T_DEFINED_
|
android_flags = -D_SIZE_T_DEFINED_
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue